diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 0000000000000000000000000000000000000000..0976e3627e2c5286697a2988dd6b84e5a5c0d036 --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,165 @@ +# LTP 源码升级操作手册 + +本文档说明本仓库如何升级到 [linux-test-project/ltp](https://github.com/linux-test-project/ltp.git) 的新版本。 + +## 一、分支模型 + +本仓库采用 vendor branch 模式管理 LTP 上游源码与自定义改动: + +- **`master`**:日常开发与发布分支。包含全部自定义改动,例如: + - 自定义脚本:`ltp/tst-build.sh`、`ltp/tst-list-cases.sh` + - 自定义配置:`.code.yml`、根目录 `.gitignore` 中的自定义忽略项 + - 对 LTP 源码文件的修复 patch(若有) + - 本文档 `UPGRADE.md` +- **`ltp-vendor`**:纯净的 LTP 上游源码 snapshot 分支。**只在升级 LTP 版本时操作**,禁止在此分支提交任何自定义改动。 + +升级流程的本质:先在 `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。 + +## 二、升级前置准备 + +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:删旧 `ltp/`、放新 `ltp/` + +> **危险操作!** 执行 `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/` 子目录,不动 `ltp-vendor` 根目录上其他文件(这些是 vendor parent 继承下来的占位文件,不要动它们)。 + +> 如果担心 `rm -rf` 风险,可改用 `git rm -r ltp/` 让 git 来标记删除,再 `cp` 新内容,效果完全一致。 + +### 步骤 4:确认 vendor 工作区只含上游内容 + +新 `ltp/` 目录里**不应**出现 `tst-build.sh`、`tst-list-cases.sh` 等本仓库自定义脚本。若上游恰好引入了同名文件(极小概率,需谨慎核实),需要: + +1. **先在本仓库 master 上把对应自定义脚本改名**(例如 `tst-build.sh` → `tst-build-fork.sh`),让 master 与上游不再冲突;本仓库历史上也曾经将 `tst_build.sh` 重命名为 `tst-build.sh` 以追随上游,可作为先例参考; +2. 然后才能继续 vendor 升级,避免上游同名文件在 vendor snapshot 中"占位"。 + +### 步骤 5:提交 snapshot 并推送 + +```bash +git add -A ltp/ +git status # 确认改动只发生在 ltp/ 目录下 +git commit -m "snapshot: pure LTP upstream " +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 +``` + +### 步骤 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 上自定义修改过的源码文件被上游也改动了的位置。 + +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 都不行)。该分支必须保持纯净,否则下次升级时会把"自定义内容"再覆盖一次,造成混乱。 +- 严禁通过 `git rebase` / `git reset` 等手段把 `ltp-vendor` 的最早 commit 的 parent 改到 master 上"已含自定义文件"的 commit;这会重新引发"merge 静默删自定义文件"的事故(详见 §1.1)。 +- 直接修改 `ltp/` 下的源码并只提交到 `master` 时,**提交说明必须清楚标注**(例如以 `fix:` 开头或包含 `custom patch` 字样),便于将来升级冲突时识别意图。 +- 不要在升级流程中混入与升级无关的提交,保持每次 `snapshot: pure LTP upstream ` 的提交是"纯升级"。 + +## 七、参考:当前分支结构 + +``` +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 上的自定义文件永远不会被三方合并误删。 diff --git a/ltp/.b4-config b/ltp/.b4-config index 36aa15c38f1fce4bdef65d42943b625ae30554bd..aea68ad8f622ea701c90037ee7a1968a7d4a209e 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 0000000000000000000000000000000000000000..4aa6f709b64d2c8a137883f62335be664570a9e8 --- /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 0000000000000000000000000000000000000000..b09145a3332f41fca4bb9967a1fb6e4dc83df8a4 --- /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 221e2295699dc88357f9648cd799dd2d9d9296d9..d1e4419f06b04f0de5f88431ef7eb2ad4111430d 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 c44bb4e66056cd2e475d842ae57814988f1cffd8..b5c89de323d105bb2a0af4ab54b44a88169d2486 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 d47b2528e9748d373a87c9f05371295b763d97a5..2a7cf54caa4186b9a16402fefff778d6e0b2943d 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 3e176bd0b6e83e7128b66e7dbfcee7e7db3df25e..9853222fbeec10e833a270822c2c0ea6042bcce8 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 fe0a3ab9b28c9fb8b4e8bdc530c25f6f59dad34f..0000000000000000000000000000000000000000 --- 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 ac27433357659113e3cab8793c0ca577082d1447..384d419acf083a6e7597b4ea0162ac058fda4ea0 100644 --- a/ltp/VERSION +++ b/ltp/VERSION @@ -1 +1 @@ -20250530 +20260130 diff --git a/ltp/ci/alpine.sh b/ltp/ci/alpine.sh index 254f4aaece66ef177bc5b4a92cf5160443552378..f3a1bf5283ac7e1d141dd87e5e3fbddc3c4d979f 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 0445c92ec40819e49c0435b1881cf6b202d14087..767c9b9853dd48e759f85abb54a29dc889ce16b2 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 f57806ebf7e153d5f774620985920841f970d510..f4482a1dabc2a8aa8c8fe32acb18dd1433bdf342 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 3e18ee9480c443837bc4269a408fc3151d76b165..5c58bee5d8086f84b28b7404d66970f0eb9a0258 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 8a30b02c2dd403ef23b9d85b87166ede42d73ad4..8f23229dfc332f3c03e2300e8967dc5be2b97307 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 62ae27d494474fe342b1cceeac7f4c21c0b1028c..0653d7793a54951bb787fa488f91cb46ab9e6e1f 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 d84656f30c8eb0a8c77544063c8831586f680cd6..ef2d8f3fb9fea87836053fb1d4d9ec10ce8e6d7e 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 3123b1cd7a1568d2c7783c28a3d42cb313253e3c..1da240530cc64f6cf8b701a30b4d6271bcce3b82 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 c5816a55346fa28416377375bc91966780075dc3..5017fda2e15cd97e8d2eade0c83003fd3bad06e5 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 d767969b36839be9bf031da031679808180a961b..591c1534dfa7e54b816e88b9eca1dd7fb91df255 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 d146459818904b6be95f813c1a8be9f7a18d092b..26b46d92d9f0aa724f10a960b6c5cce59ae1d3e8 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 b6e8560d9d13b0cfdb3f0a7f1974c8c494111f1f..51bb04a4e155e83c3302b4664886d49624f51a9f 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 181e5b09638fe3e206d7f5a9547959cbc03071a7..6062fdece06e0ace8e74d956a0306b23be03cd12 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 0000000000000000000000000000000000000000..05e473cad52132800ee57c23e211870a54d61c87 --- /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 f76cbb75e69aa2b6e8c8cf4666df9cfbd6644d74..d2836ee706eaddddb351cacd1a29024e92785761 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 1eee0ae9f9f9dfbf058cdd12392f456446cb831a..dd5fa27df1b4e8f82cc86fa8c73916ecc6b56559 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 f6495c4d72b67bf2f1dcbd93d9aababcace76b82..240897e36b8fd7c5f70cf426f81ef4bfc0e562a0 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 0000000000000000000000000000000000000000..4ca8612db727bf6f5b7f5ed055ae512f077f246a --- /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 24ea26543b6b41791e5790e5ebcf9f0c3afe860f..35ae84c6ddd35cb83b59d6333235d1d3db3d87fd 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 acd16cdbf6464ea40eff470548818112a8e002c4..f80ca4be1200c40d8454e34614c9f8ea4d5e89f0 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 72fd2731d38fcd0ba3ea106353ffa40bd0a05d36..38dae9866397beaef6775f4373e955de58ca07ab 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 1b9a984547dedc3ca95d76ddd8d2361279b032c9..442ff2eee64df7eff38023c6eec27bb665ccb7a1 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 0000000000000000000000000000000000000000..5a5b9b54af998b1feb0cb42a3dcef93b56f3e6f4 --- /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 e73175e3384a0d50edc36ffe68fc77f14696332b..cf1c9ef25cc86cf0e03d7cba04d456d7d2d4f549 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 38976f3b0aa7ab0afa4a8c1be0b9733eccbf879e..a085d28152f931ed1bdb385c6ee8f316299d85b2 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 7073442aaacd6348de70b12b034180c9212a605f..6914852c6c0c8737b4ab4c5002025d348146e81f 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 dabb5883ad634e5ed589a09e6f0d83c533aa99e8..b241d057390d02364d3a8e0ff0a357ef6b05ec70 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 6b31b046e452e71afb5097cc3fadf8af01282629..7fe72a2557453a03b845107f2a55c332f6bfaed4 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 0000000000000000000000000000000000000000..bfd5047882242c839baf71287b212ad0aa5a1c86 --- /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 0000000000000000000000000000000000000000..ac78e550030f6330a42466277f7b2f0bdef11728 --- /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 7c050248892e26ebeb28b86277b1ff47b9dc5ff2..55a5e8b404322e0a151f78e276b09ac593780547 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 6b5056bd25c5504637f01f10be8b091f79d5632d..471ad0a25b805b9d4254b13611445a1cc294e0f1 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 1783272a00a1a049031cacbb417239123450a0e4..451987ae637d040e08970b7ffcf015bae07a6f11 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 c05517595f2f99f4cb243cccc38254c290273a6e..2026863a24ed8fe4f4f203218c1cb7728beb1f0c 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 e08b8f13221a23e8af8f63d2cd2baba692631804..83fa09303c8aafc509c777b56b4316eaedea8e74 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 248b64564b4c418a0b7fb41edd8fcc31245d6a6f..3908310f4b9caea7dc3b482c597bf12a70764ba1 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 0f7bb5e4327f64e2b0c96511845e86a6c6af8221..3b296fc9c2753cce54c3378206b93e1d041498c1 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 a42b690d0c1b2cf09fc2004909d3ffc6709d89e8..1e5911dd9d9fafd70cef8592eed3c2c0531e98f1 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 36f1ecad93c2a0679d4a54d6b0021e8343380e96..05b322c1cfe907d844d422a381deb757cd6303d7 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 191b22d2d6397d1efad5e2025be5a2c4370724dc..9d5a9c97344c9cd434a4f0843009beefd45a0607 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 0000000000000000000000000000000000000000..7f2fa18a136f62ae6788d7df00815fdd23a51498 --- /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 5c73dd36989c40c6dbb8b90d2f0c5bd8cd986b5d..93b24fc3ee984dc02c894cb1b5d6d0a40492d873 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 4d52b7c4bb9d4a495d79932dfd7bf0a9dc7aa214..170dfadd4bbeb9eba95233dee4484856b8ff2048 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 07884e538688569b5325b251fd629f20e44c1cdb..fda8c3156dc34b39fc2e91fba090bff00e209fc0 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 ab31da73af904796145c2133bde8ff4687669aad..1b0d3a2a8e53ac6c845d1229e91812f30f4705e0 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 46767f35c4429d3e55c9deafcac62fd0a21176ae..0000000000000000000000000000000000000000 --- 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 306868fb542510a4bbf68e351d0b8c6dded13466..9b0fa01626143bc182703cab03c7ec7d2a98c781 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 f91fef9f6cc8ef9659753cfb449fb113c1ee2c50..7b44e6afbdb9828f3ed48aa70891b865c0eb6e37 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 a6e9fea860c5e243ce492be9e059fd637af6dc8f..7081c554efb06c0d8997af186a848381337a37a8 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 0fe9ce9debbc9f887ca5235f557596a9dda31e2e..14a01dfde7b9f34b828ff33f08c6803f1c8de0c4 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 f49c9937e7f2f81623de770e4d68fe5a1959a7df..9072acc0a7ebcc60207a4248c02c3567c544ed94 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 0a0ef70f334775a056b6b63335fb86189296b08e..ed09fdbc619ba14ec08eecbdef55d366a346c778 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 22b3f932318c8d6328c302b819df188b4aaf07bb..90064f9badccef4131c1f2d97f5cc865dbd1494f 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 0000000000000000000000000000000000000000..b5291477f58257afade83d0b57d731404bd659bf --- /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 d6e2d29a96900297e1c803e6e1ed99cfeba2f8ae..1ddfad966fc1c3c18bee2c2dae6283ec35216d37 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 307843ab0d2d83494a02e4490a5fff6dfc837e76..f3965cc6813427387adee219266e5c893049e655 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 639094a94820825c780ce58af2d80964741bf499..2513dc39e1d4eaf0f89f7e60c6e421fa1646e28f 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 3508b2479d077bbfad9fda33824d6c289bef306b..efda431abe63eef51fa61dd5728c52ec256bfc33 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 02ee8349a8ac5faf640b65f0c7989b51f65d3804..d29cb790a64a53b7eb2c037e8c50859e81de8585 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 3e33bf043e2942676ebeb2fb59c9708c8ee00f19..3187d4309db91c9fd0481eb5528cb26af3b67506 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 b984c343fdd33625442b0d8e35d6e4f0825742b8..342c03d5fe5e77dddc36ac9b2859da4ff51bb173 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 3818a86571a6d9bc63fcf432c93683bb3298e5b2..255a85949749748533e93b86c7cf170900e95082 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 3b3fa32c0b04ae618d80427ea231b3182de77617..ff5286445314e3b1c501e68e5b36e380e6b8cc7d 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 09a0b3cbe70e3625c6c52b521572678d1a106b82..47e354ece9e19f88c7399590e84b08869f45c786 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 e1afeab5f82d9e73227734e79c89a32fb85c8a24..e3417f509cf2bc1b87357d4b954868f54fe92115 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 969c93292c8f12a18b300ebc163da13d212e9f8c..1d3bbd129dd0fe4eb9a7be666ea367cd6900d423 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 a1f9616300074d50593d4c29ae27fefd4afedb5b..839512b2a49fded45569a011e4f2b57c36c43d40 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 5212fc659e34268f918b4efd9900e55331dad5d3..e2d906757b18147841e2b1a5e34034f1e7d0fedc 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 2fca578b19aca8218cf915672bbb7e4053a71959..6ea85c8bb462b035c8ba5ce7ccf6f69e1c49dae3 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 6904e8f45b37f04017415c6e8d03c132ba8440a7..c4979b3e54103adeb7c38862074d479b6cf7b43f 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 cf351cdfbdb20f4837aab337b190ee5beeaa23af..e336de780b1c9ce2d9cd2977e15b287cadfb76a4 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 5c307ed0695103e67aac2f56d7ef6ecbd0a0b704..34f32e1d7755fa2dbd53d8bd76280cc730a6115a 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 9d255bc4486c995cea904973ba0e0954884a1c1c..196399db316b6f16df3ff495e6afda44199f2159 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 0f0f44ec325ff1d0e2a9d4e625a60e1088ba345d..32e425ecfc5a9b7e11b29032241d322b85f26cef 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 939825646051c5e58cca408b37ebb88f8008f40e..129631277b2d12900c85cfa0631da1d6c8f56738 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 473228149418fe66ed650595964694171f8ce1a8..6b726bd588aeb98d941ce77f21af36a855d3a512 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 898335b16011c42c6fdd145a1f02c7077dab4513..85150670de903f5d411efa255d75df4099ea1dd2 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 ceae78e7e24ebcfb075d340f1ca17e2db93126ae..c55f8a646cc3c4919ff47463ed551231ef252e9b 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 63ecb19a4c2e7d2df934e37e36632269322c3576..d5a4a96255408fbf716cecde667a8bb7cfde6734 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 fbefa0f793ac129089ec98d5ffb5931568b46701..7c991c746a3ab5383535b545c3025f2174d7722b 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 167d416f407f01e49cda072f759bd446f202c15b..2dc45bac233bf78c62bf29ca9704ff7318c393fc 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 292f7e936656154de45bcd6cdcb86f82c26c3383..b67ac52e2c1d1811f6e933e0f63e1fb9bd952e42 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 b1d83e10979aedc904dbcc4d5736285cb900987a..b0f640b06d9480d0ff94b938dd991cb11e8e6cc7 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 eb291b6bd3d2cd8dde46cfb3a72bbd2f7c7d96ae..0dee04e56a7246a4b2638fd029ef526fa9572b4f 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 0d8819594ab3f56662f0b51c1940587873db3d96..73ebd2ab8af507a4c32b82663a97498130581e52 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 e4bff34da15c9116809fcf851cbf544a51e384ef..45d4bc7e5d590468eec7a95b0aa37019e4e15f18 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 a221a9a0daa0cc60cf09450aee134f2359499f38..e459361d0c70c4303aceb3de970aeec3af7a8c75 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 9c21c17283fc1e5dce20647d96f88ca5c779c277..530f22f6e8ee3686bea4b4cc8b080b3c4e6a70c3 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 be963ed94626ad430d880a032e7f5ff74b47b45e..b1e74278d5ddb25293d38507482dc5a5cdafdbd0 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 e604effce9b281997e7f5cc7121ab3cd460d700c..2237ddcbfb4ffcb4366b269afe58bab27534a3dc 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 8faeb18f0f3b5b33d6cbe430cc8cb1c3aa971ccc..1a4bb6bd9c32564736f41fa93f78bad1d0a87edc 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 ed31c090db61acd1e8631b22074760a5ffc1ff6f..11382c4fbb9614f85d80948681050a0b5cb92b7f 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 273fe624ab3a60989a4138c3803b2989a22ee2d5..8608b6c81f0b05cde5b537549edf7f9703558587 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 f939fbe8c276c954ab53170ed2beb63c718e213e..313213d8e6ba918c82bb22f503c6b29d613ae1de 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 a4984d2ec718e73d68b1fd519c9a93a14b0490ec..1586e0ad6d5e02622bda97599cf729c30a14e56c 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 d87751c2f4a29d70665895d69757d91266caf36c..71808ef8b8d5545f52d6014bc070145f952915e9 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 dbe4ea9e7d0cbb2c90545f8499182bc1c2e11b86..b7366517e9015d9b3767cf5c7e1abce9543560d7 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 cea36b5ee8cad4d3ca782e6bf8c5063b8b8877f4..ed2c4610ab01c5495d8706c6ec2df9dbb90a7689 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 0000000000000000000000000000000000000000..177ce1e33c36be10bffa3cea77882fa8f89d04e1 --- /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 777c695057893e977affbf5f9b5456436585a634..6ab1145d19b8e93ca5b348496a7f5ab4c16236b6 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 455a275ea61bb67c6e2a08920d6705186049ec35..f1d6105c2fd79f6fe2276e64302c3a143fd5d318 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 bdc1cdf6ae76262843430acbb4272b965c9580e8..ac5f368e2a3706e8dfa4534b3c2688c726131caa 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 de10b8f3e05fa95e0e26f7d6e13ac4c7e6961096..2aea517722e877ddf5f1d9e1caa3ed1398503fde 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 c3b2b3b9acf2f1183a75f485e3402adf88221377..969d4e2f5893230f46116b347c3d73a47a1370c1 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 40b1cf09cedcbd656356a6f8190dd931058a4a3b..91470ccf909452aa512e81a7dd73fd60e8a8f644 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 d0b4ce2ff119aa2f5d6e1f04c1353e5c5642b8aa..371bbdc1b95220aec2ac13c99b7e49952e370ae7 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 38df2ef6d7142fd1feea412878d5052639375aff..412f9f2935ccb034e9bd71d955014275c7f7069f 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 a14f0df2c94985e7849f3c4560afa133e07ae2d4..cda09707022f6a5433a01513ae8cb327c7b5edc5 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 03e8333129c5e2075f6a092935e3dee96da3e1cc..565af44213f77205a45a5b2921f71676d7bab3c4 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 4c96fd913e1a09cd2b43e86ce7751d87a0459667..0978c6fa30bcd5272d57ca80d23c36ae0c623d3e 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 8314c4b1bb3d3d82b1949302fc48052a895b2074..19da1fd97389c28f1ab481a895e2a4acb1f4245b 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 a3145b8d6fdeef216c35b35f26e8c37f6361b3d5..68b8747b4dac12b1df2dce40bb94b013a0bcf12a 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 ab23e43bb0835cdca5eaa015bc873fd23f9a8408..feb8a4b5c87c8b2cb7f7f59f6ba763e45acdf237 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 a160874de92faf0dbbcd7afbe21971c6595b7a83..c830aed2ad3e43763eb106970a1e458bfb50c831 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 fab8bfea247227ae3c11e5e86c97b5494e4cdfd0..d0a03ff77d24450e9dbee816082d92324f3e50b1 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 b936b57f49470039515477b624c8ab0d1bf2f395..2be9db2a24011279b4a653764f162f401d2bd4c3 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 cf5a04ec6f597ad08097083382534fd6539698cb..88ea9e07601ffc7587afcfecd6a26e3621f9652d 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 5c427ee16832261b8617ad15b69195648d0d8d96..59b9b49bbc5d23039b7828bdab15edf6b858d11c 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 70e0c6f7d2d976804fd8919d061f1be3109092da..cf62bdc61f8e27a7686c5b03fcd248ee9f84dc7d 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 a14f9865c9a4efef70e82485448c8dfccdec37ed..93757278f1d299edd1aefa232644cc060b801a74 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 9f803e3eff65a4434593ed782109592f6eb32cfd..33db083804e710ed44d5c9bac0b76c4273d179af 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 704ce955107faae1cb8874a8f4186a83d5add9d8..107938e4ece33ef851a9c7372d06d8a978a41813 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 8638052e2ecac2af3a290f01106e10dc8cdc62d1..296cd40ac0a0f5d637318cd0bd48f8ee7b9f6bf0 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 82d60497a8aea65b402297267ecb8b976f7ef8fe..79f547ab5db5304ee2b0067b24aadc4a6501a595 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 b4c7c2f815ccdf43dd8f13da39e7e5915e03ed6c..faffcba91b7b235a587d4b1d3b5b916d07023856 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 2364df052f5c4629163306552a04a003433111e5..d3c53a1a18d2e4948ebff21d6d66c0ccd1590c6f 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 43764eeba5cb3b3fa6dc031b5e09c86b765459d4..b266630d8cdf4a52e38e45f6cc99d0010ded79a5 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 6a6bb52b299189604b25931764263f6a1d7ca422..e0fbb3351ad6a97d24acd0898b1ff3c62ff4ba06 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 9bcd577210e1da1c5d7ef79b6a3f2b660cb1e6ca..44eacc7c2989a5af3347b8f7ed16393fde0122a6 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 0000000000000000000000000000000000000000..94aad64111105e1505038b87901073afed4f2a1e --- /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 9ab02e5d30cc3ddc0669cb77dcbfa35efb44c269..8f7503c02834f4fbca91c9b2a15a9c2fa925486c 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 19d995df2f15737adbcbf34fb1c5e56a749d5d03..961ffc0913cabbf1211aaca5840c54503bb9577c 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 42d63ede65cb5b77570da428aa46b463c5c2d369..cbd2415d5a6d26202c99d46c27cf6351d1ecc8c7 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 94970e1a868e996931ef662334f8441ad97222a4..14845401972bf5153465448f93a4e56bf52b4c55 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 4e9dc7a5269628745772eb2e7de9c0d244f22ddf..4346a826b83bf543f49422d6b63d71eea9af3fcb 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 f50c07271f5abdb3984bf91198c56e98382a19ec..9278ad9f1facdd4863df1a92846613bb16ed807b 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 c35d05a25bc8c552811c1e95924dd752fd524e8e..ea2783dce7053b65c19bf6e6e32561c7de9987c3 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 c515271351bbc3126e58feef28dc2a88f2d40509..00be4d72e2f3fe8fb6ab62561c00d4bb58540c16 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 bbd5a5fb4dc282a2fb1f74dccc4f7a828af2c45e..d3020fc48999513dbe743ed8eec80edec6fd48cd 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 92872cc89d86e3eeb1f43bb74e6b3e5b80cf6a8c..b525a01adbde9655834959f38b7fd05564050dcc 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 6ed2367b92278d11b8408918586eb4f2d258a659..9b024a74e71d7d43e9ded5225987fc2d31c18de1 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 0fda20a17c2a9db07d4d880ec9ea408651c4cdbd..109d7a853fd605f657fbf205ba47957c1cf00af5 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 c2ecbf02d926808ca295aaafb2a57191c8e8d5b6..4fe4843d23ad8eeb395ef6af60f99d77005b4cd3 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 ae459d480218063102d391c4ebe5d2dbd6fe8fdd..dbf10dd6be5af20af116fd7409e43b1c43b0feed 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 331f1b1f503ccf476dba49b9f7bdd22a53337410..f7edda6b51346180ecd428f3de2509640fb52068 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 c3297013befcf13ba60ecc203557b8d9ce4c5e1d..835b458833368cdc82f5f618469b0c6b7c2e1f1c 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 a9fd62d73ce480c0e67cc0263ad86984e6613a2a..f6689d1a79ed2750b15ab3c94544c634135cc00e 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 e10355502916fcf19085146a15bb08ea81c4e6d7..ae3c193132e67a062353a25d68bd150f8ff0ab13 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 16e6891535c30d59ba7ca9bd8da910b745e10d52..9bf7f1434a0ac1821e4f2c21840115ed657a3d64 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 cd75a89453bb1820f19100cd6c6fa9268e17f73a..7f5b663e5d5702abac6a1c022b76d4fcc403c8ad 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 208c12f658c5b06296180d9e225e4c088726d139..c9a60ef751906f3e981af6d9dc0c83482a3bcf57 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 ffb4997e8b146e1e40f5da58fee4f4150290f4a4..0000000000000000000000000000000000000000 --- 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 86e1cfc914d27054ae2ba89263b3d769f2c1f6fe..99c6a1b653f91091cac7d6e50422a48c7173de88 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 c71062759df7a47833b12b9c368537da95e3fe12..60f7bad04dce48faa62ccc00274daea7f726199c 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 6ca5d7d909acd57dc64439c9abe6cfc1de5e11e0..77073f37d34b83c8cccdc8aaab06ea86e49804f4 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 36736ac06f5f0ee18b00661996a07d09f601f92d..c495d2eb56e24e28f44cf391abebe7e83c75fc89 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 e8596ec26b3172e4c69b6e210bf24cd2ea7e1eb6..0000000000000000000000000000000000000000 --- 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 544c5466b531be9b2e438f9f1ec8e93e4da8974f..0000000000000000000000000000000000000000 --- 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 49fda6fbd211d43a5b40f9d63c2579e64f4d0d6a..0000000000000000000000000000000000000000 --- 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 da131f4716d08b78248af42db586b0236ff0329c..0000000000000000000000000000000000000000 --- 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 f84a92c7d1de5cb49a6d0c70c6467e6176093ea7..0000000000000000000000000000000000000000 --- 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 b6d676f423054bb02f79595617253e343af04cb3..0000000000000000000000000000000000000000 --- 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 0bdb5147717f151c67df6ba2bd4c78b20bd79bc5..0000000000000000000000000000000000000000 --- 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 39b469856d1fce7eceffce8a959a63509a401c3c..0000000000000000000000000000000000000000 --- 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 2ffa24f432698ae3735e15ef5a54e2a44e912441..0000000000000000000000000000000000000000 --- 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 df838e8c9d8bfdf872dd06156543e2db6be7830d..0000000000000000000000000000000000000000 --- 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 0ac78526619720a80482d573a198f883c0eef045..0000000000000000000000000000000000000000 --- 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 6fb01fa41172bca4d499057d32f7caf8c2d9fe8e..0000000000000000000000000000000000000000 --- 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 0d90625691412abb738ffbe583ec187f0d3ea719..62b9367faae04d9787bc0b1f6b641c2db19b0137 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 446559efcd7d2addbad8a88c38fac00ae5cfa92d..a8330db9fb9988b964826d868032d7c27b1bb311 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 6d575aa2165bcd46e5ca36a07db33f69a91bd94a..74ee8e9ba4287a99dbf0412921acb11a5be53283 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 01942eefa36399cc29663e500593197ead224aeb..c8d0c6801e985d44cac9c093aae35e39e2faf6c1 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 599c9fd2f53b14b1c29cf558f69e4a92ce0e64ea..a4e2602456ea8393eb2daedc0633b5e577baea8d 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 de00b8a78655c429a223e68f0926c0b6031e7de7..5d3028bf549c6f93cbfe800f5e9abec3e8c9b860 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 fef993da88175fc2574c1505b567bd1719ea2056..5d6adaa7046e3ca424d7b42eefc42d76c78f64f8 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 884e615cd8ebcd61edc114d867957d8d258a743d..b670da6ecfdb3f439321830fbef6b4b0310adcab 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 0eb01224764165167e16562f94200250cf08f74c..0000000000000000000000000000000000000000 --- 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 0c2bf05a5b5dcf72315c61af4e71775bfb99aed1..0000000000000000000000000000000000000000 --- 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 4b284f27939d270ce920e02e2febc1fccc0fa231..f790e8f840d594a4baba5f917d7ff6d1dae79734 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 d2700ca57669faec8bd71b77097994c7e1cb6b18..674e2ad973288f5e9b8fd5a8d9e6c78c286ec155 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 fcbc9270829e2e496ef8bcc0fb69e558a0bb81ed..0000000000000000000000000000000000000000 --- 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 0e76b2bee11c937e878ddf77c94f695129d98dbf..0000000000000000000000000000000000000000 --- 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 974b9fc58317912d194334af28278fa9a22eef65..0000000000000000000000000000000000000000 --- 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 21d9c9fe3063ddb743ec3f4243061ba0d78f9aa3..0d18771f1b01390087329fafc56a2e21bffcccbd 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 17fdc620d5488c50de35e67dcbadc243e205b9ad..2f2e81dbda03edfca6c42667ef7cbbd65b23af03 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 04e9d76119c05f018d9fb29db39138fc7fd18f60..7cdb98ca1647ba11f710cc5020e8b14248d0855f 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 c8ba4fc1ca36a3a8b2ff1ed6a8128802b64b068f..a0fbf96319b32c50849d918aede53bf6d7c03539 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 c0a570e5c0e6e46e5f99a88fe37a9113b7b581b3..3bafbfdda7ba785c6917124fc69f8fead87e269d 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 3924a6e11291e77b015f02a70a2318862902c1f7..0000000000000000000000000000000000000000 --- 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 8eb17ce56b01070e47917f9bb44cf146c0c5b338..dc1dad5b0d0d02a3ab57e72516c33ee7949c8431 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 700eb782e19ffc4a85aea3a99b5a9570a327a76d..4d9448c27bb8908b4079aacab111c1dca5b8f384 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 0000000000000000000000000000000000000000..80fb84c473207fb2497f6ca6bb53166f0b1734cc --- /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 0305ad09540283c6df5818ba117db2b93407a08e..5193c5dfd7285a16cafc58768ec9ac181eb95d52 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 d2c40c12208d2c465eba2592097e6a0d178326e5..fd9d7eae213f4483ef2c01fe68f5055c4b847b03 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 19da449dde54422627ace7ed33b4839117f6b283..e9dd0736a6c53e9a35ec77b0c15bb3dea3c44aba 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 370d7de49592ac67364e2014672eba2cbf71b9aa..478d75055628e8083f2c91991f719533df863b1d 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 4945058ff3ba1d008d1e2426c7c7a21a4f34aaa3..f8cbfd3677738afc7d532f97351b24fd16ab94d8 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 01ee91d43ab946ef066b7122018a4a2f62fee2a9..9f2b12fe2a44115c2fbf084ad2508ba007a02de9 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 ff106780ad8f72e5d9af863c1e2f50e741528e5a..1594cfc5b30c5366513737c43b5f3bf8d75486b0 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 b1666f233a8ba69927e59b4e38c949b8c251223e..4b0478c84c5daab57a94f0c4ecc7c1c0c462dbe7 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 b79a5d40100d33320e096807c250b423e9ad26ae..a3d289b0ecdec8d3e9e0a1e101bec6c343448d56 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 ab6a7a4acf93dd5346f15ede8ed74a6ee9e0ba77..c65626fde013b52a15957d65e8dc69e983659dbe 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 1ea9f5cd33c01a660dda243e8a529a5a97ef2be5..4334a004d8d42e993f3803cc870584438fd4bbee 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 8867a132b56bb806c63ffe75a762ffd92fc788aa..000dc5c83dc05071073f05a8f1dacdd9010d3c4c 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 3a85d96725133535ab5fc00dd61d391ee07e299f..fb28b8adea047944bbcc386556931c93e824f084 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 409b37ec18e8faeb40b62f0b9197d30d40a6189a..441dd06c6ca77193e9da00f4540d6745009b2f17 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 a8d737091df7a33adcc8db4800166be12e376963..32e6e2c20ea9a23f71c5c6dbf770b3c0190a72d1 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 a192c128d61a977e85daf4a353f17637f70026c6..2a9e2827fc96ea72501249f3a11cb7b82d7a01be 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 b1b00eb6a588dd2771f7be26a679f1c031864064..2c9650773d9ec24af82b6958333cfded2d9c8c51 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 276231fe8d26a0cc60ba2d3aa9abf57620f6c261..a91c400f8fdbe7dcc36984339e73c752865fccff 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 0d016b583b484f0222acd817b6a74df781f92dee..242e988be73be6bc6503e8f3e0008d873dad7453 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 4856f3372d458fbb3f75e1c0eb67e98bf4623f2c..ad0e4fbd9a2d44f6b4ba1afcbcea9c8e3a14fdd6 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 3c19a77191c97abb9fa8c7158b6a66bb5b7f62b2..937ee934a9f8648eab7fbc06174277321228fcdd 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 63aec0d2a2d5d97260f4e5fb93bde849955d3864..6b974ec74228430c2b67d6cb0ed158fc75867a32 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 9a56d7b49bcd62022ee257e8527861a1869f46a7..95515e72aeb25ba7060aad46094dadc8b66e114c 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 9370f7eb86ba3e261037e272659f0ead9f2aa44e..b37e77a346331b13a1115e590ea0ed287dda8ed9 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 a9b90d6b615e037c239c054559b46ecfd7263631..ea5510bd5215e332c472d7b06f8b79edcf84c868 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 a81370085fc53a5e7a25ab1f23d8dc22e7b246f2..7c5eaf878cf06812f2b334ae1f14941a303392c2 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 d166aa4d3daa0a4e270fed64c32397e552a4de41..1aad41d78d0079f6207838f52abc8cfe640124e7 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 21e67179b94f03eccd860aa995f4fd653a3d7eae..4c49bb8fd6f14e88be7f026e8525c8082f679265 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 e81d22293827349f81522d8fb302724240cb8426..581df5c3215b2e5480e837ebb0f85d46acf24cf3 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 f1f5a9df449ce4ccdb93dd68eed4c0474c4f5f82..efb0c85045c2a6ef347857d2eef6d6a282d8c9b3 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 101b4e1bfe2f033c7d0a3482c8de89e3b766c77b..0b79403c92929c2929238d482525b8e3a2d28716 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 d2e489ad69de80b68f042315287f207276eb3cc1..493e970ab5f5369137dd903e657a3a9d5b4fdb02 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 8184dcdf42a06e670907ce6179f81c35c2858de8..715cc5bcda60afbd8b0a7ea18aaf13d23b247cf4 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 e39e455dd7b41d4fb5d8b948ba0cf601eba51b86..495f924a0de6dd81001e855e92e080dd2f1d78ed 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 31b1b5a83fcf1adf9d215fe8d11f97ddc01c4b78..9a86853d094839dbb0e40fe77745e2eb98f37ea6 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 7fbca2a05868ce2fbc71e3066c596f46d40efd8d..0000000000000000000000000000000000000000 --- 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 448f986a6acc1341eac052ae9663e8fe28e18d4d..aca016b62110b319eb2825669ce23f5b3608c73e 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 0000000000000000000000000000000000000000..937ab1758c33bf8c34bf40e636415bf961cbbaec --- /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 6aa2c1298e40df44c54f4955c950bd61d0eac6bc..02c163396ed10828f5748ecf013903e675314297 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 2c0cc562b620ab538ef03847066e9072c46fe745..15521ab5096c940ca71c4490de30d9d5c87d38ba 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 3beebe109ebc2d669428232184323a3ac61fa5cc..012657ac41becb1f92857a9f1492cdc59a05a7a3 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 cd900d8074c21b4b5eba8f83c0b478a45277d8ac..631e6da4e11014551577aa32e67a40fda96c83b8 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 645c4326ab967c1eed9b0a49ff65b6607c98d33c..940c56090555e3e81c21af48416a9697bbffb45b 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 dfa57373f34ac2e54ef2dfa7a64c234df6dabb09..d9bd95da2a5fd37b64d1e55f37c40557e7f8d2f6 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 5d241fb4203a2204798bb1a022ef6fc56cfa00a3..687d2a62b0bccc2fa84bb401b61f7e467a630a41 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 8a1f62eadcecb30ce161421cc8a9c047cb3b0f59..a02633d5ff9ed33e04e8c69605e0a1eb38f80755 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 e882dc768edd07777498b4d8bef577cee731268a..f7888b63df5a2ad8623efd4421c4e8d733cf5007 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 ab6fa58a7efc9f6b90d179a530bc57060c6bbdcd..fbd4ff81a1a637804fe729acd9e9dc7592c7b357 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 8cf26de4c6eef470e94710a0f539c0dc27adc202..23f6da14f01b9f7b2de40213b45136bfc1a4a6ce 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 b2ed09e6f356d26df111df9d98bce34e441f99a1..1f68f2ad67cb34af5bfe19f77482cd032bdbad3f 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 b170f667089d7abf0acc788535855bd506b7c34c..1a62ac16a5badfa729d1d710d3528cd9d04f6bb6 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 7bf51fb9c732c66da0eb88b05a6314a5debd207a..21960f82a100f27a6fdd21d56fd587d9148aa1cd 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 765cfdae5ad9be6f576967cc8b60e823a1b20080..76ce2259aab2ebd4c5c8575522975246af952b5e 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 2d9a87b7e0d3e5f84a7abac9662fb7a1fbeef074..0f5a67db2ece0f3f4adc54de9340df8eeb36d9ae 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 31203d689be6b104c1d60744b1ce8c096d45d80a..86f986acca3881878602d28516b6694c1c0fdaef 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 ed69e573647c46037109da2cfb4e6255f47c7de0..507101d00f02df0a50f28124710e1d2c3338e6d6 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 8eed84c74f2305b468cadc2fb66bbcbc2f79444a..3bc4d2a1e56823b61688381fc5eb60d95d4df14d 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 8d8e6d497ff3765cf131c20aea8f87bb8ba0ba0b..2bbdd3238cd9c66fbded282d13e373199da09c67 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 3b5b2a4196135b71985cc5047af383014e7cc6e8..1e63159b310a2d3dde5e71ccb4e310a120894b6b 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 e7fb56fe4ef61274f8cbf0c326e87a10256a6d0b..356a031b800cdc212a6b3ba81083f7fdae9392b4 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 088e062d67c640b839e5650a2f35f9038705fbed..3f1426c5ee1f85732f2fbab80e1201d44e7a02b7 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 e18945a34e73a74591dafb87ae873dd7bbb7313a..5720ffb997bd37a0fa9bd6168bd4bad61262d7e6 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 fbcb765826ef3d31eb1223c42013656fb7d8a2a8..a5789c6ae416f40554abc2533460a94fed1b7832 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 af56bca3b916c080328c3356681efbd869b961d2..ec4bf96a47a0fc291a4c9c9c13f46705d878ca91 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 98473d86aab686eea2212c0e005a46e950f74ae8..9486ce85ac2472803ed873e0d626ac1fd759c674 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 31715f740a070d01aec1087981e092b361e656da..24928c5e1a15cc4a5b17b22bcfb907519ed9b4e4 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 3dc679151a6a81aab8c713605c258fae2c2b3adf..560792f062f3bbb0fcb9164ffd9095803fe6c4fe 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 f561744c3da86cc5d80b97c9707f5583059d21f0..04cb237a145246f607f874c97bc1758724b325a2 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 5b1755771d39e6541d348bce9e9850b09c86387c..9acdb86be8f1ded74ac2a897f37bb82ce68e5075 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 03a054b4cc7da968c5f32ec3d9017b7a7fac176f..c6c50ff4e64263c3812a9da921137784c6dea6b6 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 ad00fa3e08aeef050cc9d951022bd2998630cedb..3f37a8a4f7baf102198390cb6a2a69923996ee9b 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 c317eba8ead6e6d194eaed6438bae20c85ddbd42..82fab12d98b692f3a9ae6229bab1e67c2f5ec7b5 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 1c913cc2b814e3f6b0673b8926ffce526eb27655..8d1b8adf675e8fa2136b972c18007b2a60dab36a 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 ab5c2cf0631fccfec1412e0be2aeda5652642f2d..9a7d3c61f9b9256936b3a690bf2649b05e4bbe69 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 db526cb7e961ee0695a39cd4ccc004ae7c81dcd7..090d8a6a39772b96f6082e950d42af2bc4115694 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 32d15526b02eae376006162af2387a1147205df6..b295c18bacebb055810923b4beb9dbeb7c7bd759 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 6914fdcbaf4b6d0f892bf8e8d741c6372248c534..0c1b239cf01b5347c1bfc4fd5b3a37cdb14167ee 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 87164d013731c2e1703a79662f7de13d430fdbb1..dba1ab9e7e5a2bcc28304b05dd489240de2a4a61 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 75fcbfdcfc096bc9917c513d9504df6efd51918c..4a6e73818624664f60d7485558dcbf9bda36e23b 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 5bffbe9465f0bf35f0389385529c9810499ba272..9950e1bc83ea4f8805ec16541daaa131db1be152 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 3fcfebb3bb5f9a77df702c3ec3a95d7b775ad0d8..5152ad8f36891b12d4b43ca604394825e396c041 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 2eee8d35db445afd463a332bd23d3f4b2ba447fe..129e75f4006d4c817f61f33e20fdf1d514373bbc 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 ccfddd6a2750051969c567b72b8c1fedb2aa79be..d67dcbf6fcc0a981175c216a3c938a75d9dedfb6 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 1dde9e87ba0dabac6902a4099705fa9def71459a..f2984e2dc01aefb68c6e2c815128536c385602b0 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 bf2b356426ed2340f85b5bd334ca81df62d60eb7..ab7469cd7286ecee8c1fdb7aabdac055db0eb3d4 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 3b2ae351cc2e91e535e86fc80f4c72b7c830bba9..eb8663f2cdff80b57df66da93656fbf0015e847c 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 d3f71112915e4a68aec03c1f65be54ccce6a6ccd..82126f52c8746d2a013e0196574e387cfd31dd7d 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 6a2976a53fe49adac12cd54dda3e9a1d76e294aa..92b484d4acd5f988d9a2cfbc2d67108dc9255e56 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 22975c99aa17c4ca18c57f258eea526bc94b8b41..fa742eb8d2dd8d25346f906be520e6ea90cc5e0d 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 a22e4830f3dad673eafbc633cb3a7741373193ad..be03f943ff48db0eb3764aa1ee7dc368be665f1f 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 ab16af29ef69c24399ee6968fa48ca7548ef172f..147e7e8346835b124be771f23ef007c269e4fee4 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 78844b30ee54922da090941313b1d2ae8991c78b..34a086ae7f4ad590c5daf30b51113a11405ace22 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 26506b4f6f2e8db016c767d2a0243e902fe2aa07..a9a06be404c4da29db42ec1f4870a30e6c0fcbf1 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 025dffc091d0f8aefc900af7609d8a067fed88fa..96ffad5112b652cc0fe003aca4feacb1d1700948 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 a8e73275dd0da212f24db07c9f04e3387887c844..22371ea53cbecf69b65e3a34060559d6ebea4b2a 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 41cc681f97992e623abcb08f713678b7cdf26070..42ed181b0f71655c9d21c3460218043f6544f2b6 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 de1d0b0c36706c73ed88501f742a8eccee42b5ed..f6c29b6d8706bf42984618efd8125d51555761e9 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 63f5a7b450b594aae4696cea2cd8031f5248d4aa..fe6bacb8e0f2b5d8c58233dd2a4d3f52664f47cc 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 c07b1ef93ad4f1791c80391e51c8ed53d77d777d..2a20d9565ba3ca045e5b82661d85755c446ac608 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 e8b5d9eb53c5a5e56e550640fd1debf223573b84..a38120809f75135ceb088a7e9fdddbfe4e610fc6 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 962479e753f41fd92b1eb96f046b3535b11b056e..a729cf21c96c580805227aa8c00d4178f44c8c9e 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 9fb2f6b2206a4e68918f658059d2eebc36cddbae..3a7a50d738df238d490b128d3e2332d7e472f48c 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 fb40498e6a62a0b85d08a9f589f392f7726746d9..70030771163d64853e2647fd8d70a8a4fec74560 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 2bd48b6b50bc1c84c857baf316fe44a6ce527148..5876e6bf07c9947988fce426aab431e8d90d936b 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 71a7bbee02ffdbf51f5a301cce2e80f393fafd39..429b9c81cc2467aef84909874ec45fa2bf6cb574 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 68caf1b00118458646d34b43570eb039b8e85602..a62e4ae9d9fc58cef1e2a808ae2c90ff562bc262 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 9b2cb479d5ee17fb976c0ba005280423735d8c24..663e3152249d442aef3543902ac4f1fdf0e3e60a 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 d220b636ce15aaa745f2119ece8de8d9da73f9fd..7d784da627b658cb80593e03ad10fef908dfea90 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 3d91863c35af8aa7598497aac1dc8f7cdb68c05c..c961a1a4372d651df9b9231a7d99234c2b99704b 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 65884d9d9aaaa3ee78b642bf682524c971989253..da1f5be991e90f892761d6d87e2685cc5e0d96d2 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 8be025ae9cb53db27f20145c8a4f858988ebe951..06a316667599a18a545d218df2d004afe7b133d5 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 34a82162cabde777520ea9c87493ba6dfd84fd6f..b9654e80c4a11a89573992271b46ff9830e80c00 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 0c2a3ed4bd99f1169859a73b4f536b694c0b76ae..0000000000000000000000000000000000000000 --- 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 935f47eea1ac109131ecd0e40fc417f4f3a2999e..4357bd9c297f4f526929988145fc9053e193969e 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 b8d6c316e8f69c8db2b50af886d98396a9257b94..1b82782d853810d276c57d7fe1781a249e565089 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 2aadac0a5b538ffd45387a1873bb5c73f5d3f1ae..0000000000000000000000000000000000000000 --- 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 743b6debf39ce598a411de981da701a3a8d87d62..0000000000000000000000000000000000000000 --- 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 a01db004cb65adac6649bdcb86066ab49836ca55..0000000000000000000000000000000000000000 --- 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 e75c5852e5efeb5b5696853f51c6e5cf6ee398d5..0000000000000000000000000000000000000000 --- 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 f20717090b5a7a2d2167c8612c5ad20d0447ac4f..0000000000000000000000000000000000000000 --- 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 b83324f60701a4e4a275523f73dde394adc7bf24..4cc75aa9ac713c7c50f006b2810332e7ba8e1896 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 dddc48169075eab11e825fbb39f5da3e9cd22fbb..0000000000000000000000000000000000000000 --- 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 2caf9eab519b15b727ebf7ac0df54fbff8133ac4..0000000000000000000000000000000000000000 --- 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 805befb03360b0749a84174ebc396b308ef386f0..0000000000000000000000000000000000000000 --- 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 72ad2ad687dbc6c806dacfd2241503b00880691b..78e0a1b9a7b532af59108209dc371355f9b50bf9 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 03b6752bf3d473423d364c49b3cadf0d54eff9d6..0000000000000000000000000000000000000000 --- 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 16e50a670b02982e581c734b212ddb794d405019..1638aaaf82ff6697032a4f926847e542e8be12d9 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 f309d7c19616f5ef4cf6cc097fc54e4cc557d0b1..0000000000000000000000000000000000000000 --- 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 547e88feaf54b1b04527ff1e0367ca473896f272..0000000000000000000000000000000000000000 --- 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 67c7243e8fa8370db4fb7a87e15615d35e5b2754..0000000000000000000000000000000000000000 --- 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 46985b3be540c0e325ff11d959594d78c6c76f40..0000000000000000000000000000000000000000 --- 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 38450d1fdfc6b887a546dbf5d60df82c3fbfffa4..0000000000000000000000000000000000000000 --- 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 a71b4b44bfe3204a37081fe5d6d17a76316530ce..fca61e8ac20152a7da3a295d598ab98efdd47b62 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 4551c4e8097f6f8bb6f398539b31b1481190f55f..5fe92f0f5a9a9446721e6bcfdaaea902245bca30 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 99c6592640659a0910e1b90ae95229da8c3c7ac4..d4da2426572ebb79500f7794b73df15d3c452f02 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 204703253d67024db5593b5d6510cda1b9968727..8bd1bfff550d01d1c5418b6da2b123616c4584be 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 fb76d43b806fbf051060327d80edc4a197e445ac..68e1cd6f68ecabd7929c60f0746f9bf07fde3b33 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 18f0862cb28f2c652bfd3592fecc1f6f17203031..38c1ba77e6240a47db3908987f07458279e86a6b 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 7644e352cf99740b51583b8b49d8b81b47e96979..772cb3c93e109e237ee6c5cbb74c3c764cfc9c1a 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 6a396e29de017c0cbda284b50f67c2dd0f462204..e6feb2d3c182c2ce7c7e5a0d342e6bb9c642cd7c 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 2a982347c57eddcac26b40b843f7dcedce15d29b..9c60fbfa34cd53b98abf95c2015b2b063736cd01 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 0f011868ef6504d3d9af88e85f556676e1127120..dfd9ddb7143038eb57fc8b27973273f043488521 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 8596809ef4024f99dd56058b8bba400118c20735..1861147f87c31dd48aeca4c31ea8491dc7fd8721 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 91256168906cebee9729d8a9b4a454756ec505e5..7dd37373cdf99e28a9b3d9f5d4f0b4571aee9b90 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 d6eb0829d81fc3dc57e3e68568d47f607d8ac4cc..bbc82f30c8ba86279d10de07a762cdd6d00ef1ba 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 60350f39268d2dc4e1801ee7343d6a9e76dd584f..cf35e131edd5de27b49e32aac905e31edb72c9c9 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 1a0de21efd0f612f362fcfb357a285ed342250ce..e64a7739f9bb8c05e67b095ef271bc7b4315a6cf 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 2a7d651818bcfea2407c3fcc045fbd2d32eb5505..b69d7c31d957d0cdf42fb4f910c9d5e6641bbd63 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 1d2f1d9447d74fc72fd85e6391fd53bc5ecad937..6271bba35d5183ed96b0316bd2bc1a9f5089dd32 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 45b3e18d4aae0e7942e71d1f5c180446ee534a5c..914c74f4b51eb25166687b371b60ed2aaaa16cfa 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 20f33527c423e986c245c6d1c87eda091b8094e1..0d3e6a61e6df49f8dc93f572b67fae6c831d266d 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 1b56ac63355348db96b9d9159a0b3f346ad2f8e5..375a8ff595c7947a96e63a997aa393d09e9989b8 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 c9a2f840e5b97673212dac741f40b2b0b0be0262..b51a84b97cd2fada1baeb1415c6d3b1187dcb81b 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 72428ee839bdeb221003433ff04d5d7c6f9fedd8..d6505c4a4fb19f4c3f78ee94f82bf6f9300d3ccf 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 1b15eb6b90d08a9d4b1f9085e5925f3460e46144..3475c5e54203261030e3906c5af5a9659ea19f28 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 0000000000000000000000000000000000000000..371fabb45510da50fa4a866a8aaf91e03c52730e --- /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 4f262da002802ac074f7cc51716af8eba59cd08a..a305f037a276e711a33f6612fc572ae1750019b4 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 900cac19c9015b4f7018a3855d962287bb8d77e9..0edcfef5d88c40099326a5b2d8a7cf4e1795ae2e 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 fd3ee1aedb3441e5b6c067a182a5ea7cec25d0c2..972db5205f326ad34506ff56e7b425c11aa95c4d 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 0000000000000000000000000000000000000000..96de811ad079aad05d2014d9bc5afc5c22ca7077 --- /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 0000000000000000000000000000000000000000..028da778158de6867a71ac3974f9c2263481d3a3 --- /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 10369954baf462c8ce7df21cb4fdaec9d3f8e6ec..e9b5312f44f1766eddab0019f52c55765a525787 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 deed30b9f05339225a0eb1e7fca914f38bffc54a..668c1a225aa8d4c763b4c6c0ece552b370ced7b7 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 9e98f1954567dced2c442bc65efc22c43c0aec4c..8831121837deb672b81110006471ac8ff21990db 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 0000000000000000000000000000000000000000..b91a081e570d8b2d73c0cf5e40dbf2df170d956b --- /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 4e4f107ef9b2ecf772849778ab2d6e1c32478a78..6167525957e24d43fcf5705a0d4d4cf22d2d4043 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 2016453f8ae150fd203169c00b5a17c37bd9f697..03cce109a208b910c5265c50c2dd6eaf2a0d4137 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 660c4f7a9e6f6db42bde580f1f714c985f0780d4..6cb8adab3367f7e264853012496d9dad0f852ff1 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 6bd2c596f2167ec694c0aff57fd993c9909af5e8..64d3751fd4a2992304c593f2e44bd653c7a4344b 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 7580e58cf790b56f96fa4aa14c82dfbdf51d46bc..c92395faa046687d4b7921b9727a994a23346a72 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 043bd45ad08b9bcbbcb0f7dcf0fab7c0e97c6f10..37f8ae3a369f5fe4af3fa7b7e299ea0b181d5a80 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 32074a449ac3b74e4a696f5e75af667afd147140..a8f150057b49ba99c6bd24041197b111301376ac 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 bd9835ea341e508e0ca120ed117683132e181544..f09252f6a44ad331c0eea12ae5062ddefadcc399 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 f157e1a8fbb27579050f13242915babc77d6d58d..c7b85ee694ecbc200c568da7707dafc9a2aededa 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 ab537de9862a12d590c774a52f89ade79de63f17..554b2e811990e0aba00d680e4b2b42c578ad626c 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 ac46c940c76687eacfd6a511ea910470fb81d917..e60265fc8ebb2b11ef7309c94d072c2cc3839dc3 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 3bedc2cf553a97822f0c5acf9f3a0ae56e0c3e89..d47327bedfea7f784f648e9ad15494532fbd0266 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 53f0475e3e0f8dbb4c69ca43a9e78b2d3232c18e..362c5a9b6d9f47fdbaafd6c394d405b71b388019 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 e7b2adcaa70e9013bf931719287bd866b55d8279..2bf172125fa1a82b5e98dd4725e2e1e84eff17ec 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 3d732657738225f18b40aeec5511105fb7cf2ace..a3e1b240a1af541abbca288c777e754ef36c81bf 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 7b475dd1afe1c53928ee6136b5071b02ab0eaa50..35ec882a0730adc7872af406a50abc3efd95e54d 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 ec0fc102a3101ddc7619c03140776383af56c9c3..352c73c38a50ee05c84c89f74dfa1883f5358a8a 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 f0ce990d6f22ef4db93a55b11c3a109388a6427e..55f5d711638e7fde3d6066a030318128f749f75e 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 383796c90fa417e76ed83df664cca5dcb383222a..d21936ebaa125fd1d842c5e606f6c9a22b6967da 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 bb719d78f235a07a8856cb7ad35515e0a375053d..4469f02f2c45604c4f0503f0e824dd37f371b245 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 dc15b8764e1ebdb87f21ba430455b24665d152c4..dda76492bb39e014f6ec587c61a355c643eadd50 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 3a8ea5fa75773d95b791d4f2f0e52232b218d406..eb3486d31eb5a4b1fb03c5e99fa53efbe2dfdfd3 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 f17cc993e3db992af5edce0a28aa30fa8eb7b87f..bbcc1fe457be1cb668d30280c5fe9eafffa27d76 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 3730bddc0b9b6bb0c9a3574101ce882f4d6845e5..92c85e37951256c9933fbec7b167f39e70a9e0cb 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 16af3db857fdc36b8fe28772e2ebaf1d33778cc5..d6d0599f1a908d2c6d9da7ad8d79ba835b66f7a2 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 df50d84a19b9865fabad46710ee7af5310efd814..4f8679d0265dff6b91c826b32cc02a724280f872 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 34c77967f7a1092b470c7ae07b679d0442dedbda..9af38f99c165e7b0155f9224515db08f27e86bfa 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 876f6c3d2c3b628e20267a5ea7331b3674a3c6ef..64384c90c7f8a22e137c682b8a1a16c76c27ca11 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 9625e6f9be417ce93c9e6e893c7ca00a58b2ca0b..efdbf416e91f9e38a86e2420bb07c0f2d7612765 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 5d97e0366856df2490089b1dde395d0e46a5fbf4..f60c9e2a3a793500445fb94b8bdebf2ea468fbc5 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 2e93840f0f6574fa71f994a2977020d548a5559e..565142bf4c1d8a9e5d49ce4245cd700e5bed0d0b 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 7734b1858dbc846e2ce59fe6375805bb7c7b3e4f..2358660a53f241181510013f61d18cfd34046779 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 abbf0b8a7572b56b535a9010913d22ec7b701a0a..e1fb6e934154700ec255733fce6f81b4a5ffa910 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 2ed3d1eb7bc13faa018e69485ec9f63f9e32fb1c..e2d0bffa801e4dbbab9e412979aa7e623e0f74b6 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 2d33416f393d89b14044743538c3a27471190bdd..41f13408a9795853580f80bea1babf5851413c17 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 594d5f9dafad6bd557e6d71c8156f88dbcf05681..bfa96fa2885798f83af5e43e721ea7f7b9e06671 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 e5624835a86bf3de03d21ac8237d05052d3465eb..005daa2b98ed528a138fd7ff189ec5f3c405edc9 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 32b2b8238b50dfdf7218f0a5d6205ac7c90e1c9e..76d40eaf713de912af2ca0a662653a3abc97d318 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 a00ca9758dd7e72f264cf9c1c23261c4300f9ad8..cb6b8b2227ea0b5432087ea8671d69dda3c36aa7 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 2218dd666909751559509e252cff976b0006aa60..494e431455226dfd9c623f83f9e050f3ee941fc2 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 d4ad65bceb5c206861190b0458dedc3bf9f69e73..f6563aec7c2c6a602d309893e647b4972233703e 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 f6e282e7fcfa41ea73d9bf23a2255fca0330ab88..fa563a3ca3b6734fb68c27558637429c07994fce 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 4fd99746012d3eb303757364887a67ec27b33e55..98e7d94059f57ef37db629a13acbce423abf2c06 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 80790955f1abee27f874680ec2e6fb49e386c5b5..f3180fb79109fd6e2b1a95169d577ba37e082148 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 82d20492552cb5f3a576df19da1e89a99dc46dc9..b32ecf6aa37bc4a4a4303afd43c6c7ff69d83073 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 c95895c93a8c6831003151c40d61275e602c4d40..340fb001876f42dae9159646ef04f40685adca8d 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 357e74dbc70209d68925385cb5995c0a32f3c3e2..a0be9412785f9cd6c995be7931e7f6b231fda67a 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 36c7779dab921361df62fdc3a9afe52f7726c66c..0b8d0861544a4839d2a39e1fe438d28cb6f85f56 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 27f0663ce3bdfc118904a2423eccf474a9e65213..c4e84da6e8fc59af375f77bd8cad6b8079293b76 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 0000000000000000000000000000000000000000..d2d3f6e6a48d873537850270760b5781ea3a9416 --- /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 458239a2efbfa5a6d2d3b6b05531d73fddf05652..37314e7d09a5402c870ffba1b7995bad69179339 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 10d1186fc015fcf6b0cf4a50d65e793fb6a6b7ce..cc0607e18afee7751a00fdc70af71cf6b808f559 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 4fd9fcca94ac493a9d1e3e8e728b2e9c958e210f..9012d3588322e964cbfdfd79ec9f3c4c840f9467 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 4ae9e6e7a44fc23db95beb98fa17e9bb8a7d8fc7..cdbb82b8b28417a5a6a0ba18e4aec96e91a691e3 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 a58e921c3999963ef4930145103996da32ea4e15..4792bf6c1b16e73378c91e5eaa05700ca57c700d 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 f271eeb2da050cd497fb74967f6f8f00ca3706d8..c7c554b2045311af59eb6fea48170a71d7cd6ea5 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 f5c4f8398307a3529155b53b44c32022998c63d7..2aab4a91cdc1826c1924e900b6b2661acb48bb6d 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 f567acc7042b9bdd7f5bbf708fcc5f8a68a8b42f..912d05662effe14b5daf478d0ccadd89f1a0f053 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 9ce4fc7bb070e103782d1f54100a80b015d0dc4f..6181dab8c07214b2408f24c043d9f65e89159f0e 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 3fcb9004dd301ef4ee8cc1067c6a3763acb8d299..42f830a7e477cf42a967f5b14b7e4b6902c4f0e3 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 4e0d87f0f3edc946bf9cd14e76cce9518bf928d0..f6625985a51484bfa71bede15686c44935a5843b 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 0000000000000000000000000000000000000000..6c1471da33e706d86fba667e7d3cf4b89b30a835 --- /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 32bad89b35575f1597bed1a44ef3b984bd1db3bd..332f0d364ee411d7d98dd66fbd8f68f838e14cd5 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 18490a865871ee9bf12681ca0b7689409e6926f3..2a48b7da778e57dcabfec9105311b8d05fa5ea8c 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 55f0e2f28d04938486d3a5855337e6312cfa45fd..934d775ab462940e0f47ff3b1d26dcf1fff9bce3 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 c18ffacf22a69ffd5caea98701cdad394c1848bd..f3dc5a23dfdc9df0c919c21e4fc42ad11c7437ec 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 46bd57c480fe85449c84e33e016826ef67781e4c..c53d9079fcb04bb62026bfdbf4885e96ea1fed61 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 3c854d10968c8faaaf2ad129b305d4b42092d57b..c150d40a585f28b84db596c99cf4f5bda0298a81 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 79ff5d94f8b95131eb0705900f6a59d7b4ea1b1a..f923afac803ed2653e0dd69e9501250f15ea9b90 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 1ff37bc9bc6a592f42f6477158e4533ccf9eac96..28db417d9f38f33a34849b842a1f9530b1bd36a9 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 f18343c2cb12186982b3b518d91963dc2060bccf..f939f2a1a56bd2f550d4ef9fb93fdd967c1980ff 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 4f7fa70e9e18685c6c55503f32ba77523e4aaa4c..972b1025e1a33da7c6acd0ce2a5826086e16f702 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 709a928308fadbebdc876d46934d3bd5a3482cb0..314c1bd49d912859fd48e4e89b2ceca30b6ba506 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 9bb95addbc29f730f412de5aafa483f1df1341a1..a7974dd576c4cda7f3462c5815b1f1d0f3c600a5 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 1db38ddf28788b59ed41d386356e10b593e1f5b5..947623952bc3b28217abd65ad9d0577195a31d2e 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 d9bfb05f1d19c74db7a31a7e2a12016fa4b3a5d9..82a4c7bdcdfb0fcb70ab62ea52a2809f2b59a50b 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 66a2f4d3729d88c8161d5f720b4da62e386b1545..b4000f35380eed211be55e3d6c7db6d2f52b64fb 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 4cbb16ce0dcdc0d3754da230f9bf88a79b05bb0a..e0837cac377a8a5a339c11dd0b860f0570e56a29 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 a78572dff35dd3c99bd87b1984e47d36676c3962..4c3a1d11679ceab7a5a1904d8850a20a46e33e16 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 60b07970a4a0729528b44d975ba76bc0bdf36667..abe962e1ca4b30ccacfb4966c31197edc75f73d1 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 0000000000000000000000000000000000000000..c8927ee91e294f9647031320e7161cfedab10645 --- /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 749db17db19e63ab43eef9cb0440dab17bb8d5b2..9382ae4134932031a8ca55e629737a7dd834e315 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 ab1ec00d600aeaeea5fb103979a0e30d5543f0fe..4c64e562b4f061701624b0d7c349dc6a63e2f42d 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 0000000000000000000000000000000000000000..645c96b02ac0cd32b2dfcf2dcdb4f458c7c13687 --- /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 0000000000000000000000000000000000000000..aa31339fb076f91c2339815d8c049b98c74c0399 --- /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 dac4583fa7c05a4cdd937e86bd8f935dd15aebc8..63765dea61a795aac01e5b6b14996e441b56d3e3 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 42b93ac9b3f4e711b7b1f40f41d8d13996b51a51..62f977ec12cdde0fe92e28b6ed2e25dd20301b98 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 952450ba994f0193ec87d53b779542f0cd43589a..0465aa70fe14ebb3a2f561cc4fd28f5dd301d73e 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 586322e0264e2261e28e595761b2b44e6ae43138..daeec20d96a9346c0a35f1135ffcc22a87932e22 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 4e4177ca41974e5093e6ed77f8df14bfa436d781..6e4323b37fc9806d69ed8a276d6e7f23daaa060d 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 59ef893da5f6b65d0fd824e46540fbb1da2cacd9..f4acb7f8922f879a1506c6e45953d5ad545e98e1 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 78602f55adbe79416baf5e74fcfb2663efbe2447..46a2e5fa7f3e40c1d8185f00df6797c88294646a 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 f86355f2c4f26491ba00df247025762babc8c188..bffcc2e0ed277ce9d7f7a713244a40bc6f3fb582 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 b27e9a84c2b0b1e53a81fce8d81e9e4a70437ade..b668c9e93889304f3644960f4dd5e694ff5cb72e 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 a30fa9229042f87eb005d3870e9676eafefdc448..91683396f2b036809dc102451f5c8ff2906d6ef7 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 76a6bb8a20d6b9334748fac0efa406f0c9fd4248..8a550b8f8c301b5242bc4c142003c1c64a57649e 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 6a9d270d9fb56f3a263f0aed976f62c4576e6a5f..ba06e2d8e3385daf23c76df8af885539426776de 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 96f9d5831c57208152ee73daeb35b2f6eeceec53..e62863b038316359c795688f254a3fbf6ca3ae43 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 5b51f1d120a42b840ee5c2b99b098c4c47ddf768..8dab9f34476c51ce495986215cdba945eb6cdee8 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 6c93d8dc3bc7647d7a4ff9636aa33a3a2de8b63c..5c9d8afb70c5e53e5f8ca1b81d40c4772ccf7c5b 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 0000000000000000000000000000000000000000..3455597b3857618011f2afd865aec541dcff8d39 --- /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 c9137bf1e7a438b54fe8e49f0b834a2625a86ef8..0322b26330d816554b4f326ca50af5fb86fc4054 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 6026af1e2699d035ceee2a241e03c4ec5776d26b..27f8e6cf968a7fa19c08e40de9ebc6b8db74bac0 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 dc39dbbb63dc14219992d21e5ae7dec56968907d..47f69e800fee3a0124b101824f158620955246db 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 839648f265970963c693be260d38719880bdecfd..e5c11aa5bac42f24834919e383d9689f488b7705 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 0ced7eda126c33d0d172966ce6eaf56090884189..11952af0ac3879144a7b4118e281ce2e48b3c9d3 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 35e9e79e90ae3e7d77819805e1834a82a8a53fd7..f523df1c6bde5b074c2ea0e37b3e686ee5d13661 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 be136fe0d4dab160a7df8cc8c730bf9137a03bd4..6a58577c76db78193215329a334192dab078dfc5 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 e84af38b67e25681deff06881156d826c876df32..ccc21687a507fe7566a4f831cd7e54a35d6adaa2 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 811f969cdee8147dfa43bc2ab1124dfd9fd21e41..2740284f70bffed588d4f5073504b669210a6030 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 a786b25b495b7b465ef8a2c410ae6c11e0e01763..95c0e8f3fa9d029b63b0f123a42468e9b1228854 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 858ec461af373667c1fea1a16f7cb5e4f516b758..71dd3962d153ec2f306654566800fd98be160fa7 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 eca4b90f4b5fb9f209c30752ab583a20a31518bc..3916d3d28e051fee24afd9e728d2286fb36097ee 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 e5f582414acce8158aaf487d38b74f137f8f3088..52bece6018a137c40e7c1729e9a8b75ea9e6264d 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 c379717b3bea70bcf11195abf967b555914a64cd..75856d5e49eaf50d0a13dc5c04c0f1b3704822af 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 998f642e806b17a4d4770b2b2a3263560dd22644..bc90aafd175d3da9de88243fc06f787923cac340 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 fba3816c34dccace354686348a7dc432c20a4ed8..3a8e0cf4226ff2c38ad1b4ff00690794807830b0 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 56d1505fdd7a34c636c8215d712905fa4fb69f15..95319fa29bb60fd17c08aa8d81ccee20b6a543d1 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 1ace62f119681054bd112b1ea0fab172acc812ae..594f0ebeb39a6c38880c0214fde35301ae7ba6f9 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 cc7abd4b93e034c7179c9e883bfb5f98367008f5..a231d07397999137629b0d74577a17b38670eb1d 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 4b62896fb7f97157dff38675010e395bc9f1c57f..37f54989b7c867825bb175aed3f11f6f19cc430d 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 7e059d7f0db2787a28a33524c7c1dbca89701615..97735271b10e486d6f01668c904f656f4b362fea 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 2e22f37fe0095e3b5f3982d7151d0b6bbe226f1f..78c4f7be2e88bee12660fa412724a222baa7e03e 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 73eead744788b4c7d2179bcb77bc931bac55a2a3..1817be2a893cede44d332f78fdedc5d5f9da7588 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 dd5a5ad73cb5eb87bf1c0d409131acf00429ffa9..726e09cc5b288b5c012f2738435967086845f819 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 ef9ab34b89985b8b5cc77ee081428d5ed6ece2af..8cf57fd531dd08b97fd40c36667e1b32edf1fa31 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 bd06539737bd9443666cc6abb474a255acef0380..f3d7579a3b873db9c8a4798f4b7c3e4126f0d007 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 28cbb3352b8b40dc2670816ba4c335ba677ad2eb..7f8f2ed9e59d5de1677adde8b1ad708539f44ce0 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 edcb307c6528fe26332513894020208f1bb1aba9..c683142f5d39d2fa3fd1f8e74fae2bea0947a3f8 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 58bfd27716a2dfa2ed2752ee39ed63fa8cb3f77c..2b075da131e17c5b68f636c762d1e3bb84ed9e15 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 3e4462c0398ec16da2d7dfcda6045c94b3953c79..01c157234cb602a4687d8bb3de5f2e937c6a252e 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 3e461b30706f6c0627e3943ae13104a6c52335fa..c179f75e59763af65d0d43b1a3a4e7b5569b99e4 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 cc385ee6ec6559ae5fdd9bb1e2fbc972751ab867..59d167324599b82d15838bd87e05ff0f0ea0997e 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 f14526df9b4e01bb6cc3dd24ac7b01335f4c6e7c..2aee01ff62aca63ae54e50f66c4d38b891d0b15a 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 d2d1a882a874e32e91e9d2e0fad65ff2c4a5e6f0..2184142f9c3bcf6f120e96249b54ab81c3ca89d9 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 1ab6eba9faa84c1385404850d47853f3f6f63fc0..e55d8c9606d26711a4182094679ff80cca1c5e05 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 6d92f3dece1125fea864a6a5649e515ecb8d00ae..fb55d29ec2a17d24ead6a343c44c294c687ad38c 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 eca660605e437e6f973439c69ddb6313bbe425b8..b1e1e38892814da1a10f8e0988c875d9a8559aae 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 887bfdef2aaaf027f4d2436aeed1c0b15bc2a1d9..2ce334fd4b99177f4776f81412039b18581ef1c5 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 8fc665e68a9d7dc95c30c7e83f99a1c7ab6a546c..778cef899d1a48733d4d7a6d673a937b87c895f5 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 92a36bff0784cfa6014446ed2bdf30fe4348a467..5bd675ab65a1306452d824b34df196c223f3138b 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 6ca63472c2b621e5c5e96db4fe439fb44e09e8ba..a8fed4fd8f0229d710d68516201fb2bf9087aeae 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 11530b201333f4e82d3683878643892dbc1a4434..dc11d08235748d68643806ee5d92c71bb7bd4f28 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 f6fa361b27e1fd272fe569c8d78b9d2f9190b663..d01bb3db4f2939a53082dd202985e27c87fbe8a1 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 5feee008214917ef4a19eb1bd773f427a977e64a..f1ab69f590db04e1fecb98247604ef8897415955 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 b8734c2fab372ddfbde8cbe2644d3e1706b58318..e06d17d8d6d61ffaf0c0f4252d20d7f41b8824e1 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 588fb2436ce13935cfdb0370cb1635a11ceaee3b..a0b5f4928d23c47ac64ca87a6cf880101521fd48 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 f4549adf433d6ee51d933c83d01f61afa78ce62c..083179c92df393949a793eaca8aee1ffa41739e8 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 32b411efd9bd98a0c02a2702e470f1daa0f6cd7f..f315484c156fd841dc7c0a01dd55f87280f09632 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 3c05517e45d21e380ec0e10ca2c1fb251f08477c..50a05d745c48ddd8c15a3d4f40f9a74d433bd118 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 d381bbd69f9f0c5798d75d85ba44343a2c4d61a6..4f292465e196add5aec44dfcad25ce562591a8e8 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 0e41a15280113afbc55c6561a1563d8445c02d20..57a65dbddccb287058bddf993b1a9c8517d3aff7 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 207263539749c6b1fcacb0280185a0d452355065..f5861a0a90f330d90b57e250161c2291f7afab86 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 d8181db175372484ca5f315f41780e330e29904e..f82edf9fa905dc03b9a88b7973a551f5d86678fc 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 636b71531c80236295a26790c7e3532905c9293f..481015147ce6845d71ce3d6d556e6e50202fa3e4 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 606bdd15463559068b24c31eb9c1f2c10c5ff471..e07e5a4fd3dbc71be07906a29198619afc6a9951 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 3ad1fd08e54c2a24c4c32b01fbbf2385e7040fa2..dc8ea33cda972db2119a8e5846cd4a781097a3cb 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 7b7b802cbceebe733569e12eb2a043b2a9199ee7..2669d8ad464861b8a390c55a815198e15ec15a62 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 e86cd71031af7680fe621a8dfaf7e6cd12693beb..05aea58cc8595a6709fb99dc2a18f89ab67f1f76 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 0b12944ce8851980ce17d6c99430ea0f39e95ccd..64962527d82f9f8d626b993bdd97d1c80c176c94 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 a3291c37f148e138f49de9857646af32cf9d1981..a1f53e7c159baf8a4a83630bc17fbbe1768c2809 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 da73863dd65483447231bb4f1c8196cb8ddbae73..f436e763d4920767687870d895689a42a7c72496 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 63e7f843d469117b03196fb5d32923fdef7f7bf4..0847761c75a7af864bac9036645c4ad1e9cedda2 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 1cc07ead21ec145f42d70e60a3cb535d3185a00e..358b9650834f106696f46dfd9787afb223290157 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 f72f9f9e5ea48da98975f280939072f293442399..d64465afe8a3117ef878f6db1718a93e39096d52 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 0a6d4096c869b6bbc791bd1839a9f1d4c911ddf6..e21e9aa2c2e5f0641f0a3e140351bc3a65ec0d91 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 4bdc6eb218627dc7d2fc1986f9102749502502a8..1f716cb6fd1deebd89890c3b038469bc69c2b2bb 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 8a0961b04c274cb8cf1225b40f449953823c38de..5c77d47d8cecdbe2abc39fd3a7693e9e2a9375f7 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 092f2170e511828104cb3b262d6e177f0d2f614c..a54540d584b9feac04300b4c21f14d4d991f0c94 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 2a6a676cd6fa053e69827e969b9e78faa703be50..0f73b2b74e1d7f5caf32bf4cafa6311257c695d0 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 d96a98546dff23ddfb7b0f51792ad905e5ad36b6..2466749380b3a4abac8d2d5de82cec7c3378f05f 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 f4bd61bca0b1ef033947fab91d05d32e3615dd05..420844f0a1c4946852c78b692d8300fdc6b7da66 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 3c317e2fcb08c64531b597be37f39f2f8ab3d416..d44995666194375c61ea34243cd0465ed4070e2c 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 7ef0f756ac8200bb0fb6cfee3980bc7fd2076106..0dfa7ea111d8141caf6ea252f990fd0d564ceaa0 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 7c498e6d58aa4f8616502cfbc575dff50596db82..7e7d8470bf49662416f7c83a444876575b29fb16 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 57cfbcfc6e3218428c5015733cdbb7299d31388d..fa2065bbb10a39ae251ee4b52292a0ec8e9a11bb 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 47383acec3b387782b97f0ecc57b4e74fdac4a33..273587271951eb6e962c3450b2b02dfb544d6284 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 d33f209c30a92a9b01fb2df615f164d4cf94cfbf..109711b17a866bf578ac46a18f5a71a8b8796187 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 aad927f7143d9d8825b5eb2f1b24ce5e51ed82ef..e7ef375d7f38172553d5ae8769b78cc9c49c2b60 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 a52bad064c0e017c81dc0f653f76ff5df54ed453..919f4c85421c2b24c7f8a6e5d1a12f37a9a6be28 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 a0ff4dc9b56342b6a7131731dbf5c4c98e1dfa3a..9438e292065b15a05e4f2e2d5c1375ee5bddade6 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 1a5cc9dcf6ba7b95f9ca93fdd259696912f05e99..87fe096fbb12682707732deede58921d14a6d5d2 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 422589f5b13f5e0b02d1180a8e24b64766573689..97d2b851ecedd48a2ef24921946b1317e3bf1ebd 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 4b8d168cd2be0c5fe5f811e28c43d28e1e806f17..ace107af5405d418cef7e6e6bbea8e3c84c4f9c9 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 cd6a0322692d3f2d97740946211bd8c84c0c7cb2..00fb15536bc38c840839a6f33970e77467857428 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 3d477c9cbbf1756d5bc7a6226d1a6c2e607f8e33..6a026c6aeb533209171d0c3e731a6c79c69a0520 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 50028835f9f276f5919c8c4f90f2bdbbb9f0046b..2cab7aacb3dfa0d7960ac6d2da06f534d726412e 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 bdc0c8512eaa59414e03c52865b6f2b0ee495311..73f6b01e811b3ac90b3e11497d7418a8338101bf 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 b9ddc082544cf39a4a24bc229947a3ee4fbd3ac7..fe6a875e87a8f13b8b0b169d8df99cbd020dfa20 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 198ba3813e9a6421f27acd9315696af657be87b7..428ca9a4c14c4ed56e927ec3b0bb7f23a9f5208d 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 03ec3b4e61965a79ef3867060b11ea9823fbb298..ed2f9e3bc3205ba4dfef376c123fe2e200523bba 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 ca536bdab3dc12256a21750ec112c931f23cea49..f1ad19bfbe63ac5d7c3112069e5b0097aab8f215 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 3be0a4f87f73d13c93e4632d652f77ec333d29f4..d7f4cca1e853813d939cddffb58280fee436b178 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 fdac5db154f0767adbd5b2c872c98b014eaeaa70..2f7c56f0039acb3e81b235627c6442cda33582b1 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 6524cb4a81a059a0d79aaf17cfa8db3ac3faf440..2eddf4c08cba18c0300fd23186628f944e28d5f7 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 a505891fca832f335dbc526f6fb077d0a05fc64e..0b39573776a40709efbd5585b3da9c7312adf7cc 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 4a050b7b50da82f2602a67e2ae0a5ecd08635ed9..5b28180df29b3b45623742110128f7b2116d8fec 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 8c6b514ab866280af048fda8295ad647b3782a4a..f2d6952685d61199fd627aa416382e552c6e96e5 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 1507fdfa78c3f87e4a55903fb317922232b9bcff..0b95c578ff687b7e74cc38cb4f9151027cd4a786 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 98be3dc0a607dc9166f020c473452529335c41dd..8dd6f3eed3bacefcc1c8522402c52d17e32b6fd8 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 30fd3080599048ebe6c5c5fee20b720468484f6d..f1b890fd6ffb940ffa54a99344b373fd25454f9e 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 eb32cd91a7fcb4cb303e184dd40d5e10a280874c..14927e1038e1333120bdd0bad33c3891301e71ec 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 dec930b0e9899f1e84eedf178a12da4f2aea8e26..1af38e40377fbdc917807203a5567767d9f3b574 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 aa46852583ed7e34a49bcfd32b9b399c6effd1c2..0786159aa2f76e93f872d6044f818c5d6027a4f4 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 de894868fa8c6e9e25c74f03fa39b3ce686f53b6..21e05e71e5c035e26b6beea20ec3632c9503cf34 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 8ef64f2127959573998311bc8e6f871afdcc5147..01e958e65ab4fb3fe1afe8c72f0b2144b17e7774 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 6c7f6bd01719555d327bdca140bd0f83c392959f..d737dff5560ea0c8fd869ae8783f4251b0ea7dfb 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 baca5794817b927e25c5578d8b1532e5e19a366f..1cfffb083f15a761a01bd4198736a21746667df7 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 ec15a19cdf4be448422df7d584376975add7105e..292899e033016af9a43722579325397eea21a3f8 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 9f5aca9ec99fa49863e4b829d3b4b7fc7297652b..8811b887e34ff4aa8e372548e10006621cb3ad07 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 4c795fee5678a5b254191501f85cf4adf2a0554b..8c241d45cb7b6127ea7cc25a519c73011b6ea7bc 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 d85ebb068dc42f3fa3856bba8614aeea0caf90ab..971cc8e5ee52c9a489782e3734178f59cd7e4a3c 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 0000000000000000000000000000000000000000..a43510bc39085935e87859e55e8a9ae7ea986227 --- /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 e11d7dbf4012cd635737958a5fd8cd5bd57ce801..d615ac2e6913988f62cd05f225c7c22343aa6bb2 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 f79458b9bef33e6cd3a871c1a451122da59f2a1a..faa1457de80fc97018b6ed54d8930b49933ec4e8 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 e1b67aeee3e3ff3f8599a4e2cb26397d93289ca5..6ccf25b3b29572d6f7540a91a4ee30de246db7f4 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 268a8a34f85e5e5ef7e50501eee3fec07c11baba..af1817d4f066c1373a833f52dd8e44274d0050d2 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 0000000000000000000000000000000000000000..d1f53c39d1dfe2249cb7d129bb786aaefa8b4e73 --- /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 2b9349e35180de690ea3a36bb85ab90b124f6f7b..995ea978e2f29de9cd679ef660ef576951aee6cd 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 baf73ab11119f66cc7d2c8aa019fb736700c2c6d..1cefb4790fac60d5525ca536b487e74a6e832761 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 e1c5cc5dc9cb2cd235fa406f90f14181bf69459d..d042406dbaeef87b79f98a70608c6ecf574c493b 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 275ca84f096764041f3b20db2a175b2387fcf728..57c310376d0408f45e601a4ebe137a7de110b421 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 3dc3486d3b437de729f380d26d3b8d700c2107c5..6ec18cbfab41ed034ab8bba146a0afebcdf90457 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 7b5bd6249502843c5c669bc44c5f5b6ba166c40c..b2a07f78ff8e9ac2b004fb0a3109fada523cf94e 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 a03d7511786842a1fa68fc2e620b595db64d7ef7..756c86ad2188c7dda92ecf40dd452030c6fcd7af 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 a4906815b066ca32c1e942a5e0ab08c1de358664..67911be2d8a66d175bfd40c12f1c975bfe137410 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 36158b3c1d7258ff89ff17d5076e9e1a83bb5ca2..bd3ceafd0dc347dd44b1e68ff57184ee014482cf 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 5e27a75dd97bde0f88236800d4f21dbc52cdb812..8ad98432053f104edb67545ddb4577d966170a95 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 6f89d558dcd59e495120577421b1ff17a5a602d8..2ed79ecc195fecb0cafad403868a76553363be7e 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 515e18cb17c9a92dfc03b552f19fa112f458b2cc..14a9bd47f5594b4a95c68889db84bb48dc904355 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 a6dabd5d2593d491f7ee5a5125f8e3029cc0664e..47c689a08a77beec3f017572580da8bdad9a473c 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 aea9ec4b2b36b2cae885fdcb09eaea11bdd17169..40b6fa851ed3b008727a3fae699a1c71d66e1b30 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 a3c7d38a26052e0bae6962bf745f6e0e87e090fa..f8cd748ac7a158abcff8a737237d5dcde4e55faa 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 4917937adf96164653ce9503fd21e55ea512169f..eb436278ea2f363c896b49339c868d031e7c4bf4 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 29a0d83c381829b509188fbe805b42fb81ec10a0..4621ac699c53918e749ce568cdea46001613d906 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 b445f1adc0f3d3f382362f620694515ff5acd63b..5958827f2ebe84f3cef5f8d8295648fd20acf6ef 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 808d256652c6f33c7dca3d6e746e250d8da1807d..897f4486d103d86d5f6f3965ce3e0079d06d8c5a 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 ddaa204f274d67a7e7059e466ceef5c1f4b98ad6..78029ca327d163ef80a5e9eec08f425cc57dbfd0 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 2e63bc2b9dcb03ad86bfdb26c07f7eeacf998724..52468a3561e798ac14f1aa69442a16fb01cce6eb 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 260d344ec3de93262f0dc82cb3e63840a5878ce9..b283d1bd0ecf6c03690c4397975e4982a10b1516 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 90bcff5d7abf9342de6d7a565aaba265e84cf12b..712e85745ffb43633bf1f8de494d2fcb7f50cd3f 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 d3f840ec4b345e070971ade6344cf63e76785700..70e61301b0dadebecc7f5a51802856691d5073ff 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 ecd63b150e4909f84afabc4facb2c6300be27ba9..f4c80bde7b3e5f8c3be4c9c96a70b71fa6b4a45b 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 6d1b5a67c7dfbcae27b4fe4e3bf047e12221f88a..7fa047da67d591e077b30e4c4ad8828e3fe0d7aa 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 6ac49ef4c9e8140d83af0baa1a3ccae5a1dbf358..904194334be661b42e2d074fd6f69f62fb532a6a 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 86a134b511eb6a505e9430f1f248ea925ead88fe..df54dc08c2bb667f841623aa6afc230714297c00 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 219daecd8bf5fdd1e1d13c1ffe827a2c35062825..c73d1529879ef2b702e55a7ffb40cbb85c6d47e5 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 86282de49a5d61fc5aa5475a885d34ce557df1ba..45742dd5eadbe961160ae0c98b7d0c5501414958 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 83be0ddf884890469036841b94a0564a599b9f4f..7ba7262ec5ada34f52b4ef75684f8a7e8509aee2 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 b05e809ab305ecd43f3561ff5de8a11aa899c28a..c03b1c683e42118b56b22840c0536ccddfe93955 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 c0665927b8727ba569c80f8d50cad7911951cb14..531b96453fb1a9d15e6ac002eb1e06ee6d2654ba 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 0000000000000000000000000000000000000000..182d8bd3cc0569c8ec141ad9297641b46a76e9da --- /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 0000000000000000000000000000000000000000..d6019d5495e9cc62cc11098f6c1258458270cec3 --- /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 606018af489bbbde6c4b98c29095266cba52b7a6..6578280ee67ddbce05bff0f95751433718fbeb58 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 a8254cb00edcfe7e7fdae961bb71294f3a922ad7..d6812fab6f74d450728ca8305e3361d71a1d9264 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 9dcf74ceb2fdad229dbbe31f09e03f236ed9fb77..b14203a28d90710945bd35615d0cee3b263c1a01 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 d2d7b3f3e4ea9ec8ce33a2169f680eedfd2db05e..ee7671ca348ac1e232ff564075c85a329c84aa23 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 110a3aa9bf13a550cd91e9ccdcc04b7fbb6ce2d0..b46fd1a3b4d8879d1ea95fc180bc161b5de36f69 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 63087345fe4f49979bec9605137967b335e3511a..e20a8a8ae012862bce34899f4b4977b0e8f3ff72 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 673666347a550d41e08b339e98a6d386b923efe8..862ab4edf2e0f42294236649a2813ec6fcb4605a 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 f007db187ecb0d99e16a85ba45823ba2b5da57e3..5ebc43278e6cb4836160c3503cde6dce892cd3f8 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 bb257835519a110733751118a32199286525cf18..68904e9f1e97df49474dcf554b49a07ab817d065 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 6ce9f1bde62a26695e84ef60265a3b7bc0d5d157..35cc03755cc64a048df1a318fa69ec9c6f3c1036 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 ddbcba6984e6fd7514f513bf220bd21ad5948593..f861b67f6ce60d3e1802bc0992962f3c2bbb511c 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 399055ca7d2e139d74e28006de691f2abec91b33..d610d5720e9636ca40a34bcc98f51cb8152ebe19 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 17cf04c85732e71d08318be93ecbe1a6b7f31128..8ff9f7d386413a3ca77fa030d4f1b13904a8c337 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 c318a79719305cbf2aa609e4f5b7e87b8f84cf80..72e72b481e9575483e885e4b6dfa77d0544f82d0 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 23ed5758a445ddb8e27f57ee2bdf4450e1282da6..01e34d6534f4d807279179d5b845593118af69f0 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 88db047623b1caf40e5ddfc3c962525eade2dce5..a635206f7d696e5e43295611fe42f4fe945aa763 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 8c4724eb459384e5b7350c62580edc6ab2867d6d..85f59c4e26191305e90d8a6dc1c6bd47bc27708b 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 813f75b9ed82ae073ea65862ea369d284d1b3a8d..84234995cc1465ae42449c7a54429dac9377d556 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 a8effcadb971347240186023e5545ff3873d8f88..a86ed85c550ec06737899e1c089e438b0a61b91b 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 58a4774da109bdc41b14217c5b416072cc237a0c..7b597a69f92c637d823356a7e23856bbfc8d5841 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 541d9367f6674f50415eebd904ee36ba9607e84e..da8b250524a4365cf9974b16f3f2026ea2eca9d5 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 6ad1d051e0a239ed50c768ea132342e9aa75bb15..1154e457d733f4206f0309c9899300e02652d54b 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 87791c920552df4190c53ae2defc28c7fd41dca8..ddff1528f58eda6a8462dc239da6a55720f3ea4f 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 41859ff6f154e2dba397747f712604044c688862..b58b4189cd25c352a6afa1fb726fec4ce052a61b 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 38cd7182c2da2d738ff2e40d3a286052a4cdbc2f..25c5dc1b356c48f8ce08f2820e75428f9af38ed7 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 f72e9db2205d30f23da79d913fd8514fcd551dad..99ba0d413a4fe1379270d578e3733fe929ecef55 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 b3b7b6efd6645cb8a19239e0d6ed33fc315b4a25..4a8145bf1fa4a511d19c43ea5898c185780520a7 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 da6419e1822fc971ae58a420a80afd6e0d774d53..d0d9f858e53d6f08db921afdb66079d3843e8133 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 39e7156d06a81771876033716f4f521097a363db..a85a56332a81b3e7cf20603faa21d91c16c8e13f 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 3db9c2009017e4cb1a8ef608a184fb18dd4d2c45..94d8aa3366f282d00d532862b868d6208192c801 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 5cfcda6d8c05cc49fa4580d6315b7b7c70bf9dcd..bc5e032170c62b643a8ecaa69fd80b90e7c2d1a5 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 2a1d2e1b9ad045caa2531fc0c66304d1b88b3fe6..672232c8473f700400f31e3e927e96057397963b 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 e1525a731ba19201ea48ef36fa2633340939af14..b886837387abf2de791d77b18ab421c8b9d215b4 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 d0015353337308934989edcba26ec339df75dbb3..97572c2bf9d38a024c82f05d6b00bc92c420a38a 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 260f1e00a157188161877cc90ee1dff6d9d6a3f4..92600da4a4b7005dd83f4508b76b4d014a7fdc7a 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 7525b877d691342f3a131af071694e5864ccc78b..0e1f83a1e8c1aafd243714e11c42887991b74944 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 5648f5103fb6d83662e8657b7f746d3ff3d39da3..f201f593858d88e3aec57a8bea2b4d9761a0bba7 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 906396f018d7b18c92429b2d496b1501b57a7c33..831ccfc204816dc3ca616d554b58f8a987befaea 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 e8e378182843ef626bb55d9926388aa89d94b091..996b2db50633599a00c4d153a0927aff43f2df29 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 9f5f998da9bad1c9967dd64148e95ce0153c7eeb..994ab655ddc5a82996b3a0c554cb822a1e7c5e3e 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 76f3be27fc50762f5495d3e359b5923ff065be6a..56221511e4e3bc29153b1b0f1f4c9282c4bde09d 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 18f86b4a7c64886f287a4aa4cc4b323df7cfa005..fd31eff8822bcd7c1ba8f7dc19bb96fdf462102e 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 d901540caa9c4d74df6a1e049834c4584b53f6a8..1ab71e8e9f15e23471eb96a872f6cc32f57f6a96 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 23c6758262bb613f6fe2b305114001318c660a0d..dba39cfed2c58585fac480df02bc61315ed8f1b5 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 fa36c455fb6d0dfc3ef0a243fcbd8b223ee9b2b0..e1eb8c26a6514b7c2064554df29b2ba3d5dbe322 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 92544c141e850261f59839555fe4aa4c5beffb16..189d5dfdd9adf6eb94798e19c5697cdb904aa436 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 f7d90047f8a2bcbec20bd142f4ccfe093ed6f1df..c17ea9c242f70433cd7e18d373181599de54bcc3 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 e81ec20a5b1169221123b8315deb86a3e36a822d..6555e9212973d0f9f82e0c7ced7ba4c51e0f98f6 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 d21d7f8da101a8dcefd7d7a2cb96fc5b37c8a9dc..4217a82d8f31eb1756155f1f60739f90af02c860 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 20c76ba24faee6c52a760bb85446c46bd68c056a..eaa882b87227d4c28b7aa39ece3bf7cea9207619 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 2a4603226020f7f9d854986f7d52a618c86dc3df..07b5e7b946310c6a865db4845f2b6c86903c1336 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 9795740c45dc9c9a18d7890bde014531a7367406..40a0d4a47ce942a8ed57b399a0d466f6cde91563 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 bab64591fd8830ebe59a6294f60ba4cabd628daa..755644cf9da03e2477a5a259ef4da0b515f837de 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 ee4be42507e457aee3d2c48b95e31cf34461bcc9..8838d5450b06462256448c58a845cc87b1dbcb7b 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 bf097ac1aac8453cb1f8ee105ad000b2981ffa70..065b5edbc58da7bdcd727b61a603439c5d234163 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 b6c4289891b10ef539342b3431b4b5cbd1292807..d7b872564d9b104245d2cd5b9c784ef09f4839b5 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 a214bc9dbf11bf7cbed9a4ac331345265bb72c49..38699c0379be188cba90dd8bd3518bceadab2d00 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 625d463f7268ce2efd54f463654f41ec85980bc1..d3e528c94d833bc9fbf95040cf0348550d236a0a 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 0068560fea264f15c0d5f44e8033ad3c625880d9..858ba20bc878681bc9a4c7562dd0ed85fe18697c 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 c89fe5d6d4b37c8380253d4f9c732201ace6924c..c73875dc79585ea464fa4400e73dd51cfee6db6c 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 d510872f0275ac92dbfdd9b4a08c3687a30cdd28..565e4d923ce160a88767750a2f33668c47a23cf8 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 2ea44a2bebe8f1774907d731bf99f3f51707c91a..7d6c8e974404193fc840a1229eda99c96acd71fc 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 4ce06e0a7c67a51cac4d7181cf09b272a12d64fc..4655d9a0c56d2fe37986e47649767c8d4ad3aef4 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 d1489d0453f11faab41ab6e8e2dabbb372566f60..436c52a201689e4ffa97f217fd3b1d14e6b6ec36 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 9b176f89245d340b278e13f892c9c85703a5a1ea..7227720dc00ac5ee6d0f4fa47fb99dd01aa662df 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 87fa0d23473c1c1694069580319d52e18c76b634..0000000000000000000000000000000000000000 --- 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 74dea91cdec76f31e4ed2c211c0f6a1ac1807148..a475b79703d044c4430961849071bbc357883391 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 a8f34e7a1593f20f672ada443d59328803d39787..bbce647ffd7bf4070858a4967c6ec89eec69b980 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 e7fe246eb9fcf0d42791163350ce934730f69ef8..eacf49d9457465385e716ec644b94400e63cbaeb 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 c181e63d9239751e25f0ad5fe45364e7ad1194aa..5a0f73c2c14f1b5b50418c0505b51070b09d7e13 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 5696270d6ca4459d654449b9b7755fd213c4ad07..274409ef32c0247b931eb80ce783e638fed771c7 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 ff0bdf911a64925e172606bef3aed5e4b7b1f6cf..990157d1a96c3a39814725db543bf32bc728a50c 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 b270269601a068e1f2e6500709948bac02f39bbe..8de2d8bc2573ff1021d9d954e15b62901e71b82c 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 240ab5ccb22e1d3350759851e342dbb3b4681683..b4b70d2704ac916063005e0c32fb0c6580499955 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 6d3ab261f8b30a3d710de72ad4a86c011e1a1b6b..c1fa8f31d02e907026a2f4fd315f13acb10fbbb2 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 e2ee062cb9198304bc72563145d63e06c07d669c..10d4e8a448c69145224b28bdaa414c16c4165b23 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 453dd5c754df19fc6e9c84c572e1c576f37c3abc..2d6ec8ce1428dde8e589477a4c8205c4ac8cdc84 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 9374466f5f719a6ccb04151556bec96583ae8206..f46690892c7802ac7e1e5b6f7708f8cdf6d6072d 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 c86ea9d27f2a332b06688599d31b4b2b336dff16..f3d9fca7baf6a6e52cba83daf8382ccc28d21491 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 436b0c3b50c7d1034aca104da91eeb6e0eace019..b8d51c701a3c2488b2707b459e0dfad86fc622fd 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 3185d4d2aae0f9997a0ffdd6ee45592400335b7a..a9bd864e13709aec9af4cbbd4bb5beb531891eaf 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 d819a2a7c82f5f18a7b657190aae6e883ddfdf21..bc32fdf3ba84149cbfd487ba2c0d76f355177733 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 31ddc4a4217f00bcaf6c992a578427ed6f01738f..3252e47dfe34b6ae4a90df1ba2353bf95c228d3d 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 c2c684d2b85265524ab3156b33c0665938caa619..3af0e82401d24a2c374ff548c61a7330e1c994d9 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 0000000000000000000000000000000000000000..70dd844b3515ec09316c6f4a756d3fce3d707a3f --- /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 0000000000000000000000000000000000000000..8a720e41a11bad950ffe67b969fd0f02be6cf179 --- /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 0000000000000000000000000000000000000000..dce082eefe8b79be868c79a07b58f8f4ea3ed5bf --- /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 0000000000000000000000000000000000000000..e36f9c3215fee244cfd8eabbe028e48f8ea99b6c --- /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 0000000000000000000000000000000000000000..1ab288e64a4988311f4e8eaf29afcc1a6ba782c8 --- /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 161006058cfc8e6bcc41897827ed27dff80b2e8a..55095191ba804ff57134bbbdb9ad5a564d7955e1 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 84becaa1f7bdb504e29b64307194c624175cbe5c..82dcfb6b4b2aa308f7501937e34480670a8c4f39 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 da45d2dafb282311291c1963ad84c9630d691416..eb66328d5389b9fde228f71a8924f8cb7f941a26 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 b050776b7982e568f59b31547a6ebf72a1dba880..81408fc44fa7a0fc8dbd76c3ab526c63aa19798c 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 efa70d0bef325a77e345448fc88d3fb721a8d39d..26d5f1bb9c897afe1121cfe3ed4d5a70456d17b8 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 17486179baa2a897c2efbf0d2b4d39273788aadc..64eed8391797fb01b14c548ebcfe390a403da5ec 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 09ef4241284dead93edbf8169170445e168e8003..f5fe099d8ed0788ab020db4051a715ed390f84c9 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 abae4f88ede6db2ca2fe7ccbb45867b450a6e74b..1135f55a87dbf1f18ed6e3087d268dd9edaab60f 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 126c924f18544e6390c36f3e7dcccc73fc471c9c..42d629a4ae8ee3bf416df6d89e5e827d23f4bb58 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 92e8f079cdc6654f3fbd433bba65b2f31f97f2e0..0921dce9a6fe0159952857774d70f603d9c911e6 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 385f3c3ca6b8f0a42790511cbc96800648982683..c379cd5ac4867500a7145195c29654d8be80dbaf 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 b3a9181c11471142410c14e84429e13f62796e16..e2461924a7c6d4d0170bb379800de50de3977935 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 5c309bbeb569919015ada14d485bd1bd0bb905cd..24ac81a442769d0f81e058c1aa5a0047c64f8535 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 0000000000000000000000000000000000000000..1fba2a1935a8645aec8ff5ee5c83ebce5ab27a43 --- /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 d584503adbf4c3edd29033ba3d76a4275fda79bf..227f063584537818409aa00ec311cc310b25a1e3 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 45f77a38b3678e0c5025810665b3e416234400e6..c90ecd3fd2cbd016033b35cbcc4334d1ae8b89a9 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 6c2278313c3ed3353324c6a89aa4ef970663ef48..38435dea743883abf54c843befa234e1d59e79b0 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 0000000000000000000000000000000000000000..df383d346f0dc580db3b966d77ea91cfbf1bc0b7 --- /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 841b5fd1412d559bf765aff678fd163cdc29be04..e876fd894659342d496a23a71788f4ba9edf1e3f 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 7a446e0040ff3ed00c17c9d6c5a3d88b84dab6d3..2778fb6d559418e912082c1b27dc643d61485fef 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 0000000000000000000000000000000000000000..018dce62be288a1548c9054b7a234a4242a77fdf --- /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 4be10a4f94c07e12da7989789872bb1e056b3d7d..26e6a86dcb90e1123d8d1e16d2577d4a99b84f6e 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 f05289f0081ec34c3ff884c7122510d959b64f6c..059f6aa94c61f58dfe40371f1d4c39b7559bbd37 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 7f7e149d94f9c40771c0e481f0ce95eb67b8ad75..01b879666f3e2130ae021a988d262fb55a3f8275 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 29f386df83e8f7f35a107550a70bad3fc1596266..334c7ac1341590562474748a9a752b0fbaa81bf3 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 c65113960ae3baf23551ca38146c2f0de610f835..3ebb6e33c33e28afb71e3e18dbcd5774699e0a26 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 0b64df01ec2566a2c2de3b3519fc13449481da7b..09510b54995e08028cfb63f35a056798455e043b 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 57ec4989f5dd6e60ea90d70fbb541b690676019c..3b66037e760f1e01615678c1321b6de81c3cb82a 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 7d62d65fe71ec42ef91337af635f153eb0a40b5e..f07a0976e8881588b80ef9c6c302621d63d3d62e 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 1ea8ea18f14c02119f1e49a1b6f12339df32ece7..8b4f2fc05e9b9f54ac5f4db30eb1c57231d8c90d 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 ba40666dc6d4164b741f8201b55a3895f75f6ea0..2c0acecf9942efe9099f79de69ef09f2688fc179 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 ac1de5418e9d89fe6ad6a972a7cd259edd68f07c..05f3ed41d068ce86b4faafc588243856370dfeca 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 6bffde03df03f2fc630e288a4f0018a37d791299..27a2e7c03015e32af77abbf7be774ab77847d82e 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 87d050add24bc7dfeed187b46fdf8713b489188a..e0985148d578040599b50493a8f7ea595aa8df4d 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 14425898f9917b7ca1dee544dcd9ac292053e1f3..8bff3f23ae12dbed96fdfe27f0491d4cff85a37a 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 139162751c4567654e823c1c895df88a7cedacfa..51c48360c229a52b067ae06a22b31ea77e137016 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 0000000000000000000000000000000000000000..35bc0462b676b041d9a5b52a37fded973d0157a9 --- /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 0000000000000000000000000000000000000000..b0353a724121837cc2fc80fd6ab195301b59c578 --- /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 0000000000000000000000000000000000000000..86110bf4ef08b1f4035f3ff6a36f794cb0a8100d --- /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 716f84dd6782aa766243299e536e8b5376b0ec8d..55a4499761ad968e8bc89214c0020dd716a403f6 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 4ac83b552ade875d46164473cbea93dd5d359fdd..0000000000000000000000000000000000000000 --- 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 5fd73aadf977a2bfb2a4982fc48f5510c86ace96..0000000000000000000000000000000000000000 --- 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 d987788322f5411ab198cf49da1606a4465947d6..0000000000000000000000000000000000000000 --- 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 770c1efa504ac116482bdbdf2050907b52d3ac15..0000000000000000000000000000000000000000 --- 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 f45d9606e5208e4ba2a891018a1ad0f731556972..0000000000000000000000000000000000000000 --- 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 df7944d5e651fcdcd4a2ce44b0c89644ce8e10e9..0000000000000000000000000000000000000000 --- 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 b987ef4a944fe77a3d710b86dea02aa8ac9471ef..0000000000000000000000000000000000000000 --- 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 f2dd0a2e12eb44342066fba9f2a09e7cefc1f43f..0000000000000000000000000000000000000000 --- 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 9e4ece9202e54aa1143b5d112120a8da7d91992f..0000000000000000000000000000000000000000 --- 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 d6d3d898631d8ee80404355e5f804d6c4a449ca0..0000000000000000000000000000000000000000 --- 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 c3c49bb48fbaebdb04c9404bef7a28fa685ffa10..0000000000000000000000000000000000000000 --- 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 222feb5645e8fd869564b55e0d8d25b821e7b0d7..0000000000000000000000000000000000000000 --- 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 7d389613d43228ed4042bc6f71043530c8e58941..0000000000000000000000000000000000000000 --- 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 c87ef478e450c395a47e2be0bbfabaca30a831f9..0000000000000000000000000000000000000000 --- 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 9775ac98dd834440d90721755234773c1e9d82b0..0000000000000000000000000000000000000000 --- 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 6db8b45d5137835ef3087c7458d90e14e9268121..0000000000000000000000000000000000000000 --- 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 9cd82f571a70f24fb244b77700cd299cb50e374f..0000000000000000000000000000000000000000 --- 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 63389ab55811309004aaa376677f455f0da2fdaf..0000000000000000000000000000000000000000 --- 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 2d8278fa63ab3570a1fac30020094b5528c29b56..0000000000000000000000000000000000000000 --- 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 c666b69db79a06f946afc719e59260481355884f..0000000000000000000000000000000000000000 --- 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 183242e0639d6e3ad3fb82fb91fd8f460a644783..0000000000000000000000000000000000000000 --- 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 a640bbc34245bfcbf0d53cde9d427a7e540a363d..0000000000000000000000000000000000000000 --- 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 50778e2f0b693a7c17a4ed67261e18e9a056788c..0000000000000000000000000000000000000000 --- 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 eb9cba0ee5a77651269dedc1aa07b4630e9a3fe7..0000000000000000000000000000000000000000 --- 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 0793381e44ccd555fd781b052c405387fd5a1dec..0000000000000000000000000000000000000000 --- 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 0c2d8417d23d10bb6df6cefb8a670710d5ede7f7..0000000000000000000000000000000000000000 --- 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 7b42012b4bb5c608f531d4df41a711f8b4de366f..0000000000000000000000000000000000000000 --- 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 d91b2ce23bfd7743313a06d31574c63acb519b62..0000000000000000000000000000000000000000 --- 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 b03e81aa22937382bbd935c85c96837bd4bc61ef..0000000000000000000000000000000000000000 --- 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 5237988c0bb62c51a48073086f075684103802a3..0000000000000000000000000000000000000000 --- 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 dfeb7d83f9448e6171f2fa0c06636ac8f28f361f..0000000000000000000000000000000000000000 --- 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 142c33cee09cda16c94131a4b07fedc088433cdc..0000000000000000000000000000000000000000 --- 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 ab9c3ce8ebba60b779c3d342396104c249c4b4b6..b0fb2188c4b8a84fc7fce2d415f2d82e69258ae4 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 5f4d17343c6aede9d5ab049fdd7eef102d65336e..6a1d27242bc94ff708a5a0f98902f34bce2c7f7b 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 98e0e42e0b22010f3fd61461278c598c5b0b389a..0000000000000000000000000000000000000000 --- 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 e3eda5b0dc7993f1c7fa6d522bde30a9985183e9..0000000000000000000000000000000000000000 --- 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 7630aae68558fcee3d1b9e730db523afb002acc9..0000000000000000000000000000000000000000 --- 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 10e432d97e7824565239ae5a10e07648ea976d9b..0000000000000000000000000000000000000000 --- 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 8b1a52bac3e8ed02c263fa6916198f2e7437c31d..0000000000000000000000000000000000000000 --- 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 e3a10d0ba288179a42153d3955f54d2b7b8724fd..0000000000000000000000000000000000000000 --- 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 6ecdcfbdacac7a9e919d7c85a5c993b8a500269e..0000000000000000000000000000000000000000 --- 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 14d4f020bc3731a17d4cd7c8551a093075039f7f..0000000000000000000000000000000000000000 --- 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 d64203e4c1eeb4323126a397808a1c9970268056..0000000000000000000000000000000000000000 --- 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 dfae98f937dc71b7ad8a140a4be0a84202ec22a1..0000000000000000000000000000000000000000 --- 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 9ae36eeb7fcdd3329c51ab9b73edf231791333dc..0000000000000000000000000000000000000000 --- 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 159057305ba2211ef3a62c53ede6a22c28f41497..0000000000000000000000000000000000000000 --- 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 1f31878238745f88ea719299719efa1a85b125e6..0000000000000000000000000000000000000000 --- 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 dc10d6ca784a8daa187995d192511148d00120c3..0000000000000000000000000000000000000000 --- 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 bfbcc0d4e5fea760b2fac28eaf38e4fb00bf812b..0000000000000000000000000000000000000000 --- 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 149a6298f4bb28c558ff799a2b485261ea96b2e3..0000000000000000000000000000000000000000 --- 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 b4bacf612c0d1adf243d63e6a60ceef89cbea956..0000000000000000000000000000000000000000 --- 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 0dbf78dfcac2d50bee0285bbf238126edd9c6927..0000000000000000000000000000000000000000 --- 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 1ec076955b571228c67acd139a75348785f0a036..0000000000000000000000000000000000000000 --- 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 d148d51d9683d2f4835e6db4ea74ddfde0f9e056..48f4464c85c085abaa2d7839eef5c3988e54ee64 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 7aa19581073fe87839e8c129c8636a1d363e0ca3..0000000000000000000000000000000000000000 --- 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 765a57ae6a94e3590a534bee7eb6c997271fb1a6..0000000000000000000000000000000000000000 --- 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 c27c27a28b2088e8b24dd4ee613b5025e9cd9ba9..14a4af82135168896cf75af7de0acc6183f05029 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 46d3353525200d8caddc53dc44ec2df6fb77128d..55a4499761ad968e8bc89214c0020dd716a403f6 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 beacb1045a5637ac9e2c786fddd425594d452d08..0000000000000000000000000000000000000000 --- 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 727b2ccb7219f6da7d61b740b20c66c71d73e255..0000000000000000000000000000000000000000 --- 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 c96942f3f9535439ece741bdbdc97423357a5024..0000000000000000000000000000000000000000 --- 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 13ee525b19a003cd1f5d4e57bc11f3879dfe79bd..0000000000000000000000000000000000000000 --- 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 2812986ab202cb9828f68c225bcda0dc3e46caa6..0000000000000000000000000000000000000000 --- 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 8549e02d92880b7b227b21efdc97012938d00e8d..0000000000000000000000000000000000000000 --- 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 befd1c0e54b061faed4f8c807212f7d66bd36b15..0000000000000000000000000000000000000000 --- 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 69fd4fbe843adabcbdfcf8bbda4d0607185e5982..0000000000000000000000000000000000000000 --- 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 944ed60253c2248124f6d1454d501b4a7de34f6c..0000000000000000000000000000000000000000 --- 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 e8a55375876088750db9a986455b08edd4d25089..0000000000000000000000000000000000000000 --- 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 1efd34e92fc12ea3dfb0623082d6fa8d44b3d0e7..0000000000000000000000000000000000000000 --- 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 46a02ff4f0f49b3ed626397bbd33a9a2f1a05c3a..0000000000000000000000000000000000000000 --- 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 ec2a6fa2b9049713722edcd8106c28c2e6af7089..0000000000000000000000000000000000000000 --- 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 1975255777ef72263875ec8487448feb2178c0b3..0000000000000000000000000000000000000000 --- 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 d50b59883ef5579d2c52975feda20ca0276b7d57..0000000000000000000000000000000000000000 --- 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 0dafd5632f7a22b5e49771aa74af1fc733a71b83..0000000000000000000000000000000000000000 --- 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 9b0a1bada5525a88ec8a5cda88b67c4a68dd9f5a..0000000000000000000000000000000000000000 --- 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 cebe14d7563457707f0c818abe1c68ce5e301fa7..0000000000000000000000000000000000000000 --- 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 89114642dfa914408ec9335f859520453d187bbe..0000000000000000000000000000000000000000 --- 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 66594c8dff6e7dd6421770131fc928312bb7b054..0000000000000000000000000000000000000000 --- 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 f678cce57b6855d844cfc97521c0b998b7725116..0000000000000000000000000000000000000000 --- 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 db6e0ef0872cc83d0d01cd72a79e7a266f289bab..0000000000000000000000000000000000000000 --- 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 3f0eb96857dd3f242db6dc019c3fb2833215f4bf..0000000000000000000000000000000000000000 --- 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 3cbf6eb85f921de687b19b34a406bfcb43d14869..0000000000000000000000000000000000000000 --- 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 d2ab66bc6ff5ed1acebc19a895274aad7cab1939..0000000000000000000000000000000000000000 --- 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 eb59dce26678399dea8f5cd0dd731a8b5479cd3c..0000000000000000000000000000000000000000 --- 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 1f231ee4d158d266d2a23b8fcd5a740026a4b455..0000000000000000000000000000000000000000 --- 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 165c6974bc6b2faf866def58dcda0288513f3176..0000000000000000000000000000000000000000 --- 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 a9290fa0831c641af30f06a7ffb56c9eade5ee33..0000000000000000000000000000000000000000 --- 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 e82aab37f0fcce0919c973814cc122a292de93e4..0000000000000000000000000000000000000000 --- 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 3fbe12afc6b9fe58e44b9ee31ed344fc23d2119e..0000000000000000000000000000000000000000 --- 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 936562841326dcd32e26372f6945b32f256cbf83..0000000000000000000000000000000000000000 --- 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 9fe34fd12daf750a79f4d70f5ea0e89b9e4a863a..0000000000000000000000000000000000000000 --- 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 7233c901cd83d0a98c2bb848035ddae27c281722..0000000000000000000000000000000000000000 --- 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 6b1861ef22de746a978e749955495950b9cfd8b8..0000000000000000000000000000000000000000 --- 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 0a89c7e35e5ba9e6d1b1bb464cb6c62b1c5eacbc..0000000000000000000000000000000000000000 --- 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 267654d07f2c16fa9fb143bd4f19a9ba58cc7247..0000000000000000000000000000000000000000 --- 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 730ea9b6f8dfd932c87ee0a1dd8baaa5c5a3c1a7..0000000000000000000000000000000000000000 --- 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 2166b7753708e4dae1fb17f3c3ba78662914b2cc..0000000000000000000000000000000000000000 --- 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 c667554586137bca844870d27e09aa9f35c85d65..0000000000000000000000000000000000000000 --- 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 4d12e1595e364753ed87b666b49b078afcf04894..0000000000000000000000000000000000000000 --- 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 583a3da1074d979d08c4ed3e5e09b2e87036e71a..0000000000000000000000000000000000000000 --- 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 3751d5a0903280ee71d1a0172fb10507b979710c..0000000000000000000000000000000000000000 --- 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 98724b99bc4fa38a0278cc3bf3ed1dd1a1194311..0000000000000000000000000000000000000000 --- 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 fc97160abdc4597e42100f9f05286cd20050e989..0000000000000000000000000000000000000000 --- 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 12fa5132f0b30e2104181ed14c0eb7072f4b92b6..0000000000000000000000000000000000000000 --- 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 e47d491d37b31a23319dc8533a18835c7859fe61..0000000000000000000000000000000000000000 --- 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 20978ce499dd093e7ae4fcc38f3b535476baeee1..0000000000000000000000000000000000000000 --- 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 d06048dccda7cac5df4a1330b431422c155ce29d..0000000000000000000000000000000000000000 --- 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 33bcf44f89769ec34d1a8ed2cc338a80018fbca6..0000000000000000000000000000000000000000 --- 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 5052a148ea69d1e046fadc3ffa857180a28430ee..0000000000000000000000000000000000000000 --- 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 3911a113bca57919c821f551ed557b5878efb0b6..0000000000000000000000000000000000000000 --- 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 2263b87bdc877545860dcfb3678fe0a54311d66b..0000000000000000000000000000000000000000 --- 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 115b5f1fad48e3c222733e8768486036920a0cb4..0000000000000000000000000000000000000000 --- 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 13a7ea6cd913d1bf999aedf81fda97b503898aaf..0000000000000000000000000000000000000000 --- 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 ceceaf2aaa05d0c63eae221aa2cdcbdedea1214c..0000000000000000000000000000000000000000 --- 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 731e2616c5a7bf3c51665951e9d54011516d179c..0000000000000000000000000000000000000000 --- 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 60679d87bdd8b9e30e80d85a700b6919123f5bd3..0000000000000000000000000000000000000000 --- 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 369d44cbeb88fd01f2c30f56c174813d86481573..0000000000000000000000000000000000000000 --- 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 06402503f53c545efc1ab7f2fc912e86a5958e5e..0000000000000000000000000000000000000000 --- 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 7b99a9c3dc485d0b35326044af75cd336f5a2683..0000000000000000000000000000000000000000 --- 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 4f1b77beb98bd19bbab6db2a8275976f3db14bb2..0000000000000000000000000000000000000000 --- 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 6f62cd1025663337e7be97ed13851e8d00251901..0000000000000000000000000000000000000000 --- 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 a701d803f7d85ef954867e6b084a0df69fec0370..0000000000000000000000000000000000000000 --- 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 72031b325ef42150e0e8bb6bd30ad5a3aef83fa0..0000000000000000000000000000000000000000 --- 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 9e13c5ff4d9b2e853feb45f8cccfb408c808a1cd..0000000000000000000000000000000000000000 --- 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 eacea596f31c60d861f18180779dda0720aeb4f3..0000000000000000000000000000000000000000 --- 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 1f6296dcf66581a325f7f094d0978234bd1cc155..0000000000000000000000000000000000000000 --- 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 0351d0d79301337dff2878ada4344f00608e2e79..0000000000000000000000000000000000000000 --- 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 67840d0d991923bc9b20903c2223e67d9decda79..0000000000000000000000000000000000000000 --- 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 9173699cfb1dd514c652d16de50042ceeb2da30a..0000000000000000000000000000000000000000 --- 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 e7ea8b52b027ce117319493598d61c6b14eb62d3..0000000000000000000000000000000000000000 --- 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 c9ce4e0223f48eebf37db3c5e086d3eaf26a273d..0000000000000000000000000000000000000000 --- 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 9d8278bd8509530b423791a0c157bf23b0a75b6b..0000000000000000000000000000000000000000 --- 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 706c2d9988351a70708d53c11557ba377c6ec005..0000000000000000000000000000000000000000 --- 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 2a4d98612a5b94377fae86dbd927b30b5aa6e3aa..0000000000000000000000000000000000000000 --- 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 2a5a832ec24a8965ea5dcd7cd95c2df38e952f87..0000000000000000000000000000000000000000 --- 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 fb8cbdddd3356cd7ea1ca3c5af385a851374cd76..0000000000000000000000000000000000000000 --- 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 cc983d0d2a9ae18ac4748d5933e28acd760a654a..0000000000000000000000000000000000000000 --- 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 a75c7bea3bbbb2d0d13d6b04371e36a4e0116d1f..0000000000000000000000000000000000000000 --- 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 d70c48a4779637e09b0fd15d33166b4dd9e5cf17..0000000000000000000000000000000000000000 --- 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 9aa9d217201f3e85ca6ec0ca6d01b3bbba97370d..0000000000000000000000000000000000000000 --- 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 4cf7abd9d1d68e0149121498a69191d2b6ec7cee..0000000000000000000000000000000000000000 --- 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 9422c398071ddc23f298e01048bd7803b405bba5..0000000000000000000000000000000000000000 --- 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 b5e0d3510f8e960f5fa8af84d832e65122c99492..0000000000000000000000000000000000000000 --- 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 a8a874a193676065e0758db3a8f2eca6a5731204..0000000000000000000000000000000000000000 --- 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 a43aaf882a330208d8f3df95cc3232dd1e73fcb9..0000000000000000000000000000000000000000 --- 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 863169229d1ae02383e82d17996ae227700deced..0000000000000000000000000000000000000000 --- 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 fb3b750f42d432f7bb1564dea2e5aed34ad42008..0000000000000000000000000000000000000000 --- 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 6a196de11485d23c46761013b284ab37f6876401..0000000000000000000000000000000000000000 --- 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 2a1a081b3e31aaa8ca0739e421309009b3f94bca..0000000000000000000000000000000000000000 --- 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 be2472f9235a886997cbbc576834197f11607182..0000000000000000000000000000000000000000 --- 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 7491f281a01c43dc2fb61f1b2bea081581f93479..0000000000000000000000000000000000000000 --- 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 cd035beaed2260647827fe9df630b938e26ab4d5..0000000000000000000000000000000000000000 --- 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 b5acaae63f2f9f18e57107cb2c94f03e0a9b211d..0000000000000000000000000000000000000000 --- 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 7299ec34f2e144f95faf2515c158cb9f66997700..0000000000000000000000000000000000000000 --- 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 3086d359c85f5e911d17f58a6af69cdbfe6fa73d..0000000000000000000000000000000000000000 --- 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 ba99b688135f58f58f3648cf8eb28d9243544aa9..0000000000000000000000000000000000000000 --- 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 df87c847ccf53394a7cf5da819a2c04aeafade83..0000000000000000000000000000000000000000 --- 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 9b015e22a14873f4b8a122bf66d2cf32d61131d5..0000000000000000000000000000000000000000 --- 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 bf33f18b48778f05d35c388b72001421ebc47eac..0000000000000000000000000000000000000000 --- 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 8282987ea8426de27684ef5188b96edde5853213..0000000000000000000000000000000000000000 --- 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 b250a85c181398d734da294373dc5dd82cb57ad3..0000000000000000000000000000000000000000 --- 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 39df16f9e28dc955f02f86d1855296094b9a3dcf..0000000000000000000000000000000000000000 --- 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 e5a4ae35067993982c9f13f471f6522fac4b00b7..0000000000000000000000000000000000000000 --- 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 a38df9af74ef90ff84238d1ebf26c0f9ddac8c82..0000000000000000000000000000000000000000 --- 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 eb7ea3221ef9758ac5e98938e730b7cc73c75ed9..0000000000000000000000000000000000000000 --- 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 c87cf59a14960a4c13f5aa3814db2a2f01914a2b..0000000000000000000000000000000000000000 --- 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 90adb2bceecd5ae451523ba365b86d993a3147bc..0000000000000000000000000000000000000000 --- 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 bbdfe93092372147d1af419590549fab378e4db7..0000000000000000000000000000000000000000 --- 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 b0502283bc959e215c2f7e76b2297db57ab13178..0000000000000000000000000000000000000000 --- 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 56890d2b0fb6ae7b200508c3b9f0bd4ef5e69fed..0000000000000000000000000000000000000000 --- 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 f2f55b1ca1138e5506d8f7881a829d6135f1aa7c..0000000000000000000000000000000000000000 --- 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 b9f5f128051d7839ae332b361e99956652c84e7c..0000000000000000000000000000000000000000 --- 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 ac1819fad43dc3d667a7df232a0f2c0dd11e03d7..0000000000000000000000000000000000000000 --- 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 5e05e60c337a02233dda7c182437c64b5e86c7aa..0000000000000000000000000000000000000000 --- 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 8b9040de9029c97cefc85c907ce32d95392ce8bd..0000000000000000000000000000000000000000 --- 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 cae92767624ce71090ffecd1de38084d1b6bcf24..0000000000000000000000000000000000000000 --- 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 6b96abf16b581986973d5fb9dc36daeb7423665c..0000000000000000000000000000000000000000 --- 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 22d92aebb0796935ae5bac5bcdbdd714cd04bfe1..0000000000000000000000000000000000000000 --- 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 523d9efd16e22798914b9fc24b7a524c41b86457..0000000000000000000000000000000000000000 --- 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 f5e692091c358498a75aae721f1d27e2fe3deaa0..0000000000000000000000000000000000000000 --- 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 8a68ab6fc91bb13381012c2e0ee74a5627cd8cc7..0000000000000000000000000000000000000000 --- 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 7591fd663458dd3e0c9570289d14ad55c7abcd63..0000000000000000000000000000000000000000 --- 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 82477c37438c1fb9759e183ea08118d5b2efffb3..0000000000000000000000000000000000000000 --- 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 0991fea46eeea9759286a8f0555299e422bdb1df..0000000000000000000000000000000000000000 --- 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 433b13e9bf218206517d67a70ca293b60e0965c6..0000000000000000000000000000000000000000 --- 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 299083bbfd984dbef8c287f54de469968b9a8584..0000000000000000000000000000000000000000 --- 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 9509ecb33942aa56626edb3d7f5e9160736e8e97..0000000000000000000000000000000000000000 --- 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 47018473a71728d442ad5a7071dd1b31748c089f..0000000000000000000000000000000000000000 --- 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 8b587587ff44b94a4f36628f79f7d7994a461a17..0000000000000000000000000000000000000000 --- 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 4c39d56e0b08cdf24c835ef45547560a307780dd..0000000000000000000000000000000000000000 --- 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 a568dda4014f76e7661e776ef3e100b7744683e8..0000000000000000000000000000000000000000 --- 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 7716aaa2da923220e5eb1def3260020620406417..0000000000000000000000000000000000000000 --- 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 1e4fa6b82eb16d4bc7d5bb5e95b080b0e267e4f6..0000000000000000000000000000000000000000 --- 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 230d9be39b7d84ac8d20c587df0ea93665b54afc..0000000000000000000000000000000000000000 --- 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 9141a5313c2be7bb0d31fa084af2615dc6045b9b..0000000000000000000000000000000000000000 --- 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 ad8e76d8c2e3ce716f0de97c87233fe640c02620..0000000000000000000000000000000000000000 --- 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 c977c9351fb90e6743f71a7bc61dff6408d3fc42..0000000000000000000000000000000000000000 --- 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 65f8e48ae071873a79bf471f528d74ac7b0f6bc7..0000000000000000000000000000000000000000 --- 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 79b6c80ecd3772da13c31e0d16c2306dc4e041a8..0000000000000000000000000000000000000000 --- 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 92c9fdc29fe05bf56a345fe0b22ecc9e1580ef22..0000000000000000000000000000000000000000 --- 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 235a7d478fe81f35d44d260fb40642d5c7944a12..0000000000000000000000000000000000000000 --- 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 466cc95322311e61c9193145f39420e626ed9e67..0000000000000000000000000000000000000000 --- 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 43658fe78dfed6fbb9fa341c5fa955b429576292..0000000000000000000000000000000000000000 --- 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 731b5cc86b2b4db3cacb5fb7488513b1af007e62..0000000000000000000000000000000000000000 --- 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 b8807b236a8563ba4b212413177fe458e2848f71..0000000000000000000000000000000000000000 --- 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 f3b708b8926b5b40f2057998cbf82afa35d36a6e..0000000000000000000000000000000000000000 --- 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 d7c4e4326e22f9c00840541a9841ac8c3fa88830..0000000000000000000000000000000000000000 --- 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 d8750ba0a7d1dabf7eec422e5e9097355bef338a..0000000000000000000000000000000000000000 --- 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 3f9da4606b8398bb2e2f50c65bd718f97625548f..0000000000000000000000000000000000000000 --- 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 f8fe935b9279b04a44a62b439ba2c2ec830a512b..0000000000000000000000000000000000000000 --- 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 74466e6560a1ba60f7d35b5bde266e62b4c573aa..0000000000000000000000000000000000000000 --- 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 46628ca86e5ad32d73872c0a95e11e3e0d28b087..0000000000000000000000000000000000000000 --- 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 2c99b485c74d982106e51e5cf841ac3836bb92f7..0000000000000000000000000000000000000000 --- 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 1671a0953b7722a89d88fc323388113c184e5d36..0000000000000000000000000000000000000000 --- 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 03cab29d38e281c5d21793d6612bfbb2dc66be8b..0000000000000000000000000000000000000000 --- 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 1b53cf8f4f6b18eb5a5683d97e8322716d4be79b..0000000000000000000000000000000000000000 --- 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 5d4a09c1fa4db1fce535c5f7b48493a571f86eea..0000000000000000000000000000000000000000 --- 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 6c9dd9cd51fa8a3b565f6d6d8a77c8d4916e8378..0000000000000000000000000000000000000000 --- 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 a68fcb123b3d6dd4b5bf33f2bdbe0c1f1ff9830a..0000000000000000000000000000000000000000 --- 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 2ccedb3014bc814b08e46baaaeabcb6eea097f4c..0000000000000000000000000000000000000000 --- 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 f905fac3d5e123f789180c1d3fe2fd59ca1cb8f5..0000000000000000000000000000000000000000 --- 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 9ebe020faeb27899d74b79c9a269965543e4034d..0000000000000000000000000000000000000000 --- 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 4bd18e0438982ee9d73a0a337f6b5c295f90fba0..0000000000000000000000000000000000000000 --- 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 5789bf227840581c481ca96485972903df62dd0c..0000000000000000000000000000000000000000 --- 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 c153d9a850901688b75b57dbdb845c2b9358cf11..0000000000000000000000000000000000000000 --- 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 76517001ea51c8344e1d2d31ee0a1365ead5dc58..0000000000000000000000000000000000000000 --- 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 e9663fc04e16a90e4cfbbadaf63c48a1e60bad44..0000000000000000000000000000000000000000 --- 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 b4e942905cbaea8c047b46344d08df38ab10f05b..0000000000000000000000000000000000000000 --- 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 bfcb4935bdb6c91e6b6bcf34a74f84de1a87fa39..0000000000000000000000000000000000000000 --- 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 6aa9cbf5cad70e620c57fded68d4fb930d1b0021..0000000000000000000000000000000000000000 --- 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 62a0d6ee7a6e526a72b7f65eaa584f0aaed92e39..0000000000000000000000000000000000000000 --- 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 764ae57588297bc3eb4d631332a652d58b37f3a6..0000000000000000000000000000000000000000 --- 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 7e93e94163af2305871c705a5ca05c1ba7b883df..0000000000000000000000000000000000000000 --- 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 1be3456ba78cb1826d8d29c421a095d243fee6ce..0000000000000000000000000000000000000000 --- 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 ec5acc442ef27be72230dbcf38c41878899c4464..0000000000000000000000000000000000000000 --- 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 e46fc8eed495147c848aed0638583e4e44f30d80..0000000000000000000000000000000000000000 --- 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 fecaf095ac6f9bc03d6aafe7506748de0bc10128..0000000000000000000000000000000000000000 --- 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 d5f1c1eabd7c949e5d07f33b8361e5364bad62e9..0000000000000000000000000000000000000000 --- 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 fd052ca86ab223a41377d180df96beae6123c33e..0000000000000000000000000000000000000000 --- 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 10525cf3c052bfc99b2a9f74f8c7bf0816ddd7e7..0000000000000000000000000000000000000000 --- 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 fe164c78e8f8251ee11832f28a0c4123dd4c61d2..0000000000000000000000000000000000000000 --- 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 983647f35f0b6932969c5281aba7685fee2bd2e5..0000000000000000000000000000000000000000 --- 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 473b9ad5588aa3a290fc2b76e8ce734f71e8b4ba..0000000000000000000000000000000000000000 --- 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 b6f229069720c9c75ae613e7af17d23847aa672f..0000000000000000000000000000000000000000 --- 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 550d21bf5f8db5cb65a8ddfe38058152c17b0520..0000000000000000000000000000000000000000 --- 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 cce7646fd30bc1cef5ddc9b8c8d35a62733b48fb..0000000000000000000000000000000000000000 --- 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 3d2418a598022fb0d38e96a44d4825e3457b2906..0000000000000000000000000000000000000000 --- 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 9ba8cd3fabae9f3531defa39680e0cd54eefbe25..0000000000000000000000000000000000000000 --- 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 59ce9b9b79c7edb54bc35cb6404922b79a7aee64..0000000000000000000000000000000000000000 --- 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 ac21c395af85731796c0c32a59e1a6434a89d433..0000000000000000000000000000000000000000 --- 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 b0653bfead3014a0bb753fd97a30211ffa5a6970..0000000000000000000000000000000000000000 --- 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 1e4c53ed008037050756641fd15dc0712cf36e4d..0000000000000000000000000000000000000000 --- 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 282c32ef0b47439ab4b7268e15dbf6125c4bc901..0000000000000000000000000000000000000000 --- 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 0154c7cfec49387ad46ddeaa8c69511e342d5ebd..0000000000000000000000000000000000000000 --- 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 370f02e9a28069b4520498b7e93c8037d0e90fa4..0000000000000000000000000000000000000000 --- 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 40551afc8e7417846fcfd265f7ff93b09faf9bce..0000000000000000000000000000000000000000 --- 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 b706a9e774f1c45102d495e05e409086a24b75e5..0000000000000000000000000000000000000000 --- 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 892887ba467b4ab75059bed2465df5fc6bba4be6..0000000000000000000000000000000000000000 --- 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 3183247d8aecad5617bb178b173c4b200c36907c..0000000000000000000000000000000000000000 --- 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 56ea995f36862c6c52413acef3c6d6386113dab0..0000000000000000000000000000000000000000 --- 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 71c5ab29cdbc6102bd7e7d8f9bf03393141b4cb1..0000000000000000000000000000000000000000 --- 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 f532ff394dcc0c654a78efeab8c21560d1b0dbea..0000000000000000000000000000000000000000 --- 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 d12d7ad98311fa639f97a24cbe8b5b0946b91ae8..0000000000000000000000000000000000000000 --- 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 c92bb7c536472e36b35cdf4442b101d509dcbbeb..0000000000000000000000000000000000000000 --- 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 04131007237dfa11c2d6c30b44431b24436685fc..0000000000000000000000000000000000000000 --- 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 a678d8b0340761fe1dfec39b207509d3dc1ef263..0000000000000000000000000000000000000000 --- 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 466fdf7482bed05cb78a7610afa0736f91a78f88..0000000000000000000000000000000000000000 --- 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 3810a802c9efdc6e939f64bef7809b20947aef67..0000000000000000000000000000000000000000 --- 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 ee6a30cd1fba5fc05d216c59c855427279c3d7fb..0000000000000000000000000000000000000000 --- 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 0d8735872f24392d21038e805d18b96ea0cc5658..0000000000000000000000000000000000000000 --- 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 0745f902c2ccceb3bbaf3dceb04d6d7806ca89b8..0000000000000000000000000000000000000000 --- 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 02e70c9dc4879e603b40f05f2fa546fbda614db4..0000000000000000000000000000000000000000 --- 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 9d3b41c089be7c049a77800b5363356d1040d48a..0000000000000000000000000000000000000000 --- 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 7167d04cdb1a42bff77026835c5f78a17a99a9b1..0000000000000000000000000000000000000000 --- 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 850652ae4ba71e9a70a21011ac0364b80c9fe5ce..0000000000000000000000000000000000000000 --- 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 503264627eeaa01ed7fcbfebd8d2ba3ced40b7a0..0000000000000000000000000000000000000000 --- 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 828c21d0479727ff731c59a7cb5854a8046b0adc..0000000000000000000000000000000000000000 --- 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 c131a4620066b3c1a3856c1b713a4b228b600b01..0000000000000000000000000000000000000000 --- 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 b1e5bb06fd5fc4d09fb1bcc100254e7fb92468c4..0000000000000000000000000000000000000000 --- 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 793eb4dde8e1a134ce64372df053d35b097011e6..0000000000000000000000000000000000000000 --- 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 c9815709ab1055bd0833af14c89539a9b636bbf2..0000000000000000000000000000000000000000 --- 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 9c78ec6cbd7536d58c069e8c5e052b2896a74759..0000000000000000000000000000000000000000 --- 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 78acf66b14c2242d099dd7e5dc79c1b8715d9f0f..0000000000000000000000000000000000000000 --- 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 de342ee281eb1de25ac981d10ee18cfbba0fd37d..0000000000000000000000000000000000000000 --- 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 9e8e0d6c82942ae8a3ced21d0584ce8e50272183..0000000000000000000000000000000000000000 --- 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 126f27a920c6729e7eb79343e42df5c570e75cc5..0000000000000000000000000000000000000000 --- 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 609b69bb9c9cf114b1af6479fce1c6a3d67d3a59..0000000000000000000000000000000000000000 --- 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 94df737e5791f285a6a90f58b46670e15d0f0207..0000000000000000000000000000000000000000 --- 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 7e0bd05d5077807c9c6bb7affa90dcdb4d2cd266..0000000000000000000000000000000000000000 --- 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 9a7a75029fcfb6e417db5573c0d43ac50eef9260..0000000000000000000000000000000000000000 --- 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 8a01cb4eadec9972dd0f5b5fb92c5263626077ab..0000000000000000000000000000000000000000 --- 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 4e5b4d3482dee218883892f8ec25bd748a87aa84..0000000000000000000000000000000000000000 --- 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 a8f81b1ff5d9ab5a07f235a5417b5c3a79e3c8c7..0000000000000000000000000000000000000000 --- 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 58e0902aea9a146310a641c02134ae73f0284928..0000000000000000000000000000000000000000 --- 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 03e9bd519cf1b6a0727e8b3ef066d9e886c5bf0a..0000000000000000000000000000000000000000 --- 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 0e5b24b81ff282c4f5c0c9d772905b45d5ecdd6a..0000000000000000000000000000000000000000 --- 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 94365bb93c6411638edbe63032ea179e6ef8441c..0000000000000000000000000000000000000000 --- 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 fb3b1afc8377b25293c2c2411ccbc73a1e0f0cb6..0000000000000000000000000000000000000000 --- 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 8f7b13d9a98d5f8091eace3cc2b9ae1f68d42139..0000000000000000000000000000000000000000 --- 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 de4bb0cd5e104902195aaf7ab3315bf6e40f0178..0000000000000000000000000000000000000000 --- 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 b72983b6b9269c01214ea87f03ad823fd464e95b..0000000000000000000000000000000000000000 --- 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 c3aac436cc9284a2e516d0dd35807b1be60a1d2e..0000000000000000000000000000000000000000 --- 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 e041fd8c1f3af61a924641eb77936dc6559a7332..0000000000000000000000000000000000000000 --- 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 96739181c45d04c918d590ec5000d376aa475856..0000000000000000000000000000000000000000 --- 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 d603b351ef802e4e9fb78d6d286afbd9f2df42d2..0000000000000000000000000000000000000000 --- 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 cbe7f00e2a3ffb4dbcac6bb4b205d4d14a863a6c..0000000000000000000000000000000000000000 --- 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 a6ac67c2a561cfd35840d04a8caf5f1070ba9f18..0000000000000000000000000000000000000000 --- 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 0fa00cda01143803e18717bb8ea56456068fea3d..0000000000000000000000000000000000000000 --- 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 a3abcd1cf35219187027110e385410b4531dc09a..0000000000000000000000000000000000000000 --- 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 fd746fa3855e7b026f9940db5828a801c245fe98..0000000000000000000000000000000000000000 --- 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 813caf0dce8f30acdb5bcbf35c5c3e9efe20a055..0000000000000000000000000000000000000000 --- 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 2618a802d70ca0bd381c585ff397711ff73a3904..0000000000000000000000000000000000000000 --- 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 8e459947d7f146ca69154c7e8357f23a36cbcad4..0000000000000000000000000000000000000000 --- 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 afb8c966decc1e2e7c5d26c55ece148901d1d2cf..0000000000000000000000000000000000000000 --- 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 00e44211034e21269fbf9530475c25395d3cc528..0000000000000000000000000000000000000000 --- 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 af1cc3291b35bc8773613c9a034c83f6b0232a80..0000000000000000000000000000000000000000 --- 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 097668deb5e4dd6cac17751db3344e63a8377e6c..0000000000000000000000000000000000000000 --- 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 1569af2e7f193a17525953bf4ef5637650a6d024..0000000000000000000000000000000000000000 --- 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 dfd0e1462ced1298c25689a95bb9a5dc797e667c..0000000000000000000000000000000000000000 --- 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 c17250ebe14dffed83ec655f942ce1e0a8a24bc4..0000000000000000000000000000000000000000 --- 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 ab57cdb8444cf3790ed6ee59d0725c487ff92578..0000000000000000000000000000000000000000 --- 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 212ea308fbc0239fe4d021f70c3ba37c796e85a3..0000000000000000000000000000000000000000 --- 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 00e22ff91381879f55a46a160ad68d8503a3216f..0000000000000000000000000000000000000000 --- 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 d22b7e466a70339fb4195f70fd000d60b929c53c..0000000000000000000000000000000000000000 --- 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 c26125b07d7aed50d043972e4af47b49ed9cd174..0000000000000000000000000000000000000000 --- 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 f7a812172a473f69301ccd82fb6732172541f0d9..0000000000000000000000000000000000000000 --- 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 2bb834ea425c9aef0884096fc81621f090c32423..0000000000000000000000000000000000000000 --- 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 90de0040a38b4c450851762010911d630f3e1e13..0000000000000000000000000000000000000000 --- 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 46a671aed5d001f0741087ce798bbc9557f4000e..0000000000000000000000000000000000000000 --- 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 cd70ed22f61c6382a858ceef724000fd9861b7ad..0000000000000000000000000000000000000000 --- 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 d8e9da1ebfa228dd54b5729f23d2d3de2e476c67..0000000000000000000000000000000000000000 --- 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 4de6c7cb63d8fffef45e97e6cd1b11410b88af87..0000000000000000000000000000000000000000 --- 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 d38d0943179f338f9c2761fac9ac7bad4feded7b..0000000000000000000000000000000000000000 --- 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 e4ae4450ed5aed2a038b4ac65b8f29ba587a9a5c..0000000000000000000000000000000000000000 --- 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 a60c4d7c5e1639ec75bdf39109c68136a284bc49..0000000000000000000000000000000000000000 --- 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 a6f32e443c37a4d31068ea674a4e42c0b356d3be..0000000000000000000000000000000000000000 --- 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 4c4256b405ac35727bc2c86fa8106f33f2f5e6a2..0000000000000000000000000000000000000000 --- 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 4c226ebb40dfda9fd0b052e213fddeab9f2dd7cd..0000000000000000000000000000000000000000 --- 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 bac9fb6c84132bf20451c716b7bde6d84817c10f..0000000000000000000000000000000000000000 --- 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 a878b7ec368971e75f19c58b94ea54fb747cf635..0000000000000000000000000000000000000000 --- 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 fbc9e8fd0eba5bd464aa3f7739b8db800b4e6d42..0000000000000000000000000000000000000000 --- 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 6a9e74ea0fdf7d4114e7d990baf3eabfdee7a12a..0000000000000000000000000000000000000000 --- 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 5d2bc29d43d68b9db6d038cd6beebaeafd31e894..0000000000000000000000000000000000000000 --- 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 4ccb2fe90285810a9051dfbc636376a173da5045..0000000000000000000000000000000000000000 --- 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 9bd74ded90263c3050dcd6a930edcc51c2216d0d..0000000000000000000000000000000000000000 --- 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 79f9e5f177dd05241e56a21d4c34f362f3258d02..0000000000000000000000000000000000000000 --- 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 6f3b56718ab108a986e7c1388dbb414f0d3e885d..0000000000000000000000000000000000000000 --- 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 7b36ee6fab79ec31c27736a2ce70f77bc3b571e6..0000000000000000000000000000000000000000 --- 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 0334fc8a7a674b09843e036dae3a2ebd05daa7cd..0000000000000000000000000000000000000000 --- 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 1ada543ee584734140e26841e09ca99c507a5440..0000000000000000000000000000000000000000 --- 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 3b492eb74b127a02cea3bc2c8bd5f4e469f4b073..0000000000000000000000000000000000000000 --- 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 4c171f353d745637bb5290e153ca49012673d168..0000000000000000000000000000000000000000 --- 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 c2428e91fc157ab65e23387ca0067667b7b0ea31..0000000000000000000000000000000000000000 --- 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 ae6e3bd39b1df5b8e2902b3dd3e5799c89ad4318..0000000000000000000000000000000000000000 --- 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 fd0df7fca77b3d271092609b7449068ae81f4c03..0000000000000000000000000000000000000000 --- 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 4ba8abe4c4cccdfe0d38552c5166cb9b5f733cf0..0000000000000000000000000000000000000000 --- 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 55ecf1fb237d5a5467a8f83ce3cdebf5c79b929f..0000000000000000000000000000000000000000 --- 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 0d932c36951bc582ef4a23184373896e454b7401..0000000000000000000000000000000000000000 --- 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 fc45e59c308081b1839c57c4a6b239aafb0fbc6a..0000000000000000000000000000000000000000 --- 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 b29a4b2ef06e641e384396bb072daa2e7c8ff484..0000000000000000000000000000000000000000 --- 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 85dd24ef12298690bd4529c95b464517838ed97c..0000000000000000000000000000000000000000 --- 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 46746012d551e618c7a5bf72b5f96e75ad38972e..0000000000000000000000000000000000000000 --- 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 a5f65ed77532dabb9cb8e21dfae85d1452f3d403..0000000000000000000000000000000000000000 --- 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 93856e4eb8504d43af0e074b24a52b742c2f8d9b..0000000000000000000000000000000000000000 --- 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 591cfae79edf009be23807edca5db638718182aa..0000000000000000000000000000000000000000 --- 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 fdbd14f6ea40fdeedc0189048dc6267607aaa1a8..0000000000000000000000000000000000000000 --- 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 99cafd075c3beb3b36020b5d2a98762ed3da6baf..0000000000000000000000000000000000000000 --- 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 6a5edf9e18c2b231fdec3ef142ad7d9fb4cd6a43..0000000000000000000000000000000000000000 --- 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 f3d39ec8db1207b05010e84d21e9aa20dd7f8ada..0000000000000000000000000000000000000000 --- 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 d0b409719272d0e78a52a135607b5aee94c1dc2f..0000000000000000000000000000000000000000 --- 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 d606cd9feb1ff87bac01c35a35526770534194f9..0000000000000000000000000000000000000000 --- 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 7e47d75ae3ef677de49dee13420b23ae4c201bd2..0000000000000000000000000000000000000000 --- 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 d24adb066ed1dcfb93799d10a60707470e832c03..0000000000000000000000000000000000000000 --- 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 845789dbf1737b7483b8edd580375895dcfa7626..0000000000000000000000000000000000000000 --- 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 22bc08e5c594f3367094f3394e3e61fea57387f6..0000000000000000000000000000000000000000 --- 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 1997f5f968539892f474c8e26162f4c174c645d2..0000000000000000000000000000000000000000 --- 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 90915a2e485668e069c7da15e80716a0c7424092..0000000000000000000000000000000000000000 --- 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 bcf717c4dd9a5a43b394a01a7ebe8d38f8aae597..0000000000000000000000000000000000000000 --- 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 61ce08caf7a40c515689a0633eab0a5083697c01..0000000000000000000000000000000000000000 --- 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 792fb905f590d834e32740bcbbf62bdc83b46a33..0000000000000000000000000000000000000000 --- 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 16a1c025e92f66a02ab9a81d8ab1f84a7a8fedd4..0000000000000000000000000000000000000000 --- 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 c41d2e232302dbc51cc27c1c818cc7674967282e..0000000000000000000000000000000000000000 --- 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 1dcf7ee8eef142a4b642d95d64a14d84baddbb15..0000000000000000000000000000000000000000 --- 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 95ba26311036ffa99e4d2666d3359ceb20ee1e81..0000000000000000000000000000000000000000 --- 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 6df2acb4d91e3369d2cb30dfaaebbff74a105046..0000000000000000000000000000000000000000 --- 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 6aa5b72683979fd0daae5c7ee47147f6794db7cd..0000000000000000000000000000000000000000 --- 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 4aa9f07d44ff2d031ec501a87d4f79167c2ae203..0000000000000000000000000000000000000000 --- 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 22278c8e1c88d334a8c14d132253283e84181b15..0000000000000000000000000000000000000000 --- 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 cdd4fb4668faf84f158b34f1858b2d0deb2dede3..55a4499761ad968e8bc89214c0020dd716a403f6 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 11b65bf21a681c96de0968c737f7b8410b9d514e..0000000000000000000000000000000000000000 --- 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 2592c71b1341f977c35d670efe65dff6f3109e5f..0000000000000000000000000000000000000000 --- 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 c0d50efaf2e92d9ee27eff75cbc78bb17d17ecaf..0000000000000000000000000000000000000000 --- 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 010915e85065a58f91a87fcd110d6cd9f03759ef..0000000000000000000000000000000000000000 --- 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 1de52bee14df79151c3eb80afeb0f69899b20b7e..0000000000000000000000000000000000000000 --- 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 e321096abebcf5a3c9895131c16b933e007a1ca1..0000000000000000000000000000000000000000 --- 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 f6cdeeabe1270da4ccd77c4939c384004b3332fd..0000000000000000000000000000000000000000 --- 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 f601385cac7cbb6241a22b360b03a9bf7aaef3d3..0000000000000000000000000000000000000000 --- 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 4997ec20322ae409f4220e5253af815a8eab6c62..0000000000000000000000000000000000000000 --- 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 dcd5d15345e0289cda5cbc2cca202e2d62f9251f..0000000000000000000000000000000000000000 --- 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 ea26ffac589a607705b769dc2587a7301e05c9df..0000000000000000000000000000000000000000 --- 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 b7f810f5cdf0219c2968f01f79d4e129e834ccaf..0000000000000000000000000000000000000000 --- 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 0bdba0b25ba2333ae558c21abf43eaecc1d8ed74..0000000000000000000000000000000000000000 --- 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 c659c79cd8548ff36378d0fb584daffc1e4cd818..0000000000000000000000000000000000000000 --- 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 f84ed3d6023454101ac8551ce1c995dd48c8665a..0000000000000000000000000000000000000000 --- 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 6c7e38aaf0f0059690379c63b41c831ee5c27fd3..0000000000000000000000000000000000000000 --- 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 cf39ea0add4d169e350f3b39a3c1a0dffef769d2..0000000000000000000000000000000000000000 --- 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 5bc2107a7a15b45d2d26925ae0d1942fed204438..0000000000000000000000000000000000000000 --- 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 f94e834b7921b5e4c23a661830e52bdf69b60b72..0000000000000000000000000000000000000000 --- 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 b4fc4d46b76fd87436e0ab35a414314a86d34de1..0000000000000000000000000000000000000000 --- 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 719f92ee2a6dd7691721cd0fe3e80a6c736e079e..0000000000000000000000000000000000000000 --- 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 e603972db28dff6fd1cf9f9e564ab57f84d94187..0000000000000000000000000000000000000000 --- 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 35637068fc92d8e589bdcb26133dae2625fa903b..0000000000000000000000000000000000000000 --- 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 8bc360e1801fb630b7cf4b17c9da8ab323df9b3c..0000000000000000000000000000000000000000 --- 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 1dbb4b992591565230fa107caaf71fe0257eaa03..0000000000000000000000000000000000000000 --- 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 d0830b10c1f3bf5aaa43112214a0b1ce6ab9dc6d..0000000000000000000000000000000000000000 --- 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 021e835abfc078a7cfe43f7dc0bb29cf86a7a86c..0000000000000000000000000000000000000000 --- 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 27642378aef9cf0143ba5f1d401b78b67037749a..0000000000000000000000000000000000000000 --- 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 9fc8a57f26b8cbc23fe5c8d5bf75d6f342610e0d..0000000000000000000000000000000000000000 --- 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 2eaf9313bb568bfda0abf3828c9e0cd9b20b57fb..0000000000000000000000000000000000000000 --- 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 86ca2be61e69d134ac883887eeb29634769aa67f..0000000000000000000000000000000000000000 --- 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 304572ff9dae33e800338a6fc2f9eaa039a2c427..0000000000000000000000000000000000000000 --- 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 5644af116db5fc9eeb3f8be6529a32c410fbc9bd..0000000000000000000000000000000000000000 --- 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 118e54cb6a83a7708e94102ef84d25fe1563441e..0000000000000000000000000000000000000000 --- 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 5c501c3000d6620e3887242b01d5ae21b6090e16..0000000000000000000000000000000000000000 --- 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 0ce757bfc5efd4fb15d8e0854b6693ca465b57b4..0000000000000000000000000000000000000000 --- 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 44fdc07060f40f1960f0ada722d9f29cda652862..0000000000000000000000000000000000000000 --- 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 41d933f15493a3c6b5095f77b9fbe69bf96e59ab..0000000000000000000000000000000000000000 --- 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 31a59375f8b4e0879c3e7b9b812eadd1de2b5b4e..0000000000000000000000000000000000000000 --- 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 50666e08d7e3e061ba2faf2aae8c4f970af78eb8..0000000000000000000000000000000000000000 --- 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 74a908b7d2d1959b35ced6c2dc2f0d074ed8f2e1..0000000000000000000000000000000000000000 --- 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 fdebb2bc5e5806816008de9301df66e39ac6bade..0000000000000000000000000000000000000000 --- 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 c7c948eed65db744585f4be770b52aeda5082788..0000000000000000000000000000000000000000 --- 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 69266e3b2b5164c13a7039936147fbdc3a284cb6..0000000000000000000000000000000000000000 --- 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 5022393d8bbda2682ab6e1be8c1a26456008cfc8..0000000000000000000000000000000000000000 --- 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 4c7f97eba4eb619c310417f9f069857d6c682e50..0000000000000000000000000000000000000000 --- 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 e85453866cf49028115e63b436c15c3e2d109578..0000000000000000000000000000000000000000 --- 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 f0896dd25331b3ad0b546070631235c80d6f1989..0000000000000000000000000000000000000000 --- 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 38ac52df57dcc5c6d7f0b4f2a4f0ba79066f2765..0000000000000000000000000000000000000000 --- 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 7f6ae674d26164462e3f7d4abaf2cb11510c2981..0000000000000000000000000000000000000000 --- 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 a15c32f4fca031872f89c5ebdc1f83532513b5c2..0000000000000000000000000000000000000000 --- 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 4f69347531800f59857102329726a516241c84cf..0000000000000000000000000000000000000000 --- 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 8f0d43a76f4b6f33fab72e45096f1e13c06f3d8e..0000000000000000000000000000000000000000 --- 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 8197e05f568d0f67cec67e37e65428a1ebb8d483..0000000000000000000000000000000000000000 --- 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 027123906e5359f4fcfbddbfcf9e2e7aa1e569e0..0000000000000000000000000000000000000000 --- 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 848aa237b0063e6eeade7dfe0b962293023f0786..0000000000000000000000000000000000000000 --- 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 336a213ebc1f62ab419f88c039d329aa0f0798c7..0000000000000000000000000000000000000000 --- 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 7222aa72865d9299f6b94946472a6737badbcf27..0000000000000000000000000000000000000000 --- 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 9e91be66402f47481470856f9722eb0293155bdc..0000000000000000000000000000000000000000 --- 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 7c6efa06d2bf5524ee235c61592cba17537a1636..0000000000000000000000000000000000000000 --- 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 abfb6032ef632bd021204ecc559310d6289e8ccb..0000000000000000000000000000000000000000 --- 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 75a4d224f3373a74f66e90c13ed725fdeda15e43..0000000000000000000000000000000000000000 --- 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 ef844c4b0cae267fe5ee08d139da83b078737877..0000000000000000000000000000000000000000 --- 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 d4d0dc0b3a6be4e9c2c4218af91deb14fed07717..0000000000000000000000000000000000000000 --- 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 2f44814ec6e156be705f43de7bb841f1ed0d7c8b..0000000000000000000000000000000000000000 --- 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 c0ccd499b8b9c93e45133f5b3f189eda7d09beb3..4bead182170deaa10859c91248238f339c64709d 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 ae021917c411fa74ab21a2fbf89538c3c1b28569..6f7044b4a7c00361d1da57240fb7c28386de5fd3 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 b86fd5675a1fcdcd5f9c367971629fad1f3b5ad0..b6aed2f6f597b7db0eaa8d5bd81861ada516f1e8 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 b1eeda16d0e6c981bc81556b868a03576f336536..93f0618796be261dfadc12556413366614d4ea74 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 460451c79d0a6e9071de847affbeb64d65266773..6864900aa6b4c29468c48b9d83beea0a16d05253 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 d77a1405fa637eebfd6fae5723bcdf05bda02ec6..f7d720b45ba4b607ae6b0172c0f00fd3038a3cd5 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 133b3a516fa42fd4dfb1bcc6142eb6eae3c11919..b8b185d138c949555c0a24ae910cf12be79c3a06 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 9283e1de89e9d91f06a6805ceaa0e4ecbd00cfc4..19c0ec72d8f0faaa3040753cdb209880a15c4d80 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 97aa1f5b5b56f4acde5e2893a6dd911276c5b75b..9ebad9475a0b23248d6921922618a35e394559f1 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 d43a21672ef3de9eceb70ba92805e8c440232b89..75ab9153bda697cb96750cb20bbca05e30c3aab1 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 7bd3435d930145e4671ac146471217fcdf068513..a43499fddd8d5be5d6babb4cb536c5afd7e4aa33 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 7a1452d450abb64b5c219d9d925d5937f32e89d4..9607db71ec4f31253a343894965ca474aef869ec 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 fad70cdb1e8c5d4c51a0fc0df04da7c5007b9d19..95d3434357bfcf44fdd33854c280e3e55f16a9e5 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 e641bc2795c1f0969c9b128fe8dab4ccf152b9b0..c5678de2ef7f136dcdc29cc13a31752337fe7ad6 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 bb818254c5a2088da1976438145628d8c1765b32..46a3d3b98aa52d8a4c34fe286d2b3109b28f66e6 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 c5c9b8d2380af3d42fe62071efde22d646f1ef48..2e50c5f6b32c364328e95d844c648ac01cd5fce7 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 9c6f4116303ca8824b08be047d0d7bc92fdb33dc..99637b812bddbdb93d616a3e4267dd1606f9876c 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 63dc6b0ec23cffc20487bfa336244bfde0d0b93f..87bafaaf4d11f3718cd85093ec84856cf3bccb61 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 fa782767ac3359fac0554f4eda361d5338c3132a..a0c9a7238d8eb1ceda329a6e8272cf105b3d5a65 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 b74d11c6cfd46e33fcc1bacccbf33a89f4d305cc..4ab86a1d90ba1ede28f5d88c3013b3e822e4bda6 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 ef615ae645b11b5b4d62d46acf605f19557f6c6c..d1a94df4d8817eab9fc6b210a2f9786c10296c8c 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 5ed4f6d42bcf7e51a5a763e42d0defc852445498..0220acd7cced11a10f3bb226082095795d27eb4e 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 c35aeee9a34b09129ca0653fb27d08e05fc464b7..5f620909f9d4736218ea7c7411420b86921c7df9 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 75cd838a38ccd27050d60cc9e83a44107dfe1ebc..4bb9d8d0955734c748f818f93ceef2ddbe9342e6 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 f11e067095bf39c880a80469c82640fa93d77e79..95f3894bc5510906340ae4c6b2bb747ab2104b29 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 0d9027da858fb854c6f98d75229f8b201619e30d..6738437e748cfa7aaa68c4bc039650f9ee3aa7ef 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 70b0a9dbb885241588dbbfe42f0eaa9f3fca2384..ffc6ba579a68ebf49671928dc1716a5ead840c8f 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 c35bcfd9a3da29e00d06b95b773b1fc191baa62d..0d2cd117de541f28347a2aa30dc45796211bca36 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 102d9927433d543d35d649f13983589d063350e8..358ec74f9d83f1fc3d59df067e7f6537cb35647e 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 9e3d80021d82b9d60ebdc02458623765b9e41608..2459e1fd3df31f48ac46815999350f38029ab74a 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 6f6f190e15c6f99a5795d817e713b873fac1b5c9..0be60b64523a3cd875516ef5cb31e8483eca628c 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 6faa20a0475a1b202d0f73cf9544596a63e4034f..add861bb7e3464b9f7c2a9baba598d6d160d7e79 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 fa5adb463077acbc6b844c0e6d9080c378291642..355ea192b941c769285d3e6e2e125936b2ddfd54 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 172b12f34c62d51542010e7fb13e151067a2be38..dcaf7de63c79ce0abe433d5479580fc95f3745f5 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 2f6c2a164c09cb41f2fddded4384d8ee96915567..fe1c1e7d194aafef61e7f3afa488194eeae10d8f 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 69378e71b57c076f1285fefc4b97c5ffb2d4af52..9870cad62f51afcef61ddd3e2323ecc873af2b9d 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 ee0d25c752c24ba77b6feb76bb32e2effb4e9904..dcbdbd8f7cf53c33366a105a3b9bed3819ee9ea0 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 867fbf0c052f07a3b9a8ad2b03b9aa79c3edf1b4..847832b87cdb90db9239db65edb077913dbc09da 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 0db00ca14af41d5fe108693598337f2dc620f5a6..d304119fac4220402bed36604797428eb0a1c3db 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 658c1a1e418fd83db8ee2b7f2c76f8d5b2146293..6ab962dd51ddc0c0486c4e6da62c88fdb48a4765 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 37fd557ad7a03af0add3f0d8f70f4fd8ed403348..51257d0c45806cb9b3db4b24700431f3b7d51160 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 f3f271aae8d4cd55efce16b0cfd1075ea311c116..20407d63e48cebe08c6070b16795ce318dba192e 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 8f78970e07e6aca4fab91b74dfe1a6057b59f72f..3cdb4b04b15cdbfd59bf263cb41f2707051a4eae 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 4c1cba6ac1e86e7b11cec44e6395a6d5ca16a374..c90fd6a4b8abac9948953fd6c0e6358fd23b2e35 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 00250cbd9d2a0245252067d96c7c15bd4a466596..8db1d046808dd18b57e70c64a4ddcb08fa4f236c 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 b19c2b3be1058c7320f34cacd51dfc417f2621b3..ed0e483ea2751992f2e76e19fc4346b33a7fb715 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 d80a655755bfca14abc33714a9e7f527df51198e..b3cc4342831651bbc912a9e03db84d8c63729937 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 ce9c09a43696ff0e83c80c81003c98c7d3f635d8..5f16862cde7a0909650fd611f789622c5c6e1c08 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 a5d3ef7a0c3fbf12b3f4646b9e068953fd2ceaab..2e98d808a0a517332b02acf76e57eaefbd0e4131 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 e0fecd805839cdd93623f9008b4ee77cfa0ba07d..a555ff6c7d4489d3a99ba78e35c62147bdda0cf9 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 cd1aa03189288001e08795660e627c424dbc8ed9..15e8cbd1d45277ce8ed8caba2fdf511c0a68c723 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 70499a0aeb77d7bfdeff71e91c5afd637fe30003..2ce0518011241aba3039da3e55366e189b2a66b1 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 dc929c5fa2997a6ba905847f3be4ed20c51c3759..9e074b7f5c6d8c8ada0171ba157b589eaee905a4 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 32ca22d9a6054436f5453fb6f4f7f9476dee5c84..a6f48f53a6db862dc060a174c96fd2ddf65db1f3 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 30a850dbda90fde858b3bf4c36f1a8ed7d7cd26d..14ab430aaf70ab8562d4394f72ee0df2440c8dea 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 a243b3e988ff13632911a199bcebd9ff1fb0876b..6cfd3ced70c6e412b185263b1348a749ae193f6e 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 04f6d2b7fcd001098d84db3c2ca2bd016b991b60..8f0c9ae956e1181a51d762e3b14e41bed1266117 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 615b97ddf99abea8502e9aaa09a16cee1e22b2c3..3d48b63507de7d2bd94eb7752b39b36b64798fd5 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 0de8c9a960495621451329f769941b682fa3f4bd..51d2354f0f3912e24767a6cb2276f77586a5d321 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 fea542a8a5415a63165bde8b2aeb6723e4ba0597..d96c3f3a2154a0338f0c5270943b2fc5c968a856 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 d7cdf0d87c3e713bd9365a443a0944aef5e6e9b5..f7ec07e5c8d7d00feddbd8aa10f99ca3f2130135 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 299d19472f8d1d5108ec799c99dcc0e5ea19d0aa..3e4512774746ad3835ea7396c458b56d4ea59258 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 650cec2d246c486d9d3ff6c2d01fd5ca7c11cfd4..ddd2e3043d9a6290e79946593dc4f47c8500f626 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 2dbfcd1f03d71b980c227acf12da219dd00d15ba..03377a89348a3ef1ec5c9af6a0b405fa6d338320 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 ea3f9aa11fd635048ce81139adda8f4a9f63ab94..0311bb4074280a6638a5f9947c26dbeec7e52f53 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 c56f7ebedb3e32aee04667bec3366af5eddc3409..b2fa9986931e83810a2cf2e4c829ef127577d48d 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 60428ce27b627af25459ca5eb7bda604ec6a22a3..8de1317c598996efd38aa92c022f8db18f85f921 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 52c8d7004458e37ac48840c606170676e9079248..fc920c2852fe1ac06be302e01b1217d51ddbd205 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 a4c2e2230f8d716683db1f350e5ae074bdb71d23..12a30c55f81c90939e1c3f4ca8ac757da2b5475e 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 3cc3fd5c16b2495745bbf8cabb4ee5f066317229..09715ed6d29077a7f1a8ae2d958b04812f421ff5 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 68d4d0bdf0b9a4cf03ebe0ca3ef786ca5e4ec856..f1f9f9d60e29ba980a5ef3ae69f717aef6d2181d 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 d9ddcb30b21804355ec945d987c6c8c74dd10368..c3d72488ed2aeb6686fd7acb1d2f49e228c5d63c 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 8463d953ddff2beb908500d682339942d9594c70..bb10fcf4b5a6e7fdf52773362f195f68f7e23651 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 e255720df6b1b7cc56b99cafeace1347e4bd1036..d11312ed1641d50645ec50c4f8b293cbad05bf17 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 6bf1d376af15c0977cdb8f04efb080a589c4433b..dc79ab15d04115945f4bd042e24f25382c04e0ba 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 745df9cc52caf8ca4c12fb1e889d5beaf82db4c0..c08078138a30a97927a280b6c1be59009bde250c 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 ebcdf05778b5e872924184a3a68d9ef5329e4db0..b72999f3b7fbea13ba794bf1689e7450cba6d813 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 c19227b918f7271373f65f3f94f11e2f5c5a3a3e..13c7943d591e1baaa02d27639b1944963a34d332 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 2e9961a199e21fdc4b2703a696d8fa8897559611..08888b52872c2a340731ff96be93e99ff91c823a 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 f1995ed9be0b9c708126dc9aae77b78cbc1ac4a5..15f6f2d7c458f6e494619a94e39332e9abeae962 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 3b09cf4ae8188abac88f7ec4f425e441f9a52890..917120d9b5436c9df2ffea1615a0ae92b951a496 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 235643f931bfd4f2fc567e6ce7f1c5b4959f86da..ef891e9100cee1f8e5ce517c784a242a2b16c4a8 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 a7c48d8573c6a2292125692dbeffc93d05467bb9..83cd102cd5c2007735fe042ff9ee38c8dfac8a95 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 019c4aac0ff07052a12c1ad979bb52d32aa6b09a..4dcd5cdae657c1666d07cfd8e73f9016b402eb2d 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 c44809012f717509ee2b58c781bb3fa7b28eff62..a0b3633124ffbf9d79c90cd7165754b7790751f0 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 9a4c05b5539bff9d6742e0b0c22aedeebb18492a..edbcd01e366e50a8d9ec13fc977dc0661320a5b8 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 b35c41cdd9014e5fa5f1063ba693cfbbd152c8a6..cd59da908c73f4143842fed6c05e620525be74cd 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 4e8dd846aa36514dd309c7d12d91a5888ad83275..0fbb8482be88be2f22d0f3b13f4ab77d251dc1a4 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 b5b698f8beb7d317c5c2daba729687dd24576a05..803c459349c1a5350d0fdc0ea71d37e63bb3dd4d 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 128169c3fb67f206eb737f75b25cc874d8f7550a..686f0b9220c57c52e57ea4d602669035218afde0 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 910224e055dedd92bf8b25f9f2e4afd74d55dcb0..73f5d978bb66cf6e59186c5367d77c8ed2d1038f 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 a75567437cc3ba02d34f0fb3cc6fcdcfffbfcdf3..b3c87715620545bfde87f579d20f3997b92e3e1e 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 5968b386288be091fd61a5058c6484589a4a3537..a5c595cba03ee5b5e73f82d8a198c10d0d4e1432 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 eea8e9b7068b15cdc2a96b3f4b1249ef99c91b6f..82d4a98f4b85286fe58871c120c3ac64f6ffd971 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 ed4cd407839e302b778a4c5cb9cf3ef33a55bb8a..80107f79a976936cdfeb3ee6132f86dc1bbfd94c 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 7647003da64c4b35e699b6cd7cbfc95b70863e9e..06894f4c5b8b69c504d8b4b07af4a66f136519fb 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 e2fdc4c3745da5ac8b95b18d93f304520638ecd4..d8cdc7bb2e738f868c6e3bafcf5219cff0a33da1 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 ca3d0798f42cf1fdbed41520e4fa27f5d964c434..380d8a32b1f5771ddcce6fe5cbc91c1c74ddfc35 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 7c09d759973c08a3fdc63c33e2384e341fd25637..54b58a4a4b2fb5a0bac88d3b50c1e477c48a1e74 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 9fae578b4fd646aa1e55a741aba2779ff5eb30f9..ffdc945e7198349777dd3a9b92b0609f8168528d 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 334d170d5a4c0dc088aa8bb4dbde7fbf8b82d7e1..e180ff7efd093eab14a8c8550b1813b3bd187386 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 8cf13ebb6265124ecf202504e2d4b496e8a29804..78cfaef16c225561c16551731a30833249cdf5ac 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 87bda99d0e40d7d0802327a8be0999a6366a2365..f16ec3bcf844746731193ddd1e6d4e6c9113eeaf 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 8cafb3bf00ee92d30dfad2491e785595a9c5339a..bd21291027368b27c79a9db743efe34de15baaf2 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 3938f44b72d35523212c2d3a1df316d164c16854..e8751dcca839af410a2b872ffaa3ce6a9a77125e 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 d4312f5be5d16ada6351c82c144303e78c887267..d69493a2c94247ef3f34105736f5ddc2eda71e5a 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 69e6e073c9bef04fb4a6213af87c00e9fca1de8e..3bcb95d5f66b1a2f4a2914d8552dfb9ca604637c 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 a39e2a6266d970618e5fa2dc2664666a370056e2..505d919f5bb2ae3d55a892141ccbcf3f9f3c93bd 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 af3a5872b989911343d6b9fe6c4fb99707159864..07543360aaa8f3ef21d41199fd1222d7f5f03273 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 990e4147073b91c03bd4b236ff540904d7a05522..322e0afa9503c01785063bffe74f221946a3b917 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 98ec93528c8de10b553543026a2fd240d32fb15a..27fb0835bacc33fa9d76107e832d8a1e0cff8c54 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 a21a2a11099f438f4798615d77c65e75d29c114a..4dd288d3c3bad824abbe1a67dcdcb1e43bef5223 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 f8a3e9c542ca8c9767cdd0057005e519f58b2b55..ebd609963a3651212447ff2ab0885e20b19ba302 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 a431c765686c04b14104b8f63c899425dccdb7a3..96e741e1a4a27667c737c88e7d4a511d3d3e5c19 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 75fa591e014601b2ef9308a118992a704365392b..06023036cf4c704c43ec64cfaed75157973f3524 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 b8a60028c6d3d1a3c0d75922f39697b57329c440..bb4e86c2fef77e75f9216c7fe59930d71e5715a0 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 163ce59ef3d41363f2443a37f9d49c2713d69e9e..a43ac4773eb6dd100f50c41e1cb4f03057c0b5dc 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 569eae904ef2eff41441029d3427313107febe53..0ed40fe612506d5a571003d4d9b592a3faab608c 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 7c340b6c97ce03a1b04709f06996e5a66e1a653a..6162152e574e51cfce095b518314132d331ee68f 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 4340cc8de2c9d9fdccdda87568989cc25b3e4ea7..2dc85ba6d0e8049eb4b18faf9100aad9ad29dbc3 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 133a579afa893e90d896d68fc92a93e21ef84efc..c559c189c163d7f7e1fb995b0806933504b278ab 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 befba33eb7bd6d13939f4f2551c225263fb20aa9..5ab14b8f03bba6e1a94ab60585747fa89221a326 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 bc9e354fabaa193de6f0ec55d2cca91fee168a4f..f937e8ac392ad914bfdd891c3f37deee9bc5882c 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 b3f17b3d9da91ff2e4fdb46ac6c98d2244da8892..055f018be4a02597d868e0e6a292302bd668eac8 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 1d2e19f8d70d98e79c11998a3b39efdcebee851b..35a3780ddca797c8f7c36a2afd9ec662ff7db179 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 32b33b83e7fac339bca837a5a8d1bb7f16bb0ca7..9b1ad91b7f86762e157071aec70f15b35510d4a6 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 e31f3896fff3aa37eac2e4c458f10a0fe74b42c3..5a0cdc37d8a40b2b510a999ed94d575746ffedfa 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 2f09d6fe1926d21ecfc53fcc0a1bfb0706c211e7..063c52d18f6c660f89035728ac0e26f644e3866e 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 b38aefe66c95d8c5b1148483900824a11dbfe9d0..403c1ed48d24ecd501639509349a47218a87f102 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 c42bbe6d6664fa61c3886e65fe510197fd2c1892..f79f5d081fbde6c05a6334edd7b4e5bd56094c1f 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 258412c1f022565304c6796614451bd3ef839c29..b8d96646354543750cc90f792bbac5b0085a9ac4 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 300c3ff7687400dbd32708d10abe09a53680dc6b..de399e9645214bd1731b02e8fc84932510b14865 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 3c06c806e30c55f66cace32795c9e9b1fcb55932..1b2abde6ae21b8e4df4a6805542f1cfd6c8a918e 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 ea02b5bb0e54b178e0e1dfa7e21cd1e926321d00..d2f8091fd800cdd5e657992d5208aa45d0250b62 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 071db60cdaebf687117d4e06f0ce5e244f26ce68..8cb08583ceaf99ad3a3afa65bc1459f462d694a8 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 d8b78a73442e681c71034601301f401c47e02e33..ec573301c9cb7e468db629839da9bd1bb0197e85 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 7806e742a68a685d31d40d406709bba45560fb67..7ba1aa56eb7d14b1189c4985de3f8be660c053fc 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 f7a07c58e99bb480283c8f9af78b2c179ece0d28..7c10f11d2b3d29d087354af118344fad03b4c218 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 294f1826fcfebd146a5dc22fcf48cd60f49592be..92b9f83775ca9baa4c998c591ccf54c2cbddc135 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 2baf7132d24e3aeef190ac51f997b905458e7d4a..f42aa724d5313e8f154ed01b7e48f4e4a602abc8 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 6a296191b302d681d2d8cc3e29cc332b6a497a7a..dc2c76a5a868646bb9467da90f24fdacdfc19897 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 ce8d7d95718b98dd4a5a331d77cbd7f6af960742..ebfd54100bda00f37c42b288e0b36b4dd9285ff9 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 de370c2e65754a731f792678bd04b1749962cf01..cddc2253acc107ed08ef9cc6dab824f099faa4e0 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 816b8a919dc664a1e5221ea90c6682a4535ad3a2..dbece27fa802c31f4ff6ed5ea065f127e4ab0bd0 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 c20087816a7bf3185acf90c3b09700e54e9fd761..0a9e07804a5893d0defcf4715902e8e7ce145a69 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 02a26bd64409fcc2d4faa6adb5ac8008ff50c626..18cbd0517f30f918c495cf9757fceb586c1ca709 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 5154bbdc8f8b60c32d5845113e43b63a10ef13aa..c3b13c2c5ad41fb6b79251a61aedb824de09b422 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 42f3a60591fdbed44961ebd725f10d81c5456483..7ed7e3b55af1b45a95cad45fa388178693515b63 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 03737ee2e6fdef298d89b584af22604db34f5f6f..7e3caa1410cf750dbb94cebe7f6ed6e9feee10f7 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 a30b18b3ce2ea32400f018a623d88fb03787d530..8716a3f4670887d23886d5ceecb91e80fb6ea048 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 52d6f8d8a630e22b83cc13eb3cda0bfd02392313..5986779e13f75f59c52bf9abb3b4a4fc22e75044 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 8b25b05def6fb919df0160a1e7c5ddfba77b18da..b1e46d46575833de60092227f7d4faddd7c8e89c 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 866e953eb1d629f092a03307d8653c664098552a..e242fa99f1e83acc8727d854799dd14678d95eed 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 1cd3b2fdc6fa1ed2a5cb43b5e9194f02b7f3c427..45a97b54a9bdb27dc6b564b090b5330251c85ad7 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 70a8c590c43650841f20eb4e74e586cab81ff1ed..32f4f086770488f480fb507b8bc6d510f6b8a9ef 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 348d8cb739da976d43f975a887996e87e7b0a35a..eb5d05d254166ae21c805f5ad4a68afd1f698488 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 d69cebeca812e4542dcdc739d01a085b46e44fe3..9296012263fb623f061818d2ed0ff864e4464788 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 37507d88705881aabf6d1f13a1a4c861a68ddf6f..b0de7a63d1e30d63e7191683193bb0957dd9d859 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 15569dcce843009e49bd385057dddd1c3e59bbc6..9b1627a19473beb6d7848d331056ac15574cc6f2 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 e027f27fd3fddfbafd5c736bd2cec7b55220f96c..1bc7c61630d81be9617778e12273031fa7f81bcf 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 b01c67231d96c37059897fe1f3469c480203b984..51b53bed64dd9b5fcc90d0ea49b4540831b6c5fb 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 da4627ebc71f4388eaf1bd5ded8dcfa8679a553d..40d3f4b76805bbc281d8d4eeeea8810c3f12b8ec 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 06381002eb36b737739ae8ab01a458fccccf73b1..46f892b93787078bdd3ff3cd016ef77b3a2b149e 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 87ecdf63bde0626397df8530451c8cf77496a8da..fdec5dcb5176555b953b7982ea6d62829971f1a9 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 fe3163da5d5537a10e156fe10949620c5f9390ff..7b4a46cbc01aab854bcb742aa02fcd3197fa53f2 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 48754f8156ae2467c94a741f99e1cb0ea44ccfd2..4695c18b7866190c2aee584fcf106f993652c7bc 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 f398f44a6ba10adee6bbc2e929c608e6135f61f7..f7a1c0541204a38719828fa482615eed44e83de8 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 a72d6d6e795025df1090ec5c6097380dcaae0e09..e9c70edab3e52158a464d0fa669530dac1d4b9a7 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 4b3ecf818c3ad7a0293be8a65c8f9b22a59aec6f..6f3db2bff9e72837c6432fecafaa14a45b4048e9 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 efcd5b3fcb393e4400d4447dae17dbd64ff535d4..a08c2355e08107a4c0ef0bcea022295513383403 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 ad3c2814b85aaa9430511e9b6d4dbcddbc91020b..319ce7cdf56f90dc2e27252c08292bdd15c48621 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 5d7a99873353c5eedeb13f303a104a976866ac3b..edc0329b8552a20485e4e7b0d23b199d43322f7f 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 7eb64481f2f242e266c21ac7a291259033f8eb07..a37914e1958f85a0c6deb3a6fa74190876fcb7b4 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 738ae9ddf0f7879cb2e35523c3f35611ac9671b0..f516baecdde9284cbeaceb96a27550f7b5ba36a9 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 4e8afb6084257afcf30d6a71003668e924609ac3..478c1772d301bea5081ba34028abc8476d90e8c7 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 86803da99d95a53be41bb74a1812f1639db0f1db..82b27a7cef39757b98c8f820d6746ad1605c0a5a 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 abf9cc06c496f7cb790a4072fc5ea35832fdd227..a7a8be3848d00bd0e58a79e58b2de5df8cac3e1f 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 96300dde130b69fa34cec1205785cd425183a2dd..aae4a2bb2713ee038b28b8e0202cc8c9c06aa24e 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 aa19695d68186ffdac245f6167b4079439183b2a..ebb7584c37b9b5e1b3372e066c525c03c50491f2 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 d60e4635b5b009d518ec644413048dc22fc4480c..389b67fa6cfec3f1e0bcd7044cdf54b6705bf555 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 3f04b15109dc29162dd82501c8104ad0f4d5bf66..82320b10b602638b07b854d7bd1f8ec2467c19df 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 01f16820b8478158f0e7dc8eb7ca8fc14400afdf..47f4d25da78f7bb7f6705af795c3a3b480b98d58 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 d8722c7f60d65fd9aa3048482159d8888c0330e3..09656841b40465fe48af63bad066a69d17e48e3b 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 234f374e2b3407c79bd55783d668b62dbff6bff1..e85cb749e5ad123a7b1b241f5a5ac3fbb75f5a9e 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 2d3a50ac9ae97bfe0a5fdcf0b48c777aea7f989b..fb6640249e1ceed76a05bc035da1a433fce2276f 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 1d5f54bdb2e75a180a363d154d0bc3b5dba4a038..9fe1624b79229799f3dc16f9dd5b217bb5f72310 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 1f486092ec9cb7374710863c7998d16957ee9edb..657344e5440cdbb8b215c5ff30d5c914c6bb6f19 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 409e08e46d7d9c1c8a294cb49dab754663273da9..2a2811292db882f51944c5fc374d8d3684d01297 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 9a8a02d5b2fe2e08666539ada454e05d0e49f20b..be52addff91172b175be116fb4d379a4ed467774 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 c9b7564aa91f688195db395c7a8b6720ee29c464..539759ccd2537abc0be5913234d57c794bff12e7 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 1f486092ec9cb7374710863c7998d16957ee9edb..657344e5440cdbb8b215c5ff30d5c914c6bb6f19 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 5174800a3a5c26f8e8009789e4460eb7724f2542..7c0d20baf1d62de33adf727724195d6d4b072b03 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 5a9fd5b8553c2e54620a4d58b1e1dad6db341eac..c537d4683bb75a0c6f5c1374ffb1c0d14f666e36 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 2e6c77deb8093381db82d5ce33249987d67c7648..dca6feb96d296aa4fc95c99c9d65c0b5bbcc5d3f 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 3d78a35c9726773c901a0aa1889b89660c48953e..f3a589e722d6097c12c1fd257725b596d20ad3e7 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 be0f140dcfd790a01c60c29cae4b9b23c9739914..a0c6f56998703ee56d2aadec060ea21ecdafb8c3 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 7d38dacda2a16210aa0ebd5bed78abe061563e83..67fedb66ea0fe7951f2ccd72f29ffe0a73865ade 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 45dc746f3b062f3cbf41a34a0776207a6ae3c194..71c2c2490a08dad2e9da5df1f5612a5d02bd2ef1 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 bc9a007eb51649ba15f37ea48ab2471f80f9cecf..d74c5ea35d1eed871302e0e94156c68b1b725617 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 d1f899101684cee6a8bc8f75d9f8ffeefa29ecf1..23e8976f47507c2f677faafa9937db19edd3dba2 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 b5c6e0def210b3527cc1b098bed350c3d7c70583..82c7eb98651cf6a22db9d4bc6c98a1829936a486 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 611ba85af75acd84f3be33e82094ab29ff6a6c38..4aa4abe2e8cc01a72ec3f5ddc78c14ae8af22940 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 788b374c4855f1507fe1243481db095395bd607e..e44bae5383ba411f665976f82952e6532352d623 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 9d02a074d4cd63748aa3dc019b051dc12e280678..889abf48abe596b4c11ab470d2ef12f28fc624f3 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 3b71f89f845f1b570ca68f28073272b0186227e3..1990b658ddf2d00f36fd6c28c91ed174cce44c54 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 8ac110c351ebb803bc2607491b3795f85901193e..9f0267268522493f47171771896578f49c390471 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 19a4959e47b7c89f18a2820706d457e6ea3bde61..e0108a5edc0e824be06fe38ce2185de389c394db 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 2ab7b6464b53599121bc55f6689ce5c5f7d2577e..eb92f615246dba31a1b7267a98a7d67f74a4dbb8 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 9cf83d9a32a59901beb3f217cd4cb64d3960dd47..0bc6dc795c06d004345b5d923840055647186070 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 3b2ad0298d4d9fca26820a7f8291cf191eb0b02c..d52254b368e5de2794adf5e34921e85269f6f9a8 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 c92e306417d0c9c7d4df1498396b2b91f80dc4b2..ee63948f00afd4f848982b93e4959083ccb4a260 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 7420d449603a0e81ddab663ce79d0d49a9f37198..3354085b1f6360f6cd3ae33e91a06de442eef686 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 d58fc8c4fc61975877648a1e5cf398195375f247..9a1fa3bb871471ad92248217141aeb29793bcfc2 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 ad7b6bb2d760369ec0a7f0212a695b6e4530ded3..8efe1e5db770f14c65d5e8c026d1ee4141b0f5a8 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 609102904152cc7ee6ab360c49a1a0aca2f24020..fa6e3bad17b0991daa8c6831c39ec424ceac710e 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 6d06dbf980fc31135d99f57284e6aef344a60f26..259e6ee2107a3f7d69cab45f02f2edcefc907c5c 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 9aef16c4524807fc4de5597c913d1e452fc62c84..082ca3dcead5e2269f716e1e52ee0d28039c0d2a 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 44a616e3b1dd65967260f64f50984337a27e9dc1..a19329af9dc59e023e628c109c8a6d9a584ff724 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 a27c91e461fe3732b7ea812aa19ccc36063a7728..b3d6084a20b774dc20828dab0d44f0e5fbbbff18 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 b707a2cb5648c85eb780461153f0dccac1f8215c..bfb54628c8947a479f2fe43c1c8cde3dbe9318e4 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 6be5e52e760e95f9ded96db60cc38821cf93d409..ec76020b4b1292479d0f4d9aef035d10d6b0092d 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 b923e1b2cd0e34eee47d025374312abc21be416c..0acd20626772a5a562825f0768399de8c65d21d2 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 011bc230be14dd311959c4664b16fae5e46c5891..1c7edc225f3409a09137a6447e56c2882c190605 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 ddad4cea7c407c61cefe2e09416d5f08b325450c..2fa3d1e6d7733b321f2398e1ed535f8dfa655271 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 88300335134f61d8bcaeaea7013b2b8e95981830..214c5e8cf48915fa0e2da75346c804ab591fd6ed 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 5c510c0378c2647accb1b3339bf60d140937c40e..278ec8bd551b27f941c573aab4ab7c21b5f12488 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 dc03d21dbae4b428db57506f4a99f49369dd86a2..6e704158a575f779a48729a2ad85450c49dbf7f5 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 fba02242ade25094af2101b174b12b9a8f9a0ad0..67bf10cad82eddc667f7f53e3a1195bb6f6e52ec 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 1415667bd2341206d477b4624f4a92581f2da56c..605c13083ba5d73ce5f32ca5919ada7dda899702 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 d5d8265bdc94a78783aedd8151ee42946e03bf2c..9397417aa4549d8ff1708256cfa0a6d8fa1edc0d 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 0093c32fc9e2a58161517b3025535cc586700522..9ef5d46ade5c6eb9dfde83ad5b74977d2ddfadb7 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 5026ca5ecee37ee222bb36a54f699c7751d7d4f0..48dbc27055ed1413cb8d24628237eae5690591a7 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 f448523161bf15d197232c7f7463d0e8933ae2b5..9853e43c8a10d4b8ce13acd58d1ba099ba40f1db 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 3ce5a9d02486befd3847b7382ece3ee75c652514..fe48bd57339adc61ea817ddf48abdbf7486b5df0 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 4811cbc1b9e5ac644463000eeb346ed80e0739df..aa0810194d6ee2e921f8dcc996fcca7a5c0054f1 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 9e58a94797756601ed87a1f8c8b25fd079de32f1..d2dab532d9dc6b3071adfdfe34885bec7375a161 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 6c1a7122ec1c06a5d1b967b042337144dc4d1939..c9f1f7dc6983863d5d7f872ff5b50ec407f5e31e 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 379ed0e75f836ce52fe871beeb80755cf7ae3788..9912e0f8bac1063acc1fa11501868062cca8bad1 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 bc4a061e6011f3ce583b946137669ba51cae8775..469f4574745c41d0ae5f52365cc185a0d3ef4702 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 3fe7c78ad39d377221ec004ea6ed38b4c624d8a8..d4f3abb5ed2ee7222a134de1e643162e530547b1 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 f8119b0f74e871d21ea16fa6ae6c274bc322ec3f..3346a16f00cdd18e2f306dd77bae5404d5be8b2b 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 297a75c6fa0da3f90e25454876aa36dc4e9c9d9e..74914657a81912e10d0e58747345e007fea92f1f 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 edb58d5a473351411ea3d4f1bac98c57a385298c..f3baddaf6ac1cea20cf81bf6b4142f3c7d774516 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 124f4d42ea2bbc7d8c9194f170e69fb2078b44f0..391a1726f0067a0af6620234b1a9630236d68667 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 3c78b04485b5dba1283dfee725f6476378f69222..43b1ef5a5eda6cf661671ae864d6daf47591bfa7 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 0f82b98c028e10f7e22cd98812412fbcb4f2ab96..061c134fbda974e80c1f6de0f861b00edfbfe76a 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 4daefac2048e718e8e1db0e92b978fe73209ea7a..6dd9c8c316eaf2332a92ffb5c7e35ee933000d2d 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 1c329d61ea8f1a1913b6542133c321b1d85aef30..a58f99b303ed4bb69857805268d664ea59ae7265 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 ecbfb0f79b79b5ac24d819e56a3202f8e8c2fa44..9db2661baed77dbeae6080ecf1851345255df799 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 74b018056a33370fdfad310b01be8c598287eda6..6fb3412fd7a3bc869733f06611fca30bf7ecfef6 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 1cda173f1b5cc49f2e28a423114f597868c9b3a5..b52dcee6d4c5fe2d4babe15a3fdb6e729e6186c0 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 81648d7200d47ef3489f441d14754cd7c152b041..3ebcd137636073a16eefbdd2863c2775e44b65da 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 92deec7050e4785bb1ec035ce2d6c11555ebb9ad..62efa14624731a150d501df4f156cc2cb90399df 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 3acfb7c63084b5aa01050e6bf9b09e5ff6abbee3..0865791db4605b9a4ac1e54515f13e701968e184 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 e079307856a83625a54f262e3bfa93a9ff0578a9..1ec442f2f2f9983a39e91ce86e5fd4cc881ced98 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 406c7ecc21f804e5aae64d88001726f174312179..acf3c9cfa3188a45cbe3d06b2f991b9da93fbd55 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 7737b02215801cfa7f9b55b1ffe6f9b7ca6b1319..62c9889fee2ce7ef30e7ff420a4137fa5bf40a55 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 a489bc2f4dcd88d16bc31ec3befab5b386ff6192..b7a52d7654b2b00a7b2cf5c963a84c4b3efee247 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 359a9096d0a9bd67fefb7cf9a2b011b36ff621a5..2a5950498c42782997210f4800c939d7e7b01a40 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 0f864407cbd07687c651e0e350ad78db4fab961a..9f9a010c903b291340e67239c105020b8e0944bb 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 ab77025cbab78076091f5839882d98847bf31ef7..b532ff924a59d2b2159873a178d09353502bd54b 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 a74c94db90f395a9253cb11e9948b13ad61c81f0..4812824c47c97bbac7f79a06f8b2d2b0af28803c 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 75f555816903b9ff2e0d58e0541bcb623a59816d..9079b9b1e6707054c9624f94f8288575c459be35 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 3aee9f379414887f930df7281b452c92f4b0ec18..af47d408a319ba48d9d1c26d547e0952348596cd 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 d05603ce89302a3068082fb764c03451e67cf436..e472b91f4b6e25b1bd896134cd17ed71b12ead90 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 4c6dfa2875c27d2bcf7465eff4202520d40ca965..3aa3f6c55ac940c8cb1efb27b8bf65dc3e23073f 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 fc69d09f6842fd081dc07b31b67fb335a1579cb7..3c8de7cade26109866d526e75eba0526187a7781 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 8190b4de2fd49f8b4227d0ace895adfb1ae59805..e55e132f1ec4d8ac8e86ecd9a423e6f3a99b824e 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 3e30dd618cd8ef0cc25968448415d98a04049be3..39936140a0c876a109e950498e61b9fca8458500 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 bb3608f3750e4b014cd6aef5f2778cc179cdc5dd..2c714c02f6e8703105af91f9b242047083d4f375 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 65e9c24ad06436f4d849f1cc89c86453945ea982..d09173d02dd676947134d6eb6fa80704150f9428 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 7f80b1fd25fe4d2b29b1bd96df2f7d54d074b5e2..2db7e09aafa46e2041c02fb9274594667a56a8f6 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 581135b51d0a5c0dc7e9bc241ffbb342ca3213c1..42823a665fd64dded837e8a6e77ceefe418091a8 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 f6ce75867a532a5b68a7b49e504d1e85037fcc8a..352667274529953f6239bbaba1648bc06bd1fd7e 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 e9307d28e2977c0e9379ef6208e45e5c9d29295d..086d8f6ed227ca5b92d6308bdcf1961c4e910b00 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 420ea1ababac32d966cab1b04c20091e099b7e88..edb635c40180528cc88a08f7d0e25aa3eed16e10 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 d0e684ee847a120689fed89efd4216a9c75bd2a0..c35c6f05e35b87bfae35a33351af9a897a14e8ad 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 68f70359369838198ff538f795d1eeb9c036e900..7a4680048c7f9dbb3da68c0c60c6fffba7cff251 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 aa98276a46f270c37d4876f7d7edcb80b5ea2f2d..d842872badfbca510cc1d3cf41c0b12a4206cc93 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 b8adb6d60fab6926921a5c2cf6957034ee1a311e..1c33f13e81f9556a95749ef829d98a7a53638879 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 c2e62976060d01825786c1d740a8be659050bd79..69cf02473526194b329254f0b6abdbf6ebf13697 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 0eb4f9d340c053ad2c6e4369ce756106bbf4b8fc..df61316349584a5da84007ca72768311a8755848 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 fc79892d905b8e05202d8be2f66582f7c96c7e59..d68203f629800df35c658a674720666832c5785a 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 1fc52a5d3457dc3bf0cdbb610aa0f3f9164bc6aa..73de8b486d15832b22f5f597dc7dcc2608c8d077 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 5289f9b71c3675191bfadfd308092f50e03003d6..116466aa6627d23bcc08d2d37e9e38393c757593 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 9a1dc1b36e59fb6e423bd2687197242ff32e74f5..c047287a2747b5f0cb0e230b7af674a5b4d4a8aa 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 c4eaa23e1d25e289bfe4629c0d6850bb264fbe91..f43b0d80e3b2d5c3824085480223c89257c2303d 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 fdf9ff534ebd365eee08d0db0796d265b76e91f7..9d5d1def5840a81cfdbc43cd509cfcaf66298676 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 c3e4782012c4eb4b52ca50c43d54ddb5a1c1b2b3..0c17184f05753e920892de6e41c004ecb7ef3836 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 41837c55e552002aeb1482a0619412659a0a9228..243f0cc115d9e3422205cfeca0cc49ad44876bdd 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 a78d8702c6da25cf866283d1049246f96c202db8..750015ff14d2745f6cba80b24aa02ff5c9c6e2d6 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 082a5fda234d82d6f6e57f0637486c43eb4414c8..60fee048ad7655f4461c2c32ac52da6812ba37ea 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 150b7d42f900d246b223b0a4f979ab5749949781..26b297ffffedec2b6467ef7652afb19b99f4ae87 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 2a497cf9dc631a117acba0a494589528179d0a6c..f69ac823fe49b82ee903dce9efded89886befaef 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 174e4f69eff0a1683b5db2c8c4fc0c21556e121f..bbeaf59e638fc0a6146e59497030df322fefe63f 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 541558d76ee1e0e791e6b103919f838e9a09e4a6..402a44aa7123b4a8d34d714ebeae941b28553e0f 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 66b3791c3933dfc9492665e11b24752ee0d242e0..2a8145baf404167c91f456712cb59339d2d2e388 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 de5ff01fc9142003192f5e2db1cad0cc2952e7e6..e5072d2bb862d4dba54c9b557e8d5da9af7a81de 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 40f7822400350e1e89d8406f82bcfaca96acbfa9..538badc4af72f80822d53ed238419bfebb260580 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 63e4aec622d4006833a6e21102e328d8c1452fe4..e4def8315e0ae9933d8ab8fa26d4dd94d1c50f98 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 03ceb46c28ed9eb0563c213e476b8cb367a5886c..1750c08097672ca8253d97f991a83ee763203e73 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 d7969936eddf055a4d876bc1104adf05b478ced4..953838e4545d02a2c611e73d3b616d52797ad195 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 f37236395c1a3d0541701be00243859ca42549d8..e123eba86a61108098ff7ea2e38c6f2cc228b2cb 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 ee63bded0ff3ed8497659a02c7a1de275fbd6875..7007eaccfe1906a1fdfcb2ee4c8ac02030b48703 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 ff3e926c9bf5183c5271e05cb12356d74c524d8b..2118059501267f0dc9251804f1d72485c3c82d6c 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 a5b15d3a8fbf1597f9a0e0b3f1a3bc5aad2a6ce1..5100af99f63bf9edbf881da95adcb17ad011db90 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 5220f925fb10c38f3cdd0b88cd826d31928bed98..57d47174e6db30734e1bcb03a1571d63b3b3cc40 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 d615e0c3f11e2b954d5c263a13abf4e1f02698e3..3f733be6b2e1c85e1a24aff9b70af289b969018a 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 39c43f597f5fed5d42431eba1e2b750f3d2de988..3f79474493f41fb247ed1444f7ad3f33255506df 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 1df8726afaa44242369a7d467d83a8b7aed86e86..fcba28721fbd6ada4dcb817db845dff43a480e69 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 0f4e416912f6e73a69ec2eee5f8e3c5bfb3b2b37..8b882952fe125679a5b249e2c31f36d976fb28b3 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 65085bf652762682c1a8f56fdcc38494b06f2b6c..00482dedc67b1ee3010cb30bca35b38a0cdabd50 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 719be803d7c384446e0cc246a45036ecd560bf40..afccb7b2cbb7872e70117190f5932e0e8505f196 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 7d0521a663c4509d377a50637ed7575454fe91e6..52f359fd274bd2e72f56927ccc97c647096377a2 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 7f4bd71cceb6808ad3ae877fc52f1314a203aa5c..bdc5dcfd4f2e740cf87e560faa4043bc54350ccf 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 14d61d4428f9ffb90efc4fe3715b07e8c145ed16..29911dd3b930717da23f723c0dcafba39d06f124 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 406e65024db0fdd0e4d0b5ab83d9731fd988f4b9..3059277e569bfd5a57c055b7d6533ee7d3f56c72 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 31fa2fde7d5d4a2c112564729406f1c5df27869a..1ef8d10ad1bb583054ab24c8709c38474b33662b 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 d79d9720dc3b573b6ed9e0adba0d441bee0cd80c..2e9894a8bf297cd3c810e2fd8617f37b5b2826da 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 1e68c0329ff4400b5af37ebc5f5bba698fb6d225..9b884f26f8f87e079fd917cac459ceb8566a7901 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 69428111f44af3ae5edadd403373a94570d95e54..dbadcaa63ec531884748ffaa22f9de290a50d770 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 7ace3c4ca5ea7776a55366a8ab378db4b1aacea9..77863248b9ce26520b1b98248d2ecf635a25d4db 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 0e9de49e22644edaadbe73438954c4d7ed0a0acf..6b57cf7ae37f9fe75be1a31e18173566a7e5ccbb 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 993e8817b31169d1d3f24a0191aeac0ad1db2b66..433b59d451e42cbad651f569d86323f008c4820f 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 4842078e767fdc5d6a8fac5cf706df62616e8215..e7eb8af51321bea9e39b2e52323eec86b8639b5c 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 eb218645f9881658738c0dd573eadbd0782946da..d321697ebc01b323c8bc0700a4a30ab47d83bf9b 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 f76c8bd7e85c2063055535bc77ef0895056ee85e..8e86258eb1dd9e6b9327a55e9cb4d870a6f1b479 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 cd698f5f400710b4f10e6ef6891732df1422deb3..75b675b8df464d9ec1c8835ad8842fef4588459e 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 0fb851f9e93275e24997a84b299dfdf76816aacc..2b359ff1342ba6e0c9fcb153becf9b0238a6c281 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 80452fd73eb415b3b4fe55aad01f2c8a4db16b67..bd65a11cfba434b4a5ff4d42b1c7a6cc38cd5e57 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 88360cd29f072c02bffa6b11e909f52175b6704c..597eb22dee428e2a21e99eca45dccdfc34a762c9 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 f8807ace014b9c8ec0d740989138b8431d61b885..3e77e8bb21333414271da2fe9d1e060d2e5fb0db 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 dd25c011940cca05a411b935cd523aa9eb03c645..ea98d38e670b4ccd3dffd62dca0c8f7f2ab0db2a 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 3ecc6dcc5baeacfb5aab3786f8e3cda697d847e8..b6120426a005a58718b731b718c370dc3a3aa207 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 d2a4e13c38b3ddc1cf06c7f4cac0e1901f843a3a..cd824a7bfc7ee4ba527aa79991e078f0805b81fd 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 c528442e607ad6841e2bdf7e341beb33eb1d21dc..aa454342d5603b10a6a46ef85c7bb4f16c1ebffd 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 3b1a0f7ff89a529bbc31f62693d1d8732f548963..8f0e993892aa5bb2c8ba11bb426095ff19a962a0 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 8e087bb672f2d54e801877e67eccf6756a3cbd41..7efdc7f3ed1858527ba8199be671ba94942161fa 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 4e709eeea02221feb3e413440dbe10bcaf17cc5b..3c6ba59a829ac18c0669c6d335375b90b72c719b 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 93bf979fb2fd58a937357da4257b0efec68c5507..2492e060a3eeb3adeac9434fba25127e01a8d1b8 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 371cdbcd41dd1ba4fd27c87777641d40dad89728..d0b08d50589c00451f0541a02fdfe1f02d396393 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 c3f36b20c27f1990e4817a5b43f7ef1b381c1f35..1cb00e68a2596a606c286a91fe5dee6bb3d9adc5 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 3b17b1aa4905138a379b6583470dafd1ab314b09..fd55e862173f4cc99daee70ff09c82aca2ff09c4 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 898ed8284f17cce5d9e7b5c7aae20af33c2563fa..4746059b8bcadd3d49d79af378bf51797164a7eb 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 0f9e8d4c9ddc4df049b76c6a3336d07a2708aeae..33e4e4b494f30af1f7e644f4e47a6b8e851d70f6 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 194267539e99f1330b84e7fe10a4600f10fb74e6..4d3ca8534a1ed7f12d41613d84a9bc0d6c9bf76e 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 1ad86118a2cd74b18c155fe549948740dc0972da..9cea7e036f7939acc8a515a8fa7bf186168ac3fe 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 0dfaa96666fed84405c47d00cd7b52a2a73ee2b6..6d396935d4b71ab5f23cb7356702118d36413221 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 70257b570fd97b5c2f7a2f3a1363d91d84c6f305..afcb4dbbc2eb91a65cfb16d92ea797d10a92b286 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 3445ebaea09bbee26d0ec904669867c52906d2a8..63596b69345efda3df8b6cd0d9ac4f3325d7f594 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 d45cf3f19dc0bd9d705f732f7c33ceb20eaed0d0..2562e901fb0a934faa9638b1fafaf5a74ee876b7 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 446cd691a3695b1d8b235ab25f5306a969645396..a81003b76dc04ca400aa3841535a4c2b12402d4b 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 e1c13d5fc18a41ed140220220290d0a0c8c36690..aaeba2027c81be256f29c860622ff6a1bd6c7647 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 a684e3559cd71c6deb30f12484c7d37fadd01eea..5be91394fd0b67ad7f25d5d49ce960e5342a66db 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 bc4d335f2a3bdd4470088abe7ba28cc92931a5f0..aac8315d97686ec58fe1676b32886c386652f125 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 8f86c166fadba6f7d699de363cf23d6b12061393..ee465fc3657d88730d68d711dcd4e617cbf1e9e6 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 9a17063cb4414e067693c54f9445ad6d543103c7..997a1e0e8dd6f9d3c8116eb501ef6834361627b5 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 31f2109a4e78b12e3ff2e62b920082cb9b248215..10d7183f17e52ed5241cacafbccdbd5488e3d10d 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 1dfc4b2df5ad1d66ff6a771e4f9775f4392c0e52..9cf78d23319ccae2019e4ba9314abf4a5181b38b 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 18797195b7ccd4bf38cece3262bdf5847f684eaa..2bb16c3f87e4b2d9d9457169f3144acb82527a2d 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 3c05ab042422833381a6b06450a05706f7b501a0..dc517537ee3be9cc60824fb1ce20d3dd8246cd21 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 15ba0dc6c246aa4f6eafeee776fe57115f55e664..720943d131691587e58ff086908661e566aaa723 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 371e3b0b66fdaa9d2d7f66e466a167ce762d7f0f..e5dcc1a00e70ac5f39a4501a8983c8c3ed92809b 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 687d01e288d914fbbdc18287746f71296c7a4327..9d390e3206867b5555eade5a832d832e73c2a11d 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 76f31982508dc87a4f400022cd46fe766071f27d..0d608d5127ea0dea5e64ab2b801bc1a5f05965f1 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 31ac00858018c3741758d0b5f2bf28f87aa6c1bf..a7ee7e02616bb412837700c60148fa89756ec48a 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 883885df434fb4ba3bb555dd565880f14623a984..36cf5b90948fb59111f457d2a048f7b47d5df320 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 cce3941e7be7212ea286647ec601d3ecbb9bb85a..82cf275066aa7b0c354b5633b41c8983873250e9 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 bc6f7fbab08843802a89bbbc347847dd262609a9..cbb4cbb5165e8b9be4aa0fe9def0022e44ea4b7f 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 bfc271edf25f9cd0f343eef11b335d5da20eb646..8f366d9dd16998d899291cf220296dfb6cdfb9a4 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 f26e7f5f14453bbdef9fbe82d6c3b87deeb1c8b2..ca64a6d3a8ce9bcc9bb65688fb197506f8b55e5d 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 ecb8bd828978b169e57d7f502e7d07e0c6bcf6c0..633bb48ab648b03063a636425a93aba3f113ba24 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 398f5d527f4cd75f9e8107619f1a4cbaed62cee8..4a9c2adf47d9631a26fe954a5711003cd8c67445 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 e9c8ebe51f07b2ac0bd89433b49526d3e08644bb..0f54eb2c0017984ff8418d5fb33889e8fce414c0 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 caf4470e4a26b27ec79deed27c147e2feceffdf8..59ca2d2583f6ff4aca16451e7895b431a5d0d664 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 f4f2dcfdc477a6d5a9ed61d22b315c253931d8e8..8050a1fd43c0074844608bdac4e62a675d9306c7 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 6e89b8a05b19e86eeaef0736e51071ec7b40aa8e..99c31564206e9642691ea0a98460f094e75fa622 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 8558b3e25333903aaafb2e219649328c6ec4d364..82fa92130eb7aa229d555bb3a96f49fd0d5f8841 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 a19b029bceb0abe45adbfa7b2756c2246a4c1823..4e9746cd9665d7c54ae0928ef4e4ee8d6d70e098 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 e90a06a5c235b1ceb669d702d495b4e6673bfc9d..0258dc05b2c865ab8c7e24499ae18e8aba5709d2 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 32b91872b275686ab56d5f84c84ac1209b24960d..bb981d6e1037a325d6c9b45fbbd84039cb02f9e4 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 98a7d9101f627201e8c6209abe9ac29bec9fc5b5..3fa737f68a4c8148209ba2767a3ecf1c56e77758 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 a425d9fa076dcab2bf0f80b20b20a4e4aca70cf5..4b09eefa61430a147a9d46dec31cf66947dcf3f9 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 605f02e7c762ea2a7c5529ee31622160466ff1d4..5fc93f738f50c507df7a29a6cb7dbcf39c84fa6c 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 d36e5f2249e9a883489b29e59d9aa442c94c994e..2bd9de660b0c7f24929b56bd7f7db0c0422fe078 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 503986d5958f8d43f4993b95f63f52f3d871cd4c..617595246edf3d5fedf7ee9b89e1f202dfa74b2d 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 a4d09d120274e6c2b68f7cc38417411db0e0dfa6..cd3bc4a51c91d9d5d9cc80979b452ccbb5848f9c 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 78e843c8685bbc78b79ea066bde560133d490205..3812696b5f119ebaffeb28cd04f0949f566447ed 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 82bf960d553dd5923e41be059a610d63253a556a..7b7c9717df0bd51efcd0e85e2f58f55ddfe95661 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 70818e29e2cc2da32de106c197ae9ecf96ab505c..c512c7952dace37c838ce45a1ffc85440246a531 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 93116aa894e77cd34544e2451b1b71d606d2e1a0..d967ad3655611289cdcfaf0008b8fdee45dde8d1 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 b96a31e9dc1cc191673ab292f02d733665a335fd..b560d798413efd9028ac31951402329299e83b57 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 9903333c343c9f8859f107749ca94b2d99acf988..59fe9f5d20350bc2e7a8826ec87713b3b8ec538f 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 5d7096d10d072f489f4b8fd86ad65b9c3a27e542..3a58b50961a6d000d020cca3a4fc2c3a18077cb1 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 f2b2a546f0ea5df49a58feba930cf876889030ed..1db39906042e9156e523f2b34454fe470e89371d 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 aeca480bcf52e6e0f4a65534457dbb5393266567..86452bd4e2ae35a53c4b0fe4d21056773c9757c2 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 a81dd7db260a82258dd93f9d70471fca6b6a5897..ff2112a0784159a7b42d5d4e7d4004d28cd40bd8 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 46eaab5f1bbec25c75f909878a084017bf39b1b8..c79db2fe79385c82102b12c335941edbff6a585c 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 de88ec85084773f56722ce2afb45fa6118e665f2..bfe9bac68c1644563eee5a472850e4bac3001913 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 bda3831d1cb4df1ea4bef208d10e398fee34378d..bff117f542f010e89100a58f8e2fe9303181db0c 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 819b5ceb22f0e3cb1bbb20ebce14a79cef73c3b6..920ebd4bdb7c67af67ed57932ed40764617f9b97 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 19bb3b5e0f530e177cb853ac76ed284d751ddd4a..af75625d94b37e1b61a36ef47f95e2fe35038fd5 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 15fa9df51f6e719dafa73764b6343ce976b5a760..d66aea9883f949a4aa6ba31e7c6e0c0b0c793e4c 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 1901df032e1531b41283f0608367c175ea204612..75bc94f34d3d3cb70df8ac54942e1055840aa954 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 ae268c8225e02a4e12a2091957d70bc093598fd4..1acdbe7ebf08c6be2a91c42e828204836c1d9062 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 dbc6abfc7232c672a2222fb334a21b7373c18f7d..51d67ccee4d62892841192fced62eb93344c56f2 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 f723c67b6beb525b7e5d09326073ea5ae8269f6c..0569d1a6473c83983e95830ea5cb40ffe9008f2a 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 ba91fbcf58e15b923237c2679e9b8a4b6a28525b..60703e9b5da899f56aaf0048463138d0303d699b 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 58829ffb68a45e9db22acb8ba0c1b9dad451375d..0969ddd6da55245523a2e80fdc8c44c23ea8d396 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 a09227d8d814ce54013fb56b6640fde1d2381d7f..c95a3af06f5a437e8b69e05b5560aa2315566fbc 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 ee06d4390a49e393fe556d2b99a07da317c09983..a6fb4a1d9eb28d86ffa22e5b3c74842ae5e5dd73 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 948433729ba89161ca9b962b445afc7a2885dd75..73208043859b91648f4396e6e6f3e256c6eba9c7 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 c06c372fac1e7d16d58a9832da295c1074658d8c..e18c719892e9b701f7fedcf1ac243a629b23b7b4 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 5528c33100db07bb209a24f120b27c54bf7943c7..b09a04a32608eb55b92b88727796c6ad52bb3fe5 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 19fe4742fafb0f108d7b7e79e9dfc52832778d41..9410cf81e484a4316aca487f2e81e083b9913168 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 ca4f94868f9822495ece694a8631b31b513f1b98..14bf0c6b783a9c56cdb82233d5e8224574870dc4 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 388897eeb41fa090083bb36f21f144430779d9d1..107cd2fd2483113ed06443218ba915c79ad7d8c3 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 7fd6317c9ef3306c35b8e36075eb4fbdf99d50ca..59105f4f5751f14143e70529936fd58258c35a9f 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 51b10305b4c23e8745df3f9cefaaba56b0745d08..f59ca9908e8f93f2e5054900e51b00306b19624b 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 cb32430b797b0a93222b2bd7a40dc616b5104a2a..27e8da4db1d42efa93f32e533eb10ded77410389 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 e9ec8999c9856fbfb7e43f68b260e48437c4f5c6..69f1b51d822873dbd4c3a9dc3ef61bd6c991377f 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 b7c765f5ed9f5c106aeb70e05aabf8940032cc35..88aeeee38ca34e3477f689c75029d1c4432516b6 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 14aeed1768d412378dc65ceba9c7509771edb493..f74cd1104dbb166471cef8247bc94bf4dd6b7f37 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 15971e98661d1a5c10448416d735a1c80d2ee06a..c14abaf46ac167c3af72288bc33bf83c77feb629 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 264ebb10385f820fc719a1d55bf27d56e0ece090..9bf6310f6ca44fb81f32d9323be98b92494244d7 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 d298c30ec8f5f27cfb07611e9f87017634feadc1..ef046022a3723ce0e007ae1f1c1e9871d9366450 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 932fa8200d60e517968122fe70e33c85018c23e3..a0d8cbd397adeeefa708cbdfe453c28dd6cdd6fc 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 364d224240b5f5bde404de0dada5c1f2b6bcdc76..b18b50590eaabdcb496a5d3661662b7313e3e5e2 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 2364f579dded45d98da2bf37f081700b9810707d..f8ff1300cb302d427119b53d91c4f8fadda9f4ba 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 800913a66b5c1efa406273f9fbeb173e0535f125..8bc788b6bcf480c5098b7ebee3c6ec66ee57439b 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 aa58520f9583f44d8d391d42fc72fde73a935fba..45c7ba99106f3969057adecfcd30914f339a3db0 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 93e8c648f74cb2c2b5d24ffbd0c20aeab08c52cb..1886eb5f80357d49a4dff845b0f91d7f0d596f0b 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 2c554e91e2aabc3241d3565aff6474542311557e..d0442b4a9d17b817ffcd7b9fccac0e3d8ddbc0ea 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 05a698f335707dba0a1890f745dce120ff5d058e..98e3be0db593700f471dcd4ef39b751b6d76f16d 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 301eb10532c02cfa3edd94e3339082cbc999bb71..cee4430dc63c01e930a0e6e71ae735a7c1c710de 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 1951a0880be97aacbbe92ab19075f6f9805a76e8..12ed26fd5197ac9a3fc04bff9de249b38d2a0843 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 e279bcc82e2f7885e2539d58a312ed582d684b84..562c78d2d1a23cab27dbcb90ba40d1d56f00af2a 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 0460e8cca6c20cc8b9e5c1360dd4fb0c19acaa0c..fedbe212394fb2e992d8d80ae8d25c45ae5ec392 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 5b99055d03f174dfc4c5a4a916581031c8593dd9..002b2582d231953644e312cc49f26236e83d73c0 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 0bc21d0d5affe43c50ede0b15d86f205337182fa..b0e60183e8331d7694416747e9077d4f1b064b6d 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 b1a99a4c220c5c761579e90cd058de9d3065071c..86cbd5e50698e84d31149b359a5b860b212bd904 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 a2e56846059b855cf3d386ee94ac0c6ab8d305c2..ff41662a5d090930e2203348fbb7774c312dee3f 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 e42496edb944b0fa7ecdcd854c5dfe9140c4a159..c839e1ad3636f0d16f240c500666ea2da31ab5f3 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 612759686d727f4f6436358ae2b12cde2f342006..5704dccf14003a079a33067ffc8dc75483a1754d 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 d57d95980330a0738fa33a5147c7cfa906d3e896..715602ac1d1e266e55301eb3707f7f22fcb5ea7e 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 bbb236a5cbd37063ab8f2c612898bc7c532f638e..1704f640f86e6137123a2ab82f25594545f018dd 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 58696b537b4b06a1c81e0c01444b9308a088643f..04cf508e89e933087d8a80f35323245748222b98 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 68dd88c18b74ef1e9a85f28f33348fbb099c0025..3a6e502a6694523bb4c95b16a3359005169e11ff 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 a0f0a13ca0cbf78616f13f9229100485a99d9c5e..df01d88106f49c57a71e9b72ba5d109aaa4e2584 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 e87d519abbf51a46d5037937b89f59f6be27cd70..456692e9a2422de9fc10a9864f87458cb0f4e9bc 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 8417984ffc29b406ee0d00cb45a9a758c03cfa61..c3080b74109819881e8609cf9ce9236fc4ead51f 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 94a8387d3daaae5e0d434eda7c69c3a9ebd3f9de..29d715df81513cf170cc3cc43980aba02780ea4a 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 90500b3712396a046ac609ba2a2e178855ef94d4..9254576460a7ae454f3d8bb279b8b921a4702710 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 769c82d72c6c74237dab678eff1bbf8c7d31bab0..8ce18059ed9cacd92d2de5a888ab695a73dd6217 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 0937c6fe135e309c13b4484917ffd7daf71ec14f..9a23d645768cab0d18896bd24fb0c35539dafc83 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 e38e6c5a797355949d0cfac235205200b3bbf5c9..11b2cccf773fa7b4974feec5b895da226b68c154 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 4ac4462bbe8dc90df4a53af9a62aed0fb9b26962..c2d4d6d6a01745cbf29c88f7a965f5c6d536f20d 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 fae4e9380e2a019e025a3bc0d75d89a6f26631eb..2dab4fe995d8f52d7a4aebbaa214a2903ec85f1c 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 d16b227b28744bd2f1fd770d8d5091a7d6691fe4..818b86db5d4d9ebe55997904ba9e71c728f32802 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 cfee63c95fea94911789d1749a45c7b8770e58dd..4d375b7bd29b4a31c19a52d83819ae735f2b7b95 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 20a8b7227b621a6164af1b77ed6578a799e039ca..892512df96f8d149c057b968e4f6bcf1111246cd 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 3c7b5975c901702332a496cdd8d6df8f15d83f56..a720b205320d1c9fd7a839fe57461e09f4321c87 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 22e7c3638657e593f40c15ddd6fab557864aa865..ba6bcd81b87653938c3735024759f104271af077 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 cd39dbd9359e127f7818022c95b8175252215e37..8b41040b9439798653abbce9da4881f27cbc7f8a 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 2ae84f4775d11828d33c757016e37e446358a589..78fbf6ab112743672db75510551bf151fed2c1e4 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 d82f6773d8d87467672b7847c3d87debd8ebff48..ccae3c50956bdd4b1379a9708effa5973fe306fd 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 09d5fdff75247caf9dc539508fe7e59cb274a009..208f653a10fe405d9a744c955757ea6025076a09 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 d7082d07d82cce3da706410cf55d12f4d4523db4..c64f5c9e0287fa8eb4f49b9894b47839f7c23002 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 8f06066ec6ff69da76f0762910b45ac5a23e0308..f60c829cf17c27da3e244f140b5db1207750a51a 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 63363bbeacf0817387218dfb3c3fea700c8825ec..1d0c70c29d96e08e94cdd5846e7fae387b14d6ca 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 a618e98c8eaa9b1332772f5d67da5fb2d0047159..7cbd46ccf99b46da4d3321a5904d7225815eba31 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 7813a56177185bfb6a37e7a09748dd9f0b5fbcdf..5ffce5708b7e118e19264a041ac79057eb71a32c 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 a6a260a3b8a6184250a774f6a92638d24cf7d551..31b695874ae9815f3ddda1af5bdb33a8ecbaf44a 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 fbb7c68ffefec570f3445dbfd1d3e751850d292f..90fc4eef49e3c258f42acfc9ab4a37d385ffab48 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 886d0f04bdbb48d4b9d0bc377b7f6943281990e3..b749de85b7fa723ae5ad17f6d95c82d977ff13e0 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 a49d5fa440d7587f282127163bef3d99bcee3a6e..9ccce99958dc354781e3d9ff2fce04062c0b2b4a 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 4ff0f13b74b10f79e35af91c91295447f9ec371d..b6ee89c4b7a868e599c133c171ef3cf3a6ce0b7a 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 d638190f3d20321ee9668c2d231ef842b4f10548..191c0a0a78567630a316c5fe6d675aead0f2863f 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 89e20171deebd0dd9ed0982f3e89ab97affcee8b..a2c0fd4cadee6b0344b60b583ef622e94fc83e6e 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 6db863954c5bdb18b68248b10e0d1d85db6011b2..dfe9a21b68ec397901bdb6d0e06893d572391789 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 375afdbd66f9ccd31424132f56fb9b63d601bc96..ed26c087a0cfab7aed3605a17eb7f8ed7729b96a 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 54d3a1b88f5ce6395eed1e1b3c97b9b3a238b890..b05bca0c642f49bfc434a3ecced67fdf4b1fb50f 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 39fc0a089efd5f9d6fd9caa1be0fe86fc1245af7..897c775a4230189054bacc25900cb26cc794a163 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 5673887c9084e7f0e6e6ad5dff6f83c123b55bfe..d38b8f29c2024f9cf6ab3bf5d7f53b77ddb579dc 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 abad5fd24e362105b57c7867e1c2346bb3bb9bf4..afc2d3d29e1f5df9b8c9b604cb416c86f4874a63 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 c5c5097fa70b85d441c0044f7c27c40c49992075..38c0e0a24316ba73eedb51bfb832c1fbdbc53232 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 e01115ab5a6e82083f03817b017dcfda76f77e37..fb372e78afa8ab24e1aaafb955f77969c9190c7a 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 13aef05ff0f2d00801af1acfee5e796ac954c516..c458fe6b690c17b0f2d6d35a4a26bcf228434ea8 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 0407d6831a0d1c5e320f9c0a2b861fa4500f7ab1..b0dc3d5613170df015aad1309dd2e3d4c7309180 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 b84750675cdc2c3ca42953937f96bd600c1f792d..ba48e78e7d23e6dfd2f0abedbce3f1eaf179d7f3 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 e3ad45071b342b61eac72c862375aefeecac0049..d71d7bc661f52c21790bf38092d1d943aa700e82 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 33146ebbe0784297c447381c917ffe0830ae5d8c..db5d50f71ba55572c30e06694617c94da531d891 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 e49117e0d56cfbb4fe59d24ef2dccb9e1c967edf..af0e1f68423b2bbc886237fe5f46f3305b20244a 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 6c0ec8e7a240a461877b545b32b291935ae7664c..226faa8bedfef6374d7e164e18b84b85cc7d190c 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 305ab0454f08796d7e0407b5d5588c07f5af7965..17c14c5267d5d97df121722f4ef0fecbca061802 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 fd275292701c748b45512baa999a8ab70fe0594f..9cc54502e0d904b299c92d2b4ea2dbf38095103d 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 8ee37f1fb1a5d1f7cdb073f925a8f51fa8a1d872..e9bb3e035c9495da43d0e064f0c5a2ebb6b30b88 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 fd2f9035c7de906280049c754c87317e6521617a..57648745abfa8b08e883550d994217fa74c134a9 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 eaa248888531d4a58b3466001c291459f3b66620..de8ed409f5a6701c24c65fe62b331eb6a842707d 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 e9dec867d11a5179218e8fdc3e31c7fcb6a0f2f4..e119d337c684fb6a0e81989f232e22f262dae5c5 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 30f8a636e849a2e45121e15040cf33b1113c51ea..833d35488b3673b7f34881bca33688aee9bb7f38 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 25242b370ed7b462b29688a457e5a0becc8ef8cc..fc5bc75a9c24c128a58a97bc7e99a3492c42d2b2 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 3c902a49e1f5a1175433278b0040e045ae9df9d0..85062ae76b5848aaa140ee053a370b3c878f5f0d 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 af93d2e3432512f1834aba49a16372afaa3c1c0b..5128ba92f3f523d3070d18959ed28f18a71596a4 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 6205d8d292e84ab190f6703cc242f75e5671ca51..868bb9beae67daca6a3ebcf9e6c07c5404ff7506 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 adede97b2b894f09f203d01b0cb0a14375947c76..c4fc41dc2be400c827397cf57e7d4b9ffb7b65ee 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 0271e4a8ff6a53baff28b932ca600cd8e14bd007..e7b9cf41d7d9d5d3f82aff4bfc395dc2e4527523 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 36bc7849432888821261f1779b7f54d1dbb4562c..0d12bcad6025d103ba437abe949e47cb7bfef390 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 1ac27495f90b29680e06e7cb803fc47f0bee03d1..41372b0e7b4e0f40c619c01380200b99110449cd 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 6db9fd4b076f8cbce0134bd6c0b91ea40130d36b..b893605ac3de345168a2cbf124346cf1c8bcda46 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 63a6c2797b4181b34e69d89c222e4371596d8180..7d16410a0918bde2abacb63c551ee798f87cd6e7 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 bfc3c3055f6fef5808056f9e7ee1e522e0cef540..05fec5e5caa10814b96dc3bfa192f59ddbfece61 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 f1b7a5b55b7eb7d8d38c9de34788771fdc9e9ed2..ef60e30e59b44f04f6d2516a29b0aac759692806 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 2d0d365f4d1cd5a56b1f50a4dc92ec1b0e587d25..4770e641e46a260966504077c3fff14d4a920aa7 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 27efa291cb9e26c6620415da0ed949fe5de0507e..ad9a7b81ab8618fbcf9fa15c40a758e0985f9482 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 814fd03aef19aac3238047e6e5d891c38704dcf1..ef053a01cdc87a7e17ed9625b416e5accc2b675c 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 cc463aa76f5d243a697c5d627b7cecdcd99a58fb..7f4663205ddfe384a1a0820105b1a1d3b7b67321 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 0d691fac48b2f7f54156c87d6a59ad68138d707d..936755f101f345978b7fcaf6324f97969d2d6273 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 0d6261441617f1690885de8c4690fbcbf98754d7..28e97b6e91cb5c525828b7dbd5d6444f82f9450c 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 d30e6a1abe5725c3f81695f6cb45b849a74f23f6..141503f3a257e4abb10349047faf1a913b5cecdd 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 120f21d03a07a558b317644eeb2e5e5b9142af1a..5f27f1c9188694282e624144d8762dc91088c18c 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 2fecdd197f358e142350176bbe5694bda712fc4b..04bfcb73f7a37a9b470073e4538c380b851cc6d9 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 33c5b5cb6b9550d63898f6bf9f91ebbb628d0a86..92c9d5d8cbb7f96484a970042e6cbc5cf7647ef5 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 8c1239e272f84dc67ba8023b9ddaad901c377ce3..842dc3fbf0b05315ea75c64d7fdbcd793f287828 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 e77b53eaec0cd09b0a571abe877ea9f35ac441ab..03439fab8306943d5200f659404ec6d95efea907 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 75ea8370b8f653d45fd1889e235f247448a08cc9..8fb93a5ed2ee702c259d231d68677d4b4a5fbff3 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 84d229afc5b2f2107f5810d8a08549a5eeed5e82..0a7622401a54ba37c8ca86cfb90cbdde27aa8f07 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 93cc618ffe75d6ae1114acb9a0a1d7d4777c45d8..bf58111b1c9933e16e302cad411cce7835ff80a8 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 ea4a3358818aa137b7c7c0c60976aff17f2df25d..b1738a0c1c4876266ba72fe8dc0c5d545fec5810 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 3197bdf67c3e930047d70b6e9ee9ee18681f1561..a65394258b4e131d5c6675f0a528529893157127 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 59c1939c73831404ced0cc8ed523bed3ac31e5f4..3bbe1b8e561d498c39ac092473ee95f50179f404 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 0b9c8b7653944f69ab8cd357b92bb555e8b8a7ea..4df74f8d0ac7fa922219207a9383c6d03b14c84a 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 116691d8811f87e04a0c020a7ee9edb0fc6d927d..16795454761f0f46a7441d3a406159acaa133fe4 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 7a5e60557d4147ddc37498319981d8598448523f..9d3cda4d87a85bd32939ec46c5e8eb50eab834bf 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 d4511cdf3be3e8fc7d8d4bba831e187a92eaad70..38ec4380f7aaa429cd87c21dd439bd7a752835cc 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 28a7e9ea905e3d5b05ab9aa61633be7ed030a9f4..dc5ed39d39bd09e69669c8e49e9b8cdd31dc8001 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 f3175fbf8ab0932620541abec65c8642a4ba3915..3e0a5f5155ca7ec59dd7c2dd14ccded4d3755b12 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 a2c5cc65780c30f5540daf687980e4cff79117e5..49c0ee21d03d802e9415cd9dd5faa86ddee0f233 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 80cd2ad969ae7c1e3dfcb9ae3afa9c1d3f3a1f70..003b0a15cf0540c0c2b7b9d1e909d7f5529b33ae 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 b1fe5703970184961bf6a4c774f912bb9f523a4c..ca12b56d9e0e33ee0732936ebbf1916d7488ca67 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 28b93ffeaa47a54d8fda42fa948af0321df26fc5..1e7b84117597d2019bb87968f14370d289cfda1e 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 126f5aa827e3e959ced30d8e1c44cf92ba5d184d..a3bc00f0736b1e3cac200efda228b88d52c4ba80 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 451adf13760829109f062abe9f5a5f06043b43ba..1f1dae95cc4ea9ccd944165a13f4c37d62f42f54 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 bf2ee46643f6ef10587cab2fb6f1dd73858b39dc..cfed56ea29047a0d3302c938f5c8982b23c42c77 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 9b43ccd8f71a208d326b7f4fd66ad70193d5eea5..47bad30c373d2531969b3ae5feefd2525a102e9e 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 b7d216aa9dea69b05540b9339361ec8ecd01b134..56028026bc1d2dd9b757b4c03f038978ba665f5a 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 c9931e2958ae47ad20128511a26388bff9af88bf..206630c7987647cfafb23caaf4068ef5db1b2cb8 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 dff55f0ac0d44049480b8feae9545d0d48e47c92..c0a6f204d5cdd9897a8e5ede20c525a8306c8f35 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 7098e2e5d9dcdab7821503a6802b913cf9751df3..96306081f08a21aec46995f2b1c38707887d5557 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 e0dfd24ed6c8c2ff971f145177740ba796ff935d..6079a90ab6ccd4d6aa1ec37fa5c11a7eea632ab9 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 0a8583fad6ae1e9c0a58bc860b956e1c3a4d1cb8..0044e036eb1ae3f5623b3b099b5ee0f2fe02a830 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 33e5562ca8d997b968d91504b19b140a88973298..ba992ca85bc64381e2eb63c036485614978d9944 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 e35dbef992b31ff321cf61d1d918b107b41ca67b..986039a7cbf9aa053246d16e89c75d550f6861e9 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 639e508c278c57c2fa74eda3cccac1f8bbf571eb..0a722ed19bfc212bac4c88076c5e13709aebfea9 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 f34f6a197ef49d1a3ff3543e47b1911d5747cf96..15d2a09a1187421276bb7a67429d2d1f442a9f3d 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 4a27aa83e3c72307880772fd431cf1163e4b63f5..eb0cd5dd06e86c7b48655cde6079deacd6885fa3 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 1bb53cb589dbbf9cb2fbfce9b1c4bd64e619579c..8d2bd102df3488a4ac55f9119179c95cb61451ed 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 200966b9b873d68f4a9888ecd86e87d0c79dee6d..6ebcbcaeaefeae767f71372ecc802e5084a56904 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 4b44242da7965bb4f5799c62b445ac08556cbc78..d555430037abd514788c735cff7a3f4fd777cb7a 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 4e534cb0260126d2bce6730b140bb4188986bb15..71ae2bd1f51a42cf4067294030cce91c9016de55 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 8d96f85852110b4d81b250aa6a6f1af09864b925..a2956cdaedd0a0e93c41487142fc9edcdba02aa5 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 52837695d7e9b93c8a12af58f2060c95113ae53b..6d68a148d196f4e4376d8149b4e81c78e2421708 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 d6e54ead932a7f9aea395dd20e3f235b83fb87ad..302540e7f194c13c2ad590565ba76081911d93b8 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 25e623fdbcf58ae38d85fd27c439c6a697c9f6cb..630a6ea82305f5fde76efc5914ccc8326ad24e59 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 c5359da16c36ccdb4055d3ad4d10b8071a100afa..d072eb6a32e40b1f41bc795b5133987dfc1ceb5f 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 9e208b5bbef20b37b3fffc9ae855229b20467009..7c31febf5fd08fcc5d855e5ab5f8cf412170836e 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 6b19992bab56fc341c70447a4a4eb7139a6f6744..e691f8ec2e2549975be7a9fc68bb1e1fb711add4 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 e41a26db590768224ad00a05bfe0b64a44672389..82d65f20f2061fc607ec6b678b7fcc67bcd44a21 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 3c6dddf6f7adcd273ad002433c9a38ea95340886..4052a55e200d33b3e825d0a09d2b45e39a8b8577 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 ecf0498fa8a7c6303fdda16dd997dfad17a04d62..d9105c37e20caf84321987e28efc29e6441661eb 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 0a48139e0c06928b85cc0c0b60e3c33b9fda5e25..127b724c69e44a18302c51240804c43850e46498 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 097d161850a7571b9f3d326471cf28b497990f01..5b6cd2847be481e3805021944b8ed1b4b52a1cb3 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 553d2dae59965dedf5bc9affada7311d72cde9f2..073393e4347a0a89e90013fa6bdbe9675aec3cd9 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 51c89f3767be81560e1fa8ed6e31c5fdff0ad14f..18e68fbf0d3488af6ffc978f412a5377e06cbb7e 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 7e46d2d07778b1a7bb6de3287d9dc34c3edbb45d..0b741acb983bb1ece853e3fd04fbd9fb3b13bb7e 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 2473e02b51e4ed68e0d3b0d081526c3e98315930..dd485110b405da9a252106b713bd7828e83a728a 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 791d0f98834c21a52c6bd2d63a8e4f6601c71560..7511aff1f385c85493a2fd3c51a2d6525a8671b2 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 d5e341ee4c8d841211ad68c29588e5f52497f399..98d6f42defa6cc57f7ad1bacf4268cade28e9335 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 b30bebcb6fe0b6eb9d239c4504d8ddd8c0b5bbe2..48fece0da99ab9669382b62ff68071cd3433babf 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 534972d8a17e5bd5bf0832fdfb1876862a0d8320..85408b64a65dd13d146f60cbe7bb03a8eda0321e 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 f4c7eea5afd74e22d69e20fe003682e8d783f701..97c63e50b2cc54428cf4d3610adaab8185e78594 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 88b3a805abe9458e6c54d70b3d1c6bf410715f3c..b840be65fa4d176a37efe7c7cf3ccb50485491eb 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 c54863f6bb95c45c4fde91bd1f45ef732ce497c0..890c1bc539cf107cf18b8a347090e99eea237013 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 721d17a51a4d382b45b883f41c3010424a6004f2..ea7406b415638717a51fa1e8a4f7c2a89dd02e03 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 b61a081739f45574c36c0a82573d84cee236b74b..97b1268a264463187c2911d0f18bab997f77dcde 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 75ea461882785a3c2a44a99d5211ddec7e8f6ace..0ef256d4ae44f92c221e60d458416a9c0f6c7894 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 b89ca30d2d4b6454e19a3e42b2a19068efa41aa3..a0c7a17f3c76a67b9f691495aa1167250c33ef2b 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 e8c39b2040dd94fc72fc248714c3d94a9362be66..461482eb5621506d8e63bebe184270b014d60514 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 a8b032c5342a290c263631907987b58569854943..608859201e0d218dcf37eb68044bcabfb68e2478 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 61cec17909a7738a3834fd421a4da497f3d4bf1a..a05f5c232e53976a75a4d54fe696572e53177760 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 0425a3f31c752078471e63c5f5b3231d2ae4622b..a33437176bdda2d9874c1053f6df0e3d4a516f98 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 68a0b660fab3bf583b66c561297d5980322dc38d..655db094f9b3ae8c9a51f268de250e21a6d048a8 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 017d1c00d3e7c273e7bdb2dbdf7a8a7ff662ae6a..ca7779487296aecf851c817166ff41fd2317435e 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 ba92e5d7d91fb8fe4bec70fe7a3dffb341923560..ff8752ea62039e8dbdfb5369b8f6eb82128a9644 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 e75cbaa6438ea1c36fe08d0a64148ec2589aad97..ea15ba85e762651515bcce64ea2ac41742929f7d 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 b1f4594350ad2edbbaf8693a2d60a7b1ba0a41b6..19737f1739ebdb78c37a598b55280cde4573b39d 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 10987e307d70110e7eea8979473819c559a7bf8c..55f3f48cc6c8b210218d2133529d2662c72efce8 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 99286d9cfe78374fa65b6664097e464c62c5fa9e..93d6c4f015a0814b988e7b7c5bc8879c74502585 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 d22310316117982595c160fc1ff9adc5ef3b02cd..1fdd3a43f96f1f2a883e69bd511ba8c1a434066d 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 8a9b989f1bfdadcee5b8dcac43a5d4a9f1f38c0f..ea35c6533e5a45b4645e7c47616e2ba87eb3d6bb 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 53e4122c697007481451738a522f6a1220946dde..a128971088d4bc6937eaa6b0402d749836c321a6 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 1df6e5af2ae53548a666a9397f2747324222de8c..8f137c9a51c05c78f6ab2769b9b30ce2c011737d 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 771c85eab61575087eb542020489f681895f943c..4d06ba74b47c664dabd2794a47e8ab0cbd5ff5b7 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 d36d675fe2f054ce6c722b98c7b9dc16ef549398..bd5948b10b1c46619f0d2bbeabeb7b0c11e94de2 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 4fccbfdf4f9413d1d3c73eeb383d558ae3d45b24..9396d98c5adb6149b3b3c153a1a51b64f02c485e 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 a8123ba58d6c1c51e286bcda99587fcdf006c35d..09b9891365b4d98e1ac40a55d6987fda10b16091 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 78685af3d279127d7fd47ccf14bd08077b6f49d6..ecb95f6e1036785fddfe1b0bb59b69e9a9fd7cb8 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 9529f6cc0575838d6df1731ca2356d6feba977e2..f491278460aeab0893dbf4d1170477f6ae4b8999 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 3984d6b92e4b4723c77a4b4a68b3a7d8e3d4489c..b6793933175db0938cbc7d01c1f2a63ac0e4689a 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 5aa1113c4c762bd7c290128802e4c09d1d824f2f..338127d884091747b1805acb1b8cdaea29a5e57d 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 9955929ea88f1dafb9b05e6f151a370db664e6b8..2eb2a19610daf49cffd5b853ceaf75b8c4238188 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 8015dd2e9fd27ec665aeb857137afae6668ba8fd..cb67a3e4940e3a1aa720d2f75d595e5163d896cf 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 d3c0bdae95d937ab3c957d7cc1dc938a36d9c2d8..e28091014713c768a78d5c6cd9988057e77a85cf 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 f51106bdf6ec2ae80d48d2132c73d41d8301fa28..d42248e92179c7ce11e76144969850cb92d1ed53 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 afca84eeda19c249da57a15f2de35c6b51481f13..1f6611289f8a8c477eccb29a78c52909c3083948 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 a5f8b33834474ffe540d82ec15355a8a44171b4a..00566fb2bb1d01f0aeab1b555438a2f8b77cbf60 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 ee3f4587c9b71a6adc8a64c056a61aec371398c5..38eeee80ebb5c5c51aed0b4014e61506ac79570b 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 a3d8c48643ca0a5df72fb922af2689c67095b43e..446155697920d90d2881f2f101c1d2a6847db408 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 038cf94f0b79331558c18c0474dc37b0d03f4f18..248738cd3971fdfe042975c8bd8b2334290e11c1 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 ea81f99caf9d04a6e65bbb5776ae1255c1a1b676..c09d38b97dc1c55e2babe7b3017348a77fbed989 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 b2a55d8616fadb021a18441d20eab42ab72d7d38..f169c6d40727f7cd60b0531497035a36e713c6a7 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 eef5dd8db63bd9863b07226f1a6f7a9d04d87bf7..409459455ddfcd113554b1b095d854d5316607d3 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 2145bde8a35b5affc7c229af4ddbfd75cbaffb89..38a405b0deaff2b931c5b7d8e50e121ba30af3fe 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 db6b3b3266d6b8b96a7488bfe54a2da1d68219b3..0b8a93ba29fd298adca16e11c92b8a5c62f8b75d 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 39dacb73ed60a5ed830cd23a575561d50f8648c7..c796f7f2aa2f1318eb184e9a72823277688b67ff 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 cb0ae72b6d44ab3dbc4a4b883d7d51a89d1a9919..6770a795e68e35de3d97a4877effeec9a4c96cbb 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 f413e55cf39d5444fa7184ff21f313228c75afd4..690d769f3477f1045250240607663a1336269d09 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 341b318de2e97aebb3f1a905703a9e1fd82d8a23..ba27107ef6a243dd682b86e0b5e8a65a59a67f05 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 ea1ecd5294b00b2d47fbef78ab6025747e71ae37..11f6f228dc3871db172b417e0e54f15d9098147a 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 476167f7fc39909c14576b2c57905f457f8183c2..f1f9f5c3651c9124693ab4250b17ac21d8226afd 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 4107a3224fb579da2fbab6709bf954c4df041d9c..7b1550522129b45564f3380c92a35b8d4d129aaa 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 cad698012885626655fff0ad31812d2fc749d7a9..158ce530e9d28a79f1205413fa2796d39e7cb623 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 89c80cecf6d47f595dc08fe9ef3d95f22ab86488..087506f1a5f032fcbd6d5e1a37e1cf9df9b8e637 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 ab53b3fffc666f0aa3dc79320facbb181bfa080b..e86fdbf3dddbf98b08f9f4b659db9cc4da68329b 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 1388c4fb7bf80367cb6f0e8d09aa5ccef30c6c44..6c57834ab57a88133a9ca5dcd1bcea46eab94147 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 33880f4f18ee29d4e7139d04d03db1333df1625c..4be4ef1ca12ab84a0d7bb453cd455aca9dce7fb1 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 02c5056b477b670a5858997c0ca7d25394d49065..c39a0dfa6bd637a8107c642ada077e4c3c140470 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 22ffbc6f57e5040e5479760733b079f283f7d7ff..6492d321132e44f38212b02066fcb260f6b8c75d 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 a9eb822501a1b660aa16c78913ce1b4a3e72d2e5..acc6a74d446192f085774017c927e259e9303c2c 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 984410476f5ca82ceb14a1edfcfcf07f4c270f87..df9bbf75535ea58cdb174b87658b34f3ee079d18 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 0046c9924649703af1e38558d7621e5f55bab404..3650ce7dd40a035e6e3f985231d3325781c975fc 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 71c864ea089db8f95b9636b001e23d118e6cef62..0f6d4f80e16e0acbbcaacbd59e2c937c3b85f84a 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 7a77b77f18ca7473e60f0406cfbaf427983e32ca..f5c696d2ee9162428d64017e7fe39ebe2f7f7c11 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 9b28c42ad8042738f1f527299ecbf9a4d42e6930..82d0a9b2f3e0dacb3dcbcf8d6ae8ac7b5fed54ec 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 a7c4520524038517e711dd66e603f3552911ae32..11a2c1606d2cc746457af0dffe8b63e08b6b78cb 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 888a5a22b1d4f495c5c924ceed863b9cec867071..f353ca23eb100b0e44da0719074d4bc263778731 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 8c999e34f02c5226e57ff203a500973e31958b9e..fc15b771debed29e74f6dff08de3c5303abc0226 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 c9abce9c3d22468208884a6f9bd7c355ef132b40..ecdc78446de9f434ff047cbcf7883e343011d71e 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 edc06781fc2461f41fe0fcc2e753557d6117b73c..fdda86468fce7c256b3d823536704727c9f468cc 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 a8973757c307259081356e7c1870ebc75ac303e3..5cc4a7749e9bd9a7ae48686c7d8ad055285f9309 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 4546ab8ec92e06726035575f16d29a2b9bbfa165..75508c9ca9ba85c1ae8f64def3c3de8f6c252fa8 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 b93a1bde4ed6e87e71fd5f77c5b681b4a9395df0..43862cb8c98ea9a976369ec7b6a787bc66121c6b 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 9d7fc0c8d9882d7263877765de6dd9ffc5864323..a07ab9c0b91c75a5bbc0e80e0c76ec0860c4a4da 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 566b38e5c92854cc3bc7ce9e8b0da572bb019856..6fa051e0a3a6a9bef8716499b770c0bd5605c5d6 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 8912503afbb20ab7f9dc986abbf72c411f32f767..4b12a75090277cd0fdf79b86b0facf41317662cf 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 8e8617bbd3fc2cf71ebb32d23b052e32b1df9e65..ee2ff5ad4c802ea9f0c026f9a89c93051c8a7aa1 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 9112208e10bb1e90e3f9ee8f8c089bebb3df8536..223fbffa7bde4bb8f7032436b7b2793e7a28a451 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 61447104204e71b5aa086c1e0ca9b3caff901d7d..b05c8c31c50f1564080b83adfc1b9eb1e512a66e 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 edc43f87cb78f673423493e938c1f547fe29b2f5..e741605aebcbcec956a8465999608eec7899ad43 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 0db84c4f209417aecb908d43879ebc1537d47e0b..bd0695060f0a1e1fe92c2a13dab373d7b819f110 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 27abbd00e707d3e00198a39b499a3fc3197a5250..35d9719287571e6c9b033565110950d92e2f927d 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 3393297a4ef8485cc7e26390733388e69b898c48..f580f8cbed0a14fcb1e0a440fcf41337c681e672 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 96c2d474486666684a178516fd7faffcda701095..4fcd0a717e104d811230ce6500f2f9eaaef7142d 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 3f85712142a4e71fcae368e1e8a2bfa49602bdd9..897be838d63bd618d38c5df3b2850d95384ccea6 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 cd2b669caef14e1fb539a8f1efd68404096ca28f..4712bdf54411acc632cc368336c65782b4a341d6 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 31f9b9fb946b1538ff0b763adb9bcb89a9385bde..1f1fe4f977fd2ba33f1fe7d23a0a56019aa6da83 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 cf17b8487880d73cbd56e5b3e33522cdc50b6d60..7ee343ac86c335db7a2b43a4a1953141811e339c 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 5404f8bb83367d6130399eef2dbc2f5b726b5867..2076f71819a509a93eab44e153b5356732d73dca 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 92a757930ee2947e70be773c87a9fda042471060..f39b33ecc002f65d18c30d843846c643fdf97261 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 572a242e5cbbae6af4ca46d3cd3053e8818880b5..02b06f38f773494276d2b24cacbcec9ae3a6f53d 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 9c55fe8cc79583c892cde8d4ff11ea497bd65ec4..8dc5d302be48dc5e2359a298d7bcd8b7470da244 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 1b507f8952b5db3a43693f828353262a42a921b8..1d0a3293695e0aca66f4c444d9358ba387514414 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 6f8fa9e976c2e66cf2934b9fc888f0570d1b4301..64be6c5534bf417ae9f9f7d8ea90dcf5580ad97a 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 018ad6b0c24bc502a5a19468a584035a6568120e..0bb4ba6e81c97d8e3690364e47d90484086e2f0c 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 9d7e575c8a2fcf79ce0d42af2b9b20dc747768d6..89afc0e15c4b44f56814f6752d2bd95fe1f86d1d 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 3aef445155cc2cb4f15bc2825ee9080e9a2ebd57..9dbfd08bdcd1c96b6ca98454ed8483a5c7779540 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 6dca3ce1ddd5667d7c478154aa0225388a4a0265..97d31a380d2e0ec5ad10cd5cc72e8e1ba2ff74c3 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 31ed137de9aa3493a70fecfcc2588abfc8107ecc..4f9561248d7f6f72109c94254651d9cca0fab035 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 71ce2358df8a126f30a44ff5fbc2552be3299c06..7cde9039ed837bc28204716c19dd13a18eee4cc6 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 165b09fd6896f224fe02d9beea6e207f4c126223..c811842a22ceca0d2d758625b4d21d8db34537c8 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 724ecc390502a63f43e1236f90dc040926bd35d5..b4900a5f82d657dec41b250274cc1d25e53dd4c8 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 288eb3e3566abf26100f999d02081b5ef02a6694..9240fd3e3d4047e6d26d1c71094f8497245f4005 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 3593e4c7966bef183bc5979e296beff512196d47..21f94aa6ebf80af7734a9871a8694dcbd9d3570e 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 40170dbb2d025ffda3693644c7d9aa4246f16bcf..e0a9857bda38f156fe2534c6ccf8285f10fa0431 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 1762627132674ab16cc596d1aa24015e9b359a19..b9ea4f901531470609bad5c4ea22669b7af97998 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 a37b06793320eb91bc4059a7c7e7a427363efd83..faa01c14e91c4f16a2cf0b05ade732a395c44c72 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 07263b3dedde488196037e7140fcaa367cc49f5c..deb318cb786a5299c20b846eabfbad1111cb24ed 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 f13e8c414d1af28e732a83082ace0a65e43fbf9d..38b6a9de95d56a62e721f6c296695b3997681628 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 2e57403aafcd5f627b15358e50fbf4227a7e4022..26331326bcc8a8659766ab742214185dd5e04623 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 2585fddc57029d733cf98b521dbd5acdd973e5d0..ba240fd2c9a4bec8a5d342645efb85c288a41954 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 da48575efe25b9e541482173e19ce8709c13a562..9277c0a624f32d8b8d43f2ec5622a24eeaac186f 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 ba09b981bc4603c8ec99fa8415c1715e890a3898..70560e26fa05e433e1c3160d7ba5b195381072ee 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 d3f812b4f4ae80044e57a4ee4d38e3fc0f653434..b1e6c06d7d1d595859faab411bb876d11cdb4ccb 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 cdf9d6074e8214467a132d95f8ad102d9e4cebcf..d22aa3e3e622022af64a03221b5d29dd359f55e1 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 5bf76b8d5efa27b4ade29fc1d759f4b6363e5b85..d104097d0e29d3d5f9c0375049158c4bf2baa674 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 9dd3f709102a8bcac658f5adb89d0acb99e95032..58714095f85afba91bf5d78842b9a91789cd220f 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 53a192fbbbb6ca64d955ad1580bb553b4772a795..5cb135b162f46c28e624cbcad0ba5b24fddcc8e8 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 8253485d15b26cc1fc48b2eeb96815dec78e7169..820067fb880b732043df2efde8b2250b9af65278 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 e9949f855ca6a0fb6dfe8b22b356a1a30fbc614f..6b685bbf225a69d96658566a206e23473b077758 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 d107d80dfb2c0954673ff64c6b37c86dbbc1930e..6a33d2231bd08fa00f0afe4073a5316fa4be85c6 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 b92232878363873c023c80bb8e965259a910bb2b..b925d8724f0046d37f63b72cc7c8a70ab2e5bff4 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 cc0d3a2966ba3a5b60bb5a6c9c764f1d313b86f4..61d394e1e86e8fd7fe2ebc2356c007a7bd54578f 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 624dec055d855b3cb08711ddf962e1ec7c1b63e8..7dca23825db04e43c285da123d118d4ab4c5c625 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 b35c141c57904dadf52c32de98cf994e6105dbdf..9407349b21cf83ba530ec7d7cc553a7a89a80a98 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 81d9ec43f619e47d232dd2efe85959cc6992cd6d..d73b7ef472c22d7b7c43f24a3e8dea65905196b6 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 d4a579edfa9bc243bb5ed44d0c849e3b5ff7eb46..b04e3c802c525143c8c05c294009213c4dd66004 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 6b52b938aa804188e593c16b2cf56f990a23dc3a..233990d93042c0a8ee2db8253f57e5b963ac04a9 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 6786238e7790565d597612c768c2f0b05a365ad6..5211cda94470b726caaac536db4cf94e763c5639 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 774deb4d9122836fe3c859da5477fa866508a810..8593b50f506051d308cabd816720d22ff74997fb 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 9086e879222823c558812153d460ad0e03bd8f38..94b7b5a52a2149f03bfbfd3ded5299f10fee9016 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 e82bf5c3f0ee5199f63b782f72319391e8fd0a0d..c86cb1b6bc89ba4916ffef1043ffa55a04931523 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 0d11920d274158f1190d12a18d8c76d337eac448..af5aaefe0bf013bc7c2095982458dc03aea734e6 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 46833eb16a0ef0c74579e6f4c9f303d966c58db7..7c7ad372bd5a3310812e92e52f58a7541cb1dede 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 72c40f11730f71705d522c84ba6dba900ba639cd..ddea5dd926b1b77e3ee39ee7b0603ab6aaf31315 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 3fdda7d00cef319e0b439acc5df89b5985b03b54..f07d25406ac6fcf3f45183a7ed4c3a45216b036a 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 2299104fa4d07f6d7cf263534ad62dbfa8b5d41d..a81bf370492bd0da0fd6bff2895f92eee9218bba 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 4f47b9a383f908d7f45cb8597e891120771fed8a..88413b8030e76ecde520f3150e9aad7164bb28af 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 171accf95491714e32f1b39efbc77a015f4ba976..e34cfb6896366fa812c34939deaef1eb37c3b267 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 d48329df63810b34723568300d468b69ac09a0ed..6002ec8aa7d99b6e1756fbb0d53655bb703e0b34 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 4157be4202fadd39013db5bb56b8037da54c9be4..d946e1e577747cd84c9e4d2634face8feb9af0c3 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 626390170411ae5104d199281174492f84a0b009..3a32f75559b0dbd8dba3c5f63087ecc6c7a3f289 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 c48be7a47d37f141fc2178f02be36a324982e6b3..d3d53ef4f3b7c95e34a757960dbc24e358c9c007 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 895af898019d294434c6fbbdccfe53a921a9f4aa..bd48817f1f4aea32896f07fd8a9582569a84f9ab 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 95bdf6f9e851010d7e1699f8f6db56c1d83e418f..5c2b7157e12177e652516ac036d5b3ff456c3f15 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 2614e4623a69a79fae0a3f0ef0aa9a0d8c7c9c73..6c67b948ed76babfa3768fa603e313d2ecc37e00 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 92cd2b30c9e7dc302dfaa34d604b0427b5e576be..8d0b968599d7cb9ba000cf8d92ab5473021cb066 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 3137d2af2eab63b5b2a77987dc834d4936018aee..6ae9723ae85af51e04d278d317e0312f2e7852f2 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 f945f6ad2a2f31f107f9ad7791ae13b90bd30973..5f8f3c6bc8344d149450fb7c6713faaf73bbbdae 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 d09e05673c6b1055c6fa235af171b8d4fbfbfb01..40af0856fed5d8c0bd7ae022f3123d263d8597af 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 23dfb265920c9758928fcbe64590105ab0a57b95..70caf3c499597a605911b65a46d18735d2893f9c 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 166ba88c71921e6a24fdf09658eb03e54cfa80be..f63ce2105ed88c3d24b69ff9ecc64399e995edda 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 b0527fa7d68c0b99aa3bdc51cd87d0207e1404b5..6fcbd7ae832a15562c0c9392a059672b2b6ca108 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 f1fc485efb09377b46cc0b3b856df0b1f949948d..11a60630e260466086318ec4b2959203db9780cd 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 3876f66168b70452ba4b3e6fb7d721fa91a96b21..9b9f6fde25c2623909e9fe98644caeebd1536b0a 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 0807479d5111622b2a9760cf80e8b3f90566c3ba..32565bc1d3fce60f6661384b26aafffd57d5f5af 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 e2b7bf152ef54c44dc22e7d91a780f0e62d743ab..10f4da7af962729c326d89c6e3eb8145234bb081 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 d396f3be9b2eca640e53e1ae2dd73930e2e3e1f1..7aace0b5de18867cb07aa7aabf602cc37c4dc005 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 9d57d031e6827f5c9f1d58138019f28daefb8da4..e8e275ecdbe7b675f9d4869735348659c6572e02 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 f303e9854b6c9866e20d89317d01a982f30abfc5..478caba890a0db120b36c5e0a520805cba4837a6 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 b02a1aef83a588c158f68be5d9b3e3dee6a3c49c..075e4fa77093552dadf9867068f2b0cf16ae6444 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 12f522e1f8c29f8beffe0dfdade8585c28e3d382..6137599e0a6ca87bb282bdf88d11b6b649eea35f 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 3f8e706cb94ec0235f4fe1660d7e2fde8cb0f4f2..cd948540bc4d9c49c1127fd13024fb99de0e196e 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 79cdefd998eb164a2d49651069a3edd92c105ed2..f0f7ef0adfad2d004665c5c06c0a1458bc7dd94c 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 6b4e99ef96330707982e0bdeb5acb29e5c5b9267..398103d49975ce9bf4aab3d743ef30e6639bd803 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 2f7a664c1b5f086b52b833882e85bb7ed08440bb..b9a0d7f36b61adfdbdbfe88d115712c5a1485a5f 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 c83f04e159f7c09f3de7779565bf39ed6d31279b..6885e97a5511366f75cdf38dcf6dbeb999088aa4 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 1b9affc4f5364de0cd8672b928fa6dcb8477f62f..79548bbe0d219b6f8ef4b69e0f0634e1004ad204 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 1d7395b2212799210685f450b6ac24012727bbb2..3663a664fd3f823dbb71c171bfde31ffb21f1202 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 b3fdf821f8130fcfc0ef5c15ae1bbfb20f9e13f1..ba1a332ef978926cf5cb904185f8a579b89ec8c0 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 00937989de8413c271a6fc7e0cd9e8135a652c50..abe874c934a4c1f4e47a379ad7f5644991635988 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 f20822c50b87c85bdbf269e12db9ae5e130d70d6..3f6fd1e39ab1a11a2545553f77e888d201d48153 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 df0d4df87de3c1b8adac8462f1043a97d35ef473..33318126f3e6c1d29b8f27b5c5eaca74a25322c0 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 f454290c6af9de0d2e29ae5aa67292ed478afbfb..8909bf9227621a25101a78c3ab08201350197019 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 7e8824ba42972e7ef0af621f74e8fdc2206027cb..e7dea02b8705ce669282a59546f1cad8e0877c26 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 10c7961f286171839fd2c9d80403ba9f4bb463c5..3a8cfcc792e2d97ed4fc829145b239e2d2d7fb28 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 3c3e71546885dfcc8b0fcef4d946c497ab9ad673..62cb4f005420f3bd3b1814113169d3e0c88b8282 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 8de3b433d29353adae4f585cec5f9186fc7a1fe4..1f398a9ca38ff19aea1218f366d874d453459c15 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 00a1a227a3ed69220050e7b154959cbf53eda3ec..d7e1718c071656e9ce09f0c9a5ea7fe3cb4aa203 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 995e8ca8f5e2dc43a398790ac1e9854f1972a39c..34c9440bba6c16ebc6349ddf80066502a3343e14 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 0a91256736926001c4a862930e1eeac8d6698e42..ee4ce0d1db83290e3883c6caebe453afecba4482 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 43f75e45e78741543ba97335a0a646028ac8cfdc..73bd49c0b8801c5412d36730dc5e8cb757baa103 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 0a52cd8f42a96cb1b8ffb60a4ca03bbf9f5fc551..08531fb76f93a30054ce0cb9f984aad43414a07b 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 196c840440045a0e1fbc79074d915e6336d966e8..a379f3d105faf8cbe5ee66d3552ed43812a7ff2a 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 d63af5bf1f4dd21c161729e65f2a3668c34880d5..bc435dd4debad093eb20a247106bbebb163c6a3e 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 eae549ee66e36fdff8f3ee649fc86734d1625cec..d3ccc2e6dbf6a480002dcefb14df7ac58687dfcb 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 474e85a11a56028a82472c1ec6bab0e88b2f4968..2b1bd22445d7fece927a170904b74b3006303bd1 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 c41c89fb165ba43b48d010ffc466630caa09729a..321dca574235a98701e7dd96c965da3f42dce01b 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 005f46a4b0edc797b2b4fa0aa7b19023c54bdf62..eccaae043a1c937ce39ec914d1a433dc762f3b12 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 1a6ebb23e5ea75d03fa5abdaebad92f500f7bb33..b3877475b365899b12a145998e3b3f271dac11f2 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 512dce8f1a2df34d8e42d1ad7dbd3bdd2647456a..1125765a8c14f615014a390e266a583167979db9 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 96985b6f7b74e9e91702b6e3a34c818bcdfb9e94..c0d0a785737241c6f8744b91a72205ebf9751e4f 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 1115bf5a428803126d3ef3d58f135be4a67e0699..b09ec4e2a921eac844c04e791f284cf4702db90f 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 446a0d0edbcc4c15aa6d73249011144037e5c8e7..b1a7c6bd943caf4513c3d832c053005ec1c53f2c 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 092c47b6841c64aa4ac8527c11d9fa01649957c4..7acf9b0710f959d17c06038656a54dbe617dcc61 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 25efb95cba6745e3b693930c05a067191bee5433..8b94a9215296eec2c096723930f53cfc51e3db8e 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 fee605dbd2a26111881962bc5d4c5b9309951a43..1dc899a4b826ef74ba4e59f37ad0e407132d785e 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 94d8dd92c2e165df9f4118acfb9f5be874829510..43814793d08aa0bd1df119e5c6df792ff84fb1f1 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 775ec73ad2b82bb53f8dfe198c87e7e682527db9..bdc95297a78730f0066077c84f97b0a175f40965 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 405c3f3836a67a2773dc1626a96973c9f03f9845..d33cba9f64065ea16906ef5c03bcc3be9221c653 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 1bfd17e48c664858a623f06f72370801ee6349b8..51fa309b18d7c1417b59d7459ed4d5e971933e81 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 54a6ab1b031c478485d9dc72ce80732064b4da8a..6b3343a6831754d1a1e2885678f4216efddcaaeb 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 3bbcef8da773984de456c880b27669126d924f91..c343b9361f5e53af22b4be56372b0f9ea7afd654 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 d7658e1ffc8fb708d202d84ed06d1fcf4fb13c11..e4a774329e4861641be58cece8d0769884b47c5a 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 378cadaee4d6296ddd27d8fc0e61305bc2ff7be2..15895d1411da0f6c02c57fa69655a3355c46e530 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 9c594ad08c5387d11a33c5601ee31175395c0c09..a4601b563f82f5c1c76aee840ee3cddd63e2da9b 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 9bd01a66ad252739567c66449ae042d51e01fd84..97a27b5a1a7778962dbec88121ba5c40f79e89f1 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 ab1eae7a1e2a7eebbfc2fed0b6ac9b666613371b..1f71078f7df4c57db3eb4b794defe062baa43780 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 7eebaff7ba3727622d780146ba0013b52c402cec..03f940e854d6cbc78fbed5b62f0993c900fda097 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 a5bd452fd0bf2fbdb3bfa7bb92c383e580236f6d..b8dda80e3c570e1e827ab95dfdc3f8cd4b26af86 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 fa9eaf0eb00d2bdb28f19eb91b0e3b1876826f0a..f824bc9eae21aef064b35ebfcb68c82fdba08adf 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 a5d0e8c0386120ee8929c04f59d5beb21c0cb964..e67e474c42637ecd2f799e3545900e30d458d0f2 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 7d0e500ea58831d7363deb10fa950d9918dbfc6a..6aef9800f590febcaa93424e7b6b5cd6b655e7f7 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 e7a1e846e5a38cc9a3ccaf027fe230cc29f00455..6dd9059e8f09f0e4a074d54133fd412e83fa6d25 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 5dedf1f6e7ffbec9a6c740e65b501cf351d243d7..cfd5f2a8664678c53b6a6b3549336c87c89c00f4 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 ee421a1973bcc8a3039e5762589e1bf12852ac67..3765e725454d17ce2327cf8ad5a646d6b81cf224 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 bbc25e325de1f87cdea2f43aae274887c65a4c3c..ee9ab09ded71e535d2eb17ad59f7a6858f012afb 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 9541792012e1a78f1a05930b321b532280606963..5d44ea71f9f1a53dea4437b79d3c4d3a2ec98a12 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 ee106c677a502be01fc9d9e8323b8bff815f33fc..d7b8ced94a4006b40578e4d6794148372eb07de7 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 c81ffd374a23bf91d7414db0acbea6b85a54442a..03b421c0bfa36c73de5fd9c85572a77a5955bc4a 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 d323c1ff926ea8f1c2a5819f82e2dcccbe830b0e..9b110d1a45fac3fd769bd8c2e100905336880047 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 b03526e5012a21c2f5fe2919a31fae341dc2f47c..dc48776d7b67035b7cfc84e8d14aa18110a28f47 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 afe03e9aed26e66f892f7faa5a7813de0d3c809f..45ec8306881a4bda1e6875fc168186f7a025e5f2 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 3c68b8fd9931423b100933edc4013da4013fcf39..3ce4921162f45a30ff96a69bb9e2d45af23a6ebd 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 b6a8f56c66bfafe80a1f9301cd58ea4989ba809a..3f3ce10a5371dad774d8b2d515e4d09f7b0d9fa2 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 a31eb1dfe5d741f1058d2990804976d3e48e2f70..9d24c83e28bf7934f26edf5fa81a05583a9225af 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 8ecabf3609740b16d58bf22d57c8f7693026a628..f000839201a1b65d5c1882ed07077fa650498942 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 d5392679b3d516ed6c5ad143740d5af1bb44985b..729fa18faaa2ace03264c8bc70a2f45b1e351b4e 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 5e020c637ab295d7c4798bdbcea3daaa9f054734..ebf55a551ccad228605649557c9bec0248363b7a 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 5e1964956ca535a5a0b1fe65e21302257073180c..066a4c8afe7550f0773099ae1d559df5acb4789f 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 b5cf923e87268fd7a5c69a40da56d9f1e26960ca..569e59b9ea9715d3186c74369911b7f20e0d5ce4 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 26037048b20dbeea07d0812e820ef7dda2e23b03..31171b3b59f6881e2da4a1b37af08aa94b8eec36 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 6183f8cfd6e2312c9e0506ca5fa3b1e4830e8512..1160e43e60a966d78d447d2e3cfe7ff78c65b429 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 1d4f8b604ce370bba1fad46f23e95324b1822fa3..c1ebfcf80a1a7d56aa3db9a24ee1f1d1b3c2ec66 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 c3936292a51d053639af45ca213dc4aab98be007..228c68c8d855a8ff852f111eec00ceb0ac98525f 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 93b784480e57e6271c75fa2f2e5d478602d9b8f6..f3d13ad0fdcb2851fc2e603c4fad55c5e8dd2324 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 dca15fa2b2d98d5203fef8cdc14a2d41fe6416a8..8a46c621de1dae250e8f3ee8b745519feb1908f3 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 32a3e74dc5ce03adfac1550370cb4505a9316070..26dfeeec46fc9e2c52098e142667f5471f2eb941 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 6f158da0420fa29f00e4e0efb97cedf387305411..693a563c9ed86a45ed13785b621d05df8e6a8c24 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 515f6e5f5d729de789e40d9e698d79c110c3d393..5c5400da5276fd582579a02a2a766ac40bcbbceb 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 a7324e8dbd7635741f59263c47b6f2698ec361d3..d3c264aad09deda52ad242bfe966c281dae68049 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 5fa6f7099f07a6a4a6a2e13aa716c77c76adb03d..8c9a9cdaef235a5ad562dccb8f5c144616914cbc 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 73dcce305ccbefb8c38796375467641b206de72b..15822d3c510029fb98ec05f0bcbe16f2d5b77fce 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 f0d49aeb62a0bb2d7b963069de4f5d92401d8b6c..ca2cbcf2ba359d083a1c43b5e4266bd4a33aef79 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 54bbbe4ddfcec013eb892ad46b5c200413ac3b4b..7dd4de12119e9dc3ae42c3070eea70ab3a8eb8a4 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 4d5dae71b3b44ed4b70ccce41a1cfd076bcb865c..2524aa6237b8aec271f9940b8b348a6e3b4ed35c 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 9c0a8da8920e096741300be9819435ae82c9c01a..969fdd018297a885958735f2a2d2a9628b08518b 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 7082af22c97c1650bba7609759e8ac3b20f481bc..fde2027514ef39192534e5e41f13b8544972358a 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 04b9d03f3deb9ce81d2dc2c0a56016146d02ce5a..fc1d5c5999bba752f059a73b0a3d29efc63f2598 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 ee886f8ec3d13df60e96ef7af55e8d2d32d98783..3d5e82ba5f10a91327bfed8d82dc8120411df2ac 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 f4043c91a9b6d29bfff46b0b1e8c06e12bfa24f9..1e11442cb89bf413ecd66af18ef2c4d3c415258e 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 c83cd884545f588bc5887e5ac8418557f68b50ff..2b243bfa8ee7b9153603a9f909bc3fb31060b19e 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 c4d784e037a0bd9c86d99836f4b93d19c8784823..d4218769e3499fb08907b9f9d880f188b93265ad 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 0713c34b71e7453713acff518daafdd0d9bfecf8..ff26199cc06a1c277311ed50c1b7ce3b71b11fc2 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 da3d950f6a9079a09ce0a1db077fb0a56cc72e31..f4135dd7fa8ae7f86dde4a0bf27e23e87e2de061 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 0cc8591b22f97c27db94d0e7e16f0ac56a0caf6f..46335ce0b06196d490fac4e98cd6c6e2205ad0c5 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 b1b3cf67e59fa57744e88a69d41b7622f7f67c6e..5be3b986d80312cdfd5cde1d846d8830697c9ed1 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 7eb3109d73a227b2d0f8b63fb9297a60e324074b..2e5ca73d567ad1e535ee2583768d6c57c14051da 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 83c8c599c12239f94ab42f52031ddfd99b07a603..8d8d029242e93c72062b3e1179a045671cffa34f 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 674a55414a41bf49174867f8aba434e896c6aebb..5ccb145a900739159bf0d468f736bbc245ef434b 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 2e1e3197a1a1b7ad8f24ea49c1f2c4952c4c468c..922b1aa1f3e19b093ca8ee3f88095d6d71a98c5b 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 3a4a75b6bbfe9cb87bf0eb630ffedfccff8df138..e382a6555ce544163868259c657f2a0b1fe8c26f 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 20313bcc41bd5d471d33d45ebe3d7a5831a8591e..993daf91c26f26a39de3194cdfdd0a15d40044a6 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 6150a34a7d17ffc4f818ecee300d13f7bdd326b6..43ebc17f641fa4446e5aacb1a95e806246145129 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 7c90f1414c8c495174273c349e0731f0f03e1d7e..c1b256e78aea64ea3d8d0b655bcc6ebf089abaf1 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 c3447ebfb155338a080fc92ca177e74c86a19894..d1630684851001098f2678ec4f8c9bdc9fd31985 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 bca21371f4a284ff3020fcc0bc9b725987d41343..f5b90f6e7b0c259a643d9ab444266593fa50d3f7 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 f651b0fcc49cdcc87ca3121fb04a2c373ce2bacd..f1f958c957acbf22bfd0c03d946b56488a7af146 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 e6d1bc75cecc5ad6582abf9e7343ff098ea32d64..69d2ca6bac7e15b38612185e6983858ced435fe9 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 7fd9744dee372bbf760610c816ec78220413afc4..8c4e9ef4cb5bdbb6cca9e5918a5d78484fb0cc9a 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 9d1d54386b47bb1c490fbd6929bc7fc2f669d775..55819cbebc54e11098a4bdc001ea0fba00e6f08f 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 4b66af6eae353b45330eedbd3e6b335ee267d415..a11ba441d7d8e0e2351677a46b27f18f958fc3e9 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 5c7f27fd3294a40c037da09cda4ea2eaa42fd595..0cda514e10bfa05b90bccfa87e0c8ebc27a53cae 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 f96b9a06f83d8747cf6ff210a65f4d4a0ee694d3..7c54c6e207fe26a32b5d18a2e3b250f9638a42ae 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 ee96db93a61d78da79f840e9e8a0593f0424ba3a..8fdf6c93d82ec56388d3a649ededc505bf3ec19d 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 fe3b1156dc09efdf469a7f64b6a8804bd31d8593..ab6748e36f740debc2edcb8274c0ffd4805d2b32 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 d3d8b626151e6e3dbe9c45c9be3369017aa9f971..947741a302d224f06f5974d45f79aa33c365992d 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 8c44b25306e7e9c8ea6d5776f734b5f7f1d5f500..253b43ecef30f529e5c633832d3ba3cc39afcbbf 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 a0e918f4716a8940132a207962ec44a02c2963e4..db8cc74b3624bb0750428005e2b21839b140b6b3 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 2c198f27d3cfb7dadfe9cde5a87741da9250ce8e..c7e7ec5e39101fe2ef7c90e529fa7bc486fad4dc 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 69939a8f18068ed3a09986a7af917a134bf710a1..c9248f34cf72fdf00009c079b4477a02750d75ae 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 266212fed071ecb2a09bc1e0103b98fb1bbcc974..3a4da07f44ade64f5ec074ae6777d819c25b4d20 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 43bba70e0f814041bfe1e3b6401ca38be67b8219..6119541323d76a8ac291e43b65586d361cb83134 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 a083244e43a5a0b4801672866ae9797df86d5843..ff121718a2d073f1b4ca4989bdfb7378199354b2 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 06965aeaf0e7077ba41d30de990f62730428af94..06e06cf0cea574c91f77a588b59cf7385e1b33d7 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 9c1acac202b019cc658594d2b91f07dfd78cc4bc..3b0a5c809dd2f2db8651bad30092d8ee58330867 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 5f424ba1c6ea838506cd491a189b5dc78284e54d..12c7d69e6db23aa1b954fb19e4ded5ee040a936f 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 6d211d0d2e0d62ae5ca94ee5751077b112754c80..cbfbdcc4293f4c6ef14f1671f114dd6892a19599 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 d9dc9f255cd82691c956f641611a64dd658e6ea5..ce44db54f380ac350cf7867401504342708ba6ab 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 c40ec601c959d7510ea4c3536ef0faf3bd705ee6..5f7e9f26ec96d988b8cf03f3307ea92b0217723f 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 950db39599e4d0cea99e91e6a79d113b0116b90b..f323d09c74d74c4da7726a69d0fc8dd4472f6421 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 ae1aa6b628c1d7ad651c07e435fa52f0a9a3fa13..51e9f9196051445abb213f0ad503dfe66d671b30 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 d10c295443523ef48dd69cfbab3c17d7b38f4d93..421809d48b220e11d427a9646540ee3595e3f4b8 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 56c8a93820c8dedbcde7b74b7f78e889c590c0ea..b872dcf6bccc8fae8a8c46d9a368603e45dff620 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 f057656e027ff5eda5dbb7315bef3c830fceec89..1fa6a4cc51b5f09d4d89ed3db57aacf8f582e067 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 f61150b3dfdc32c73567a242e064edd011e10606..b41aed0433eb5b2ab94e361e81b284c8f4b25946 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 5c6425b47c42c6bfce6ca7edcc7c0e381b2b658e..ef6be6f1a0d419047c61be788b380d5e5c973a5b 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 4829382c4015512b938314bd3ee13d442da607dc..294775f55f61ec814a575af4f266fd2f180726c2 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 bf18d1ba986113896b476f1d76f1c703f818f4a1..7aeeec0871f7b22a0e37f68815cf9e07426fc432 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 d83f9c9b23396eec81b52998ead5ba8ebf134bb9..60f246d18d29d5ca01c1afd81d436b132cbc4f3d 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 009e8ba4365c4aec2ab878504c998d48a2b6e107..73d2f3f9ecd0a24de4cc897cbd8eefe340c6d9cb 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 40579776eea0e819673a4a6a0c9edabd994e3360..42b0e39a401d5ca41cdeaaa3ec48213d548736f6 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 624b0186295108bfaa53430965a80ee1cc279ab8..8c49aacf575358b9592688d4f1c6f3d794243cad 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 2d206af2262b3a057dad2d9f176c7651ae3f39b4..f04a1dc0b1d414178fb15be54013efaa0a0a1107 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 b06bf05221373e5402e2d3e016f9598b753a0f84..6607ecb71ceac8803f83be6532ada7c1d956a250 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 61603cee56b167eddd8cc18d69301a678976f67a..9e4d1ee435f79d138d527c03a04ad7104c4398be 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 f3cca131aebec20c510501c5410f1b5de2238df0..badbb8372b7139065360c61d0b71f7ac284b5da2 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 739fe86a50b625a55d22c59f7db334108cd2a1d6..e70fbe7ccb87756fea3258cfd24b6ae6450293e1 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 ece0e67bedb98bc037ab70bf4f2ca6d4a6d1b32d..267724760735f72702e4d31594419321b968109b 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 2634c38c8c2c1b0de7903f9a011018b6c324f69f..5ec211b583f4e893e43b40a738a3b67170741462 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 1ad0fad33297eee47009188a2eedfd0779c8507d..2e03a306bb5e78ced7bb3f7b70c7e6c4cdae7309 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 73e17468200cc160f1ebd05e6088e6c16222445a..35484650af90ae1c9a1bc1543ec5453dacfda127 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 ee7ad7aefe26974dc00ab0de7f1f2833d9d69567..dfeedc09b69987228e070667d0ae3b45451f3e4b 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 521047fff17b62534a5786ec909bb67120e1732b..4eedab1387e99ae1853b5b81d38c308c07d40369 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 1fdda8120809ec71dbd8c4eb0802127d487932c9..01f512be9475d4ebb999728e9adfb954907572de 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 1e9096b2305ecf6efcf6ce915cd9e84d02a067ca..005cdde1fc22373514d6e238d1a37ff87512eebf 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 8919d82f5760c929affa3a0cd4dc9cf66148da8f..304813209fc1d13de18d08ff1cb960603c0309d7 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 ad55764574c37b747a6f064a91201b18b91b84ff..077c9da4006e7d09dd10789d6f6848f39765f9a4 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 46744f8f8260f4b3cc53d07e6092fe3ad20fd8c2..d6927854d1dd029522917fb5e54ee101ea3feb53 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 47567ddd8030d54fa2b69164d77f0134cec20f86..72dae78eadc55867ee2e77ca7187f8e5d0ff457c 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 63ccfca8aa6a86ee761a9d6cd7f77480c12baad0..41694044d9d4e0c0333f3d8dcd3ff3bbddffd046 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 22118c3fd7d176b5cdff1c44fd7e8c32249e9ce2..1c52d704392260dcef0717db20412648c323a470 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 24a575ff98bc525022c860ef4d210219ed38feb4..d9beb018ace91d92b0768a63d26b16548882d059 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 50f4a71488d21e4df1598b5fe6558248efa5fdac..9b0ec49d1606489531b67635627e6506ba2ea7b8 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 bbfe452504133b1d6cd3da51fb90c83c0c49d981..e35318db966d0b793e5195f7939c83949955655c 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 34848d9c9101cc396fffa68242f793b19c29313f..a2d15a1f3dbd50d3502e394ee766b50e0a42912c 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 5daea50ad2cc3e8c8458ddb4cd20b2b1a4b9a82c..57bf9f199463a5bc8f99c822927277664b038aad 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 998100f80716bac269aad328fe3a52c20d533955..539b7f3dad110b30d44a7ae1133a7c4009d91a6b 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 4565112c19283f6d46c84423525b68287549df15..39fb3437db27e971fa7fbbc59820fd2ae9505708 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 ed5086e4d01768b55f49f182cf0c9ca4164c9b44..581a423930f75ae649de3521d964fbabfb3ca287 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 7446670559eed484d145cf98e3e277dedec10bd4..1df6212359733c0fda9e5509002d544bc645a593 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 0cca4b0f9d6c19976e5ded4fc26b584b4833565c..be8f4a24edc240cd5ba2d52147bdf480132ba0aa 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 521f60e554e34886510a1cbdb4b0baa46e198dbf..58f4bc6076b5409b7a18f5e230d535181ae087ce 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 19ef649e4723d03f235e3727d34972f6f352f0b1..f1c3dd6ed88b9273527e1e9179db617cfce8ad76 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 8528322f2bf3dc5ad983d79273d39f89097307f8..711177ec32090ac6e55aee5eaaa0718fa0901cc7 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 c2897589e0ecf9b2704f691510252f0904c984a8..51f66e4fcc45b7e734c8a05334f428e92bf91b53 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 a17ef6300dc7c380a82802211095d9e16a721b72..dce1d19825cf5c9100be5844d01a60bc2d51b113 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 77b9b84d25c2d38eb9f6fe2cbade3f83449f3181..7c0be1ea2068d2615690ec77d0c7ca90b19788cc 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 55b81b2ee38b3ceca838e3c6e052fa6f91af9146..e4cb908f187ef8c8691ddbba2b28414f764a38dd 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 fe8b0a0cac6b0e186d25f4a9b1d8fd083eed0f96..324486254d3e5d6ef85e5ae3c82eb223178c6638 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 a11c195409f398acedf81ae2bcb371c7f0f5106d..1ec8ba26e17cb905cb9ef3dbd11ceb5b1b5b229c 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 918ffc0657e2f0cd8954d21bc06f9e40f72444e8..f9cfd466e85bf63b436450fa0d30436c7fff670d 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 1db09ca139430ca5d253dd0e1d772df373af9a34..4dd3d2acc6c46f175b800c66a0e24106483e28c0 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 1c9280207944c7c5f68676f710b4aa866cc87193..2ac2721e4eaa987d753f95d87b3c5d8d1f3d23e0 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 84da8c2143bdf26dca3ba125d87ee2f8cf025d2a..3d6a53a138f3715af8ee99c601accd2b2284735e 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 ef0401fbca20053031e2bd3ef1d242aec8917064..ddc0d45fd804106b0ed8f604c95b41a99af896f0 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 c7e23fe5678c1406369dbc005f8342ca5ff45362..ba12651df79ad93c760775407d01e4c45db607af 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 69edeae8557324816dd4515b380108ab72269377..f5e97d48bccc93c4183ebaeb6224f813f8bfc7cd 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 95da50c5bff8926cb7901788b64f34871e64df2b..75835260d05b85dfd03cafe9c8691b01aec01c5a 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 a98b6749918d60247706d69efd5045d63508ba85..493d47272e95cf778481a920d987a77c0d6b9e61 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 16f40c74ed2171dfd9bd3a238007686b8cfa9881..cc2f2619fbf245fd785c9534f32418a6abcc8bd6 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 0c3ecacb67648047174387842274c4488779a794..63055667028d2abb58ae5edc9cf7e34326d4cf71 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 efe31c973c9cbb2a6ddd1ad112b57d6c045bcbdf..4d286af605d36a824898caeb5cccfb96182acaa0 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 d9da1cab03f91b731e8b9d565cddd81ae8b9c215..42b0fc984ffa05c3b75219a93adfde558defb705 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 63f1e39ae814de6d40247cc10c7fb3b485bd5890..95325ca579d614a77809d8dca36233446ea78429 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 6065b31b1f89db076f7eecfcbbcb889ffa1b3e0b..458f9108124fc62bda3c0464c7578b8d914a6e0b 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 5a5a344853da3109342a48d197cd38830784e313..10f52c7b6f5bbb8886c49429d38dadb6b67a7aa5 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 4b180676ecc7a83b6913709edfe6843382c4496a..4bbf49952dfff907a4db29bc1a46733064f01096 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 9408120165706cb83a5aa8db1fec6464fa74fd9b..aa1d02a63b9967bc51991c22aabab2d836698351 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 cf0e206c947c7aa5610d876a628d0fbb8166f448..21b173ada9e67288ab62c8a45eb4ec880f3ebe07 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 bdb69f03f2a97381cd2ff922d88d41c56f659486..5f3b7902555868a512c7a996d5d676893391c0c7 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 f0d31794c09d22aa2c24d3652e09792ef7591437..eb8e8940befdeb736b3818cf75204ff550f8e5cf 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 ebe3745b8ee1dad361271a377e1c125f72e1ee31..094c6a794ebf5553ce998b14fcddb83f1ae3b9e4 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 6d0ff515b8317029e36ed31c8d06b3ae41c36bcd..0e49947c4b8574fd235132bb299c1a78f5657f4b 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 6f9d42020c3c0205550c97de44e3bac7d298d3aa..668962983156d6dc934d1b09d75b22fd21345fe6 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 e8c97cd9e7d23c73bb2f635764c1a089efe604c3..83c1da60351929b013c27d3a0f613a9c95af57e7 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 1ad5c7a3fba5bb7323c8cc9afdaeb456f5cae8d4..94048fae283f71bfe6a0a7ad1aac595792289b49 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 9b137c1395d96e772aeca4577b0e8a18cfd9ff3d..24a55869bb168b4fe11fbaf134f405dbe1a3414e 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 d67d2fbe20c86894137acdc88bbc0c7d7ef41d5a..270cf9e80f69e8538a813e51951dc0a9ae51ce15 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 9ef4b0c65d6075ad483c40dc9c45c4a2657f5e84..d49dac0d885be3080e3724113b6704b50d8ad996 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 2e77bd127f12243f420aa2dc7d742d02ccc415a7..8e66d2a5c630415dac6c9da78ba153e3f39ccdc4 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 31c6e38efeba06b324205dc106f612b62f3b4dcf..62af267be9a4b2fb89374fa38a95a38ee4104cb4 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 299821a9e45b41e1393897d7e44ca02bb00b72a0..d48999e11702a092160af876d7fef9367207edce 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 73d763393d4d08e382bf6071dd378f787e6a0925..9765c7df4b4bcfaf094f730820257ab2113e88d1 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 dab4b280f761bfabb40b7ad0b7993c75d9299ed0..215fdca2a54b364beda74b70230c9d59fd1347bb 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 88f7ff642964e740dbccaff44e5162cb9bf409c2..535ff8c8b05c83baa035fc8661212c8793688cb4 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 bc6c7c7ee000a06acc491e69052d3178e5147c2c..bbb473ffcb8980953fcce71b279fcbf138836cf6 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 42daccd257f32bf4699a96d4bf20ad179c06a17f..4af8bdb088e74331668b1fa0da28674f2b002a2d 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 14803fd06e066a6070ad3c3f587b75acaf523bc5..344b90123e259ee9f49c637329381e1fdcf082bd 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 79a9556050ca15c710cf234c0e3bd2019701bfe9..0087f7834a7c48d74aa6f9141534d36393e916d1 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 5426403156c9a4cfc3c99ac749cc9dd3950e8196..e60bd4e5bddaaa8d5735bbabf674abb2381c3e75 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 79a9556050ca15c710cf234c0e3bd2019701bfe9..0087f7834a7c48d74aa6f9141534d36393e916d1 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 0a38ce4f6bb0f5c64bc9e6ceb6b9b3854624fd86..6a0c3a25f9ed413626c741f99e047902bfcd8088 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 cb7957d4f53dd9b42a09141f3fba1047f18f65b8..79a17d6f8d4feab1ab222033a1d1f516fc849006 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 d252300c07e88310465abfbb4f3c46cf4a583e78..fef92544c22789605b8716790113531c2a35fba1 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 06163a609098045837f4d1a8ddc704c2415c811a..3e55dbcf9736e80c6d320d0a14f52e6fa73df0c0 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 12efdbf580bd5ffa93ebd86b0350f987c18b80fb..33e6a7ab976f9c3b4e146ecf993f3387cfb717b7 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 80ff5f053aad70c6340d2055bf2d841cdfdf20cd..f26ff0ba1522fa6d4c9dd19f5ec371b94c44ed78 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 d52da61e853951a5cf18c582ac4da00011d0f7b8..edec314746d0c3586f1bb4807608a164fd898cc7 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 43d02fea40d99f46f4b05a9748cfa5844f5b0c78..00a25494871cf9b565725c50f42126ef105641b3 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 a5876a562b8bdd2c446f8b048baf8d22c64c23b9..e74029a1344e593355c3ea6ce2008645d7cafefd 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 2640b07500db209235afbbb7ddb2d1f9f8e38ac2..3451c36c4adfdf045e1776ed088d21cce4e0041e 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 3e45abc49b153465bb0839a6e1fe777d8f0da5ea..85c004c964b6e5f4432d172e3a75a4881d45fb3c 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 f5d465c36660a8bb2f2921328928792c50c26ef5..be2f080fc3f097db8e1a4906f752d1a4c8f9555e 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 3ea22e0eadfcff91449470cefb1e0bfab4d83280..e563d2926bd3528d9c3ba36aa549b28eacf175e3 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 361a44f802babb6222c1c73b0d290e2568963518..3e5da6903aaa439da92df210ea0c07ea95ea96a6 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 722cbf2b5f3274e666c7a028cfe744f692813192..dbb4614ede6c9f5fa0d209186cd7ca076dd1c8f5 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 fcf5e7837e624fe839a8405bce152fd0637c3b61..137054f2ff341f4702360b6bb217d09d05812ae1 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 207e41f71bd78909bc0bb6ab60e4b794b19a131a..148cc3674fb3b5966ad964fa5d56db2da28524b0 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 6f8d30a3ba94d230f4c572ca7ddea323011469dc..e5f6a1bda85c5fed7c5b00ecece43161beaab42d 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 8967b032b2d26b7b9f5f594c62e04912624e9f3a..50691770a543a3231935c606b972747dbe765b64 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 a3cef8e264a5b018f8f94b41679f35e8951f0a76..4d203acf2d7f773349d30d730fff1977882a38ee 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 6e1bc43fcd2dc7a39f3a67f22032e83e2dbbf3ed..2756ed1a0a06774aedbc8d0c84c64cb76eed4b8a 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 efb6a8aaac2194fd80e0d99c658f2819c2f6f6d0..3f64a0ed26b94bd5caaacf00b54b22c58071d6b4 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 4b196a6eefeb351f5c643bf9d152d39a76aee9ac..a45b6d06bd430f4f80736e6d90a8bef613cfb999 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 f38bf17e2fd5f9b8df9f9005a1775833312a4def..fcf5fc0c2277ec785f734128f4b3833c2c03841c 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 0c2662aa23339d6d60fe5b572e5550e3a403badf..4e5c76ee2fa586f4abff6f52d2e8488c867543d9 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 07b193fd82e0b93c59759c3feb07a5deb099f75a..65983a0f34e49e4738b7a7f5ceb542e0b9134d7f 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 07b193fd82e0b93c59759c3feb07a5deb099f75a..65983a0f34e49e4738b7a7f5ceb542e0b9134d7f 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 07b193fd82e0b93c59759c3feb07a5deb099f75a..65983a0f34e49e4738b7a7f5ceb542e0b9134d7f 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 507fa068eaf937d9ac610019d14b87a512e6ce86..01d9200dea6c4ede5849c2275161b5004c1cb36e 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 e83a5057745d91b9e36aad86effb88b506f15bb7..45a43a5769fd2aa98050634c1499b59fcf92348e 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 e65cbece4052f58c2f4bb3d51648a5cc3fb37127..38100f4c6674728dc1bf0864fd36b797cf023b81 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 7c1780703c3886be1dcb4c39461e9356295ad905..114d307b5b14a7645faa6d791476645d29b42fb6 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 544890a55f1c09b6124230ac03124fdae60a817d..30b6be5e81286c02db9492b58c06e034055800fe 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 490a37f3d01729940dba7f3bc4bb4f2fa170ddb4..eda5228569476520a8ec8d9d22032d31c5762fb6 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 fcd017711b84558144e3a3c697f14530efe8e4df..fc958c4ea7e73158820b3f421e7e182fc08c74df 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 2820e8ad0abfa995be99128abe044ff76191838c..531121e2d03b3b2ca79fd29e475314c9d74920ac 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 48067add85e5c0bfc39133d136c227bada3a9b3d..5eedc4a9b1e8416c73f0c993bb49aa08094abdf3 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 603f52656160180a9825bfd32110f35ec0a80533..bc2fe56c995ac749bc32e700726d22be15734ac5 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 2de66a68b739f9cb0cfbbeb1b77140c832e4fcda..35cfc6e23707648c87b12072450b15315a889eab 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 284ca8c2526bc99eb3e5909e7f5e5ee2218494d8..63018a70f4c3c71e187d0f11e0fbe4b41574b470 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 515d11801b493f15f149064ebb45f74b26e810ee..6d99e3b743755c4e7798f54373a6700f52bb34bc 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 222aaedbdbc2ce3ad9cab41fe23907732da615a0..12628d2dd0a2a593f08dc0e3a9325b58ca7c7c73 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 24cb0150fe323e54067bcacb289ffe5229adb2e0..5605cb4923dd42d2ffa7a872f96cfd9e4c8b1ceb 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 658041327c85c137a83acb9bc7db9ba107628a9c..8f853303b6d6a0069824a7ec0486fbf053a7449e 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 9d5d71b8dbdf940c46fbb7c1b74e66cb5669d960..ab13664904c4d52c20990ee90e47d70f0c5a46ad 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 a8db824a9985721447bd1650b1926cac1945c3e3..3d966cbf5a8450e3beafa620212d5c940b05cae4 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 80836bd17950276eea991353ce28e9732f1cef8e..81871c1af2fc2ce6b8d877043fb90d8c2eb6ec41 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 80cafc6c2472c915764724bf78b264e035d6d759..909a5cc2578fdfe06a79305db97213fcb06565c8 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 d329344e7c96a836da971c3ca531c4ff2461f7f3..bf955b6c0e2c049b6f2fe818f1d8b83387bedc1f 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 292f24aa8a88b5aa30ea2c1c4670b823fa757196..c833f323924602d3c551bdf81fe4f659a43fda14 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 745ee813daad55676fda385066ac1e9362220c86..334b449b5b5b0dd536a2a7c6bb537e182786489b 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 036a034e847683a50b7708d57b9912aa5c701065..daf32ea78e2ce280cd420ef2ba02313658e70bf2 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 07d44377103cefc08b38eba79239c5be1a9ab71b..49191543c8299dd4cb67580aa0b3558085a0f1ea 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 33a52bdc998dcbff4923b73ee7fcb441168f38bf..ba658d1d47f30054112a287bae0cd47a4cc029df 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 48067add85e5c0bfc39133d136c227bada3a9b3d..5eedc4a9b1e8416c73f0c993bb49aa08094abdf3 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 48067add85e5c0bfc39133d136c227bada3a9b3d..5eedc4a9b1e8416c73f0c993bb49aa08094abdf3 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 69b4432a9b3164a0aff7314c53b4d9f1e0943bdd..a613d76300f3cbe3f13b87bbe9294565e362c0ff 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 ebff7d171d4a9d7ab67d41f3e802f02a8460891f..e865029e4137454ad072cb274c3c31586e1080a9 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 50a74ae0678f71c2837d54f7ed15483f83d46add..d612d6e248bb86d5507c51f230bea67cd28b2255 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 6ce3fb6b6fa9f7591e2ab2f4e7aed2dd5d0799db..02d2abde39cebc9895ef2f8f3012fd1bd089a90f 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 f5870180c0815d27d1f55bfec18873b99561b3c4..e4e117f6c07e727423800e4a0fb5b0d3ab201d63 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 f48d7c35ff8c81724ae97a4c62ca4454b60905c9..32ed38ead9c234dd58aad3bb6e45af4ba5c18370 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 73e67546700256b54b92495dfdd3acf5fd415f12..6b26f4da4e27dd9d0be34ab40530c17e65d34936 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 ff4a8e7d5b1bc62c00630187ac751e9bddc1ecc8..a3d4501f86856f57a875aaca427174b58a7de347 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 4ad2829661cb2483a3db463983f636881f8a382c..28bdb1ba997cad60185d5798f2d98410141d614e 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 9f76573801c14cff04d5de71b769b8a6e36f09ee..6d7cd9315f214b5aa7f9a5ed9d23d355150b8fd4 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 29554852390cc83391446304c6827e40a63a8cc2..2bd1ce6c56d7c930c0a12cda28552215b6b26bec 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 beb0f2e267377cbbacb4806e6fbf47858dada4e5..db0ff15e5bb3b1e8e0905ae429a111798152b100 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 69d12361934305c68e4fdcf44cb9d6a2793e6933..c0fad8a8f77bc2616c4d4f9ff65b6cd59a6abcbe 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 85932092a0731aa4eefe35c3c6ca4f7af6d4f0ac..5092f8f034035e132d98973793824422f322ed8c 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 ea3e41e004a8fc11a3a9eae9ca0462438680614c..749ff370fd942407e687d59f29e327ec3c541352 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 5df208ce60db2534200a8086d1f8b7763395e5bb..b7f51afa31caaed7e9087a15cf206e5f1cf97be4 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 d4044d9c6f9ed23d32ce42571941fb4e92800fbe..b9afce4e09f2bf3c13b66f81c2e74577822f1f76 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 01758234c04cbd28d541e49b7bf2bd07ff28913c..5b7268866102dca8c4564221203e42c6cf6e1ff7 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 a4dedd19f3ad4f0cfedadefb77b2fdf175ef3946..e08f2cfa599ded882a78eda6c63f59db0777fe51 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 152a5f8e80095612e76eb04bb422dd0288903eca..76146a737cb0874d26771651b2e63d48cd4f21e5 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 9bddb412049657f11ec4293b1e7079812fc3b0a6..02214bd830087ab230839cecbc6d9024242b05af 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 9ce3e5af5efdce1084c98fc396883b6c5c339553..923426dfed209c4c97c6f1600149778b4e40a8e6 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 9ce3e5af5efdce1084c98fc396883b6c5c339553..923426dfed209c4c97c6f1600149778b4e40a8e6 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 9ce3e5af5efdce1084c98fc396883b6c5c339553..923426dfed209c4c97c6f1600149778b4e40a8e6 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 4270861ece52d0c5b2c417f9b9189d9ecd9204a1..eea70bf670dc01bc05e66e2efd2b57823a58e155 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 42c19d27f44666ab0ccdfd01c325fb23dab7891c..898a767e1499e82fc0519ada5803c0df91dca79d 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 34b7912b9a75e639746422c3458a407d94fa9b71..9f4f356f141408e95e32b38fbccf1cca3cd601af 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 6d29caf14b61c83852f31b06dcfd83d06ad843a6..8a00cfffac4f49c252019cef13531e8cd95a6375 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 55651486ce7f92f5ce6ff3cee100c6b5d61049e1..3811ac2d82c1b02fd97fce751f0462ba2c220db4 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 c606099e37520f41cd7fece2af06dfdae7d8fdb7..bf5f11ba9acad4ac9ede3bebba4fe6f21905f1a6 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 eb9e26ebf8499378db045d80a4fd7ef822f2708d..0d28f647953f7d421c22cbe794e1f1b833029330 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 00bca9005fef201fa9ae89091c9295c28a8927b9..5d3c18a0fdc5fe49ae3c9688a657411aff5962bc 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 549665c718440eca4c789cef009e471474890a02..854c7ed702f27babf6c4d386a21d7fa6fb7481e6 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 527596025f06eb069500779cad002f060b6351d5..a586b90459f5476e3b2933397882bfd8cac041e6 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 833f5915a7f01231b6f367080ba73f45b4c4aa95..d766e4fd7b235cf174ee952b80af26519e666b09 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 73cb94648b78cef50484952f37c44162b6ec62ea..0a831e6c55a3703c90f0e0100fd6e5b9c4369363 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 7d178481896723bf9c9e47a690eae89bc5f75328..b6c8e99c2dda20455deab87acf0db3c84ce1912a 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 75dadd75ab1563416417511927ccde19a1370bfa..aa7769dd7d0fccbf6351f683d3d51f1d937e3c1c 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 bae8637cc6ab65ac7b582012534fb9dba2b2e14b..d504d5e6034f4252102c4c016b3f98f745e3edbe 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 bb5d60584aafeb73129a052214a1d163e5f215ff..8bba4ffab8992b6849e52f0439230334a75c93d7 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 68b21e92f58ce03b2f003eb0f70570fb4cf53aef..5d150196e94c9d8a865e4b36279b6e2222240ae5 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 5c3584e7e696157baf1f89420c608e666f66b002..f24393bd22ee388668169aeaf3dbafcc139003d1 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 cf9b45609b578cad66d8eb6ed296b929f8ea1200..fab4324bdbbe676b8e32c0d058d77b99bba09d48 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 36d1da95da0d4668dbee9ce7546256583e185ead..b123dc86ce703f8e17f9be178e64987dd4693f62 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 46e88137f382df667e04e6052f757136603e0fe9..c8f921bc3503af52c1e9fe63cedc57de4c143eb9 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 c7a531d0f557910151f2bbdf645d5ca548b8fead..f3b52c6c08903e4f98eb4b65be274c15958356b2 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 ff7583645d586ed5cf2ac572dca8fbd33ca63515..2901743049e6241de0a598e08b27bad9486d696e 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 208dc8ed7543c4fba4a835471ef70f2edfc0eccc..9a54e4feab7c0c53a8e8c2e97059550e717563ad 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 4e2ec064f3fa28e128c0f0bbafc29e1f1a6bf4fe..f16c687bc327589cd0618da38d29214d07af8c28 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 baede765ccc7b72507f264ae73a35904ea06f38d..442af72558b5bfdd72f9c6abda99fd89a73d0e7e 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 5f4c10503ea9cd2db4f6919ac5b2d4b8c8027804..14bfdda4daf5ec877592f8099732a7a04aca341c 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 a90627802ae2bd0c45a0033fd9f31df9ea2bd1c4..b8a4b08108c6f7de18b83f35c08d6170567a1d19 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 4cf3b2d88492c005e3d814a77e61dd112a754f3b..5afec9676f9e959038d3d56926f6de7e6c25c770 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 13adff8e0372c0c1b12caacc8272eaad8fe45d07..31c01f86a2428eb557ec27d2fb4fe3cbd7f33d0a 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 8569ba58ecd76e112b7539f781159de63e492e50..c2fbe5c8e9fa4f6007650c3cb8e5fb19afc72a81 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 2969f11ad8e80a8607a792068953f969df4d712c..ebe96e94e76d1e4d18535dc76536379149ed090d 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 16fa963d0695c54b541a3f738238b307f62f9932..80342f8850d75fa40cd6bf4c052dc7dd816f702d 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 4285781bc1e5855bfbaab5d7f2f2ecdae8891d62..e6e498d827fff3f6bf70c3bd325d96d3bd38afe5 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 0dffc9f28edb567f0664fef1f6fbc66e8b46b3f2..1c94c53771a46052650fb27b70e0dce715e25c58 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 8158a700a38b4db367027f9ef2440a070ef54c3e..3decf49615de7ea079f2f157b111c2891d1babcc 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 39df520ac662fe3716656fb3f87c9bc395c75adb..9d77d560f11086d97d9352387a3d595b28a92dca 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 96d4901b9db3017e85922d65800a6be6d8797e95..2157414986e407a52f8bf07f56667993ccd8b1e4 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 1ba685231ada3eed4ff1c15fe679d3e7f8eb5596..c929da9c97f64b927704cabff10fe40606e1c16a 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 4911c4f4c16663d1ccce8650817090d65dc1162f..2812c0f315f8b160d5660bea333fcdc01b4a4512 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 a1391e4ebb4379596eec4e792deb29b426983213..9e8370678ecff3f24519b7985b0efd9d741df3b5 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 b9f7e738dc85eae9f62c064d797f72b4c014d16c..90c86be4229e7254a7d5a859b6323e58b6af6127 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 7d402fd6761cae0fd2ce0799afc5147001bf03b4..09b88136e33384233c43dfb8b806aca237fe54e0 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 93e4a90459d55c79cfd55e1c47f07c4725d7fbc5..a56284998830be65dfd8f8346006185a7c3b7f5b 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 5f95af8c77c7fcd7e5976b9ce4378fdb56a0eaef..1a3d2a7fd7d180224032ea4d8515032ad5803c07 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 c2847c9dd9933d759d64b3e5e93490ef050e7b36..7bbbe99d5e4c291165a9b03bfbdd2db4df2bd329 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 9687112845cda7505185133bb0315637819f9d40..1e3639c64df77e894e156611953e26eb6e8a671b 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 336367f920b57d5f49238317018042628a57b878..6ad24df9f9d9cfaf2f79e0167ebdfdc772114510 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 60c502f5931eb9ec88fc7b6287fba5c100743792..cfb5ddd459257c9345d1760ee51263e3d626c96b 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 40b3b48222bf3cfcd52e7669c3d603a9f5284230..fc3a82d9e3685927bea7052d1ef40f053572308d 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 9d7a91fd2371d553925625fb616bf7cbb1c51621..412ee6498890a864414e4ae3ba84216a9ad8d1a9 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 6b8ca767148b983a345e74258ccb084d85c67355..23db0bb873f0adbb316af2529367cb613ebfe22a 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 5e42ddd4fc571626ba3c23752b4c9432212fd0c0..50e5263a64056435b2d1405c7acf7cd1096fc980 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 3b0a6fee19dc78b589b3870953ce2938c890b383..344ce88b4e6d58e5d6270fed16ba9daf554790e0 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 3db868f069c0b7b52dacee06c81d997925542b88..cf8c7b70c34cacda348da4642bd4c60cb0304bf9 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 659202f739e2d3a88a604762e212a2434c9aa4e2..96724fe766d1c23b37ab885265195c699b8a9f25 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 f3e05275f9f6f6a51764bde994e1ba47db4708e9..f728c0bcc8c13803a17b14807b1a0295c516ea93 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 02c9d4dff809ddbd710864461186b06d174f498d..abaa8a5d1a835a10cb9e6949b062127b5c2b0e7a 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 388e9c4b1809e454cfea385c9fa6fe23dee59baa..6a836616ecdf4860630f7fa455fd125eeb1ccac5 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 ba672756b338415a4e328520c4929cb8ff7dce46..d83e4e435c26ffaefd64c8f6ff4467238dc6c712 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 da5c0824bf53ea143840e413d6dfb7ac7c64ec99..55d5147bfd7f58c6c976e49991808874b11461f1 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 dc69d283afcbd9e5e8f67f304fcea6e68fbdfd6e..c195279997d0aecc0dfcf5304f2abbd85830a21d 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 c3baf6c364b82b43d05b6cd65c5f9f0310af7944..1b084b3faf4e4b80e116137e3eefa566178b568e 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 f2ea5635a788529f17d92aa6c1ea8d6562152a55..ebbaabad8710ce24b6238970c4c36ade8f188100 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 836ef92dab753e5f5204093158ccef954b5e6612..30e8f3dbaa3e7e5ffc0fbe6326e1287ec126ae41 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 92b20c4563826e0bd1e8fcd0e0c0e15546c303af..d1e8be28fb84cc43cc59cd00051ca9caa6ebe56f 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 cdf1a298c4c5fb0bbe5c995b991737a2022c12eb..73da488ed78d7609abac5d2d1b4c1ddad3475bc4 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 aadcfd840ac95c614faa82223a6738d3e4287b9b..bb4df9bef6c85c029bde1b5f80e33ac3471c8a85 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 4ab58ae4b22931784513388dd9d07c0f1cac928d..1d801fd07c3ada986372feebbac70b0729f6f7e0 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 31d077c7de472ef1aeff0a2bf3ec5fa924c0986c..01f74e39184877ff6a2632c846e47ab032f8c5ff 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 ec7c8ade37880c1180950bd7c3f2ff3b559bee72..50d4556a893a027dcd118d8528f5666faa4c6728 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 da1241c2ed041ef6d6d11e06b18cfd706f8400a5..0bfbc2a6ef23198cdcf7a805398ec18a0edc2c88 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 0b33cc2e3048c845bbc32aca3889ab38a9aaf81d..9a03c5423956991721982ec6c3f42d55874ca140 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 c5ef809108da98397bd8df90438e02c8a814f7bd..5a86eff4a27c38d14efafb66232b4b9f6d541eb4 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 73c632be25146ef238b52f0e02f26531595ed50f..9dbdcb966d23a9ea7d0fcf32cfdcef03ad083455 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 50d9b7cd67a460a2915fd68cb38a02185d4b8e59..6779880a291e789d90326eceb5aa8ed83209084d 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 dc6976218a84c715d793919b649cba7ae85624a9..aceee8d3fdc51375cc7d430ffd5de2224051c614 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 3708f7e8514448bcd53b8ce458c8d3522ee6a453..849b959e22c18ee0b42b622cda08ee22d4ddf8d5 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 b9c6ff9b5236e3708a19611089d81001ee2ac519..d65518cdcc2ea6fc3478c08517249d1c66941e09 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 bf8f35ab0e6c03eba0c7be77cf07bf608dfca244..553a1f6c39b77ac9ecd5cbd8cd1a902dbe9da9c4 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 fa96eda850f784c6efe41046b87fe9cc67d57ea2..7a3a1d399b374056ee09dd2c225c3441f3755df9 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 3885f2a0ccdf4821f164958d6c99fd48bbfc96cc..5628a42f9435a07e0846ed814ce928255eac1ae1 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 e51d7ce18a03e11fbc2fe9eb24c10f2c1d94aa60..ee5b8475e307ce0ebc26483000b9d6da1dfc98fe 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 8505c94ef12bbdb9fa0867932b6ddff417437445..f841f14fb9056127a85b2ab399700c9ce9aaca3b 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 404521ed9cb9f231ef4dd584cf9276b2c01bcfb9..c83ecc86e0b18c5424e9f6547db2936a47eed35b 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 0e072823e5a821abf280789f75a70170bbf5d549..527e76ee67a97356ca2e7ff95ee9a5655d78f47f 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 6674c9a53d3f38498c69ca0636e3e172203ab0bb..972f81488606909aeb3a07c3c371f4028efc47fb 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 a56f15bd2407853b5fc7093245810c87aa546137..a4f172a5b9b5f9843b9e1e158bdef4ee06f6395f 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 9df9e428d124a9a3b08c0e570cf5c5d491d68349..a529c161d24cee37f3ec6b0aee701ecc4531560c 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 da0b6ba7c3be110dd218a937b35926c55fc80902..99b2fa2cc55dc802327ae2103b2999df264f7181 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 ed1bd3db459814d02653106dfad0b9d42d6b83f8..31aac3259a4f6209570b5428ad7862d8793e860a 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 4edf21e7d274ad1a1e84b1b081b88adf5ab6b384..ede54e9268a82787bfa666cb2b6a626b08c925f0 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 e59bb745bbe098658fe5773d48a6a2132f60bbb8..499b60d13fea7fe943454d2b998fe384fc715885 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 2421a8e202548aefc9ec64fd68233d83ead2346c..d36676266b57315180c1aeae49ab6c168014fee8 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 fdad7cd38a3e23ef6815614494df06cb546b9be6..d295a72ef4266d36811a87db16d18e127fc1b3e2 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 e3cf6a91b781d79ada1c4928da8b5399ceb46efe..ef6dd4fab970a35d6f1f7d6cc1a2318913f0d29e 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 c2458191d1cdcc5b238b6d71a525ac3fe4c282b5..9560355850ebe92a6e00a5cf8f808592e4e79a58 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 80915af328f3f82d138898e9ac41ffdc2872d4da..c6b06cd879166b216746d999c7e0ca812ffc2a97 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 59ed6c252f80160816289e3bbb0120e306c02656..9d36e5d36b35cd7a96950f83bddca318d359e1d0 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 5810589854eaaacf8e1fbe89d7f78570323903bf..e4f6c336bfffd1d95a962dcde897d3f57b1cc160 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 b5e2e0bcd2e932b8a8b55c40a815dc247c7470c6..98e1e968338b5f35627ab762bfe948d35fdb9584 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 df8bd4967d8c9a510308ca7962f647a90ccaac2f..4da54a1e3bf30fdd64461d72e558d3164654a662 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 117efcd614e520370b4b0833516df134a05a1cef..e51eef5243cf0370d54687a8be5e837972b02183 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 3565a97b6e5542dfbd30d3f01bb100538381ee07..d77d0b2bcf48c7e085480fc9c3dba9b79c463041 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 3565a97b6e5542dfbd30d3f01bb100538381ee07..d77d0b2bcf48c7e085480fc9c3dba9b79c463041 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 eaa6da11a6e9421ca60eccacdc90679bfd41ba3e..ff697cfc0036e934e357f4065e8c679f426c3d4f 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 bc48f980693fb51364780966f3996f209e24ce56..fcec4c1165499a2e6a99f2cda286489026dc9366 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 f947ee5ebddc2387ef2849fdacdb35c03eacd69d..06cdadc9d1aeb488c100653abc7d0896c9e6aa9a 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 178bfb4224be845e21eb29fb0ac4039ddf2af55a..fbc425a2860011427173c017d27ccc7cb7d1e2b3 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 64e9d957ce3cf629569f75ea8e5d44f3070c2979..c73cd5d6eec749a8a59a3ed3da5a1ba03319c31a 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 3b39e342ec927a639697d034d5277d83eeac9d91..9251f860c4a8fe6baf1c33cf3dacba2f75ed0aea 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 c570d6e0807678d33778ef3e68f7314db4c8a619..0a099f6238a7920f7f2614c057fdf3ed70b01210 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 18a159656c154359dcd0c7305e27f4fd17222670..e6fb517cd681c668c35f8c87c9a6c399076c0c28 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 9fdeca2e45134e5eb1348283b6752f3a16121267..5397d4a2a719c614c0dd4c30a9e5336a1ade91ce 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 01119afcee5d759714673fd9232ced7760c6c171..f8c1a83aadc8bf912d960057d6980afd8c6749a2 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 54d9a458337008b8c77910ff832e709c9e69b9c6..e64acf4def5c2962fd780bb002611f22795902c6 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 1122cc81d931b594a7a495f18ff873a89cca4143..1e110bb11a063c22566f7d12bae0ee041eb5788b 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 11ad5a3d0c1c6312295af595417f05c10d82d5fa..c969cbb120d67008dded3380cc143800f52bdfe0 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 582dde8d2bbd0d4cb4d78e23516b3c57caf4e2e3..79522d212484460891b07eecfc6bc78915548f0a 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 ec7803cb0d6538b380461c8d18101334c0230777..3a1c9daf3a84319292fff448b2a9dc5c689522e2 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 01b85efb7098947ada554ce00975472f140f683d..2227a0c54ad47cfe1629c7597f6d6e3f92f7591a 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 4d8c9c09c232c913cdb004b1880f32bb863b256e..7e56cfa9381fbb16f240d8bce48c54c98e417c50 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 1390779f242e4287ee551c5c4037a1a0137fec85..3b2d512441b7c5df5fb3c1faa6f1d9c20ac47db8 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 79d61572efc3452ae5e071e1e3e84aaca6340bad..ae5de7dc3543638dfce2c6ab04b19fd6090b3226 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 174775e9b6ad866c17225b22f00706e7b78ef684..2d44a7e686e222a8cfad6b6540795b5aa36d4cee 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 ec6f83611a204cdec4a99f2cc1929f804718c987..e199de9cd59e5c7237eb79390a140335f2e78b16 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 a524f8a96b77b8f7cbda5946607806ced630a853..3d41debd2d82e3d744ec0812dab28e540deacb50 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 810ac6880ea95e6f139325b196e6f1ad8a6d563a..6a7bd253e62b64ef48cbaff7e9b1c26e415a5ad7 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 38019e9ad41ec7f7371b9e4eafd38c08f389bc45..cc5c1e4930c88103eb9a89ab322deffe15e7825e 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 283e7cd8348636d69f28bb0ba4bf261dfb90e6ae..6d0d258492bf9a2295133dfe095e9b3f0f15bf34 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 283e7cd8348636d69f28bb0ba4bf261dfb90e6ae..6d0d258492bf9a2295133dfe095e9b3f0f15bf34 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 283e7cd8348636d69f28bb0ba4bf261dfb90e6ae..6d0d258492bf9a2295133dfe095e9b3f0f15bf34 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 d465bc064b179ed2027347e1cc5e74097dfa1fea..2feece0b42d44db9d1571c9be0fe5351708100b0 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 7d128cb227dfd39e34953462fb23eb053bf1faed..ce7aa395fb6922c075dd602dba63e28848d069c2 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 2c0d4c24966be4107f7f283d9ace31c20c12451e..b0bbc784d7fca8bac4519e8d7bab56db863776db 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 c13b5fa35831b852cb00ac656f2c1ebf4f108109..0e3e837603b9e9080f57e2f651be423293d30040 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 1b1906130a762b7072c6df30254fa470e515872b..ff4cfd48e54835b327fd753ef6cd3f9b415049c4 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 17ececc21bdacbdfe2d134384318708e071cd89f..00ebfff792c01a11ed2196be71935fd2a9cc29c9 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 709ebe16488f3c5319f78f69784cb76bb22ed3ad..4c642d7214b6fbe4db0b0c9250426c7007d4209c 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 e85f47638af417928f3127260750ca201702879e..8085a6c7bb7075dd177be5755c3874d4ebb5c069 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 ec2837070724b1ba763995ac046461ff80a1d55f..f2ab0ac6b7c4b93b72455c45f626c07f60f715fa 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 5942430d68d0d3c06a052f479f7cad19f2c12a53..73277b3402b5e32681c4b92f315baaff24535980 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 a5118f4db62f1d1b6be47bcd40057f29df8b89a2..bea2575e1234545f4da7c3783de8aee043ad2773 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 bc27c272cbae43a50b6a67819f68fddea1ec0516..b2b705015a3133e8dc0eb3fed3009dac78f76e95 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 4fb388bd5163b86aad4a5644c1ff57a05df5e227..ceac149f0e069d20a1a2a32c288fb5c7ef75067c 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 2edaa6e1477ef5ab09114aea757e34cbbbb5478a..28a080b094a5240e0e8fd01e908bc7f6232f0807 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 d1a11ffe6b4b8f61b7974fd658537ff1bac5f107..f7b05555de7d0ba3fcb2315a9f2b693d93f78155 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 ae3c43738de3d47b655ad76fe438b1b1fc6407e5..3678ed41624fb47326d3e40c89378c2e10099f24 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 eb4349c0cb893d67e6f5b13e66a8b4f23eebec46..45106b0809613156a5959f3b4c7fc491ae9cab15 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 ff045cc9276c32ca7f92ccd99096c5c87193d047..82d734bdc261714cd052c4fb4e232de6b9b976a7 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 5a8a33daac2ee3ceb5e53c1910536bf47e66b3fc..7213b27fedf812017ecf284961ad2c92e1786fd5 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 23e9a1cc0fc2153864273dad969648a00f208321..97699ec852a0501e4991ee4657c30ef347a849df 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 3eb7d768e44fd7d41b561de5fd9c6c9d037ecae0..5069dc92d0a1ebc95592f2dc6a130e15aa76f72f 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 1df6d0dd5245dcb901029bade27e5607fa47395e..7435b0a782107366eefabd861a6748257c4dddbb 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 366a00a5b17de24d47a5b4346e51817e5b73345b..9f45c7e9a92fa6e5d6397f268fa3fcc872a50909 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 c10f4bd602c1e9bcc6931a0f35c766c2393b5aee..7db79ac7d83aba55ff80099edaf00d7573293bd3 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 e0bf1c50d6067ee77add8efdff650f45f79cb27e..577e2cdd615c241cb03e2b03683b367ded33fe32 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 966945fa42e3c025116782f54f2d5275e6e38199..59724f338daf44233c33239c282768dfb6d58288 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 ac63294794a4316722ffe6188133d2fbde341f80..6054ab12b8a117dd36cad763810999cb97ebb3cd 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 abc2bd39a1a1de8ff41b609c117ed4d895055b72..a7dce05b88e1064f15b401c4150b83b6057585a4 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 541fd7034a3aa9684bc0879202b59492cac77756..931cd162749ae55320dfb273c920b44b4efcf1ff 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 6abf0d6bf66139b068422fd9a4dbcce2f30445b4..949a56728296de50705447bb9815b68ba21a0e07 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 10edaab397fdd54936ce1c779fccdbba4727cdb5..f830efb2a5989253bcba6f61f39096772d3c8a46 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 303e3bdeb86c1ead3efe528b21ba3414ed2d0199..d23e6f2f3727a73b2b4565718fcca07a01456c7c 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 bcae462825b5b70aaa674de957f02bc95e1c6c78..e75de7f921e6f5729858ec4d16f3a07d6d20474f 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 fbab86dfbc704a1bcdcf7256fd413d2ce39d8995..82ac451161a7c2132874375d427cd86300b2cb8d 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 fbc8fc1dba283b71d5831cb68d46f3b073eedbf3..0e0bf1cfceae94f895b1d0be0c6750861762b103 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 4f4015d9c34a552a9ed8d7b8ba45b23a3178bd91..0380c23e6e17c9e1cce2114a81264e99fbdb5f13 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 ead73d7a0d5e5fad69889346c26a8bc721f0a5bc..d9a49b42a50c6b9f3192cbe2bb878a6c9f8e4cf2 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 d2e1b478ddc9b4f48d2ac126badbdc2f2f4b5e00..6bb326b9a5a4c366b1263d4206bfd90c4f58372c 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 ba284a70f169c3bc90f7d7c40fc244a559b4e5ba..039f4084bc188df4fdcc5d70e3bffc5294371b69 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 3399417962ba2c25d8b872a387fd1b9991149289..66de75d180eb521bf4b707277292f376e6e775a4 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 ce52d7e17fe2061c6473413f7a1f90fd6a35441d..0a87df6bea404666bd3c14578af32edab2121f1c 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 a9e0564332f67653c4de872991ad9180d02402fa..1cc0d2a0b82cc36edcda561fbdb95dc03891d81f 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 757a2f2d527b0b30a36631e500a20f0445d07637..c38762e7c08bacddfdeb33d33c381092d070d147 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 41dabf7e31630bb185468d0e8dba4dfd9b600df8..211991afdf8a9e7df3a709436620708cc65a6b45 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 6e69d986c533de9004517a62699f3b26575ac6b0..3dacf3bc374ac573ee23701ab567f1ff2c08c7d5 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 ff0b05f81b4a3e256dd87f69241afb740c6b5c48..d7e756bf5a6d85a16aefecb0a31e7dfdea765150 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 ad2e6aa42cd8494d11cab4cb60a65095ffafb470..38971e59c6ba623df3e90cf725fe2f4f38577ec4 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 003612c9bf3fde4e68d00bcaf18e98f9896cc9d0..e55deaac9368fd6d7845ad9f9dc4846b54b17d14 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 768ba5299d052486d9d7aec4afb23430e714ef3e..2efa58fab554b6da83720bd1201b557d6ade797e 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 bf41e8daacb6973e8ff35db4db819a73a76117df..3eddf8aec11d1f92562d0ed60c00a87ae88a3c59 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 bf41e8daacb6973e8ff35db4db819a73a76117df..3eddf8aec11d1f92562d0ed60c00a87ae88a3c59 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 bf41e8daacb6973e8ff35db4db819a73a76117df..3eddf8aec11d1f92562d0ed60c00a87ae88a3c59 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 98fef5f0f581d9cf9796b1027972297cc86dc059..653dce318581d93305f3c86da77e7ee8576b3034 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 70d5e95cf74d15b8d0c6edd79cb67397c3e36afa..75a2724b69fa7e8b1f4f3b8d3d67000094ba4ac8 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 6ced35c5e95cd943e05771c724b65f30456527a7..1bc94398a9aec46f3b6b20600a23fc5e37dbf240 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 201e41570bab5c76777bec213eaf692b43c6ce45..f7b0f8e82f89628b0e90b6e267329ad4b326793b 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 0ca43c2cc73cc7698930d43c8ab3d14acd59e4c1..e422586bff58698e771928b916456e6bf53fa0bc 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 49990d65fcb9b82d21f4842aabd4be147e8e273f..01ec4eca1a887753dbb32a11246f0bfad08b8671 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 44b80c80d2eb6a564fd2b8a70da2b96e527b1811..1fcfd3e7ff1724aad4e709c84253691fffea572e 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 e52fde8f9e5fd409ac213af3843ad588fbc1f5d5..e773a4f619ddd3d51558c6dc8522987cd4d91624 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 f0cb4d8423b50a564191b8eccb341296b3d87349..b4a6887ace6cf14221ecea31d1619069cb5b5c6e 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 42e6f57c5f4362a7f724b95b0f36ab8300f30fea..16dae1ef6fdf9c9e19e180878ff50672edfabe68 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 b971cddfaf13d840dd5e2d6f9025bbf641a024ec..4497d44c3f6276ac384db331b56abfbad6b44211 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 fa76618d957a623509f3a6d488bb91a1bbbb3360..500363ef38e9e3f7b91537023f7a5993bc907fab 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 bd73963d8a196813083b60bad059c22aadd48d7f..09322a420ce16014ad7e8c7ca9136c9c7b1f2bf1 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 b34fcafd65c9016e9fd73b977d0ea38545de09d8..1e723777f98150be64474083a9b4ff15b38b1d71 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 5a3f7a92e167b3ba47fab270dbdedc3c879b2988..ba29e1c2ae17db7ace8b0135c97d77d833810815 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 23f8462c82995026f73e3e0128d749195b14385e..08f2082ac2d3f5853635b295106ff3b531ebe129 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 f532620f6e33427dcf0118b374d4ad134afd719b..d0db1989461fc523f59300536d17f48d4a4c3583 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 846508822f9ad0cb2fe7a8e605fe50089ffa77ba..87ba7559dfd3f3a1774418d5605bf107246acb89 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 9c0d0a8f4c7fce25ccea5860c3bd5f49b1f3a260..d74476884a2372e2bffb4726c5e5b2a156206ee6 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 fc7480b3e05d45b9943e25b747c041ea426a2fdd..940ed7d40a07a66bc9c0592353213bbeb5f539ad 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 33b20e209b6946325f29be7cc3885d52c6bafb2e..1471fe62e9b5b3e5c984484ee4f9603bb1121773 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 2cdbfedc4095035be5f4e7693521b5e91dcf9168..dd732373b75d5136ca38f6849279ec898e9b085c 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 0c49582722b2390c204ab748617082d48f682ba5..8f0aa6fa30d917dd08e175379f752ce2aebd14bd 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 b88365b47a43945bdeb187e3da513bafd2c196af..2117e2f933a8564dc2999e8aafa1783f143055aa 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 887a2edbbd070f5e2a479231714d36730e8c7a8d..c86308e2b2cf66d0bd46d7a3768e794cf966d94e 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 475c323f804b1ad3c91b0f68393334285029d421..e1071ee72a6e94cda4987f3c3f76d6824012251e 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 2f00f4a6af7f9640c8b45dbb7e6daae4a9c6c146..af1acd11da9a79a04f9ae5e8489c81661df1aeff 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 70e1c5c29b035febb7758ec6f108c3aee68c084a..2a1dbbb2d2f507bb0cfc8e2af3841a04f9eff25d 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 1a01f1fdcc08717ba62e993a280b909e94f20600..2461d5fa41dd541820078099f9daacb3e263639d 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 3d76edb15d0537bd6f2592c5a3433fe43395e47f..84cde6f223883a3b7835126bb73e2248db23d695 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 8e358510056806eacfc8af9dc71ffaaceedd8a48..6d4e160cec2221f40fae45a1216b5efbb1b1f925 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 25f72c68312150afb859c0e447d1dbd7a358fc48..0f5d94ce9ea8f46b23df7f3504708892b98fdfdc 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 44f42a07dca3580aefa4dc2fba791eb14e742ac2..7f9c5cab6a396924c01f8fc95d061e0174d7f78a 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 aad71c1b4f89986d6d24111d3f8d77b6061a19da..88fbc2bb06715615a037a40a67cf105bd1dcc891 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 3389fa96582005b7c2d60123c7dc958c7f07145f..e6975940c0258624872eb458b06f94435ad64bf3 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 945dabfb4ea2a8de1c5179a28b5d24092fe6cd42..15565a09530196c62c00b28c3ed0014e3b1accc9 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 39d6b61a57a2f8633f73463cb1cb7168c8072ba4..f92ba53256df5e7c64d86c8888be9f9904bde48f 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 5065e8c4c71efc57555f63a489e0c0e1563edad6..8672b590576c5ea8a6f1759eb235aba268ccb0d1 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 1b7b409befe598b14e7662afdc84ef5fa032c5aa..9b3c2287193b11e2366744204fa596664bd776fa 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 bfb76d78851ee2f05955081871baa29a8445c874..2f66a58515da42e6c3ed5efe856fb5f3ab045493 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 5069efc50730254a3fc0f9b4d51964eec2fb145e..c67d3aa9895439c3aa523ea2ec8ae38016b4f845 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 2d88215fe344849bc814e25f73a2d5b4cfd04ed1..e3c2445013241c654a84e1ee5914c54044c006b9 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 8c586a480d1acfb8c13cdcbdefc3de0b4e6c4b24..602b5fcbcdda3838787aca957bc62386a6c94207 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 462808f83480db5a9da233fe3508d4a5ebbdfc13..c4ed39ee814d8d2e63b7dc559f833513f9fc8b84 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 c6cdd2b273c0ab4e6d92dd7a9684b5de84bbf83c..776ec387303108a3789a26e9e9ebec3c4695c0b7 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 8a9cbe56b233bc9877a4fd18f3e52cb6487c7e47..178c4ecb2a2bce4118b47278b013b762b11bee58 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 ed4432f7d5b7eb078e7d56dc6706892cd6466b4a..829420c41ad3679fd402fecefd3f16f29a237ad8 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 43d3659551c27d35f9f0f63b88ecd039c9bfc822..fd5c87a98ce6e741023637249f57d4ed61a32a6a 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 9df83511697204ab16619c150685bf7dfaf64963..3564739828b393a7c2e905c022163495f15f018d 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 e18f03db4baae3678eefed20a3435809e07a5fe0..ba09070fad8cba3dc841ee218119103558791284 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 f59dd716746c655da6e2376c1b899e6b123d9e9c..2472cba2a47cb84c0819732d9ba44b4cf290f54f 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 f59dd716746c655da6e2376c1b899e6b123d9e9c..2472cba2a47cb84c0819732d9ba44b4cf290f54f 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 f59dd716746c655da6e2376c1b899e6b123d9e9c..2472cba2a47cb84c0819732d9ba44b4cf290f54f 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 dd3932bbe9368ab6dc1518218bc12ad7ec807643..ba956b744661be29d8bc50ec337d03702cb84a2d 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 940589213bb934a88284d1477104b23c501f5ba3..be600c4fe0663251715f1f2eee5a26ecbd8c70ba 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 f25f9cb682510f1d29c209acddf641e456478a98..09c43697aad3118e4e4a0a940aa68100cb4fa12f 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 8928ad1c21baa1d893df8fc4e68df8f5f6358ff2..f1b3f113eb8b233fc4c05a9054eb16471c967e74 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 798cf36b217265ed75795a95ca1b67a79c8f5447..ed234f257157bc68ae3a971fa089d854c533ce8f 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 07a7130ff996da637175e787e3054ccee0c700a0..b9a43c8d734d91aaa3d8d04e944b8f3553c35410 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 c1f3828d45cb4b0a3028b2d575647e77b510b4ad..2a8af073a5c2af18df7d2b432c9aaeb9a19320d5 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 3a5d5d749e2752fd53f922f8f18171d6b1f02bc4..0b92240a4820714626d11a099b85099143991476 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 59a22beb91e81a28772af5bc556f1d9bbe76e217..40d45cd00cf85e8f7c1c26f6b4db221ed4b543f6 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 683e4737ca0f73df61171fb19094597ee1273241..ea5384d2a356838be3efcf74f6b1043e2da385ba 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 961c71554902c0b5e3a7e73d804bfb71ce5e4c63..9df92ee15a0dba304405c8ba8cc26f2ed939772d 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 684cced4b783c57a5705781ce5bbe5f4ff3b1eea..5a715c14690ff6ccc4657b2547f4da59cad46ebb 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 e3f8c39ef188c718fa2d23af4a790675bddbee7c..1670408b8a102b307b7612e387756aad69f06424 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 22e10231ca0ba82227c5582d426a82acaa99e463..b01df625af71cb879097a5915946add05e3aa7e7 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 0251e49fce4b76bb4c5ea92b7a5897f2a16be556..ddf9a52975f4c2f1ffcc250090419bc4bcc99564 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 596e56dcfbb94dec2dd925ac073582614bb03a21..d4469aa6269ea5ab76e244d1382459f8850677ba 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 5f8e79ea26489dd2d3782e9e1d1b3812d9f9d8e9..9151b50ffa0a0850125706b612aa3d304cbf2406 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 e49fc9aa8e94ef83a2cfdcc22f9afe5de97be6fd..520428dbf5fde991d750847b92cd7b5527d0c0f2 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 006b884a5662cc98602630e61c70dd6bcf6f6237..12d7bf0f1146e872d4f989c9c93cce1b803f7a8c 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 053fda3658978d71f3f065183bd2a2765e986ef4..c410f12c7f25b68107e492ca7c65048571f9709b 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 425678524907855ec275852330819a001a35af6b..7b0ab736a9e5a1eb20a57a346a1b6cffafbaba6f 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 cd9c075ab10a9dc1fca57dcad891f31cf43bd554..b6165a80f58e6df3c8db68f3d30b1016c7be9898 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 57d7f63c68c499ca78c585de9af2ee4dbded4774..f88b63a40962ce599496d59165e4ae21a4d9c378 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 79b7864961fba1bac99a01aa5ea48f5f4f09b322..5c6c8bcceb07903a10a6de7e104cd93166fc9d1e 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 8d7f33724aecf9593802a02efe32df0fd7cca8c9..6d8254fb36ce21e95e81379ca7584ff71483aa31 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 334d393679b1fa473873ce248e16f8d02edaef57..912b73ab2e4fb67ba8b77a0fd87b83f8662986a1 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 fff90d000c1e993f51b813f632ba2170709d9229..ebdf9c33f72906bc5aa0a0ba904396fa6e1943e3 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 f86b4103bbff59b4615096f76c60b71bd31dc5f8..692c7f4fd4f6e6c7eeb34bb6b5fe714c3cf9fbad 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 c99a06ac6320c355bdadaea34b7b28a74ce35661..57662a33c69a68e08439a0f3cecb5f60da304680 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 f8bea65fd8ea4f8c7ca823eb2783d9fd5032e30b..9d8853f039cd61f2842750d1507994294ffaa3f8 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 f8bea65fd8ea4f8c7ca823eb2783d9fd5032e30b..9d8853f039cd61f2842750d1507994294ffaa3f8 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 f8bea65fd8ea4f8c7ca823eb2783d9fd5032e30b..9d8853f039cd61f2842750d1507994294ffaa3f8 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 0c759120e286317851e818ae00544e474492df33..8c9d82f4c34bcb770316c42e4f1f08ce21291e5e 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 ba014a5ab8b78593bd056b47b7b64975cc5c1f89..27a6f22a76180f3b13196b7e71ad2e0883417a1d 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 2822977f0bd2841d7f1a5eede6698c4b837a259c..a0a07a2a0ba341099f53ac602780f732101cde65 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 b9cdc2a59212646dd040a6371affda61638cae0b..9df370b70bed9ca087f3039d963ec19829e2170b 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 ee9b9823db9130683fe8416cf8edb52c2de82058..772dcf916c393e23e5346b001b88790b3449484d 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 259dd7d9a224e1957fdcb630857670e5e1662e82..68106afa3372b4591364f0ff048a20d23238559b 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 09ee6b0fc424212fab5d55b64b19c17dc6017198..eee7ce3e83824951ddb73800d1e038d7aa10bc69 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 a460dfb3ac914e35df89fe1a4a5f25f053f42f5a..7908f4c7de2149679515c47ff547e8ce33f83089 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 715cdba441851ab467ed42d9f5adbb1539625152..000e3f46c7ed00c8e8bf6466ab6b55423b2fcbec 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 234ad5b0d3e6c2654ec2fdb3c6cb95b7c748be44..9c6210026e3d1e98ca260855588911be3deb92b2 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 a63605023cc7d6ef6a8125b6d199d13ecc2c8562..cac24d29049af5b266aa165af510bfd67b247f9b 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 dca9a1d8d53772987631189d2d46d73a1e0ec97c..e039b6c558cc7c7266f8515cc3243ed273817890 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 4e697b35d4357b727bf88ce0f90214d3648e2c3c..54ec34c6508a17e692d437653732a7ccec6df556 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 7927567f8bbc429d467b2b329a4b85be71567e6a..cc4fe6880636105ab080ce08bc11a386fe2ccd1f 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 a609100778b38a2d6f7e4cd364ef29c1c86c57e7..2d0296dd34bc9c20c955449c86f6ba6f9a6dce38 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 e5e8fa2b10244689d0bbb9542317f6b92f00cc40..d0a55f5be70c84966584e572d883af8cc173cd37 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 a3b515701645662b4f6822f4e4eb046fa3d743f7..196eb698b20a194de30c1d95244ab6798235852e 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 d4208c466ccd31d5a5e64db58c4a634a12cfbade..7f2035125eb35b268f9b29993d72936ea20d95dd 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 40c1effe2de1384e5ca5cfd2a378d5477621d352..9df7bed26798b54951f7b15dee18afefc35daf51 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 58e44c9cc20c0a5e73a4c672a8ac4032863f4f23..c8ec8679295ec46376c1a9ea1c060bfe9b7d3189 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 90b0326842282284ee4bc5749c10577427fa601b..ff32a2dabd79f6b6f22fe76f2ec70b2f9c41cba6 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 d5d0869f94c0d5f59923f7982a910533154a17d9..c1f74817854184957b5d258f6231767da4e2c842 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 c4a192d98bced3247b512e6cbaebc1157184d70d..cc747620b445a06ec391940550600f84a2745473 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 1c73ceffc77f5a1024fa825f47068cee7cfc56e3..7a13771f868faf5a42894ec644601e9a3332cc21 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 959f3216b40295bdae147f5e15938ffe2b134fc1..080275bf66251e7fd8decd177ea4dea2c99ef1c2 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 736f67c285b90eae6dd3f051cb2e6a68f3de8528..f52f0dd1b2b296e0a67f4cf2507287374a08370a 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 715cdba441851ab467ed42d9f5adbb1539625152..000e3f46c7ed00c8e8bf6466ab6b55423b2fcbec 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 715cdba441851ab467ed42d9f5adbb1539625152..000e3f46c7ed00c8e8bf6466ab6b55423b2fcbec 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 185776ee7b79e2b044a20a46b946bdac5119d358..f6025bb9cb907e7007e2b223b762d132dab9ada3 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 96722c6c050152f08d563e8f7606ab82d8a46ade..e66a54fea254a2e8c51356adc94e7d6935557d4b 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 643b36ec0239dd2be7952017e9f344a4479e6696..19752beacced4a3b247a2095c8d7cfe65506524a 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 624d576bf1b7093b5ef8020061c0ce424248bf2f..e75c59456173901de4c3bb517afc8719b2f9d1de 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 0e1de9efbfa3e8fbbb66340dbfaf8cac66b34010..b1795facb8eae07bae396d9ceacc08fa71f2e498 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 bf53fd04ab043cf0eabffeec0b3eb516664b5422..105b08a069ebecc7ea6b5695795fe0ee8c83d5c3 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 4fd3c889a06e1aeb58719ac6f0528d16d1b8634b..c70c2abe451b55bdaff6b114321e0471f550aec7 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 2bcda90c7f581504f4b4f9f88d7ec3eb5c014b78..cecd47002ec58e47f0397d691bcff315bafa1064 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 6b4107a348c9fbcabdbe3ec459021ae47fa42f5b..e5a74d214ffbb9b23620bd3339f6e0dd349edd5f 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 8267ed2ba0a30d776d2cdecdf7bc38418fce2ae9..4ed852403bfdac02cd2018a4c5f523d06b9a66a6 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 50aa80c18bd616f6e9fbae684088139d794c3de0..d0588aff6b7f0774059c3b1d8148cef4804a46ea 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 08f059b48072704bde57d87ec09c594479d0a3e5..56652924f3316da4921a0faabb0c1572c823283f 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 43d4cba41dcb8c6ea357539f25a40f4fce0752c5..f2b2ff7ea90dd4ccf0d1f52a350a5e3626c8a56d 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 9cf85191c02819916b1af432d217b301f5b34cc7..605923061fa1285e4a9e46074b6f0a705ce43781 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 3a9c1e00d2fc041c40152f18f6474ca2a8df041a..20c581bd319bec49efcbb7cf1055c8c3576e4bac 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 018e745b63e45f210f294c9044466cceae70f655..6134a2d31c1f3bdd90727cb1188014af17dd35e9 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 0e3bc9d3e9b183c904b3c281a39847d3a5c5704d..bb5a4e43216fe96553fe8b665de9f3da94434161 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 aa08b220f9f6f612844f1b2004c2a708f597acdf..f2fb20cd4c8678a512b3ff767988c68853f1e31b 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 192cae6833bd4bb2ae4f24ef86c33d144527d5d3..326f77cedbd029f74e54dc20e75afff73e5d5a1b 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 2a28dfe1591245821f6caf597744e04685e0f6cd..5587a1684206aac521ef5b052077436f4247971b 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 7262039b473d3e63e5633fc225e4782fdaa419e6..c2d8ffe51ed6d0ef9af923ecf5a7919964ec8f29 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 2bd830212409b5a91cb739790414ec8f01f194a4..2075bab67f8120e8c061fb19bcca334e9cadf537 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 bef063761b3187d83c416fcc91be269fd7291722..d8cd15df40726135fcd90a8bcf039110a7fefdcc 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 62b3ee0c2d576acb122785a1d21ab4a65fabe6c8..885f3594a5e29d9a36bdf783fc5a5722ffcee0a3 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 a8b9927e615af110399a08997a764e3504038bd9..176adca60a87b4713af0296cc3921c0a7db7e18f 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 a90a760311af1a38534c2c8b24e7444b6865242e..743ccf9e4e8f924e8100d6bab22195802a89654a 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 8f8905d68a1cf6a052230013cb6875aca6e72dd9..721f2ed645db6eeb8abdc0e6f5beab1f579b89a8 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 bbb35adf1c6fb69c0bc306d33f45acedc1f0f566..7d2df4065ddb61df915888f4d5e90a1fe873c1bb 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 8267ed2ba0a30d776d2cdecdf7bc38418fce2ae9..4ed852403bfdac02cd2018a4c5f523d06b9a66a6 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 47ed9c146409f54f6c3a4143212883f669a760b4..8edc51232112a1d6cc4053cccee53cde7d9d8565 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 694301ad23b3524d8e10f24ca7c0580e3be28ae0..93b4bca372772658a28d59593aaebffd425e5f4e 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 4eb18e08d087341e0b9a7b3f6f7b619feb5523b2..806416feffc6376a766393041a8d7f647aaed8eb 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 66b8579de304ded4b18f515ecb1b7e169d6734cc..fc7d6aa90d7d63521a4d992e2ad1b07a3db89436 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 e90c372823e40c6c2d299420c5e6f4e372d97af0..2d0d807c8b3f80e827b300e85ec5d4a9c0336aad 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 8a9aa8af8864e0989b7c34b28031d6c4eeb7bf92..ae99a8471db1918a4a284df723cae27441c7b8b4 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 4bb1e112249d95dac30997a30a4779ba4b09ac15..36ebb577a75137f8a8f19b538932adba7eab72e2 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 ce3afda49136934e18c1d1f8cf72e753003813c5..57b61e610a5801cebc5460ea69774bd6aeb3a80b 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 f8ccf6224ad271d097c886330d642020ef84400c..1ead958b2d80d9d9df8236aa77b35c3221f49728 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 ba2646d5ee9908a67c1dd734b083f4bdbd8921fd..cd15e746a5cdcbc666f60abb4260e45d538a5c19 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 2f210586a6918723ab29f51de4d1da18d8d2244e..244c5411e3e4880f85cb073bded416e8ffcaa514 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 d0a688c502ecfaf3087f6028274121e566597d13..7db3e8ad49c7156ab0eef32da65e02f4fdd7aff3 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 aa853f2edec4844447658998f7446df63f38dd4e..dd1ac91567f554a3f109db213c874e421a5f0e4e 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 52ea39be75df914c32cc489f79e6038c8052abf6..4af4c722fdb1f2278d44c6c2c8bf0eff3ce544bb 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 0c332440a7eec0c6f5e1ae42165e6c8d29888b83..5a50b84fd0ebc0cf77ec95c94384dd11b7d05e80 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 25551cc4f457e4bf431726ca2f1c79fbf9d677c3..83ba7508861e6ef9585d361854bddbc971eb4051 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 b858f00eb841380ac88c0872f39aa3a73d72d872..4bdddb73a5557c909dec4176f78bbf7f66d2bc86 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 7bdd4a7a36bef249c47a299680b64506217647e0..3cdab881e12c62c2b4b59ee0f0534843700fdde1 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 5d184df357db3638f4605a33eba64b25e6131933..56486f6fb179ef588e6543321995cecb9f1e79d5 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 af9e2e409fa7bf4dd5b33afbf020471560559bd0..628dfd646be1dc45163f534c01f61e89cd420e2b 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 f96f798f1aab4ae8861b3dd70fe3d4256f59e38a..47368d69bf39d930294d55687990dacc73f1b3f2 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 5d60676e9270e15ab631f643a996f5deca065efa..0873831f1fbc32a4e4823dc441610f02cee39cd8 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 e607a28c5114058e15232f89f2937799786c8f39..6560f58e2e3f30fd321dc67df71009c1b6a7bf8c 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 83b5ead40cfdd468429df84b62bfcdce94cb1ff8..084faf3653529f8eebc852cb933958408d1728af 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 6cf5086e19018d803e9b017f97ba893c48ac500f..b7666786d1f927340bfef226c266b0e5a30c26fb 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 a207d888b49beb8e47f72fcddb82c153a327d53f..b02de162cd4e7d5f2ecc7196dd2d2913f15dd5cc 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 256ccded032ec82cd478ac6d20f3ae59fcbc899b..2b3c2824dcf43a6d38a42ae4e11c6e6bfbfbb809 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 ba2646d5ee9908a67c1dd734b083f4bdbd8921fd..cd15e746a5cdcbc666f60abb4260e45d538a5c19 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 56031b9ab46c1fac08f8fe4c74c25c6f4ba0df69..a4075ad737ca582ff10898be2a23098f70b24d2f 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 0d4da954b542582e37ca82fe1a61285a7e8d3c06..a0bc4d95bc42c5da097ccd75d8390fe123dc63b5 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 d9646716ea562103ec7d023d6d51f0d57a1d3cf8..54ad26d2709ec234a646a64e79bede6a2cf7512f 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 a80c91b36ebd9a2718536cd7b1f6e8afd7f8068c..6b717bd23d876abba8985bfa231fcd7cf693b1fb 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 1a0c628538445ccbc6e93c4081ad8586d8ea4125..a631425c70d430605ffe35865945ce8f1bca9c3d 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 3c85e679a5a26fc797f1f2ab04fe6eb4d854761f..03f58d61db97ad938d180dc3b65c22c8e1779f51 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 9b421791733b93dac140c53ab4119a38422d5fde..cd30f5219ff7093eff42c04bc50de911d52ef815 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 85fb4e222085dde46ff86e2d6802be3b0bfb5059..b12948bbc5d42db55a9b717c7c54fc226900f14e 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 dbf199f8b09cce2add6212e6a2db3ba4568fa26e..e4d7c196b5986657ac6128070e00011eb52cf70d 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 94ee1cc2afcd4fec088f907d0617222589397dbf..a429ef6bde18c8045331277f009ef88184fa0f5d 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 79a730ed99167ffa8b874026bdc813ba33a5829e..9d298c152ddb550ddf7c3279ca30a19e99603bcd 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 5fa60e8acc4ca03cf2d303ea829aa97acf11b42e..94e1db313b9e7c3d9478f51c784f49c7d9ac488e 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 5fa60e8acc4ca03cf2d303ea829aa97acf11b42e..94e1db313b9e7c3d9478f51c784f49c7d9ac488e 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 5fa60e8acc4ca03cf2d303ea829aa97acf11b42e..94e1db313b9e7c3d9478f51c784f49c7d9ac488e 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 5e9534cb15388f540f2869ffd9f4b610a07b49ce..482dddabcf55d504fc7e54eb527223037d52ef68 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 19270c24ce36a21d9012e0a286466d462d805eb8..bba25c7c0e77cc39e818bc27a8ff2ca550b9007b 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 05fcf55c942372d881cc410d8eb43ad948002205..69f041c370091ac82007aa10de0a16691170fe3b 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 810aee37026ef250f539083042994fe3de4d6853..04dee485113d6aa4760c8914caacb7506fc55f66 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 23f3ab3f95ee516d313537d01aa6a5513580f6e1..a5edd1a971d5a82947ffceab1a0fd1eef0525d07 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 76efdd2d31a730cb2d0ab6d5872c417a1dda5315..619d709b825131689cb59e6dee4e1d974350e6d9 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 df5c80de4489c68a144ec9ef7c7e592c1d79c928..b320a13f8101d1dfa138ffa7be84ab0a5b2fa83e 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 4d98c90a452a1de73c6ee664af6add77afeb2d42..7c9a304de49998e80aec4907b215f47512fcb839 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 77ae20b8c591134de5a57ec0e207deee23447c69..d2e2a86ec36d992a07b14ac16d4441cae18d047e 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 1034c7325215114595e9d742f0c0affa6ae300e7..fe067e4fa088e6e6c927f79875566ebf72fb0e25 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 282dbe2f65ac7bd1d5e3e01fee8f01a16510e445..fb71b2e4f3243ea4b2fabf63bb61d3d46ba1dc65 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 142485f6ea25744a04a50dd15c473aa0c59325f9..4b95c5488ddad5cd785d3bd6323067d26ea9e6c8 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 fd7f1104e224002291df2180254b04c9bd43d4fc..8dc113b715dbe24c40d286d95998ada747196951 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 353eb779ce9888d6dda18510c95781113a29cc0e..5d6e8482e86505535904f5b26a7aaeaa8789369d 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 c9b530e7b809d0a2274c0640a88c24b9e0c7b678..12b3879f2f0994f38f741ff47ce442f7dc17ac29 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 c51c996a73bab31539c6f51b798a577844f1296a..9ff7c76bf8b9e838f7d9afe7c2ed7f5e05591773 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 9ea72cc6ada28e9b7e97116042bd7b35feb2b861..5761ce1688c5664b11f198f070ebb725bc611fe2 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 2ff2a328711d1e63c6ba47e45b851f4bd88e74ec..bc2b8358f054500c5d3d4a2294092cfd31d53da1 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 dba7f99354d8ad5c8eaa30f1871c944635cf52d1..1b61ee1a61a0a09a093ab0f1218345d86a82c702 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 1b298488489011c84ae791a4ad3a3e3367002362..e0d5a56f40a6fbf0f6ce78fa9813244d0d8ef59c 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 0167d8e7dcab5ab8f2cd8f33ddd12af9eb7afd51..93e71c08fe3a43a913d2e8dfb7a8e3a71c7c53af 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 755b88d9279376db7a1c6a7e7efda5c7a78bfdcb..17854009c999c2cc2a032c48ff7bf255ea4d5967 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 c7a603c5c257879cb4f8e5bfbd034403e106b778..5dfe152aa7c5617c4be6c69d6278245cab659cb5 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 c5c4d66590e658dd14c13c86d2919e11b436c974..7121ceb4f054a0b1adc589bd30f3bf5aeb8f661f 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 f67ea540d74ada973cd21e77735ba84340f99e4a..0cd970d68400a3154dc3d8b27364e7be47994213 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 af19bab27ca4890516655ac46897d7cf9540cedb..691207941bd59b8d12dd6ea3c741d79b66e75c7a 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 edf80952e66afdeb4f7eaff960df37d9537b0ea0..1d9a78861dda161cd193a15e65b8aa786eac50dc 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 8118c99f7bcbda26773864e4a0a21985ea0c528d..be254bbaaebf0058b411f18f4548b8708fa0308b 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 7ca6a71552bd4b21d43c2d31c8d8e62d966d9423..7e17be1832f493293d7aec168a9578b67872b1b3 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 a04db1706aff0095ac0afdbf1c17d8ddac939988..02af19f9e56b074e08d24bf6c84fd1a587ccea60 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 f343eb9dfe3737492e78a82bd36a820de869d881..c8a3a771d77dbf9823eca290f91ee0a776e71f7a 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 0688e594760d84874bbe28f563d190ea9d1329a8..35cf0096b60981c1f84d50050462cfb0c2cd71fb 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 81878cd74131a93d60ee0243f157a51b84bd93f2..af7e4a66eb3ef606b688e1d3dec39249bc91db8f 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 2f78ec9bff395644f0c075fc9fc4603eefe21287..29c775a7f1284c5e221ce915ffe8d82af1a30f4e 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 c5a2f5dfe182a56bdb10411fe2f2c1f82b0c33e1..78bcb9b4adb696a1568bc9643b5ddc380cbdc34e 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 018d94bcb3339df68701edc056506e499f883b7e..a42a79fe087490c1dfac6e72f23d4965c492d13d 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 fab686b3e72f9a0d4044e658aa7a02e7b8302a52..b0eec29c577d4cf60dc711668125cb2df5664eac 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 119f8fdbbcd210b6f12ef80b0a0ff42a3ab516ee..1e63c1346f2e4d1e163b7cd57181ccea63a15c5e 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 bd887ded931e7ae0b54d2ff05ed38af8ec833c67..84977a00e669c6edcd54831bda328eba398ed47d 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 0601917aa534f738a0b3e9a02ed94fd709f9ad97..d9a858a5618a6a5546731241699cb37539bfe6f1 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 dc3200eae33a47e2f95de2405a3aa9fc2b94f90b..d99b576311661f97e8f1956129c09802d96443ff 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 62a6bf7f12f8606615e8f294923741f00404985f..60bdded252e16df8032c340a132e71df80d1505c 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 6a62b09de4e5392c50186eb2c1936a6545831356..12a103ae2ba8d96f6ec0ee66996a81857561d2c7 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 25867c5f6758e88b6e1dae8b5347ad9b01f90425..413ebfc74c418ea04bd172b18e755e862c0d129b 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 362246cfe7ae54fedc00d3183762b1ad47d5104b..8deafd159226c194dbd5b9cdd03fbf520d440475 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 6868f57b3a3c582b93a84846a856b9751d95cb04..cba7fe546f966fd51533445e968cf064245ebe58 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 ab193c1c849cbc0db548ae98f6cf961035e70bf4..16beb3c0eed44a1758866a3f3cef5d99c51acfa3 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 8d39483dc3e53f490d6fd9214955bd8b8ff8e739..9b028f6857021fff47d6ad7c599b567b167d0a82 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 b90f3e96ec3afb523cb83b6537f3d017e1e49021..a1d806ef9866345fe77329356acbbf92ec2a0581 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 7d81ddedc8a536f31e18ef9e7ec09352ba5c07d6..e01fb05301c1f70d69075ea4dd3ee64913e1b597 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 87e64e9f5b7fcc31732a2945c0b31479781f3336..ed300205b07e21519d27b4a1c00aa311547e7497 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 97acd4294397e5863169d7e26e1f90820d0dd3cf..b2caf5cc1ee13e164d608dca6fcc6b5b7bb5a27a 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 4b981c0cfea6d802f78ebdee970bf23022d8c354..4bd887ae978d33a5a98e3439667461284230d842 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 35f2fb847b3f806988d93f4cdb157194ec2c2b38..4a966ac30e23e7781b9f903b862d639e13405e84 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 11fab31474e6b6fca0553d3859c81fede93b1d59..45d310b528c86528028f6cfa6f04eddac8b823dc 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 14a9e2f8ac4d06cf320a41b402b95142a3ea55fd..2d8cd1977358fcd4833a68077e12db183cdead07 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 6a5fcc8106250d4dc2f509907270bd441f7e6c4a..46fa0c160e7bcc294f16dde3d6f0ecfe12849210 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 842d96a620522e8b83a128b20d27d0046704a22c..f083523ac4ae5f85ba505624b3990d03932a7c7c 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 de0f20a6a90ab6cf762cbb97dc4bf7a0af26e235..f7554c988d2d77e1b520d3803ae122ab72140bef 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 15464a0a294efb8d8c57d40fc960728b82a49f37..15cceb46a4ab8c56c2cd56698e209c9931b55af2 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 ab06599342f377e20f7083e8b0f5cb0bf7616f56..efb3af21b26331b236536ad342b6dc862c3e9c7e 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 e33acd2cdaec6379dcb64f75e2501373c9c05b3f..68c258ea95899350341f904b60b3649cc17e20a2 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 88ff762a33a9f08fe610d25ff911a02a4d06e10c..e3f3bf79b4afd250faf02b18982f4c386425aede 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 bb80da7e8c6686218048c39f1779e8c34a914c46..672ddbd747ca846a53e2a925cbfd410c19826bcc 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 99a2e0f5a0d124f69b41dec2745bac022f38bda6..6fa66d8609a7963a48ce7426d1b2991f71c63056 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 422c7a48d8250ab4a72ed7abcb95b65010a067b8..142fab5bc008ab72605d9e842d80198548c26c4c 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 f744191d0e14a4184ef7bbb03a766a935baca26a..6e66bfd95109217aabbd24c003fafce7bef8f300 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 5d1729f311244d4994c57d3d436ed82a5fcab66d..2207797e02ac21668f153925fe12a9021339d8a9 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 fee0606751413400ff2d22e2fe978a6557577d74..31f5ee3aad66474ee629d037ab3459c1ae6969cc 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 c0bd0bdda69e6233994be6bf60892c0d52a9d01d..65af98d02b34c24fd1ff002cc187e7d418ef68f6 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 4c74da1f123105835f34402f94fed35d00d8bf36..7ca24b04c6d5d6a61bbbd6c8d84c218add2aeb96 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 33597ebab566232aebfce62e7a0451b584a11f92..73298b4c989f2a49257106ea4a68b0171e721d17 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 c86c6b3f93a2c95bc12056c4105dfe9028f8cfa1..453adfae7d1b0c4440af9d889aa51ce312238eb3 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 e3fd178e250372d8247eb7884787b06cc8c00027..59fa5c24a6d456f841db94e1741dfec3b0662cc4 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 831a434e22d0e1944b36e0b927cc1eaf361013fb..45ae098eb486d6e72de2d7b060ba42ff3d641d7d 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 0ab9731ce4d63295c95f9dffbce1d1a91cd42584..18f84b195b2bb67e930a019a6cd9df48af1cfd21 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 e9f9a8f7179bccd0b81a6bee0f25ad297d243b69..e5741fa8b454e706b053dc4321b3cdc2d335c6c3 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 6a23e2bd7e7bb1dca5723a5f661b57abc9057f3f..4ee703adac3c6aaefd749bfbacd18deb7bf3b1f7 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 d9834e1b33b34af9299831abeaf24e853a59fc1c..286b63fcc35b3450373b603abf237ccefc96114c 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 71e1896a926f59f2d1ab88f244ac64c377f9a051..79ff782e56cce5ae169d827242da512122cb29c8 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 35a7db22315349cf8b6949974a4d7e1430414670..17f65da730cae1680165eae379ca5cbc3bb47137 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 106282743c8381ca3bf277b82361d455b747dfdf..9e127b6ef80d7f59542ed450bac6ce290e426df2 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 a75951d28a358e19648b2433ba830b3527a31c03..47f5e131285affc0e973ee5246023a25253d9d13 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 90a099ac900b273e739d8cf9ed613934bbf57565..6a7537ea6b1efc620ff59554e2694dff7cf4c772 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 b51f3d603d21bdfc05b4d3cc21940bc9566eb50b..38d8f194a4c0b63eff3baa146febb95fb06e8fe8 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 27fac03c8afd72626fdd002c3c54986b26975819..5ff355e84078f0bd994d43ebaf5cbc630d8f544e 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 d00e4e11f73ac4834164a3122a39f1722c723821..ac01d05d7c67d97a2234bc1c930942b73f45135e 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 8b0a308ecc9c6a451ff42c56b422defb72545f7e..7d2c05eebf4346cfbc78bf84cc972300b8dc30bf 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 9bbab5b843b57ca522415d7f5df6c6e24abcabc5..8aed9e8424ee86bb094eff8e69cd0752f7cd5bf8 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 97a926f19fba3d290b240cce5926fbce0bc14e88..5ebbdafe3ee47bd951441955e327e3fc0076c676 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 509a6fd53e087a6c598ac5e19d130b3b16942d15..6d1fd299ed890785282a6e8461d4d4eb94ed6d3f 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 1aa1b6b2195820b47a7b7c059155e6069d34be83..127b666b0617c71f09653f6788c728c5593c4208 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 92717222131aad844a4bcb33d1f298f44b6df86f..31e20003dab15d48fba17770304b2f9ede777b74 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 1888798ec245e529f631b1e7e908508daa98146f..8b352ea46a41be88529ef0a61fc4a84cbcbfcd83 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 15eb2682de60dcbf62a85c8ba0291d7e40b7967f..998be16bcd48dc042881534c69fcf8608cfad30d 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 51bcb5b4c3fc39daa8729c0ed8eb00114ee03e58..ff2eaaa32def1271bdd5a81901914e295c35e073 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 439a1787f89bcde57f60965d9950995d736ffe56..e3eb20d3663371a21c373c6bba05c1dec4e28237 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 c4ebf5bece985e571fb937a797c16dd4c6463f90..7416bdbad2b208d08f0cf8f01c8ecfcc1aba5cdc 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 35b7f49ea7aee4ed9c44223fc2e4e59951d7b2e4..40bb9ea885c572c4dfb6f8ac0f34d948ae515185 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 914be5971a7d4a2ba26e6219eba97459a6babc6e..fbea54b6291c3d06550e80156c155d8aa8a6d172 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 e07399d331d1614e52e8b5c5f3c59ea052574261..837b214bc271fe86d5dde956221b090ea91eb39b 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 e49045ad1c932ac270e6194d85f4e1b7ae0f24c3..385c175cb1eb58fc3c040d5b631232f797bb9d5e 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 f70f85eec2b27a8235ad6dd6ab5b82335f4c0bfc..e25a91b7a9c3be365d60a6d0eae89418b62ee695 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 c7798d661d92d960ab90e769b75fa54909e0a7dd..6669c9106da916d228717b552ef7d34027d1d04c 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 ef4e7243ae365f65eb74ed27057e63ac46f1992a..dd8602a0b04243e57a22541a118e3e549fcec8d4 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 a703b32662b9cf92b3aa6f3971556f79138f5f6e..6d560a4dd20e2619778503712f4931850df27857 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 b7cfdac375a2d9d04a287c7cba325e5de9d4c2bf..996244f73e414084f63104fcac557921a0c2b5d2 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 50cf479933e830883ce0de86a47ed8d1b4692df4..71d99e7090c8ef7b9e924268cc402665d4501334 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 2f5d54d86fb731e1abd9accb4f3c85353763b497..ba8bc8fee73bff7315783f7b56be5a39b3c8dbbd 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 3537ce85fcdd5d04fe2556a9d6683ed1376e629b..7369c3040aff67308d8477060f222b4a0e81be50 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 80aa4a6d7f2bc90b3608613cd12f0313181fcff8..110fb2f8862761e453f6e99a65e1722d8a01199d 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 aba812c34b02a956b1d567f3a16fcce6a3fbdca5..d04ca5883e3b69cb8554ead63f3159fcceb213af 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 62d718f5a0c50eb6248eb9369a28cce6a581095b..df6acfd90233cee638f2380359a919378652e901 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 a6c5a3f4491226d524d92e4528850dcaff120f8e..b73d59540cbe616aad4ba37978061022c337b184 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 62f1a42be2cd6b3fc39082e89baf81eca09a0329..6b68be7fd1a3a25652f9e94db5c704158f6a0cfe 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 17e72606ca74857c1d1b45172ff05f3ed5c6baa4..49b709edbca563193c0f8210fa06cba8279b9996 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 fac3229f8b29ccad367fde3209847c7aeeebe9f6..8506b918c7c045c1b367b86a63cdf013da8b8b47 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 d00af5a8160253d151b42817d2f8a3831baf1a4e..6984831f7f370ef2f8e4f03a85df6012d1273dc8 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 395a5f409ef0f615088b014fff248bf640b99210..4241a4c1f4becaa9024c53d4acfb0000ea2d19ad 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 94c74dd50df4f077ee570666aa26ad14be902f80..2a5e59507b95ed8a434f04c32c4432476a6fae72 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 fcd5de325323d561a8d27bcae000a0c979dfd48d..20c43ce9642d40c617242cd566d4b7af81222c8f 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 0e36a6b34b0ed3b9250f7232646a2641df4db81a..63ca66e41f6583930e9063ef5025cc18a842f356 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 58b06e87e9d56a8087495aea205f01b3180a6017..10e14f4ad568b836d43f8a1cc0d1f5bc7ae1764d 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 ef197e53da78af451498b45c7a11e5192b1f1a57..bf9b4ef48ddf79ba9ff5ec71db365c2996927110 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 e456c48291fb7a4a53d5bed7e94a3d12e1f6918e..1351ade104cb85935b74370218157d6511dcb55f 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 0281ac96b00caf8e0f3daaf29f537b9ceef61ba8..502f62ebea03950cf41798a41c1bd950d2ae8898 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 9052296e128ec4541b2de8a834d38cd47ae83002..9399cc6b433a24d6064bbc481c239f3ea3890226 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 ed1ee883f40caf289ae36d56fadd3b0a4ad71d68..1add2843c6a05b51661e97958da43a6104256ef6 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 4733e5e0d5d61d027ff65438228947720e9dff96..eb34ba1f3b9162a66aeb7347fbf19b54ba0fec01 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 c0ec6e096525a699353061aec31eb372d5a0d612..36d5d16e3c80214b738ce4f68c861b6f75dca729 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 3867f43fab78efdac77a3b90c305b3e0ba653a96..7e6b939db984c051407149b21dd543e02276d6b1 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 a38fa7a49115f5b0e308b0e97c685327874b8f72..b6bc3800e0ebf2b24de4022aaba28b06a0a397bd 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 87e997d849aa171682f6119ee317dd440163b098..8759392b358fdb0e488d4b4c2d4a3ffad85acb3d 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 25b7ac670b6565f298e49f070b2fabc4531daf0a..459066ba2cc9b355769fc39dc94af77d5437e581 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 fac11ea434ae9c79e0c30dbf2c46028aa03fe0d9..01f8db5a40db1a30019b5aaf3599df3567b1b959 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 e7d1ec802b5d9759b57300e6d8d6315f02f961b4..26ba7841c703ce461659681c4256d8819c6c6e10 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 e170046e6e4618b91b0145626f7718a14a010684..a6b4cbfb88ccbcf8c23a45f7e427da5582a628a5 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 60d0a95cbe0306f480c099d912b6346b03798d12..da55850936a49f5fc91d779bc4ddcb98787db317 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 9aad5687dbbf30655a9c0e6aadf161778a902107..70b1f9a59a463538c0a360767f8bfbcc26d86fff 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 dfd29eb768f450273dd18f7a545e4d81952b3ef9..726f7292bc83188224559ce8098a5c3ee24151bb 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 80dfdf3286c44d23b8f62d330b72abdd368eceda..687e12b3c34ab96ce5ec27f5dbf1dfbcc9f1695b 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 6e8e4aa09bf48e6c6be49edde5b323b33006814e..be590e1b6dbbbf28bb29a80a69f89df902be54b4 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 a3edbdd61b97a74f683692b7ec0cee783ed0851b..682db141056a44349be4bdb42343151540eaaca8 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 39e0531c54f50b6c27538b47140dc83181afadf5..293532f27fcd622cea39365e70da06d37993d0a7 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 3634caec053f4f3dccd174f8af7f8ad45d4c504e..6981a97c8c889d391d0374a2ffea9486834b2101 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 1b91717c965dd53be2bb46aa35cd61d44510e7e8..73e38503f33641d87ff0811539e94cccee74cc30 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 25c4f16aa98bfb8e4afc9e14b501672cc2044163..058c5c6d535cc1e2cb0ac83e38f22abb7129899f 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 d4082cc49db77105c26d9604c9eed707c2057840..f06d32a3e501536ce7511bed4ce40bb143244e0d 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 10921d5d4b30fd85d6c5519b30ea053e9b07c151..53dc2e3a7a8f0ed444a27b9ac17537a16d3a3a05 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 4e5d74e8c15dad15ab9a7d9b06b970d770a01127..44c167bf3c036291953fd22bcf06b6ded6077436 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 7076f1b88712b774308c3ca36245408f948f507f..1b1a81ef97fb3b21d8e12ec05c69e622b98a2eca 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 001ff0ab5f3add93d4c6b1bcf3667db415b1d4a6..24b7a679b3211b3bd9f4490a6e5a43ee2c1e4747 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 b3b0c4c19e9ce98552d2e4c03ed7626f6bddb60d..b4540f3b793680df6bea48ec6820877f2761f5c6 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 72761079957310ef57bf312ea070d8d457b66cea..d3f92d0197ac8fed8ad31918a9a0631bf7be67d3 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 7857512954ab23dfd505bffa7458dc35f78cd10c..68b57ec934e4be46422357f058a8d76b17ca3421 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 4677a12ead8a7ae8a95ed9e058b8fbaa86bd7ccb..87b50da866c33868c8f3f010a11ac5a6e209f380 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 c3cd42f1875b21b0e7b4a960ff10bc69e7cf6ab1..2b616d6385b9b71ae0569f25b8bbe54f955e828a 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 9496764ee60f8516a3e6abf09f668649be18224e..0717af5dff48053f4c7bbf5815ae38517a74ac8c 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 ac5eee49beef87897aed3e8dcecd63e059165a98..b73191751656824f928d6d2731900e1677e6a752 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 95f2ecfc03f2d2212616a5c35455d852bb059f4a..1378e65a808b907bbac64763477a8bc8332632e5 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 b77f0763117c9b558efe30049809154078c24894..632097fc02b33faed393cfed810c0a0fe2d7abc0 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 a32fe73f70e65a850b0aa54c8e4b9b00b4b17e60..80d304760d45d360d30c87e17bd95d2e99971742 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 4619020409230d2d5173e17f2be1fb76b2ffd7d5..af532acf4c885b26221e5bf0206248beeb1d837c 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 1d1fddedd609dab4d48d6206131956912fb31a7a..de82f81ad9d7bc2b2dcc152b2b1984e676ddbbbd 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 a1f49a6516f1b7f00efcf91bac35d62d223de11e..d5ebe07da615d8fbea8ac199ee50f3089679dd36 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 4abc337154cc0898efd42024248e3694b7ce6459..1e3b0ad8cd1113c7bec85c311597a7d49b2f4df1 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 b4840e7b549e545e4d0157a48e79392f4b81ba8a..f8fbc6228621e0432289fb0df52ea6921c95db32 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 2449055c77d7aaa08bb479afcc477bd2dea21fac..a4953904a0786dd8f6282ff06c588836a73ddf95 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 6983eda128662d15a3309cc6589fb018205904f6..6e83bb8dbac71fafebfdf45248c1b2f1d9c76cac 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 3983a3dbceaabc4078e492ff13accb4da53b55b7..8c522728e367be1a506f65b51f9c3efcf6bf338b 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 4e33fca3095ba13b48eb65477f3b20c4183df485..26a4f5baaaf54fe6271c2e555eb21772541d26e0 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 197aae55c904039fee37d1698e12577a975c56d2..ebb8375b649b1b743e60f9baa6eb49222e66f939 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 2ed4ca81b60e4f369fd3c9168462d04728495226..216abc59f264dd1d9513d302f48eedb3ba3806f7 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 f999aa37ddfe41dcfe3cea3d2bdbf5651bbace4f..527523d6efccb8ecf28894015c63de6c23beb49d 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 97b06382dcb9cbed3c5c3e545f79f2ed0bb361b1..42eadee3e409ece017415fd4ffcf80230185a7cb 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 2c3042375176c75bb7a7ed2516218f0df17bf7f3..d7efa96edfdd0206906d9f1135d1a46431853aea 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 f71cd38701c0f675bbfd9a7cd851132c94477027..e783fc92ea9f3b86945ff42c1044c96246ab77d7 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 4350edb8f4bd270111a4b0de102de03b6293e4c9..bd1a168edb67b9fa8c9af8077139cef95136b8a5 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 9e94bd63a619fc226edc9a237f6da3595f23835f..e2a098bc51fa3465e45dad0a915c28ee3c850c44 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 4ac2f07555b4ef253508500857f3240e35f7a87b..3befafcd0919acf87000bbaab428fef114177a1e 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 0ac993726507712d623dc313345fe56c73d60c55..c587482dc19deab158c666955f1594ace9bbf843 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 55def092e17ff63c5264e1b452f47436ffec3682..222d9dfa18f7d7bd492aa3ca93641841d445be83 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 1e4752d80dc39ac7d599242e38c8820b77ffffcf..8c3c243cd6fad0f3a3a0825e58bdfe04a79126af 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 645aff604f21a86d36ede0b2f2145185ed9a6ac4..155ce3f903ea0a5d46d202dd443c9c1ec138a4c6 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 395dc61026966424f3b4ada9b723cba06c503983..a0eef91b08c91467130aba260f375be90463bbc6 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 89a1cab8072ac511302b3efb4d09b64f624fcbbc..6cf91b9b693693c9ba3628635eb8726d3879bb83 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 9cec5d7da0a6bf666f489622ed31b95b1b88cace..3d9175cea0145be692dfd9ee509e0f9df2feccaa 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 34afee0d2a5b0322cd749160a7cf8004b42e110e..2b4eda21272040bfcbc54f853fd2a1d212424999 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 e696c88550fade41a16cb5ab04b09bf9aa319a05..be481ec77a9a00fa56e28f902e894069082c85e0 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 a843d02af069e3b77c4efbc209d24d40afb3886e..4ce52bb15677f825184881d37fa5b86213fcb30a 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 d6c8d24755f6fde9091bcfd3e4b141dde9b03fd6..5e3f2fd8d029828f14f5dd8846bf2cb93aaa1917 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 fe771a5592a9b8e5beeb3b5510ff730a59a5a182..c0f1ea325d2acf2492b13da394fec2f7f6c89915 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 a688793893ab6bb89f3927e0913978f3d6079677..cd657e352bca4d0532305ab58572e4488d01d39e 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 2f21aff8c7270a63e65792dc1a97609d100c1a70..275cce2c07909c959b78f5b0d7ecdf87a79c94fe 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 0b800f58ac5d875b9f1ba970b13531650576201f..4bc4ba7a82bafbf99152b2457974cc676e97f809 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 a2c06f706c7d91663a50d8d355bb64f7414d344f..0ed111350588b0a5419a84a5fd387e4b9bacb493 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 c4bfb490edd0fd1ac4a6c334b4ae0cdbf729b447..a34a8996c2c306d1b99f852a68bbdee022ca8904 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 43a7c1439fbee9feba963830bde6fe53030b91a0..b9efae98491cffc388dbecb0758fafb93edf3f67 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 4475d8c90dd19b85bef9ffe5164b1a657c4bdab0..912cf5800e6fea74f5caabc71cba1487ab40c09e 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 e8f4459bb68afa67d2eece4d775ac55d64b21a47..74eeb46793b2762624e4283b643ace282025ff7d 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 70fb9941bd1d4a95425b58320e688999673ae7e8..79e73ef2d2d7263aa0cf4d82a132507693b2ea14 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 88e152aa7f17d52c7f4d5642777470e9df29e1ca..458439daf04558b433f13f8fb1a9d7c55388fd38 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 0284f2f01f61d2de25e6ccfe7774880ed7582979..8937f51b12ccde34dbefaf72ed4ecc35a9352ea5 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 66f8b583a5a6d6a8e3f92ebeee3f4f8c4b359e98..fb184721cd178b5e1d63a3b81eaafcb65ee62201 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 e7646daf3f72c1afc3a72c7b622ac1d7eae00e6d..6e18560e5084b766631b1789ebce840ca161c2c5 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 6be703729172ee354cfb2503b31e8076873c31f3..2d7f3967ced182db85931ed6b354d7fad6f1b33a 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 8cb5dd8adaa4c40894fd0d90bf0777536984285f..933a31dcd3e73162f72709f3b0d08a2149672d43 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 e2f66e58c2012c6522e8c967f342cfe56d6f8a65..ec8d035217e49723f0acae613b9ffcbc8feff00b 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 0c39a6eb78bb1de839fa36b0f69ac0c170904273..51d6a55c8e4edfd86909adb0a2dcf1c067936834 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 4b2d998c9ccc9158cae8717bedd23fed79036054..43abd366a7b6c821da818f7a38a7c88671133b53 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 1c6a363684762f70fa9d19c80c4b5ad5137876dd..2cb20c2a68e8c98df38b19abd82011103321ff06 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 47da7419848d0d9c2d3a07913a929c41b97018ea..b8a229e4fce00f0db8f36ed3bbb0595ab93a6efd 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 e5c10c07407d6a5062ac6d1562fcfeab1e7de270..88d7776ad8c82619bcd8db3fa2488032e4274905 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 9777256120228e8022f257eef0896011ac33f18a..a822d7534119bb5c6849a70eea4f4ee6eb00710d 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 0935c04b82f500fec360d31c3cba3b295c91dbcd..d09c2f70901de0829a109abba11a6d3365819377 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 c3c9dfac98f737f2e26389cbc8fbb82daab48498..88a8d221914b48a8120b98445144da8a5c7a7378 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 b2c72a555d77dbbba206d406f798b8cd66098f77..ef7c37f5eb99ed38a61aef80d3481d456270b87e 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 512f93dba07182a8c31438c817575c492dc78ec8..d5f5103216ed4df581609c68cdf802b2cd242447 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 25e07adbb090275c8fba009f9efc57ff51c507fb..2e18299fbc051325d012cfbdd56d91e4af28b748 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 31cd56f609e85427be8710304502606e71e5dc82..e3260b2f65e7ae83ee55239c4c940aee3b64698e 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 55c6a2122ddaaddea35d5a9f8c710c5f353812b2..3e5aa8b61f7a2b028c310ad36e098d66b744b8f4 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 315849213fab07c35d03402ac821532cf23bc3a1..d0521268c196e398a014b2180b8a0657a0fe4151 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 f81da94086c128278cb2e124174ac45f6be7ce56..d6407f266ff4546c9eae5cffaf191177e5b7387f 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 b9fc829a6f26064626d78879c09695e4d3ae3edd..8c3db3a14f6a958a6777aabb473b93df7670c434 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 3425294bf7bd69525eed0005b7b7d8cd0e1ec521..3117a0ddd2c7bea00eff3b822b17e63b6f51a7ed 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 51e5335300e1639bb0f3dcd393fb78a6e9be0418..f3cbdee4fe84768ff57004918f2599194ce0c61c 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 708046c6c3aea1570acd4fffedfa9635171a2d74..f6b65a34cafd4ac63a539bdd06c05122fdeaa043 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 ef37abf5a8cad07e2176bfd934de48b63cc83c16..94c337889a163e794e1b381357854ca1b9be4ff8 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 e8ce8c20fbcd8ba203b97dbf16c98e07d59e5a19..fd32467b5e4ac81977097a13779071fc94f11cc8 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 0493de2830590c8838e8d84eda358fc8b553a835..7067ee795eec69bf5def2e7786e0dac9d12d1b90 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 ea75c25c3e5558e743c666ceb758668e72be7164..73b88f9579e810fe681d1779ab4cfb3191a44b46 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 cdf4612ab9d371dfdbe4e4bc95a2fb277fadeb29..1a2ad77998562a4b0d03fcb1e1334d8af28263f0 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 0f598615c177af45e613993c17497bda5148118d..489f99708107f749fd0bc471e62975c74c7b1c74 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 598ec8a5355e630bc843c4c29b9ead90de2ed0e3..12a777ea140772265b17f65b8472236991ce64ce 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 a1b99972b302b1e87b7bd060b5d1126f3fde7156..5d4e1dda30baaa6c3722cb788876e10c27bca0ee 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 29a8ad343e453fcf529a81ab7767c83d889e17ba..3b6901c25dc7d9c161e1d107439332f43a36fa8f 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 5897fae450d4eeec9d95deafd631a96cc1f80937..04ceb2745af3fb7d87b151bbb5b395f435aa1e50 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 7c7d2f761c3ce96a2d242fa23d3f196223c8e265..084110cb9f9f08b662c557e05d69d359e75dd3eb 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 22ecbb224286d76e6d602e1983017b8ed50d4c2b..e5e978a96ed505610a87d138d754d972faf66dd0 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 5d60de775b1511642dce3c32f8fb257b75c6c33a..ed191172e4766e0a740cff2431d32f40c1f8bbaa 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 9e42686df76a886f54266f4675361a1bf36ae7a1..08320adeca306ff2ba276a70bcfb580ae557db23 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 0e02c633b9c008db5b6eb8569f15dcbae5233b8e..f90b0a922e9b846205f79c567113ed56e708fe4e 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 38b4ea5a060e1098bd6699fd84ec1adca9ef8903..f6f053ca99cb84ec68215a139152e3332bcc4a74 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 0488c5fcc255e2b8ac6db73445f9eb8f51668770..5f76ac4993b2dac513ed9b809ec86bd0ab9f60cd 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 9226c50b6cd65519a1c08b830dcc87d51e69fc06..3e30d1699d267f493ff2e6edf0da96cb608c9b62 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 5073e9c9d9e336fa9d1067ed5b9ed7c521440be6..f3a38d6a3b58a3fc842f0dd21e917dbb1b0097ae 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 b221809d9ce5585511c528a3092b0187e1500f0a..1614ac36660b236a8e4a1c3e71f60fc6f4a832f5 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 8614d573379c87b3449b31bdc716ea1bc8672035..12d1a558a00516b8d085462d74fd8a629240f44c 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 d4116b1e9bc00c9ff711ebe7de5f5b732a0e5745..4ac4965a5624c13d2f1c994a4b54e9f3acd02149 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 1748ef344278492b2bc74796bd570d460128683e..e207860d77621e147993078e2be50631ee2baca2 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 c372b5af8eb1e3caa7ee3cb882be551866c036ae..0e46229777feadad281a5b799d54686471b4c8b5 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 aa9a7f766e2ca3058f67812025d22a349ecc3cf9..7d1282760e718289bdff3faee1ca781d9e299fc1 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 0000000000000000000000000000000000000000..9de0a4d9317285efebfe2894d97ab938d56fd693 --- /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 0000000000000000000000000000000000000000..0073db2c73e575ee537375e7cb571f5a98e14448 --- /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 0000000000000000000000000000000000000000..ad6a9d7e6a1be27f3aa1bb88571b6f09cbc8622d --- /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 0000000000000000000000000000000000000000..71e9afb2b47f9ea3c89e9a57da4265dc6d270ba3 --- /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 0649c480fc6b2da9ddb9ae4ae64b4a805f862caa..1c12a456cc41620345cdfd24513b9d251ad22a61 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 e70d0a7e19928d99b51f4eece777498387bcf768..5003681f7bb4ede637f7d57d10dc9c69e7923e45 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 20ab88f97cbb05b9ab9a6e6c749ca48b0889c1b0..9fe44113f70416d1ec821eef931156c08157058c 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 850c1ef84cfb62526716a86fd0059284ec3a9c0e..cdea145f9ad4d4342821ed5accc8fbefcf1032e7 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 d53efe885272866771d23110a2652cf9d97ddca2..a6be3186d724983d6d9dae321bbd1b891faf7452 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 7b98f4c92297d17a715f14a8e6c3e519a38a922e..6e033ca5ec20c41439a72400a96c03e6c7398d2e 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 a36d08f5e5bb46df93a9f927b76eef4d7eacc5ef..366f5d1d5393a9e18c63e0d7b80e1679666f329f 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 bfd549de219526fe24e9da9b5b81de5dcf10a5a0..805b698c643e0e575ec621a1746d0ac733e7f34f 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 de2cc9a07c65f88d9395dd6bf08879019f03d531..32a2949102c3f0f5b2cb0edfdd75f84de66501ab 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 e9e9c577980cefed7260eba0e0eacc8db744e42d..9b0237fe3c6c1116ae3982c11ce8927fc33e58f8 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 3faab1743179df40242ea36ed50b489e78fb7fa3..9a1f7f13150b2c940296e5e3884536b890a06834 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 d25ec835def489123cb0116b5b1e7b9a7081588f..c65a7e85d7e0b2bfea7604b2751d3f2f4922d107 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 2b94974d9fd596bf13c566fd432b75b262960856..0c68b4be2a1f2048269cb136c6a1848edddcf826 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 90c2a56faa138d5a86a32c8cda059eba79ac6b66..9b223a49f921b4edfcdfaaeb9ccb7ab3e03990be 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 aa8227fc52d2e0cc0625097322941aaeff39a88d..1ccdb4c719b08693b611b46fb6260495b66debe5 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 90c2a56faa138d5a86a32c8cda059eba79ac6b66..9b223a49f921b4edfcdfaaeb9ccb7ab3e03990be 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 c8e40e5fa8a9650210eecf856003f62efcbf164a..42b39735832f4699de73c0e85c7dc796f55dc8bb 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 a1f19dd92e59236d9359c1468178803f2c2cd0a2..126a1352d91be21f8a325751771ae008e8046369 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 d0f1a5a7b226cdf78473cb0800f5d62e06354830..efafd3a8c6e12a82aa1d64a01d40f63050fdc4b2 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 a1f19dd92e59236d9359c1468178803f2c2cd0a2..126a1352d91be21f8a325751771ae008e8046369 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 b5f359d7327fbb214548571e09450e283c79d5b5..5e1c548efd55616ae861523289d88a8b153da105 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 631174b34b4d43573736c03999439e9f3e9a866e..9e65920b68739db94a6a988aede58251fb9a2b9c 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 d5c5ac1b1e2a7b320cf7d91a0df4e16fbc08114f..4d82efc5694de4b57ac6dd7cfe6a77adae3d9f66 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 6c3a15704414efb40db53f51a45737a0b1a79467..74f2ed2c4dd1376e53245a4c42ae6b62edbb4948 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 d6c750102aa4f43c8ebe3a79207a3c319b02b7df..01f070151ddbd93fdcee5eade26850559a98b5d8 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 0593d0c34b9bc03fed90905740fddfb2b267df41..1844143048c6109992449d8b6c888500c4b4e786 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 42c7fbfae9fc27e9c6485a5578e4f79f1726e2f0..147d9f91187b3ef37c4e1546ac9646ed04c183fa 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 a7311da97dd006914eb7220bf1d1147f72a3dcf7..6feed41586bc2eff835f8442a92d0e66d6dd83c9 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 a9a48bcc35dd7215cdb287c1d8a864e5130f0a45..59358681d9e698857e8982e3e180e5a454d40567 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 5aee8d19792236488d4476ab296a1e181afc0de9..6a487305d9079b13aa6e52e1fe45966d239672f0 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 519215a325289c06a7a93b854feab084fc3dbe5f..ec52cec618647d6d6c8c64a15da22ed549116752 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 3099f0a1f9ee40b5ddc45607979782c6a825f7a1..280414e7974771d26758084829023f136f706bf6 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 792bfd9ee50a14e1abd2950f49b75be372e66247..ce721c71c39d793e69adcc2ef23eeecbf2f8bf75 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 14ad4ea2c36fa99c647c1a651fabe72092b3e08f..2e2a22f2116ab9b5a3f17fe6e43d6ed1284f90b6 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 24bbb334c14af38464778897ff16b5ae91a79ad4..80c83fa69bbfd83b61d221d6b3b6394884e8e13b 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 4465bdde8570757b7dd0f147bd3ed496c77cb8ca..2cb85322d78259fefc022a4ae7b2da544f49cef3 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 99ce78b33b08934460232b4132c04c33b31dce8d..21ea57dec3157b00594ddd5efc0677b27cf3c21b 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 70ec94513c17898605edd76ef0ea6df74e626461..8a3e7c7317910bbbb32c605b07b6ec257a43b254 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 2f961d43f1df5135f0380b866b71c12aa40ca909..02efb0f172ef9e7532b262cd5b33fb46016b05e3 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 8407a22272f5b75c63e4c2029523f410c19b9a98..198495df2c647e48ec6e0c562aec3fed9c969814 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 adbf4fe70b9ada330d42228f85d7e1d03e9b4cc8..e31af5fcdf6f34432e86eeb4f3c9228c2dbf4084 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 ac58c90cc4ca537369cdc9ddf27cfe022ef3d3e1..40018b3ed27e9907e1329b0c6fdac7dbd5354c9c 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 227f7e69f87b06c44fa48c9e9738a5326a07ddfb..4ce89cdcb14d0184d72a77532815427d12dd8d3b 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 b21364ae0643d2e65dd670283996026934cb5133..0000000000000000000000000000000000000000 --- 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 e2ec3b515df17f8c54c2ee4d4fa3d807960196b9..0000000000000000000000000000000000000000 --- 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 05cf6fac4b40643bf70d6133b6a4df1d723f6cc4..0000000000000000000000000000000000000000 --- 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 79c178d014fb9b5ac80d77fc89d54e17067cf726..0000000000000000000000000000000000000000 --- 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 b89b36741bd7c10fb8d63de1730544f6142a10c1..0000000000000000000000000000000000000000 --- 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 8bf4d2755863d98dee744da23992e29b047f6513..0000000000000000000000000000000000000000 --- 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 7ea37f6634e6a54dc21c246fed65c412c6240095..0000000000000000000000000000000000000000 --- 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 a19d519fd61c3f4426caa31df0ce4f406e5ba446..0000000000000000000000000000000000000000 --- 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 a19d519fd61c3f4426caa31df0ce4f406e5ba446..0000000000000000000000000000000000000000 --- 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 b3da2c5441597b80297bc2830a7138dcf9aa684b..0000000000000000000000000000000000000000 --- 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 ae24ae108f83e7fdb26209306a6edb5c660ac420..0000000000000000000000000000000000000000 --- 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 7db9fc7339eb85a258cffbd612726751dfee61d7..859afde6e68f4e11464d9816894f2c5be3963b72 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 d7e4cf716d64b101ac6793011948863bc5123a28..0000000000000000000000000000000000000000 --- 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 0b4e074a3b8add8ece7585e3ac9a57706bd7d6e3..0000000000000000000000000000000000000000 --- 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 7cd1ce8bc5af2bbc54dc05ad5ff486d7a3b77ecc..0000000000000000000000000000000000000000 --- 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 21cdf1a834b83918f5d105a68287f48cc7745cdc..0000000000000000000000000000000000000000 --- 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 381ed21bc9d35013af93e2c78b08c78d4eeef758..1f2430b4187e8aa48cc1df4d357dc7ed7989b243 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 54d7fc485d505ef4b5c777ca78be0188c73d4d70..4c12cc32befd617b0085aca0cae132140c84decd 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 faa6ac9d7ae9f1608aab7fdb394efc408850a332..6cec28f504e078d5ab34b0e1301db1003459b993 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 f453a1f4e656425ee34b779a4a720f1a6a35ced4..b1c1fb71d787f164e292c43056517e635461d30b 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 0000000000000000000000000000000000000000..e157d8bc1d5c102ebd283576edfdeb7f2c043b00 --- /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 e18f451a42f31725d09e8716514ae22b37d0d52d..395fab68088f69a93f94fb65a86ea95bedbd7444 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 0000000000000000000000000000000000000000..2b94bb4d92fd5f7295f255eb858bd8a0c1c4133a --- /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 f5d31888660e55318fb2230945d04488c982d4ab..7d540e807a58b5750822fdd8231236018c67abfb 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 0000000000000000000000000000000000000000..83943c7b534a5f1f945bded9a952529514a9b1d4 --- /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 11309a7638bee73e951772cc82b2626f4dd10717..eafafbf951aef64462fec1f0bea50bd0cedd3197 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 80662e0c28d68c2b30d788012ab1ee5da1c3c361..3f6a3bd2c26b718902f9da0ed274abf02b114904 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 3483376d67ba550dee53e22d565c024b13fb8a4e..a52f3fe4d208b4b065f71f9e7da5407642ccfdc2 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 e64522b348348ca3aba11979c53094bf915bc300..a5e2fcefadf83b48c2e028f7479866db616369aa 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 62ae98475cd3aafed9830c1848065682839d37eb..18bbbd98ba3e95e4a9ccaeea8fafeb40ecf2f597 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 5c922989ee70ebdae6f62dfbbdf1a358c8da5065..0e98ef6a71ad290754308c288697007cd6af6fbd 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 d1fd660d06bbe6d6a4ab2a81acfc88958324dd8d..a8cc7dd700bb4d627c76415545cca6996d3ebaf7 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 fd06c7f35a9c1e0e250edb849e1c398df8543681..f2994a7d456997d6becf7a4efbfd06f030a0913b 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 0de260e1d177777b88db49e4d0be1bac9574e237..8fb9247b22554001257ac144779c289644e1b952 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 0000000000000000000000000000000000000000..e57bf2afa71fe1840972c8e89830795519095cb2 --- /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 1434d9e7d9cc8e56d24753c7f0c90df17eaab5dd..54ca8448d263cec80f822eb796ff8f146e4ff24c 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 d283c56a4e307869620756f5112e5040cf44dac5..cdeefba2c6ffbab3dba62d599c8a02ecf8b4583c 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 7fcee13d5b0cdce91b3ffbdc72e8079217ab42a7..0f63c45f82ba39c250ee698218dbbbc7d21e3cec 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 5d53ce3c2147053868f75cfe94667b5ba9f168c5..2b1f8d3c6927d3c85c6fa1f720e00f64b2cd01e7 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 cf5ea4acb1dc9ccac8c6e23683ff740dc87048b5..2b923f30a7234ad7b3295e6aff4d29ca4b15f7bc 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 92bd9dcdb89c4bf0419e2d50d86a64fb947ea2fd..0fd72cc6bb78bed001bda1c452f6565e4d302bc2 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 4483c075881323453ccb6706a59e17bed33537b8..472de20eb2121134232e3d18ad55173e5380b67b 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 90ad0d607f24eb179b7ae9074d101858fee1797b..b416b1a79981b82873494c6558717403ca91b54c 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 47515f33fc9483c946bc1d75728bd5061140c780..502bb0218de6b656a2a456df6a1d02b9d1313e2c 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 b6d89b3f534256d02fc1a1558299d4fe95d3cfda..b767e15411c961e82d5fc835a7d3b4da1a01d492 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 90adee541266e3c935bfbd1c1a586cac4d21abf0..eac85feb8a9b8286c0b818ce70307f958407e727 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 9cba3bd3dc78f5e5ae5f47c4c7919757c1adad16..60d76bb558909de529ffd7eb99ad87ec58d02750 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 8b5a6276555899360400889d01bc4b17a8a83fb1..302a42b087e7ffd34b33110634b5b6012da8a035 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 89f9ca6155509aa21b6f8888115a36d194aad354..c8144dfb6515100971c06dd89356daf9380220f6 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 0000000000000000000000000000000000000000..5609c5bc8d5d102548ff4d37a016420e27a6a7d1 --- /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 5a496e820d3bde984150dbb3250f09d839d19944..acf71f113ff99fe99c469599a4fd685fe693121a 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 0000000000000000000000000000000000000000..cb7c8cae72cdaad9d89270f8694ae028685897b5 --- /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 cea04979414e9e56f8e29a086ec188ec090922ef..255aedabdde88e0fb3ed7639e689a5387c354eb4 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 a9b241c83fd10868438afd5a61a31f7bc29833f4..15cf1b4eceaddd077e94aeae9aa3f7f149da70c5 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 90d5b76c6c51954c998828ffa3fa1792f26c0e8f..6844094899be1faa55fefb660778beff629b51a4 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 ae1e1791a87a54649b5465044aad54927ca03136..4bec41b858351501eed0cf78d9c9cb07f2e1f34d 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 15d41aab7c4c4678408d3bf5bfb9b4206b7befd6..9969810976bca73eae32d5effe57b24234d147dd 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 8428bc33a6e74ccbe10c7dcca5872dcb300b2d01..542316be8c602ae5f72bacf4c3600e6a077437bc 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 6520f60932e7ffaa7bd1871cbcf4ac3c1caf3128..96b9eb225212eedce825540e077669c685d9adc7 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 7590cd9b3632178d7694300c89ebe1319bb30439..3b9016ce530c90e47c7bd820083358ec68d85af2 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 0000000000000000000000000000000000000000..19d27e94a20ae7870c40b66843856d4a93bb6958 --- /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 a82e88c0495bdb377b3cd7b1868bcd26baaeca89..892a0754e7ed16a9cfa7772ada0371fe19a59a3b 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 d0c3082340e98e6aac1a3c4167445a101e4882a8..20db9ee8e7828baf048a49aeb0e868b1a33bddc1 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 6d7facd20164b5a77a83b871beb4d91e3dcd5162..e1cdbe3cd96ebf22ca9f698f8d1d90fc514043d6 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 0000000000000000000000000000000000000000..1c97095745ab202470ed97e6537dc59098fa9b43 --- /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 32a741dc4182ac93a5772c03568d111e70f45d52..34e16045f5e9032f1b943db07c86fcf418d2f70b 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 12a1cb4af32ec86507aafaf0c5c24de443480f0b..9e4e7c4198b555e61b431fefda249aae1458077a 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 d7511beb216861a1b25bf9b34cdbc4c68a9cddc5..617ee35c4d789e916adbe81616ac278be04fc45f 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 5151df0132dbeed91b91e1063006624c88a085ef..a0dccd2ae05b7079f97c11ccc2c4129d57ea0b0e 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 4aeca7ed01ac4be29fc58209f162885947e456ba..0000000000000000000000000000000000000000 --- 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 4155e88030c0d01eb0341de35b7ff597bb1d274c..0000000000000000000000000000000000000000 --- 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 96d0752067e64c497a342db0884c53ea7889ed80..0000000000000000000000000000000000000000 --- 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 c819107bfe3104c4d4573df2740751da92bf60a2..0000000000000000000000000000000000000000 --- 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 b639efb2539669a0cf1b00f2ae15388c502ecce2..6e4ec8b4f641390dee87e1757bb2be34b80d062e 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/tst_build.sh b/ltp/tst-build.sh similarity index 100% rename from ltp/tst_build.sh rename to ltp/tst-build.sh diff --git a/ltp/tst-list-cases.sh b/ltp/tst-list-cases.sh new file mode 100755 index 0000000000000000000000000000000000000000..3785fc68e1952cd7f9fcc9f331f99d4090d89fa4 --- /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 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 98013cd30caced6df5c75007e66243decaebfc1f..c9c3c1c3054370e6e07019c05ba41b0b43ff08a3 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 176d623f01e702cd4a05c91f426cea1c70d02436..c14d7a86ed7cd2bed44c3cc75e63393f53dd66f6 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
    NoTest-NameStart-TimeCommand-LineContactsAnalysisTest-OutputInitiation-StatusDurationTermination-typeTermination-idCore-Filecutimecstime
  • Click Here for Detailed Report