From cf90ab0efb305f9b8765d3fa3f666c230aeb7286 Mon Sep 17 00:00:00 2001 From: rocket-turtle Date: Tue, 5 Nov 2024 19:29:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=80=81=E7=89=88?= =?UTF-8?q?=E6=9C=ACltp=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rocket-turtle --- Makefile.release | 46 - doc/build-system-guide.txt | 213 - doc/c-test-api.txt | 2371 ---------- doc/c-test-tutorial-simple.txt | 1078 ----- doc/library-api-writing-guidelines.txt | 59 - doc/maintainer-patch-review-checklist.txt | 59 - doc/mini-howto-building-ltp-from-git.txt | 62 - doc/network-c-api.txt | 476 -- doc/shell-test-api.txt | 763 ---- doc/supported-kernel-libc-versions.txt | 66 - doc/test-writing-guidelines.txt | 336 -- doc/user-guide.txt | 41 - execltp.in | 474 -- include/ipcshm.h | 54 - include/lapi/clone.h | 56 - include/lapi/namespaces_constants.h | 31 - include/lapi/pidfd_open.h | 24 - include/lapi/pidfd_send_signal.h | 27 - lib/newlib_tests/test10.c | 22 - lib/newlib_tests/test12.c | 21 - lib/newlib_tests/test18.c | 22 - m4/ltp-clone7args.m4 | 17 - m4/ltp-mremap_fixed.m4 | 12 - m4/ltp-perf_event_open.m4 | 16 - pan/debug.c | 84 - pan/debug.h | 67 - pan/ltp-scanner.c | 175 - pan/reporter.c | 270 -- pan/reporter.h | 80 - pan/scan.h | 42 - pan/scan.l | 456 -- pan/symbol.c | 467 -- pan/symbol.h | 104 - pan/tag_report.c | 478 -- runtest/ltp-aio-stress.part1 | 79 - runtest/ltp-aio-stress.part2 | 38 - runtest/net.rpc | 8 - testcases/commands/file/datafiles/in.csh | 4 - testcases/commands/file/datafiles/in.ksh | 4 - testcases/kernel/containers/.gitignore | 14 - testcases/kernel/containers/Makefile.inc | 45 - testcases/kernel/containers/README | 50 - testcases/kernel/containers/TEST_PLAN.txt | 27 - testcases/kernel/containers/libclone/Makefile | 27 - .../kernel/containers/libclone/libclone.c | 142 - .../kernel/containers/libclone/libclone.h | 82 - .../containers/mountns/mountns_helper.h | 61 - testcases/kernel/containers/mqns/mqns.h | 11 - .../kernel/containers/mqns/mqns_helper.h | 56 - .../kernel/containers/netns/netns_helper.sh | 278 -- .../kernel/containers/pidns/pidns_helper.h | 37 - testcases/kernel/containers/share/.gitignore | 4 - testcases/kernel/containers/share/Makefile | 22 - testcases/kernel/containers/share/ns_common.h | 55 - testcases/kernel/containers/share/ns_create.c | 109 - testcases/kernel/containers/share/ns_exec.c | 158 - testcases/kernel/containers/share/ns_ifmove.c | 134 - .../kernel/containers/share/setns_check.c | 32 - .../kernel/containers/sysvipc/ipcns_helper.h | 41 - .../kernel/containers/userns/userns_helper.h | 62 - .../containers/utsname/runutstests_noltp.sh | 41 - testcases/kernel/containers/utsname/utstest.c | 356 -- .../cgroup/cgroup_regression_6_2.c | 36 - .../cgroup/cgroup_regression_9_1.sh | 12 - .../cgroup/cgroup_regression_9_2.sh | 11 - testcases/kernel/fs/fs-bench/.gitignore | 3 - testcases/kernel/fs/fs-bench/Makefile | 41 - testcases/kernel/fs/fs-bench/README | 45 - testcases/kernel/fs/fs-bench/boxmuler.c | 28 - testcases/kernel/fs/fs-bench/create-files.c | 119 - testcases/kernel/fs/fs-bench/fs-bench-test.sh | 50 - .../kernel/fs/fs-bench/fs-bench-test2.sh | 63 - testcases/kernel/fs/fs-bench/modaltr.sh | 124 - .../fs/fs-bench/random-access-del-create.c | 138 - testcases/kernel/fs/fs-bench/random-access.c | 92 - .../kernel/fs/fs-bench/random-del-create.c | 134 - .../kernel/io/ltp-aiodio/read_checkzero.c | 84 - testcases/kernel/ipc/semaphore/.gitignore | 2 - testcases/kernel/ipc/semaphore/Makefile | 30 - testcases/kernel/ipc/semaphore/sem01.c | 164 - testcases/kernel/ipc/semaphore/sem02.c | 157 - testcases/kernel/mce-test/COPYING | 340 -- testcases/kernel/mce-test/Makefile | 41 - testcases/kernel/mce-test/README | 115 - .../kernel/mce-test/cases/apei-inj/README | 33 - .../mce-test/cases/apei-inj/ucr/cases.sh | 63 - .../cases/apei-inj/ucr/data/mem_uncorrected | 1 - .../cases/apei-inj/ucr/refer/mem_uncorrected | 10 - .../cases/soft-inj/non-panic/cases.sh | 55 - .../cases/soft-inj/non-panic/data/corrected | 14 - .../soft-inj/non-panic/data/corrected_hold | 10 - .../soft-inj/non-panic/data/corrected_no_en | 5 - .../soft-inj/non-panic/data/corrected_over | 4 - .../mce-test/cases/soft-inj/panic/cases.sh | 89 - .../mce-test/cases/soft-inj/panic/data/fatal | 8 - .../cases/soft-inj/panic/data/fatal_eipv | 7 - .../cases/soft-inj/panic/data/fatal_irq | 9 - .../cases/soft-inj/panic/data/fatal_no_en | 8 - .../cases/soft-inj/panic/data/fatal_over | 9 - .../cases/soft-inj/panic/data/fatal_ripv | 7 - .../cases/soft-inj/panic/data/fatal_timeout | 9 - .../soft-inj/panic/data/fatal_timeout_ripv | 9 - .../cases/soft-inj/panic/data/fatal_userspace | 7 - .../cases/soft-inj/panic/refer/fatal_no_en | 1 - .../cases/soft-inj/panic_noser/cases.sh | 61 - .../cases/soft-inj/panic_noser/data/uc_over | 6 - .../panic_noser/data/uc_over_corrected | 13 - .../soft-inj/panic_noser/data/uc_over_timeout | 6 - .../cases/soft-inj/panic_npcc/cases.sh | 108 - .../soft-inj/panic_npcc/data/fatal_severity | 16 - .../soft-inj/panic_npcc/data/uc_no_eripv | 5 - .../panic_npcc/data/uc_no_eripv_timeout | 6 - .../cases/soft-inj/panic_npcc/data/uc_no_mcip | 4 - .../panic_npcc/data/uc_no_mcip_timeout | 5 - .../soft-inj/panic_npcc/data/uncorrected | 7 - .../panic_npcc/data/uncorrected_timeout | 8 - .../cases/soft-inj/panic_npcc/data/unknown | 3 - .../cases/soft-inj/panic_ucr/cases.sh | 78 - .../cases/soft-inj/panic_ucr/data/s0_ar1 | 5 - .../soft-inj/panic_ucr/data/srao_ewb_noripv | 5 - .../panic_ucr/data/srao_mem_scrub_noripv | 5 - .../cases/soft-inj/panic_ucr/data/srar_no_en | 6 - .../cases/soft-inj/panic_ucr/data/srar_over | 5 - .../cases/soft-inj/panic_ucr/data/srar_unkown | 5 - .../cases/soft-inj/panic_ucr/refer/srar_no_en | 1 - .../cases/soft-inj/poll_noser/cases.sh | 49 - .../cases/soft-inj/poll_noser/data/uc_poll | 6 - .../cases/soft-inj/poll_noser/refer/uc_poll | 1 - .../mce-test/cases/soft-inj/poll_ucr/cases.sh | 54 - .../cases/soft-inj/poll_ucr/data/fatal_poll | 6 - .../cases/soft-inj/poll_ucr/data/srar_poll | 9 - .../cases/soft-inj/poll_ucr/data/ucna | 7 - .../cases/soft-inj/poll_ucr/data/ucna_over | 6 - .../cases/soft-inj/poll_ucr/refer/srar_poll | 1 - .../cases/soft-inj/recoverable_ucr/cases.sh | 50 - .../recoverable_ucr/data/srao_corrected | 11 - .../soft-inj/recoverable_ucr/data/srao_ewb | 6 - .../recoverable_ucr/data/srao_mem_scrub | 6 - .../soft-inj/recoverable_ucr/data/srao_no_en | 5 - .../soft-inj/recoverable_ucr/data/srao_over | 5 - .../soft-inj/recoverable_ucr/data/srao_ucna | 11 - .../recoverable_ucr/data/srao_unknown | 5 - .../recoverable_ucr/data/srar_usr_dcu | 7 - .../recoverable_ucr/data/srar_usr_dcu_irq | 7 - .../recoverable_ucr/data/srar_usr_dcu_nmi | 6 - .../recoverable_ucr/refer/srao_corrected | 5 - .../soft-inj/recoverable_ucr/refer/srao_no_en | 1 - .../soft-inj/recoverable_ucr/refer/srao_ucna | 6 - testcases/kernel/mce-test/config/kdump.conf | 6 - .../kernel/mce-test/config/kdump_noser.conf | 6 - .../kernel/mce-test/config/kdump_panic.conf | 6 - .../mce-test/config/kdump_panic_noser.conf | 6 - .../mce-test/config/kdump_panic_npcc.conf | 6 - .../mce-test/config/kdump_panic_ucr.conf | 6 - .../kernel/mce-test/config/kdump_ser.conf | 6 - testcases/kernel/mce-test/config/simple.conf | 4 - .../mce-test/config/simple_non_panic.conf | 4 - .../mce-test/config/simple_nopanic_noser.conf | 4 - .../mce-test/config/simple_nopanic_ser.conf | 4 - .../kernel/mce-test/config/simple_noser.conf | 4 - .../kernel/mce-test/config/simple_panic.conf | 4 - .../mce-test/config/simple_panic_noser.conf | 4 - .../mce-test/config/simple_panic_npcc.conf | 4 - .../mce-test/config/simple_panic_ucr.conf | 4 - .../mce-test/config/simple_poll_noser.conf | 4 - .../mce-test/config/simple_poll_ucr.conf | 4 - .../config/simple_recoverable_ucr.conf | 4 - .../kernel/mce-test/config/simple_ser.conf | 4 - .../mce-test/doc/cases/soft-inj_non-panic.txt | 66 - .../mce-test/doc/cases/soft-inj_panic.txt | 173 - .../doc/cases/soft-inj_panic_noser.txt | 83 - .../doc/cases/soft-inj_panic_npcc.txt | 145 - .../mce-test/doc/cases/soft-inj_panic_ucr.txt | 135 - .../mce-test/doc/cases/soft-inj_poll_ucr.txt | 44 - .../doc/cases/soft-inj_recoverable_ucr.txt | 192 - testcases/kernel/mce-test/doc/howto.txt | 516 --- .../kernel/mce-test/doc/stress-howto.txt | 340 -- testcases/kernel/mce-test/doc/verify.txt | 33 - .../kernel/mce-test/drivers/kdump/driver.sh | 299 -- .../kernel/mce-test/drivers/kdump/setup.sh | 105 - .../kernel/mce-test/drivers/simple/driver.sh | 132 - testcases/kernel/mce-test/hwpoison | 1 - testcases/kernel/mce-test/kvm/README | 149 - .../kernel/mce-test/kvm/guest/guest_run.sh | 35 - testcases/kernel/mce-test/kvm/host/SRAO | 4 - testcases/kernel/mce-test/kvm/host/guest_init | 37 - .../kernel/mce-test/kvm/host/host_run.sh | 376 -- testcases/kernel/mce-test/lib/apei-inject.sh | 180 - testcases/kernel/mce-test/lib/dirs.sh | 22 - testcases/kernel/mce-test/lib/functions.sh | 90 - testcases/kernel/mce-test/lib/mce.sh | 328 -- testcases/kernel/mce-test/lib/soft-inject.sh | 146 - testcases/kernel/mce-test/stress/Makefile | 25 - testcases/kernel/mce-test/stress/README | 75 - testcases/kernel/mce-test/stress/hwpoison.sh | 1061 ----- .../kernel/mce-test/stress/tools/Makefile | 16 - .../stress/tools/fs-metadata/Makefile | 11 - .../mce-test/stress/tools/fs-metadata/README | 25 - .../stress/tools/fs-metadata/fs-metadata.sh | 266 -- .../stress/tools/fs-metadata/k-thread.sh | 105 - .../stress/tools/fs-metadata/k-tree-gen.c | 96 - .../stress/tools/fs-metadata/k-tree-trav.c | 88 - .../stress/tools/page-poisoning/Makefile | 11 - .../stress/tools/page-poisoning/README | 15 - .../tools/page-poisoning/page-poisoning.c | 895 ---- testcases/kernel/mce-test/tools/Makefile | 7 - testcases/kernel/mce-test/tools/gcov_merge.py | 76 - .../kernel/mce-test/tools/grep_result.sh | 12 - .../kernel/mce-test/tools/loop-mce-test.sh | 45 - testcases/kernel/mce-test/tools/mce_shell.sh | 50 - testcases/kernel/mce-test/tools/page-types.c | 1003 ----- testcases/kernel/mce-test/tools/scov_merge.py | 68 - .../mce-test/tools/simple_process/Makefile | 13 - .../tools/simple_process/simple_process.c | 18 - testcases/kernel/mce-test/tsrc/Makefile | 75 - testcases/kernel/mce-test/tsrc/README | 59 - .../kernel/mce-test/tsrc/erst-inj/cper.h | 211 - .../kernel/mce-test/tsrc/erst-inj/erst-inj.mk | 4 - .../mce-test/tsrc/erst-inj/erst-inject.c | 255 -- .../kernel/mce-test/tsrc/erst-inj/uuid.h | 28 - testcases/kernel/mce-test/tsrc/erst-inject.sh | 108 - testcases/kernel/mce-test/tsrc/hugepage.h | 198 - .../kernel/mce-test/tsrc/kinclude/README | 3 - .../mce-test/tsrc/kinclude/linux/debugfs.h | 15 - .../kernel/mce-test/tsrc/kinclude/linux/fs.h | 10 - .../mce-test/tsrc/kinclude/linux/init.h | 5 - .../mce-test/tsrc/kinclude/linux/percpu.h | 9 - .../mce-test/tsrc/kinclude/linux/seq_file.h | 22 - .../mce-test/tsrc/kinclude/linux/sysdev.h | 2 - testcases/kernel/mce-test/tsrc/random_offline | 156 - .../kernel/mce-test/tsrc/run-huge-test.sh | 168 - .../mce-test/tsrc/run-transhuge-test.sh | 97 - testcases/kernel/mce-test/tsrc/tcases.c | 101 - testcases/kernel/mce-test/tsrc/thugetlb.c | 321 -- testcases/kernel/mce-test/tsrc/tinjpage.c | 969 ---- testcases/kernel/mce-test/tsrc/tkillpoison.c | 21 - testcases/kernel/mce-test/tsrc/tprctl.c | 96 - testcases/kernel/mce-test/tsrc/tring.c | 87 - testcases/kernel/mce-test/tsrc/tsimpleinj.c | 165 - testcases/kernel/mce-test/tsrc/tsoft.c | 29 - testcases/kernel/mce-test/tsrc/tsoftinj.c | 199 - testcases/kernel/mce-test/tsrc/ttable.c | 260 -- testcases/kernel/mce-test/tsrc/ttranshuge.c | 432 -- testcases/kernel/mce-test/tsrc/utils.h | 1 - testcases/kernel/security/tomoyo/.gitignore | 9 - testcases/kernel/security/tomoyo/Makefile | 29 - testcases/kernel/security/tomoyo/README | 58 - testcases/kernel/security/tomoyo/include.h | 379 -- testcases/kernel/security/tomoyo/newns.c | 49 - testcases/kernel/security/tomoyo/testall.sh | 46 - .../security/tomoyo/tomoyo_accept_test.c | 146 - .../kernel/security/tomoyo/tomoyo_file_test.c | 304 -- .../security/tomoyo/tomoyo_filesystem_test.c | 633 --- .../security/tomoyo/tomoyo_new_file_test.c | 627 --- .../kernel/security/tomoyo/tomoyo_new_test.c | 652 --- .../security/tomoyo/tomoyo_policy_io_test.c | 195 - .../tomoyo/tomoyo_policy_memory_test.c | 358 -- .../security/tomoyo/tomoyo_rewrite_test.c | 169 - testcases/kernel/syscalls/fcntl/fcntl06.c | 165 - testcases/kernel/syscalls/fork/fork02.c | 99 - .../kernel/syscalls/getitimer/getitimer03.c | 152 - .../kernel/syscalls/ipc/semget/semget03.c | 133 - .../kernel/syscalls/ipc/semget/semget06.c | 143 - testcases/kernel/syscalls/kcmp/kcmp.h | 54 - testcases/kernel/syscalls/mmap/mmap07.c | 146 - .../syscalls/mount/mount03_setuid_test.c | 63 - testcases/kernel/syscalls/open/open05.c | 140 - testcases/kernel/syscalls/paging/Makefile | 8 - testcases/kernel/syscalls/rename/rename02.c | 192 - .../kernel/syscalls/setgroups/setgroups04.c | 163 - .../kernel/syscalls/setitimer/setitimer03.c | 158 - .../kernel/syscalls/syslog/syslog-lib.sh | 161 - testcases/kernel/syscalls/syslog/syslog01 | 108 - testcases/kernel/syscalls/syslog/syslog02 | 111 - testcases/kernel/syscalls/syslog/syslog03 | 87 - testcases/kernel/syscalls/syslog/syslog04 | 84 - testcases/kernel/syscalls/syslog/syslog05 | 96 - testcases/kernel/syscalls/syslog/syslog06 | 76 - testcases/kernel/syscalls/syslog/syslog07 | 128 - testcases/kernel/syscalls/syslog/syslog08 | 132 - testcases/kernel/syscalls/syslog/syslog09 | 103 - testcases/kernel/syscalls/syslog/syslog10 | 108 - testcases/kernel/syscalls/syslog/syslogtst.c | 341 -- testcases/kernel/syscalls/umount2/umount2.h | 44 - .../kernel/syscalls/umount2/umount2_03.c | 167 - testcases/kernel/syscalls/utils/ioprio.h | 46 - testcases/network/nfs/nfslock01/nfslock01 | 65 - testcases/network/nfs/nfsstat01/nfsstat01 | 96 - .../network/rpc/basic_tests/rup/Makefile | 29 - .../network/rpc/basic_tests/rup/rup01.sh | 50 - .../network/rpc/basic_tests/rusers/Makefile | 29 - .../rpc/basic_tests/rusers/rusers01.sh | 50 - .../conformance/interfaces/sem_unlink/5-1.c | 10 +- testcases/realtime/m4/ltp-exp10.m4 | 37 - tools/sparse/sparse-src/.gitignore | 49 - .../sparse-src/Documentation/.gitignore | 2 - tools/sparse/sparse-src/Documentation/IR.rst | 445 -- .../sparse/sparse-src/Documentation/Makefile | 26 - tools/sparse/sparse-src/Documentation/TODO.md | 116 - .../sparse-src/Documentation/annotations.rst | 85 - tools/sparse/sparse-src/Documentation/api.rst | 30 - tools/sparse/sparse-src/Documentation/conf.py | 186 - .../Documentation/data-structures.txt | 55 - .../sparse-src/Documentation/dev-options.rst | 58 - .../sparse-src/Documentation/doc-guide.rst | 155 - .../sparse/sparse-src/Documentation/index.rst | 99 - .../sparse/sparse-src/Documentation/logo.svg | 94 - .../Documentation/release-notes/index.rst | 23 - .../Documentation/release-notes/v0.1.rst | 54 - .../Documentation/release-notes/v0.2.rst | 48 - .../Documentation/release-notes/v0.3.rst | 111 - .../Documentation/release-notes/v0.4.1.rst | 29 - .../Documentation/release-notes/v0.4.2.rst | 173 - .../Documentation/release-notes/v0.4.3.rst | 85 - .../Documentation/release-notes/v0.4.4.rst | 89 - .../release-notes/v0.4.5-rc1.rst | 12 - .../Documentation/release-notes/v0.4.rst | 273 -- .../Documentation/release-notes/v0.5.0.rst | 248 -- .../Documentation/release-notes/v0.5.1.rst | 422 -- .../Documentation/release-notes/v0.5.2.rst | 99 - .../Documentation/release-notes/v0.6.0.rst | 1044 ----- .../Documentation/release-notes/v0.6.1.rst | 30 - .../Documentation/release-notes/v0.6.2.rst | 104 - .../Documentation/release-notes/v0.6.3.rst | 56 - .../sparse-src/Documentation/sphinx/cdoc.py | 316 -- .../sparse-src/Documentation/sphinx/ir.py | 75 - .../sphinx/static/theme_overrides.css | 20 - .../Documentation/submitting-patches.md | 21 - .../Documentation/templates/breadcrumbs.html | 11 - .../Documentation/templates/layout.html | 8 - .../sparse-src/Documentation/test-suite.rst | 182 - .../sparse/sparse-src/Documentation/types.rst | 165 - tools/sparse/sparse-src/FAQ | 74 - tools/sparse/sparse-src/LICENSE | 34 - tools/sparse/sparse-src/Makefile | 311 -- tools/sparse/sparse-src/README | 71 - tools/sparse/sparse-src/allocate.c | 156 - tools/sparse/sparse-src/allocate.h | 97 - tools/sparse/sparse-src/ast-inspect.c | 220 - tools/sparse/sparse-src/ast-inspect.h | 17 - tools/sparse/sparse-src/ast-model.c | 469 -- tools/sparse/sparse-src/ast-model.h | 90 - tools/sparse/sparse-src/ast-view.c | 49 - tools/sparse/sparse-src/ast-view.h | 7 - tools/sparse/sparse-src/bitmap.h | 51 - tools/sparse/sparse-src/bits.h | 73 - tools/sparse/sparse-src/builtin.c | 839 ---- tools/sparse/sparse-src/builtin.h | 19 - tools/sparse/sparse-src/c2xml.c | 334 -- tools/sparse/sparse-src/cgcc | 357 -- tools/sparse/sparse-src/cgcc.1 | 37 - tools/sparse/sparse-src/char.c | 151 - tools/sparse/sparse-src/char.h | 2 - tools/sparse/sparse-src/compat-bsd.c | 24 - tools/sparse/sparse-src/compat-cygwin.c | 56 - tools/sparse/sparse-src/compat-linux.c | 7 - tools/sparse/sparse-src/compat-mingw.c | 53 - tools/sparse/sparse-src/compat-solaris.c | 1 - tools/sparse/sparse-src/compat.h | 26 - tools/sparse/sparse-src/compat/bswap.h | 54 - tools/sparse/sparse-src/compat/mmap-blob.c | 37 - tools/sparse/sparse-src/compat/strtold.c | 6 - tools/sparse/sparse-src/compile-i386.c | 2394 ---------- tools/sparse/sparse-src/compile.c | 86 - tools/sparse/sparse-src/compile.h | 10 - tools/sparse/sparse-src/cse.c | 372 -- tools/sparse/sparse-src/cse.h | 11 - tools/sparse/sparse-src/ctags.c | 227 - tools/sparse/sparse-src/dissect.c | 660 --- tools/sparse/sparse-src/dissect.h | 38 - tools/sparse/sparse-src/dominate.c | 153 - tools/sparse/sparse-src/dominate.h | 13 - tools/sparse/sparse-src/evaluate.c | 3962 ----------------- tools/sparse/sparse-src/evaluate.h | 35 - tools/sparse/sparse-src/example.c | 1959 -------- tools/sparse/sparse-src/expand.c | 1462 ------ tools/sparse/sparse-src/expand.h | 34 - tools/sparse/sparse-src/expression.c | 969 ---- tools/sparse/sparse-src/expression.h | 343 -- tools/sparse/sparse-src/flow.c | 1042 ----- tools/sparse/sparse-src/flow.h | 49 - tools/sparse/sparse-src/flowgraph.c | 223 - tools/sparse/sparse-src/flowgraph.h | 33 - tools/sparse/sparse-src/gcc-attr-list.h | 210 - tools/sparse/sparse-src/gdbhelpers | 289 -- tools/sparse/sparse-src/graph.c | 206 - tools/sparse/sparse-src/gvpr/return-paths | 107 - tools/sparse/sparse-src/gvpr/subg-fwd | 79 - tools/sparse/sparse-src/gvpr/subg-rev | 101 - tools/sparse/sparse-src/ident-list.h | 89 - tools/sparse/sparse-src/inline.c | 584 --- tools/sparse/sparse-src/ir.c | 207 - tools/sparse/sparse-src/ir.h | 8 - tools/sparse/sparse-src/lib.c | 491 -- tools/sparse/sparse-src/lib.h | 250 -- tools/sparse/sparse-src/linearize.c | 2672 ----------- tools/sparse/sparse-src/linearize.h | 357 -- tools/sparse/sparse-src/liveness.c | 330 -- tools/sparse/sparse-src/liveness.h | 11 - tools/sparse/sparse-src/machine.h | 133 - tools/sparse/sparse-src/memops.c | 295 -- tools/sparse/sparse-src/obfuscate.c | 76 - tools/sparse/sparse-src/opcode.c | 39 - tools/sparse/sparse-src/opcode.def | 115 - tools/sparse/sparse-src/opcode.h | 52 - tools/sparse/sparse-src/optimize.c | 134 - tools/sparse/sparse-src/optimize.h | 9 - tools/sparse/sparse-src/options.c | 1045 ----- tools/sparse/sparse-src/options.h | 145 - tools/sparse/sparse-src/parse.c | 3066 ------------- tools/sparse/sparse-src/parse.dtd | 51 - tools/sparse/sparse-src/parse.h | 145 - tools/sparse/sparse-src/pre-process.c | 2355 ---------- tools/sparse/sparse-src/predefine.c | 285 -- tools/sparse/sparse-src/ptrlist.c | 510 --- tools/sparse/sparse-src/ptrlist.h | 313 -- tools/sparse/sparse-src/ptrmap.c | 109 - tools/sparse/sparse-src/ptrmap.h | 28 - tools/sparse/sparse-src/scheck.c | 362 -- tools/sparse/sparse-src/scope.c | 183 - tools/sparse/sparse-src/scope.h | 67 - tools/sparse/sparse-src/semind.1 | 151 - tools/sparse/sparse-src/semind.c | 1180 ----- tools/sparse/sparse-src/show-parse.c | 1204 ----- tools/sparse/sparse-src/simplify.c | 2820 ------------ tools/sparse/sparse-src/simplify.h | 10 - tools/sparse/sparse-src/sort.c | 290 -- tools/sparse/sparse-src/sparse-llvm-dis | 15 - tools/sparse/sparse-src/sparse-llvm.c | 1360 ------ tools/sparse/sparse-src/sparse.1 | 588 --- tools/sparse/sparse-src/sparse.c | 337 -- tools/sparse/sparse-src/sparsec | 62 - tools/sparse/sparse-src/sparsei | 31 - tools/sparse/sparse-src/ssa.c | 401 -- tools/sparse/sparse-src/ssa.h | 8 - tools/sparse/sparse-src/stats.c | 62 - tools/sparse/sparse-src/storage.c | 277 -- tools/sparse/sparse-src/storage.h | 79 - tools/sparse/sparse-src/symbol.c | 1005 ----- tools/sparse/sparse-src/symbol.h | 592 --- tools/sparse/sparse-src/target-alpha.c | 33 - tools/sparse/sparse-src/target-arm.c | 57 - tools/sparse/sparse-src/target-arm64.c | 44 - tools/sparse/sparse-src/target-bfin.c | 26 - tools/sparse/sparse-src/target-default.c | 11 - tools/sparse/sparse-src/target-h8300.c | 34 - tools/sparse/sparse-src/target-m68k.c | 32 - tools/sparse/sparse-src/target-microblaze.c | 34 - tools/sparse/sparse-src/target-mips.c | 63 - tools/sparse/sparse-src/target-nds32.c | 33 - tools/sparse/sparse-src/target-nios2.c | 47 - tools/sparse/sparse-src/target-openrisc.c | 31 - tools/sparse/sparse-src/target-ppc.c | 84 - tools/sparse/sparse-src/target-riscv.c | 162 - tools/sparse/sparse-src/target-s390.c | 73 - tools/sparse/sparse-src/target-sh.c | 36 - tools/sparse/sparse-src/target-sparc.c | 87 - tools/sparse/sparse-src/target-x86.c | 170 - tools/sparse/sparse-src/target-xtensa.c | 31 - tools/sparse/sparse-src/target.c | 277 -- tools/sparse/sparse-src/target.h | 162 - tools/sparse/sparse-src/test-dissect.c | 127 - tools/sparse/sparse-src/test-inspect.c | 45 - tools/sparse/sparse-src/test-lexing.c | 49 - tools/sparse/sparse-src/test-linearize.c | 69 - tools/sparse/sparse-src/test-parsing.c | 91 - tools/sparse/sparse-src/test-show-type.c | 28 - tools/sparse/sparse-src/test-sort.c | 46 - tools/sparse/sparse-src/test-unssa.c | 89 - tools/sparse/sparse-src/token.h | 252 -- tools/sparse/sparse-src/tokenize.c | 1036 ----- tools/sparse/sparse-src/unssa.c | 142 - tools/sparse/sparse-src/utils.c | 64 - tools/sparse/sparse-src/utils.h | 47 - tools/sparse/sparse-src/validation/.gitignore | 4 - .../sparse-src/validation/Waddress-array.c | 25 - .../sparse-src/validation/Waddress-function.c | 17 - .../validation/Waddress-space-all-attr.c | 64 - .../validation/Waddress-space-from.c | 63 - .../validation/Waddress-space-strict.c | 36 - .../sparse-src/validation/Waddress-weak.c | 27 - tools/sparse/sparse-src/validation/Waddress.c | 114 - .../sparse-src/validation/Wcast-to-as.c | 36 - .../validation/Woverride-init-def.c | 14 - .../sparse-src/validation/Woverride-init-no.c | 12 - .../validation/Woverride-init-yes.c | 14 - .../sparse-src/validation/Wuniv-init-ko.c | 31 - .../sparse-src/validation/Wuniv-init-ok.c | 29 - .../validation/Wunknown-attribute-def.c | 5 - .../validation/Wunknown-attribute-no.c | 9 - .../validation/Wunknown-attribute-yes.c | 10 - .../sparse-src/validation/__func__-scope.c | 8 - tools/sparse/sparse-src/validation/__func__.c | 15 - .../sparse-src/validation/abi-integer.c | 31 - .../abstract-array-declarator-quals.c | 21 - .../abstract-array-declarator-star.c | 8 - .../abstract-array-declarator-static.c | 14 - .../validation/abstract-array-declarator.c | 11 - .../sparse-src/validation/address_space.c | 17 - .../sparse-src/validation/alloc-align.c | 38 - .../validation/alternate-keywords.c | 46 - .../sparse/sparse-src/validation/anon-union.c | 11 - .../arch/arm-predef-float-abi-hard.c | 8 - .../arch/arm-predef-float-abi-mixed.c | 8 - .../arch/arm-predef-float-abi-soft.c | 8 - .../validation/arch/arm-predef-hard-float.c | 8 - .../validation/arch/arm-predef-soft-float.c | 8 - tools/sparse/sparse-src/validation/arch/arm.c | 27 - .../sparse/sparse-src/validation/arch/arm64.c | 23 - .../sparse-src/validation/arch/mips32.c | 29 - .../sparse-src/validation/arch/riscv64.c | 27 - .../sparse-src/validation/arch/short-wchar.c | 6 - .../validation/array-implicit-size.c | 26 - tools/sparse/sparse-src/validation/as-name.c | 17 - tools/sparse/sparse-src/validation/asm-bad0.c | 41 - .../sparse-src/validation/asm-empty-clobber.c | 28 - .../sparse-src/validation/asm-goto-labels.c | 23 - .../sparse/sparse-src/validation/asm-inline.c | 52 - .../sparse-src/validation/attr-context.c | 40 - .../sparse-src/validation/attr-inline.c | 21 - .../validation/attr-no_sanitize_address.c | 9 - .../sparse-src/validation/attr-noclone.c | 9 - .../sparse-src/validation/attr-optimize.c | 16 - .../sparse-src/validation/attr-visible.c | 12 - .../sparse-src/validation/attr-visible2.c | 9 - .../sparse-src/validation/attr-warning.c | 8 - .../sparse-src/validation/attr_aligned.c | 6 - .../sparse-src/validation/attr_in_parameter.c | 12 - .../sparse-src/validation/attr_vector_size.c | 7 - .../sparse-src/validation/autotype-ko.c | 45 - tools/sparse/sparse-src/validation/autotype.c | 55 - .../validation/backend/arithmetic-ops.c | 114 - .../sparse-src/validation/backend/array.c | 6 - .../validation/backend/bitwise-ops.c | 64 - .../sparse-src/validation/backend/bool-test.c | 9 - .../validation/backend/call-variadic.c | 27 - .../sparse-src/validation/backend/cast.c | 49 - .../sparse-src/validation/backend/cmp-ops.c | 84 - .../validation/backend/compare-with-null.c | 12 - .../validation/backend/constant-pointer.c | 24 - .../validation/backend/degenerate-ptr.c | 72 - .../sparse-src/validation/backend/extern.c | 11 - .../sparse-src/validation/backend/fn-ref.c | 32 - .../validation/backend/function-ptr-xtype.c | 37 - .../validation/backend/function-ptr.c | 153 - .../sparse-src/validation/backend/hello.c | 13 - .../sparse-src/validation/backend/int-cond.c | 30 - .../validation/backend/label-as-value.c | 13 - .../validation/backend/load-global.c | 21 - .../sparse-src/validation/backend/load-type.c | 12 - .../validation/backend/logical-ops.c | 24 - .../sparse-src/validation/backend/loop.c | 21 - .../sparse-src/validation/backend/loop2.c | 14 - .../validation/backend/pointer-add.c | 54 - .../validation/backend/pointer-cmp.c | 12 - .../validation/backend/pointer-param.c | 42 - .../validation/backend/pointer-sub.c | 17 - .../sparse-src/validation/backend/ptrcast.c | 9 - .../sparse-src/validation/backend/setval.c | 7 - .../validation/backend/shift-special.c | 13 - .../validation/backend/store-type.c | 12 - .../sparse-src/validation/backend/store-x2.c | 16 - .../validation/backend/string-value.c | 21 - .../validation/backend/struct-access.c | 28 - .../sparse-src/validation/backend/struct.c | 25 - .../sparse-src/validation/backend/sum.c | 27 - .../sparse-src/validation/backend/switch.c | 248 -- .../sparse-src/validation/backend/symaddr.c | 70 - .../validation/backend/type-constant.c | 23 - .../sparse-src/validation/backend/union.c | 12 - .../validation/backend/void-return-type.c | 13 - .../bad-array-designated-initializer.c | 13 - .../sparse-src/validation/bad-assignment.c | 15 - tools/sparse/sparse-src/validation/bad-cast.c | 15 - .../sparse-src/validation/bad-check-access0.c | 31 - .../sparse-src/validation/bad-return-type.c | 19 - .../sparse-src/validation/bad-ternary-cond.c | 12 - .../sparse-src/validation/bad-type-twice0.c | 12 - .../sparse-src/validation/bad-type-twice1.c | 16 - .../sparse-src/validation/bad-type-twice2.c | 18 - .../sparse/sparse-src/validation/bad-typeof.c | 14 - tools/sparse/sparse-src/validation/badtype1.c | 10 - tools/sparse/sparse-src/validation/badtype2.c | 26 - tools/sparse/sparse-src/validation/badtype3.c | 28 - tools/sparse/sparse-src/validation/badtype4.c | 15 - tools/sparse/sparse-src/validation/badtype5.c | 18 - .../sparse-src/validation/binary-constant.c | 7 - .../validation/bitfield-bool-layout.c | 26 - .../sparse-src/validation/bitfield-kr.c | 14 - .../sparse-src/validation/bitfield-sizes.c | 30 - .../sparse/sparse-src/validation/bitfields.c | 21 - .../sparse-src/validation/bitwise-cast-ptr.c | 33 - .../sparse-src/validation/bitwise-cast.c | 50 - .../validation/bitwise-function-pointer.c | 17 - .../sparse/sparse-src/validation/bool-array.c | 47 - .../sparse-src/validation/bool-cast-bad.c | 23 - .../validation/bool-cast-restricted.c | 43 - .../sparse/sparse-src/validation/bool-float.c | 9 - .../validation/bswap-constant-folding.c | 28 - .../sparse-src/validation/bug-bad-type.c | 18 - .../sparse-src/validation/bug-crash16.c | 11 - .../sparse-src/validation/bug-rshift-ub.c | 16 - .../sparse-src/validation/bug_inline_switch.c | 25 - .../validation/builtin-args-checking.c | 45 - .../sparse-src/validation/builtin-arith.c | 57 - .../validation/builtin-atomic-clear.c | 15 - .../validation/builtin-bswap-constant.c | 34 - .../validation/builtin-bswap-variable.c | 32 - .../sparse-src/validation/builtin-fp-unop.c | 95 - .../validation/builtin-objsize-dyn.c | 22 - .../sparse-src/validation/builtin-objsize0.c | 25 - .../sparse-src/validation/builtin-objsize1.c | 21 - .../sparse-src/validation/builtin-overflow.c | 246 - .../sparse-src/validation/builtin-prototype.c | 15 - .../sparse-src/validation/builtin-sync-cas.c | 25 - .../validation/builtin-sync-fetch.c | 24 - .../sparse-src/validation/builtin_atomic.c | 28 - .../sparse-src/validation/builtin_bswap.c | 9 - .../sparse-src/validation/builtin_inf.c | 16 - .../sparse-src/validation/builtin_safe1.c | 38 - .../validation/builtin_unreachable.c | 15 - .../validation/builtin_va_arg_pack.c | 20 - .../sparse-src/validation/c11-alignas.c | 40 - .../sparse-src/validation/c11-alignof.c | 12 - .../sparse/sparse-src/validation/c11-atomic.c | 115 - .../sparse-src/validation/c11-noreturn.c | 9 - .../sparse-src/validation/c11-stdc-version.c | 11 - .../sparse-src/validation/c11-thread-local.c | 9 - .../sparse-src/validation/c99-for-loop-decl.c | 40 - .../sparse-src/validation/c99-for-loop.c | 21 - .../sparse-src/validation/call-inlined.c | 59 - .../sparse-src/validation/call-variadic.c | 23 - .../calling-convention-attributes.c | 26 - .../sparse-src/validation/cast-bad-00.c | 47 - .../sparse-src/validation/cast-bad-01.c | 13 - .../sparse-src/validation/cast-kinds-check.c | 21 - .../sparse-src/validation/cast-weirds.c | 19 - .../validation/char-signed-native.c | 9 - .../sparse-src/validation/char-signed.c | 9 - .../validation/char-unsigned-native.c | 11 - .../sparse-src/validation/char-unsigned.c | 11 - .../validation/check_access-multi.c | 15 - .../validation/check_access-store.c | 21 - .../validation/check_byte_count-ice.c | 19 - .../sparse-src/validation/choose_expr.c | 17 - tools/sparse/sparse-src/validation/comma.c | 12 - .../validation/compare-null-to-int.c | 11 - .../validation/compound-assign-type.c | 18 - .../sparse-src/validation/compound-sizes.c | 88 - .../sparse-src/validation/cond-address.c | 14 - .../sparse-src/validation/cond-err-expand.c | 31 - .../sparse/sparse-src/validation/cond_expr.c | 19 - .../sparse/sparse-src/validation/cond_expr2.c | 22 - .../sparse/sparse-src/validation/cond_expr3.c | 17 - .../sparse-src/validation/conditional-type.c | 99 - .../validation/constant-suffix-32.c | 15 - .../validation/constant-suffix-64.c | 16 - .../constexpr-addr-of-static-member.c | 26 - .../validation/constexpr-addr-of-static.c | 36 - .../sparse-src/validation/constexpr-binop.c | 33 - .../sparse-src/validation/constexpr-cast.c | 25 - .../validation/constexpr-compound-literal.c | 19 - .../validation/constexpr-conditional.c | 34 - .../validation/constexpr-constcond.c | 10 - .../sparse-src/validation/constexpr-init.c | 60 - .../validation/constexpr-labelref.c | 14 - .../validation/constexpr-offsetof.c | 21 - .../validation/constexpr-pointer-arith.c | 28 - .../validation/constexpr-pointer-cast.c | 13 - .../sparse-src/validation/constexpr-preop.c | 31 - .../validation/constexpr-pure-builtin.c | 23 - .../sparse-src/validation/constexpr-shift.c | 12 - .../sparse-src/validation/constexpr-string.c | 9 - .../validation/constexpr-types-compatible-p.c | 8 - .../sparse-src/validation/context-stmt.c | 62 - .../validation/context-unreachable.c | 15 - tools/sparse/sparse-src/validation/context.c | 336 -- .../sparse-src/validation/crash-add-doms.c | 22 - .../sparse-src/validation/crash-bb_target.c | 10 - .../sparse-src/validation/crash-ep-active.c | 12 - .../sparse-src/validation/crash-ptrlist.c | 23 - .../validation/crash-rewrite-branch.c | 24 - .../sparse-src/validation/crash-select.c | 18 - .../validation/crash-undef-in-parens.c | 9 - .../sparse-src/validation/crazy02-not-so.c | 40 - tools/sparse/sparse-src/validation/crazy03.c | 33 - .../declaration-after-statement-ansi.c | 12 - .../declaration-after-statement-c89.c | 12 - .../declaration-after-statement-c99.c | 9 - .../declaration-after-statement-default.c | 9 - .../sparse-src/validation/definitions.c | 12 - .../sparse-src/validation/designated-init.c | 195 - tools/sparse/sparse-src/validation/div.c | 31 - .../sparse-src/validation/doc/cdoc.cdoc | 177 - .../sparse-src/validation/double-semicolon.c | 9 - .../validation/dubious-bitwise-with-not.c | 24 - .../sparse-src/validation/dup-defs-local.c | 28 - .../sparse-src/validation/empty-assign.c | 13 - .../validation/empty-char-constant.c | 9 - .../sparse/sparse-src/validation/empty-expr.c | 26 - tools/sparse/sparse-src/validation/empty-file | 0 .../sparse-src/validation/empty-initializer.c | 9 - .../sparse/sparse-src/validation/endian-big.c | 14 - .../sparse-src/validation/endian-little.c | 14 - .../sparse/sparse-src/validation/enum+mode.c | 18 - .../sparse-src/validation/enum-base-type.c | 29 - .../sparse-src/validation/enum-bitwise-bad.c | 20 - .../validation/enum-bitwise-mixed.c | 29 - .../sparse-src/validation/enum-bitwise.c | 19 - .../sparse-src/validation/enum-bounds.c | 25 - .../validation/enum-init-constness.c | 9 - .../sparse-src/validation/enum-invalid.c | 11 - .../sparse-src/validation/enum-min-size.c | 29 - .../sparse-src/validation/enum-mismatch.c | 19 - .../sparse-src/validation/enum-same-type.c | 14 - .../sparse-src/validation/enum-sign-extend.c | 12 - .../sparse-src/validation/enum-sign-gcc.c | 64 - .../sparse-src/validation/enum-type-dubious.c | 18 - .../sparse-src/validation/enum-type-exotic.c | 28 - .../sparse-src/validation/enum-typecheck.c | 39 - .../sparse/sparse-src/validation/enum_scope.c | 11 - .../sparse-src/validation/error-at-eof.c | 10 - tools/sparse/sparse-src/validation/escapes.c | 32 - .../sparse-src/validation/eval-bad-assign1.c | 14 - .../sparse-src/validation/eval-bad-assign2.c | 22 - .../sparse-src/validation/eval-typeof-vla.c | 26 - .../validation/eval/addressable-complex.c | 23 - .../validation/eval/addressable-degen.c | 17 - .../validation/eval/array-quals-node.c | 29 - .../sparse-src/validation/eval/array-quals0.c | 6 - .../sparse-src/validation/eval/array-quals1.c | 49 - .../sparse-src/validation/eval/asm-degen.c | 36 - .../sparse-src/validation/eval/asm-memop.c | 47 - .../validation/eval/assign-restricted-ok.c | 22 - .../validation/eval/not-cast-bool.c | 14 - .../validation/eval/not-cast-float.c | 14 - .../validation/eval/premature-examination.c | 27 - .../sparse-src/validation/eval/typeof0.c | 10 - .../validation/eval/undecl-no-indent.c | 19 - .../validation/eval/union-cast-no.c | 23 - .../sparse-src/validation/eval/union-cast.c | 24 - .../sparse-src/validation/eval/unqual-cast.c | 14 - .../sparse-src/validation/eval/unqual-comma.c | 12 - .../validation/eval/unqual-postop.c | 23 - .../validation/eval/unqual-stmt-expr.c | 12 - .../sparse-src/validation/eval/unqual02.c | 26 - .../sparse-src/validation/expand/asm0.c | 23 - .../sparse-src/validation/expand/bad-shift.c | 64 - .../validation/expand/builtin-expect.c | 100 - .../expand/builtin_constant_inline0.c | 24 - .../expand/builtin_constant_inline1.c | 24 - .../validation/expand/builtin_fpclassify.c | 26 - .../validation/expand/builtin_huge_val.c | 39 - .../validation/expand/builtin_isdigit.c | 10 - .../validation/expand/builtin_isinf.c | 20 - .../validation/expand/builtin_isnan.c | 20 - .../validation/expand/builtin_isnormal.c | 20 - .../validation/expand/builtin_nan.c | 23 - .../validation/expand/compound-literal.c | 26 - .../validation/expand/constant-init-array.c | 15 - .../expand/constant-init-nested-array.c | 15 - .../expand/constant-init-nested-struct.c | 23 - .../validation/expand/constant-init-string.c | 15 - .../expand/constant-union-flt2int.c | 20 - .../expand/constant-union-int2flt.c | 19 - .../validation/expand/constant-union-size.c | 20 - .../validation/expand/cost-deref-nested.c | 20 - .../validation/expand/default-init-array.c | 16 - .../validation/expand/default-init-struct.c | 22 - .../validation/expand/function-pointer.c | 22 - .../sparse-src/validation/expand/union-cast.c | 27 - .../sparse-src/validation/extern-array.c | 14 - .../sparse-src/validation/extern-inline.c | 23 - .../sparse-src/validation/fdiag-prefix.c | 11 - .../sparse-src/validation/field-overlap.c | 16 - .../sparse-src/validation/field-override.c | 101 - .../sparse-src/validation/flex-array-align.c | 18 - .../sparse-src/validation/flex-array-array.c | 15 - .../sparse-src/validation/flex-array-error.c | 26 - .../sparse-src/validation/flex-array-nested.c | 29 - .../sparse-src/validation/flex-array-sizeof.c | 18 - .../validation/flex-array-union-array-no.c | 9 - .../validation/flex-array-union-array-yes.c | 11 - .../validation/flex-array-union-array.h | 11 - .../sparse/sparse-src/validation/fored_arg.c | 18 - .../sparse-src/validation/foul-bitwise.c | 32 - .../sparse-src/validation/foul-scalar.c | 13 - tools/sparse/sparse-src/validation/fp-ops.c | 57 - .../validation/function-attribute-inner.c | 9 - .../validation/function-attribute-pointer.c | 33 - .../validation/function-attribute-void-ptr.c | 14 - .../validation/function-attribute.c | 22 - .../validation/function-pointer-inheritance.c | 9 - .../validation/function-pointer-type.c | 12 - .../validation/function-redecl-funattr.c | 13 - .../sparse-src/validation/function-redecl.c | 92 - .../sparse-src/validation/function-redecl2.c | 28 - .../sparse-src/validation/generic-bad0.c | 27 - .../sparse-src/validation/generic-dr481.c | 16 - .../sparse-src/validation/generic-functions.c | 44 - .../sparse-src/validation/generic-schar.c | 39 - .../sparse-src/validation/generic-typename.c | 157 - .../sparse/sparse-src/validation/goto-label.c | 29 - .../sparse-src/validation/goto-reserved.c | 12 - .../sparse-src/validation/identifier_list.c | 18 - .../validation/implicit-KR-arg-type0.c | 15 - .../validation/implicit-KR-arg-type1.c | 23 - .../sparse-src/validation/implicit-ret-type.c | 15 - .../sparse-src/validation/implicit-type.c | 14 - .../sparse-src/validation/inc-dec-float.c | 13 - .../sparse-src/validation/include-eval.c | 6 - .../sparse-src/validation/include-eval.inc | 12 - .../sparse-src/validation/incomplete-struct.c | 23 - .../sparse-src/validation/infinite-loop0.c | 11 - .../sparse-src/validation/infinite-loop01.c | 54 - .../sparse-src/validation/infinite-loop02.c | 12 - .../sparse-src/validation/infinite-loop03.c | 17 - .../sparse-src/validation/infinite-loop04.c | 18 - .../sparse-src/validation/init-char-array.c | 18 - .../sparse-src/validation/init-char-array1.c | 27 - .../sparse-src/validation/init-wstring.c | 40 - .../sparse-src/validation/init_cstring.c | 13 - .../initializer-entry-defined-twice.c | 63 - .../sparse-src/validation/inline-generic.c | 10 - .../sparse-src/validation/inline_base0.c | 50 - .../validation/inline_compound_literals.c | 22 - .../sparse-src/validation/inline_self.c | 13 - tools/sparse/sparse-src/validation/int128.c | 58 - .../validation/integer-const-expr.c | 85 - .../validation/integer-promotions.c | 7 - .../sparse-src/validation/ioc-typecheck.c | 7 - .../sparse-src/validation/kill-computedgoto.c | 17 - tools/sparse/sparse-src/validation/kill-cse.c | 21 - .../validation/kill-insert-branch.c | 22 - .../sparse/sparse-src/validation/kill-load.c | 17 - .../sparse-src/validation/kill-phi-node.c | 27 - .../sparse-src/validation/kill-phi-ttsbb.c | 28 - .../sparse-src/validation/kill-phi-ttsbb2.c | 40 - .../sparse-src/validation/kill-phisrc.c | 21 - .../sparse-src/validation/kill-pure-call.c | 17 - .../validation/kill-replaced-insn.c | 61 - .../validation/kill-rewritten-load.c | 16 - .../sparse-src/validation/kill-select.c | 16 - .../sparse/sparse-src/validation/kill-slice.c | 19 - .../sparse/sparse-src/validation/kill-store.c | 16 - .../sparse-src/validation/kill-switch.c | 17 - .../validation/kill-unreachable-phi.c | 27 - .../sparse-src/validation/knr-attr-crash.c | 12 - .../sparse/sparse-src/validation/label-asm.c | 13 - .../sparse/sparse-src/validation/label-attr.c | 9 - .../sparse-src/validation/label-redefined.c | 17 - .../sparse-src/validation/label-scope-cgoto.c | 82 - .../sparse-src/validation/label-scope.c | 9 - .../sparse-src/validation/label-scope1.c | 42 - .../sparse-src/validation/label-scope2.c | 31 - .../sparse-src/validation/label-stmt-expr0.c | 38 - .../sparse-src/validation/label-stmt-expr1.c | 28 - .../sparse-src/validation/label-stmt-expr2.c | 46 - .../sparse-src/validation/label-unused.c | 29 - .../sparse-src/validation/linear/asm-memop.c | 23 - .../sparse-src/validation/linear/asm-out0.c | 25 - .../validation/linear/asm-toplevel.c | 8 - .../validation/linear/bitfield-expand-deref.c | 27 - .../validation/linear/bitfield-inc.c | 16 - .../validation/linear/bitfield-init-mask.c | 27 - .../validation/linear/bitfield-preinc.c | 18 - .../validation/linear/bitfield-sign-default.c | 13 - .../validation/linear/bitfield-sign-signed.c | 13 - .../linear/bitfield-sign-unsigned.c | 13 - .../validation/linear/bitfield-size.c | 183 - .../validation/linear/bitfield-store.c | 22 - .../validation/linear/bool-cast-lp32.c | 18 - .../validation/linear/bool-cast-lp64.c | 19 - .../sparse-src/validation/linear/bool-cast.c | 37 - .../validation/linear/bug-assign-op0.c | 114 - .../validation/linear/builtin-fma.c | 19 - .../validation/linear/builtin_isdigit.c | 12 - .../validation/linear/builtin_unreachable0.c | 27 - .../validation/linear/builtin_unreachable1.c | 30 - .../sparse-src/validation/linear/call-basic.c | 57 - .../validation/linear/call-builtin.c | 17 - .../validation/linear/call-casted-pointer.c | 31 - .../validation/linear/call-complex-pointer.c | 33 - .../validation/linear/call-direct.c | 17 - .../validation/linear/call-indirect.c | 15 - .../validation/linear/call-inline.c | 18 - .../linear/cast-constant-to-float.c | 35 - .../validation/linear/cast-constants.c | 358 -- .../validation/linear/cast-volatile.c | 15 - .../validation/linear/compound-literal00.c | 18 - .../validation/linear/compound-literal01.c | 18 - .../validation/linear/compound-literal02.c | 18 - .../validation/linear/degen-array.c | 32 - .../validation/linear/degen-function.c | 52 - .../validation/linear/degen-log-not.c | 40 - .../validation/linear/deref-ptr-ptr.c | 27 - .../validation/linear/fp-vs-ptrcast.c | 13 - .../sparse-src/validation/linear/fp2i-cast.c | 31 - .../validation/linear/goto-invalid.c | 18 - .../linear/goto-stmt-expr-conditional.c | 27 - .../linear/goto-stmt-expr-short-circuit.c | 31 - .../validation/linear/inline-definition.c | 30 - .../validation/linear/join-cond-discard.c | 19 - .../validation/linear/label-scope-cgoto.c | 10 - .../validation/linear/label-stmt-dropped.c | 26 - .../validation/linear/label-stmt-expr0.c | 17 - .../validation/linear/label-unreachable.c | 20 - .../validation/linear/logical-phi0.c | 48 - .../sparse-src/validation/linear/logical.c | 260 -- .../validation/linear/missing-insn-size.c | 19 - .../validation/linear/missing-return0.c | 10 - .../validation/linear/missing-return1.c | 15 - .../validation/linear/missing-return2.c | 11 - .../validation/linear/missing-return3.c | 18 - .../validation/linear/missing-return4.c | 14 - .../validation/linear/missing-return5.c | 23 - .../validation/linear/non-const-case.c | 37 - .../validation/linear/noreturn-unreachable0.c | 22 - .../validation/linear/phi-order01.c | 16 - .../validation/linear/phi-order02.c | 16 - .../validation/linear/phi-order03.c | 8 - .../validation/linear/phi-order04.c | 12 - .../validation/linear/pointer-arith32.c | 94 - .../validation/linear/pointer-arith64.c | 79 - .../sparse-src/validation/linear/range-op.c | 31 - .../validation/linear/shift-assign1.c | 319 -- .../validation/linear/shift-assign2.c | 53 - .../validation/linear/struct-init-full.c | 28 - .../validation/linear/struct-init-partial.c | 41 - .../validation/linear/unexamined-base-type.c | 36 - .../sparse-src/validation/local-label.c | 11 - tools/sparse/sparse-src/validation/logical.c | 17 - .../validation/mem2reg/address-used00.c | 18 - .../validation/mem2reg/alias-distinct.c | 17 - .../validation/mem2reg/alias-mixed.c | 30 - .../validation/mem2reg/alias-same.c | 17 - .../validation/mem2reg/asm-reload0.c | 14 - .../validation/mem2reg/broken-phi02.c | 27 - .../validation/mem2reg/broken-phi03.c | 28 - .../sparse-src/validation/mem2reg/cond-expr.c | 14 - .../validation/mem2reg/cond-expr5.c | 20 - .../validation/mem2reg/dead-phisrc.c | 17 - .../validation/mem2reg/global-direct-undef.c | 23 - .../validation/mem2reg/global-direct.c | 23 - .../validation/mem2reg/global-loop.c | 20 - .../validation/mem2reg/global-noalias.c | 21 - .../validation/mem2reg/global-pointer.c | 26 - .../sparse-src/validation/mem2reg/if-direct.c | 19 - .../validation/mem2reg/if-pointer.c | 21 - .../validation/mem2reg/init-global-array.c | 21 - .../validation/mem2reg/init-local-array.c | 28 - .../validation/mem2reg/init-local-union0.c | 18 - .../validation/mem2reg/init-local-union1.c | 32 - .../validation/mem2reg/init-local32.c | 27 - .../validation/mem2reg/init-local64.c | 27 - .../sparse-src/validation/mem2reg/load-dead.c | 18 - .../validation/mem2reg/load-deadborn.c | 9 - .../sparse-src/validation/mem2reg/loop00.c | 16 - .../validation/mem2reg/loop01-global.c | 18 - .../validation/mem2reg/loop02-array.c | 23 - .../validation/mem2reg/loop02-global.c | 22 - .../validation/mem2reg/loop02-local.c | 23 - .../validation/mem2reg/loop02-pointer.c | 23 - .../validation/mem2reg/missing-return.c | 34 - .../validation/mem2reg/not-same-memop0.c | 48 - .../validation/mem2reg/packed-bitfield.c | 35 - .../sparse-src/validation/mem2reg/quadra00.c | 27 - .../sparse-src/validation/mem2reg/quadra01.c | 27 - .../sparse-src/validation/mem2reg/quadra02.c | 18 - .../validation/mem2reg/reload-aliasing.c | 41 - .../validation/mem2reg/short-load.c | 29 - .../validation/mem2reg/store-deadborn.c | 9 - .../validation/mem2reg/stray-phisrc.c | 24 - .../sparse-src/validation/mem2reg/struct.c | 32 - .../sparse-src/validation/mem2reg/undef00.c | 21 - .../sparse-src/validation/mem2reg/undef01.c | 16 - .../validation/mem2reg/unused-var.c | 23 - .../validation/mem2reg/volatile-store00.c | 27 - .../sparse-src/validation/member_of_typeof.c | 10 - .../sparse-src/validation/memops-volatile.c | 16 - .../validation/memops/kill-dead-loads00.c | 22 - .../memops/kill-dead-store-parent0.c | 14 - .../memops/kill-dead-store-parent2.c | 25 - .../validation/memops/kill-redundant-store0.c | 13 - .../validation/memops/partial-load00.c | 29 - .../validation/memops/type-punning-flt2int.c | 19 - .../validation/memops/type-punning-int2flt.c | 19 - .../sparse-src/validation/missing-ident.c | 18 - .../sparse-src/validation/missing-return.c | 20 - .../sparse-src/validation/multi-input.c | 11 - .../sparse-src/validation/multi_typedef.c | 15 - .../sparse-src/validation/nested-declarator.c | 29 - .../validation/nested-declarator2.c | 41 - .../sparse-src/validation/nested-functions.c | 43 - tools/sparse/sparse-src/validation/nocast.c | 203 - tools/sparse/sparse-src/validation/noderef.c | 51 - .../sparse-src/validation/non-pointer-null.c | 8 - .../validation/old-initializer-nowarn.c | 9 - .../sparse-src/validation/old-initializer.c | 12 - .../validation/old-style-definition0.c | 14 - .../validation/old-style-definition1.c | 18 - .../validation/optim/address-used01.c | 18 - .../sparse-src/validation/optim/and-extend.c | 27 - .../sparse-src/validation/optim/and-lsr.c | 15 - .../sparse-src/validation/optim/and-or-bf0.c | 24 - .../sparse-src/validation/optim/and-or-bf1.c | 18 - .../sparse-src/validation/optim/and-or-bf2.c | 27 - .../sparse-src/validation/optim/and-or-bfs.c | 23 - .../sparse-src/validation/optim/and-or-bfu.c | 21 - .../sparse-src/validation/optim/and-or-bfx.c | 18 - .../validation/optim/and-or-constant0.c | 12 - .../validation/optim/and-or-constant1.c | 14 - .../validation/optim/and-or-constant2.c | 13 - .../validation/optim/and-or-crash.c | 5 - .../sparse-src/validation/optim/and-or-lsr0.c | 13 - .../sparse-src/validation/optim/and-or-lsr1.c | 13 - .../sparse-src/validation/optim/and-or-lsr2.c | 13 - .../sparse-src/validation/optim/and-or-lsrx.c | 13 - .../sparse-src/validation/optim/and-or-mask.c | 18 - .../validation/optim/and-or-mask0.c | 12 - .../validation/optim/and-or-mask1.c | 13 - .../validation/optim/and-or-mask2.c | 13 - .../validation/optim/and-or-mask3s.c | 25 - .../validation/optim/and-or-mask3u.c | 25 - .../validation/optim/and-or-mask4.c | 25 - .../validation/optim/and-or-maskx.c | 13 - .../sparse-src/validation/optim/and-or-shl0.c | 12 - .../sparse-src/validation/optim/and-or-shl1.c | 13 - .../sparse-src/validation/optim/and-or-shl2.c | 13 - .../sparse-src/validation/optim/and-or-shlx.c | 13 - .../validation/optim/and-or-trunc0.c | 13 - .../validation/optim/and-or-trunc1.c | 12 - .../validation/optim/and-or-trunc2.c | 13 - .../validation/optim/and-or-truncx.c | 13 - .../sparse-src/validation/optim/and-trunc.c | 20 - .../sparse-src/validation/optim/bad-phisrc1.c | 15 - .../validation/optim/bad-phisrc1a.c | 23 - .../sparse-src/validation/optim/bad-phisrc2.c | 16 - .../sparse-src/validation/optim/bad-phisrc3.c | 20 - .../validation/optim/binops-same-args.c | 49 - .../validation/optim/bitfield-init-zero.c | 102 - .../validation/optim/bitfield-size.c | 33 - .../validation/optim/bitfield-store-load0.c | 44 - .../validation/optim/bitfield-store-loads.c | 23 - .../validation/optim/bitfield-store-loadu.c | 21 - .../validation/optim/bits-not-zero.c | 30 - .../validation/optim/bool-context-fp.c | 93 - .../validation/optim/bool-context.c | 12 - .../sparse-src/validation/optim/bool-eq0.c | 12 - .../validation/optim/bool-int-bool.c | 12 - .../sparse-src/validation/optim/bool-ne0.c | 12 - .../sparse-src/validation/optim/bool-neq0.c | 12 - .../validation/optim/bool-same-args.c | 12 - .../validation/optim/bool-sext-test.c | 12 - .../validation/optim/bool-simplify.c | 77 - .../validation/optim/bool-simplify2.c | 215 - .../validation/optim/bool-zext-test.c | 12 - .../validation/optim/call-complex-pointer.c | 13 - .../validation/optim/call-inlined.c | 23 - .../validation/optim/canonical-abs.c | 11 - .../validation/optim/canonical-add.c | 55 - .../validation/optim/canonical-arg.c | 20 - .../validation/optim/canonical-cmp-zero.c | 74 - .../validation/optim/canonical-cmp.c | 27 - .../validation/optim/canonical-cmpe-minmax.c | 16 - .../validation/optim/canonical-cmps-minmax.c | 16 - .../validation/optim/canonical-cmps-sel.c | 25 - .../validation/optim/canonical-cmps.c | 16 - .../validation/optim/canonical-cmpu.c | 15 - .../validation/optim/canonical-fcmp.c | 123 - .../validation/optim/canonical-mul.c | 24 - .../validation/optim/canonical-not.c | 9 - .../validation/optim/canonical-sub-cte.c | 9 - .../sparse-src/validation/optim/cast-kinds.c | 398 -- .../sparse-src/validation/optim/cast-nop.c | 18 - .../sparse-src/validation/optim/cgoto01.c | 24 - .../sparse-src/validation/optim/cgoto02.c | 17 - .../validation/optim/cmp-and-pow2.c | 12 - .../sparse-src/validation/optim/cmp-op-type.c | 18 - .../validation/optim/cmp-sext-sext.c | 17 - .../validation/optim/cmp-sext-simm.c | 53 - .../validation/optim/cmp-sext-uimm.c | 25 - .../sparse-src/validation/optim/cmp-sext.c | 23 - .../sparse-src/validation/optim/cmp-type0.c | 12 - .../sparse-src/validation/optim/cmp-type1.c | 15 - .../validation/optim/cmp-zext-simm.c | 23 - .../validation/optim/cmp-zext-uimm0.c | 21 - .../validation/optim/cmp-zext-uimm1.c | 15 - .../validation/optim/cmp-zext-uimm2.c | 29 - .../validation/optim/cmp-zext-zext.c | 17 - .../sparse-src/validation/optim/cmp-zext.c | 17 - .../sparse-src/validation/optim/cmpe-and0.c | 10 - .../sparse-src/validation/optim/cmpe-or0.c | 10 - .../sparse-src/validation/optim/cmps-and0.c | 21 - .../sparse-src/validation/optim/cmps-minmax.c | 16 - .../sparse-src/validation/optim/cmps-or0.c | 21 - .../sparse-src/validation/optim/cmps0-and0.c | 12 - .../sparse-src/validation/optim/cmpu-and0.c | 17 - .../sparse-src/validation/optim/cmpu-or0.c | 18 - .../sparse-src/validation/optim/cse-arg01.c | 9 - .../validation/optim/cse-cmp-next.c | 15 - .../validation/optim/cse-commutativity.c | 22 - .../validation/optim/cse-dual-compare.c | 34 - .../sparse-src/validation/optim/cse-fcmp.c | 19 - .../sparse-src/validation/optim/cse-label.c | 13 - .../sparse-src/validation/optim/cse-not01.c | 11 - .../sparse-src/validation/optim/cse-not02.c | 11 - .../sparse-src/validation/optim/cse-reg01.c | 9 - .../sparse-src/validation/optim/cse-setfval.c | 12 - .../sparse-src/validation/optim/cse-size.c | 18 - .../sparse-src/validation/optim/double-unop.c | 15 - .../sparse-src/validation/optim/dup-cond0.c | 20 - .../sparse-src/validation/optim/eqne-select.c | 12 - .../validation/optim/ext-trunc-greater.c | 17 - .../validation/optim/ext-trunc-same.c | 19 - .../validation/optim/ext-trunc-smaller.c | 18 - .../validation/optim/fact-add-mul.c | 27 - .../validation/optim/fact-and-ior.c | 27 - .../validation/optim/fact-and-shift.c | 26 - .../validation/optim/fact-ior-and.c | 27 - .../validation/optim/fact-ior-shift.c | 26 - .../validation/optim/fact-select01.c | 25 - .../validation/optim/fact-xor-and.c | 27 - .../validation/optim/fact-xor-shift.c | 26 - .../validation/optim/fpcast-constant.c | 13 - .../sparse-src/validation/optim/fpcast-nop.c | 15 - .../validation/optim/inline-return.c | 24 - .../sparse-src/validation/optim/kill-casts.c | 27 - .../validation/optim/kill-stores0.c | 34 - .../validation/optim/kill-stores1.c | 48 - .../validation/optim/kill-stores2.c | 17 - .../sparse-src/validation/optim/killed-insn.c | 14 - .../validation/optim/live-stores0.c | 29 - .../validation/optim/load-converted.c | 14 - .../sparse-src/validation/optim/load-dead.c | 11 - .../validation/optim/load-semi-volatile.c | 24 - .../sparse-src/validation/optim/lsr-and0.c | 13 - .../sparse-src/validation/optim/lsr-and1.c | 18 - .../sparse-src/validation/optim/lsr-asr.c | 42 - .../sparse-src/validation/optim/lsr-shl0.c | 14 - .../sparse-src/validation/optim/lsr-to-asr.c | 27 - .../sparse-src/validation/optim/mask-lsr.c | 14 - .../sparse-src/validation/optim/mask-out.c | 12 - .../validation/optim/mask1-setne0.c | 28 - .../validation/optim/memops-missed01.c | 23 - .../validation/optim/memops-missed02.c | 14 - .../validation/optim/merge_bbe-adjust_phi.c | 23 - .../validation/optim/missing-select.c | 23 - .../validation/optim/muldiv-by-one.c | 19 - .../validation/optim/muldiv-by-zero.c | 13 - .../validation/optim/muldiv-minus-one.c | 18 - .../validation/optim/multi-phisrc.c | 23 - .../sparse-src/validation/optim/null-phi.c | 9 - .../validation/optim/or-and-constant1.c | 29 - .../sparse-src/validation/optim/phi-count00.c | 27 - .../sparse-src/validation/optim/phi-ret.c | 21 - .../validation/optim/range-check1.c | 16 - .../validation/optim/range-check2.c | 14 - .../validation/optim/reassoc-op-op1.c | 14 - .../sparse-src/validation/optim/restrict.c | 73 - .../validation/optim/select-and-shift.c | 17 - .../validation/optim/select-constant-cond.c | 10 - .../validation/optim/select-same-args.c | 9 - .../optim/select-select-true-false0.c | 10 - .../optim/select-select-true-false1.c | 13 - .../optim/select-select-true-true.c | 9 - .../validation/optim/select-self-zero.c | 10 - .../sparse-src/validation/optim/select-zero.c | 16 - .../sparse-src/validation/optim/set-uimm0.c | 14 - .../sparse-src/validation/optim/set-uimm1.c | 10 - .../sparse-src/validation/optim/set-uimm2.c | 12 - .../sparse-src/validation/optim/set-uimm3.c | 10 - .../sparse-src/validation/optim/setcc-mask.c | 18 - .../sparse-src/validation/optim/setcc-setcc.c | 19 - .../sparse-src/validation/optim/setcc-seteq.c | 13 - .../sparse-src/validation/optim/setcc-setne.c | 13 - .../sparse-src/validation/optim/setne0-sext.c | 9 - .../validation/optim/setne0-trunc.c | 9 - .../sparse-src/validation/optim/setne0-zext.c | 9 - .../sparse-src/validation/optim/sext-sext.c | 12 - .../sparse/sparse-src/validation/optim/sext.c | 14 - .../sparse-src/validation/optim/sh-or-and0.c | 20 - .../sparse-src/validation/optim/sh-or-and1.c | 20 - .../sparse-src/validation/optim/sh-or-and2.c | 21 - .../sparse-src/validation/optim/shift-big.c | 86 - .../sparse-src/validation/optim/shift-shift.c | 149 - .../sparse-src/validation/optim/shift-zext.c | 12 - .../sparse-src/validation/optim/shl-and0.c | 13 - .../sparse-src/validation/optim/shl-and1.c | 18 - .../sparse-src/validation/optim/shl-lsr0.c | 14 - .../validation/optim/simplify-add-neg.c | 9 - .../validation/optim/simplify-cte-sub-addl.c | 9 - .../validation/optim/simplify-cte-sub-addr.c | 9 - .../validation/optim/simplify-cte-sub-subr.c | 9 - .../validation/optim/simplify-neg-add-cte.c | 11 - .../validation/optim/simplify-neg-add.c | 9 - .../validation/optim/simplify-neg-not.c | 9 - .../validation/optim/simplify-neg-sub.c | 9 - .../validation/optim/simplify-not-add-cte.c | 11 - .../validation/optim/simplify-not-neg.c | 9 - .../validation/optim/simplify-not-sub-cte.c | 11 - .../validation/optim/simplify-not-xor-cte.c | 11 - .../validation/optim/simplify-same-add-subl.c | 15 - .../validation/optim/simplify-same-add-subr.c | 15 - .../validation/optim/simplify-same-addl-sub.c | 9 - .../validation/optim/simplify-same-sub-addl.c | 9 - .../validation/optim/simplify-same-subl-add.c | 11 - .../validation/optim/simplify-same-subr-add.c | 11 - .../validation/optim/simplify-sub-neg.c | 9 - .../validation/optim/simplify-zero-sub.c | 9 - .../validation/optim/store-dominated.c | 15 - .../sparse-src/validation/optim/testsuite.c | 13 - .../validation/optim/trivial-phi01.c | 20 - .../validation/optim/trivial-phis.c | 14 - .../validation/optim/trunc-mask-zext.c | 13 - .../sparse-src/validation/optim/trunc-not0.c | 20 - .../validation/optim/trunc-or-shl.c | 17 - .../validation/optim/trunc-seteq0.c | 18 - .../validation/optim/trunc-setne0.c | 20 - .../sparse-src/validation/optim/trunc-trunc.c | 12 - .../validation/optim/void-if-convert.c | 19 - .../validation/optim/volatile-bitfield.c | 16 - .../validation/optim/volatile-side-effect.c | 13 - .../validation/optim/volatile-store00.c | 27 - .../sparse-src/validation/optim/zext-and.c | 12 - .../sparse-src/validation/optim/zext-and1.c | 12 - .../sparse-src/validation/optim/zext-asr.c | 13 - .../sparse-src/validation/optim/zext-cmpu.c | 16 - .../sparse-src/validation/optim/zext-sext.c | 13 - .../sparse-src/validation/optim/zext-zext.c | 13 - .../sparse-src/validation/option-parsing-00.c | 5 - .../sparse-src/validation/option-parsing-01.c | 5 - .../sparse-src/validation/outer-scope.c | 16 - tools/sparse/sparse-src/validation/overflow.c | 19 - .../sparse-src/validation/packed-bitfield0.c | 58 - .../sparse-src/validation/packed-bitfield1.c | 27 - .../sparse-src/validation/packed-bitfield2.c | 15 - .../sparse-src/validation/packed-bitfield3.c | 28 - .../sparse-src/validation/packed-bitfield4.c | 18 - .../sparse-src/validation/packed-bitfield5.c | 20 - .../sparse-src/validation/packed-deref0.c | 23 - .../sparse-src/validation/packed-struct.c | 32 - .../sparse-src/validation/parsing/enum-attr.c | 29 - .../validation/plain-char-compatibility.c | 19 - .../sparse-src/validation/pragma-once.c | 5 - .../preprocessor/bad-cmdline-include.c | 11 - .../validation/preprocessor/base-file.c | 17 - .../validation/preprocessor/base-file.h | 2 - .../validation/preprocessor/builtin.c | 17 - .../validation/preprocessor/cli-D-arg.c | 12 - .../validation/preprocessor/cli-D-space.c | 10 - .../validation/preprocessor/counter1.c | 12 - .../validation/preprocessor/counter2.c | 14 - .../validation/preprocessor/counter2.h | 1 - .../validation/preprocessor/counter3.c | 14 - .../preprocessor/directive-within-macro.c | 36 - .../preprocessor/dump-macros-empty.c | 7 - .../preprocessor/dump-macros-multi.c | 7 - .../preprocessor/dump-macros-only.c | 36 - .../validation/preprocessor/dump-macros.c | 34 - .../validation/preprocessor/dynamic.c | 37 - .../validation/preprocessor/early-escape.c | 22 - .../preprocessor/empty-char-constant.c | 13 - .../validation/preprocessor/expand-and-nl.c | 13 - .../validation/preprocessor/expand-redef.c | 20 - .../validation/preprocessor/extra-token.c | 15 - .../validation/preprocessor/freestanding.c | 11 - .../validation/preprocessor/has-attribute.c | 56 - .../validation/preprocessor/has-builtin.c | 43 - .../validation/preprocessor/has-feature.c | 20 - .../validation/preprocessor/hosted.c | 11 - .../validation/preprocessor/ident-pragma.c | 12 - .../validation/preprocessor/ident.c | 12 - .../validation/preprocessor/include-level.c | 14 - .../validation/preprocessor/include-level.h | 1 - .../validation/preprocessor/missing-delim.c | 17 - .../preprocessor/phase2-backslash.c | 67 - .../validation/preprocessor/phase3-comments.c | 17 - .../validation/preprocessor/predef-llp64.c | 9 - .../validation/preprocessor/predef-lp32.c | 9 - .../validation/preprocessor/predef-lp64.c | 9 - .../validation/preprocessor/predef-token.c | 5 - .../validation/preprocessor/predef-unsigned.c | 9 - .../validation/preprocessor/predef.c | 59 - .../validation/preprocessor/preprocessor1.c | 14 - .../validation/preprocessor/preprocessor10.c | 19 - .../validation/preprocessor/preprocessor11.c | 31 - .../validation/preprocessor/preprocessor12.c | 18 - .../validation/preprocessor/preprocessor13.c | 23 - .../validation/preprocessor/preprocessor14.c | 16 - .../validation/preprocessor/preprocessor15.c | 16 - .../validation/preprocessor/preprocessor16.c | 30 - .../validation/preprocessor/preprocessor17.c | 15 - .../validation/preprocessor/preprocessor18.c | 17 - .../validation/preprocessor/preprocessor19.c | 18 - .../validation/preprocessor/preprocessor2.c | 15 - .../validation/preprocessor/preprocessor20.c | 14 - .../validation/preprocessor/preprocessor20.h | 6 - .../validation/preprocessor/preprocessor21.c | 16 - .../validation/preprocessor/preprocessor22.c | 33 - .../validation/preprocessor/preprocessor23.c | 51 - .../validation/preprocessor/preprocessor3.c | 32 - .../validation/preprocessor/preprocessor4.c | 15 - .../validation/preprocessor/preprocessor5.c | 14 - .../validation/preprocessor/preprocessor6.c | 29 - .../validation/preprocessor/preprocessor7.c | 14 - .../validation/preprocessor/preprocessor8.c | 38 - .../validation/preprocessor/preprocessor9.c | 16 - .../validation/preprocessor/stringify.c | 29 - .../sparse-src/validation/preprocessor/wide.c | 15 - .../sparse/sparse-src/validation/prototype.c | 6 - .../sparse-src/validation/ptr-inherit.c | 80 - .../sparse-src/validation/ptr-sub-blows.c | 23 - .../sparse-src/validation/pure-function.c | 25 - .../sparse-src/validation/range-syntax.c | 23 - tools/sparse/sparse-src/validation/repeat.h | 24 - tools/sparse/sparse-src/validation/reserved.c | 158 - .../sparse-src/validation/restrict-array.c | 37 - tools/sparse/sparse-src/validation/restrict.c | 99 - .../sparse-src/validation/restricted-typeof.c | 8 - .../sparse/sparse-src/validation/scheck/ko.c | 10 - .../sparse/sparse-src/validation/scheck/ok.c | 22 - .../sparse-src/validation/self-quote-args.c | 7 - .../sparse-src/validation/shift-negative.c | 17 - .../sparse-src/validation/shift-undef-long.c | 20 - .../sparse-src/validation/shift-undef.c | 140 - .../sparse-src/validation/sizeof-bool.c | 13 - .../sparse-src/validation/sizeof-builtin.c | 15 - .../validation/sizeof-compound-postfix.c | 8 - .../sparse-src/validation/sizeof-function.c | 49 - .../validation/sizeof-incomplete-type.c | 27 - .../sparse-src/validation/sizeof-void.c | 44 - .../sparse-src/validation/specifiers1.c | 101 - .../sparse-src/validation/specifiers2.c | 152 - .../validation/static-forward-decl.c | 14 - .../sparse-src/validation/static_assert.c | 76 - .../validation/storage-struct-member.c | 20 - .../validation/strict-prototypes0.c | 7 - .../validation/strict-prototypes1.c | 14 - .../sparse/sparse-src/validation/struct-as.c | 19 - .../validation/struct-attribute-placement.c | 6 - .../sparse/sparse-src/validation/struct-ns1.c | 20 - .../sparse/sparse-src/validation/struct-ns2.c | 25 - .../sparse-src/validation/struct-size1.c | 21 - .../sparse-src/validation/switch-long.c | 47 - .../validation/tautological-compare.c | 35 - tools/sparse/sparse-src/validation/test-suite | 676 --- .../sparse-src/validation/transparent-union.c | 25 - .../validation/type-attribute-align.c | 19 - .../sparse-src/validation/type-attribute-as.c | 33 - .../validation/type-attribute-mod.c | 21 - .../validation/type-attribute-qual.c | 15 - .../sparse-src/validation/type-compare.c | 76 - tools/sparse/sparse-src/validation/type1.c | 27 - .../sparse-src/validation/typedef-redef-c89.c | 13 - .../sparse-src/validation/typedef-redef.c | 16 - .../sparse-src/validation/typedef_shadow.c | 13 - .../validation/typediff-arraysize.c | 12 - .../sparse-src/validation/typediff-enum.c | 34 - .../validation/typeof-addresspace.c | 20 - .../sparse-src/validation/typeof-attribute.c | 16 - .../sparse/sparse-src/validation/typeof-bad.c | 17 - .../sparse-src/validation/typeof-mods.c | 136 - .../sparse-src/validation/typeof-noderef.c | 19 - .../sparse-src/validation/typeof-safe.c | 36 - tools/sparse/sparse-src/validation/typesign.c | 61 - .../sparse-src/validation/usual-conv-lp32.c | 11 - .../sparse-src/validation/var-undef-partial.c | 20 - tools/sparse/sparse-src/validation/varargs1.c | 8 - .../sparse-src/validation/vla-sizeof-ice.c | 19 - .../sparse/sparse-src/validation/vla-sizeof.c | 37 - .../sparse-src/validation/vla-sizeof0.c | 20 - .../sparse-src/validation/vla-sizeof1.c | 21 - .../sparse-src/validation/vla-sizeof2.c | 21 - .../sparse-src/validation/vla-sizeof3.c | 21 - .../sparse-src/validation/vla-sizeof4.c | 22 - tools/sparse/sparse-src/validation/wide.c | 9 - tools/sparse/sparse-src/version.c | 4 - 1378 files changed, 7 insertions(+), 110243 deletions(-) delete mode 100755 Makefile.release delete mode 100755 doc/build-system-guide.txt delete mode 100755 doc/c-test-api.txt delete mode 100755 doc/c-test-tutorial-simple.txt delete mode 100755 doc/library-api-writing-guidelines.txt delete mode 100755 doc/maintainer-patch-review-checklist.txt delete mode 100755 doc/mini-howto-building-ltp-from-git.txt delete mode 100755 doc/network-c-api.txt delete mode 100755 doc/shell-test-api.txt delete mode 100755 doc/supported-kernel-libc-versions.txt delete mode 100755 doc/test-writing-guidelines.txt delete mode 100755 doc/user-guide.txt delete mode 100755 execltp.in delete mode 100755 include/ipcshm.h delete mode 100755 include/lapi/clone.h delete mode 100755 include/lapi/namespaces_constants.h delete mode 100755 include/lapi/pidfd_open.h delete mode 100755 include/lapi/pidfd_send_signal.h delete mode 100755 lib/newlib_tests/test10.c delete mode 100755 lib/newlib_tests/test12.c delete mode 100755 lib/newlib_tests/test18.c delete mode 100755 m4/ltp-clone7args.m4 delete mode 100755 m4/ltp-mremap_fixed.m4 delete mode 100755 m4/ltp-perf_event_open.m4 delete mode 100755 pan/debug.c delete mode 100755 pan/debug.h delete mode 100755 pan/ltp-scanner.c delete mode 100755 pan/reporter.c delete mode 100755 pan/reporter.h delete mode 100755 pan/scan.h delete mode 100755 pan/scan.l delete mode 100755 pan/symbol.c delete mode 100755 pan/symbol.h delete mode 100755 pan/tag_report.c delete mode 100755 runtest/ltp-aio-stress.part1 delete mode 100755 runtest/ltp-aio-stress.part2 delete mode 100755 runtest/net.rpc delete mode 100755 testcases/commands/file/datafiles/in.csh delete mode 100755 testcases/commands/file/datafiles/in.ksh delete mode 100755 testcases/kernel/containers/.gitignore delete mode 100755 testcases/kernel/containers/Makefile.inc delete mode 100755 testcases/kernel/containers/README delete mode 100755 testcases/kernel/containers/TEST_PLAN.txt delete mode 100755 testcases/kernel/containers/libclone/Makefile delete mode 100755 testcases/kernel/containers/libclone/libclone.c delete mode 100755 testcases/kernel/containers/libclone/libclone.h delete mode 100755 testcases/kernel/containers/mountns/mountns_helper.h delete mode 100755 testcases/kernel/containers/mqns/mqns.h delete mode 100755 testcases/kernel/containers/mqns/mqns_helper.h delete mode 100755 testcases/kernel/containers/netns/netns_helper.sh delete mode 100755 testcases/kernel/containers/pidns/pidns_helper.h delete mode 100755 testcases/kernel/containers/share/.gitignore delete mode 100755 testcases/kernel/containers/share/Makefile delete mode 100755 testcases/kernel/containers/share/ns_common.h delete mode 100755 testcases/kernel/containers/share/ns_create.c delete mode 100755 testcases/kernel/containers/share/ns_exec.c delete mode 100755 testcases/kernel/containers/share/ns_ifmove.c delete mode 100755 testcases/kernel/containers/share/setns_check.c delete mode 100755 testcases/kernel/containers/sysvipc/ipcns_helper.h delete mode 100755 testcases/kernel/containers/userns/userns_helper.h delete mode 100755 testcases/kernel/containers/utsname/runutstests_noltp.sh delete mode 100755 testcases/kernel/containers/utsname/utstest.c delete mode 100755 testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c delete mode 100755 testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh delete mode 100755 testcases/kernel/controllers/cgroup/cgroup_regression_9_2.sh delete mode 100755 testcases/kernel/fs/fs-bench/.gitignore delete mode 100755 testcases/kernel/fs/fs-bench/Makefile delete mode 100755 testcases/kernel/fs/fs-bench/README delete mode 100755 testcases/kernel/fs/fs-bench/boxmuler.c delete mode 100755 testcases/kernel/fs/fs-bench/create-files.c delete mode 100755 testcases/kernel/fs/fs-bench/fs-bench-test.sh delete mode 100755 testcases/kernel/fs/fs-bench/fs-bench-test2.sh delete mode 100755 testcases/kernel/fs/fs-bench/modaltr.sh delete mode 100755 testcases/kernel/fs/fs-bench/random-access-del-create.c delete mode 100755 testcases/kernel/fs/fs-bench/random-access.c delete mode 100755 testcases/kernel/fs/fs-bench/random-del-create.c delete mode 100755 testcases/kernel/io/ltp-aiodio/read_checkzero.c delete mode 100755 testcases/kernel/ipc/semaphore/.gitignore delete mode 100755 testcases/kernel/ipc/semaphore/Makefile delete mode 100755 testcases/kernel/ipc/semaphore/sem01.c delete mode 100755 testcases/kernel/ipc/semaphore/sem02.c delete mode 100755 testcases/kernel/mce-test/COPYING delete mode 100755 testcases/kernel/mce-test/Makefile delete mode 100755 testcases/kernel/mce-test/README delete mode 100755 testcases/kernel/mce-test/cases/apei-inj/README delete mode 100755 testcases/kernel/mce-test/cases/apei-inj/ucr/cases.sh delete mode 100755 testcases/kernel/mce-test/cases/apei-inj/ucr/data/mem_uncorrected delete mode 100755 testcases/kernel/mce-test/cases/apei-inj/ucr/refer/mem_uncorrected delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/non-panic/cases.sh delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_hold delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_no_en delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_over delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/cases.sh delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_eipv delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_irq delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_no_en delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_over delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_ripv delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_timeout delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_timeout_ripv delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_userspace delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic/refer/fatal_no_en delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_noser/cases.sh delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over_corrected delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over_timeout delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_npcc/cases.sh delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/fatal_severity delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_eripv delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_eripv_timeout delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_mcip delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_mcip_timeout delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uncorrected delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uncorrected_timeout delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/unknown delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_ucr/cases.sh delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/s0_ar1 delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srao_ewb_noripv delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srao_mem_scrub_noripv delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_no_en delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_over delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_unkown delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/panic_ucr/refer/srar_no_en delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/poll_noser/cases.sh delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/poll_noser/data/uc_poll delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/poll_noser/refer/uc_poll delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/poll_ucr/cases.sh delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/fatal_poll delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/srar_poll delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/ucna delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/ucna_over delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/poll_ucr/refer/srar_poll delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/cases.sh delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_corrected delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_ewb delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_mem_scrub delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_no_en delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_over delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_ucna delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_unknown delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu_irq delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu_nmi delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_corrected delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_no_en delete mode 100755 testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_ucna delete mode 100755 testcases/kernel/mce-test/config/kdump.conf delete mode 100755 testcases/kernel/mce-test/config/kdump_noser.conf delete mode 100755 testcases/kernel/mce-test/config/kdump_panic.conf delete mode 100755 testcases/kernel/mce-test/config/kdump_panic_noser.conf delete mode 100755 testcases/kernel/mce-test/config/kdump_panic_npcc.conf delete mode 100755 testcases/kernel/mce-test/config/kdump_panic_ucr.conf delete mode 100755 testcases/kernel/mce-test/config/kdump_ser.conf delete mode 100755 testcases/kernel/mce-test/config/simple.conf delete mode 100755 testcases/kernel/mce-test/config/simple_non_panic.conf delete mode 100755 testcases/kernel/mce-test/config/simple_nopanic_noser.conf delete mode 100755 testcases/kernel/mce-test/config/simple_nopanic_ser.conf delete mode 100755 testcases/kernel/mce-test/config/simple_noser.conf delete mode 100755 testcases/kernel/mce-test/config/simple_panic.conf delete mode 100755 testcases/kernel/mce-test/config/simple_panic_noser.conf delete mode 100755 testcases/kernel/mce-test/config/simple_panic_npcc.conf delete mode 100755 testcases/kernel/mce-test/config/simple_panic_ucr.conf delete mode 100755 testcases/kernel/mce-test/config/simple_poll_noser.conf delete mode 100755 testcases/kernel/mce-test/config/simple_poll_ucr.conf delete mode 100755 testcases/kernel/mce-test/config/simple_recoverable_ucr.conf delete mode 100755 testcases/kernel/mce-test/config/simple_ser.conf delete mode 100755 testcases/kernel/mce-test/doc/cases/soft-inj_non-panic.txt delete mode 100755 testcases/kernel/mce-test/doc/cases/soft-inj_panic.txt delete mode 100755 testcases/kernel/mce-test/doc/cases/soft-inj_panic_noser.txt delete mode 100755 testcases/kernel/mce-test/doc/cases/soft-inj_panic_npcc.txt delete mode 100755 testcases/kernel/mce-test/doc/cases/soft-inj_panic_ucr.txt delete mode 100755 testcases/kernel/mce-test/doc/cases/soft-inj_poll_ucr.txt delete mode 100755 testcases/kernel/mce-test/doc/cases/soft-inj_recoverable_ucr.txt delete mode 100755 testcases/kernel/mce-test/doc/howto.txt delete mode 100755 testcases/kernel/mce-test/doc/stress-howto.txt delete mode 100755 testcases/kernel/mce-test/doc/verify.txt delete mode 100755 testcases/kernel/mce-test/drivers/kdump/driver.sh delete mode 100755 testcases/kernel/mce-test/drivers/kdump/setup.sh delete mode 100755 testcases/kernel/mce-test/drivers/simple/driver.sh delete mode 120000 testcases/kernel/mce-test/hwpoison delete mode 100755 testcases/kernel/mce-test/kvm/README delete mode 100755 testcases/kernel/mce-test/kvm/guest/guest_run.sh delete mode 100755 testcases/kernel/mce-test/kvm/host/SRAO delete mode 100755 testcases/kernel/mce-test/kvm/host/guest_init delete mode 100755 testcases/kernel/mce-test/kvm/host/host_run.sh delete mode 100755 testcases/kernel/mce-test/lib/apei-inject.sh delete mode 100755 testcases/kernel/mce-test/lib/dirs.sh delete mode 100755 testcases/kernel/mce-test/lib/functions.sh delete mode 100755 testcases/kernel/mce-test/lib/mce.sh delete mode 100755 testcases/kernel/mce-test/lib/soft-inject.sh delete mode 100755 testcases/kernel/mce-test/stress/Makefile delete mode 100755 testcases/kernel/mce-test/stress/README delete mode 100755 testcases/kernel/mce-test/stress/hwpoison.sh delete mode 100755 testcases/kernel/mce-test/stress/tools/Makefile delete mode 100755 testcases/kernel/mce-test/stress/tools/fs-metadata/Makefile delete mode 100755 testcases/kernel/mce-test/stress/tools/fs-metadata/README delete mode 100755 testcases/kernel/mce-test/stress/tools/fs-metadata/fs-metadata.sh delete mode 100755 testcases/kernel/mce-test/stress/tools/fs-metadata/k-thread.sh delete mode 100755 testcases/kernel/mce-test/stress/tools/fs-metadata/k-tree-gen.c delete mode 100755 testcases/kernel/mce-test/stress/tools/fs-metadata/k-tree-trav.c delete mode 100755 testcases/kernel/mce-test/stress/tools/page-poisoning/Makefile delete mode 100755 testcases/kernel/mce-test/stress/tools/page-poisoning/README delete mode 100755 testcases/kernel/mce-test/stress/tools/page-poisoning/page-poisoning.c delete mode 100755 testcases/kernel/mce-test/tools/Makefile delete mode 100755 testcases/kernel/mce-test/tools/gcov_merge.py delete mode 100755 testcases/kernel/mce-test/tools/grep_result.sh delete mode 100755 testcases/kernel/mce-test/tools/loop-mce-test.sh delete mode 100755 testcases/kernel/mce-test/tools/mce_shell.sh delete mode 100755 testcases/kernel/mce-test/tools/page-types.c delete mode 100755 testcases/kernel/mce-test/tools/scov_merge.py delete mode 100755 testcases/kernel/mce-test/tools/simple_process/Makefile delete mode 100755 testcases/kernel/mce-test/tools/simple_process/simple_process.c delete mode 100755 testcases/kernel/mce-test/tsrc/Makefile delete mode 100755 testcases/kernel/mce-test/tsrc/README delete mode 100755 testcases/kernel/mce-test/tsrc/erst-inj/cper.h delete mode 100755 testcases/kernel/mce-test/tsrc/erst-inj/erst-inj.mk delete mode 100755 testcases/kernel/mce-test/tsrc/erst-inj/erst-inject.c delete mode 100755 testcases/kernel/mce-test/tsrc/erst-inj/uuid.h delete mode 100755 testcases/kernel/mce-test/tsrc/erst-inject.sh delete mode 100755 testcases/kernel/mce-test/tsrc/hugepage.h delete mode 100755 testcases/kernel/mce-test/tsrc/kinclude/README delete mode 100755 testcases/kernel/mce-test/tsrc/kinclude/linux/debugfs.h delete mode 100755 testcases/kernel/mce-test/tsrc/kinclude/linux/fs.h delete mode 100755 testcases/kernel/mce-test/tsrc/kinclude/linux/init.h delete mode 100755 testcases/kernel/mce-test/tsrc/kinclude/linux/percpu.h delete mode 100755 testcases/kernel/mce-test/tsrc/kinclude/linux/seq_file.h delete mode 100755 testcases/kernel/mce-test/tsrc/kinclude/linux/sysdev.h delete mode 100755 testcases/kernel/mce-test/tsrc/random_offline delete mode 100755 testcases/kernel/mce-test/tsrc/run-huge-test.sh delete mode 100755 testcases/kernel/mce-test/tsrc/run-transhuge-test.sh delete mode 100755 testcases/kernel/mce-test/tsrc/tcases.c delete mode 100755 testcases/kernel/mce-test/tsrc/thugetlb.c delete mode 100755 testcases/kernel/mce-test/tsrc/tinjpage.c delete mode 100755 testcases/kernel/mce-test/tsrc/tkillpoison.c delete mode 100755 testcases/kernel/mce-test/tsrc/tprctl.c delete mode 100755 testcases/kernel/mce-test/tsrc/tring.c delete mode 100755 testcases/kernel/mce-test/tsrc/tsimpleinj.c delete mode 100755 testcases/kernel/mce-test/tsrc/tsoft.c delete mode 100755 testcases/kernel/mce-test/tsrc/tsoftinj.c delete mode 100755 testcases/kernel/mce-test/tsrc/ttable.c delete mode 100755 testcases/kernel/mce-test/tsrc/ttranshuge.c delete mode 100755 testcases/kernel/mce-test/tsrc/utils.h delete mode 100755 testcases/kernel/security/tomoyo/.gitignore delete mode 100755 testcases/kernel/security/tomoyo/Makefile delete mode 100755 testcases/kernel/security/tomoyo/README delete mode 100755 testcases/kernel/security/tomoyo/include.h delete mode 100755 testcases/kernel/security/tomoyo/newns.c delete mode 100755 testcases/kernel/security/tomoyo/testall.sh delete mode 100755 testcases/kernel/security/tomoyo/tomoyo_accept_test.c delete mode 100755 testcases/kernel/security/tomoyo/tomoyo_file_test.c delete mode 100755 testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c delete mode 100755 testcases/kernel/security/tomoyo/tomoyo_new_file_test.c delete mode 100755 testcases/kernel/security/tomoyo/tomoyo_new_test.c delete mode 100755 testcases/kernel/security/tomoyo/tomoyo_policy_io_test.c delete mode 100755 testcases/kernel/security/tomoyo/tomoyo_policy_memory_test.c delete mode 100755 testcases/kernel/security/tomoyo/tomoyo_rewrite_test.c delete mode 100755 testcases/kernel/syscalls/fcntl/fcntl06.c delete mode 100755 testcases/kernel/syscalls/fork/fork02.c delete mode 100755 testcases/kernel/syscalls/getitimer/getitimer03.c delete mode 100755 testcases/kernel/syscalls/ipc/semget/semget03.c delete mode 100755 testcases/kernel/syscalls/ipc/semget/semget06.c delete mode 100755 testcases/kernel/syscalls/kcmp/kcmp.h delete mode 100755 testcases/kernel/syscalls/mmap/mmap07.c delete mode 100755 testcases/kernel/syscalls/mount/mount03_setuid_test.c delete mode 100755 testcases/kernel/syscalls/open/open05.c delete mode 100755 testcases/kernel/syscalls/paging/Makefile delete mode 100755 testcases/kernel/syscalls/rename/rename02.c delete mode 100755 testcases/kernel/syscalls/setgroups/setgroups04.c delete mode 100755 testcases/kernel/syscalls/setitimer/setitimer03.c delete mode 100755 testcases/kernel/syscalls/syslog/syslog-lib.sh delete mode 100755 testcases/kernel/syscalls/syslog/syslog01 delete mode 100755 testcases/kernel/syscalls/syslog/syslog02 delete mode 100755 testcases/kernel/syscalls/syslog/syslog03 delete mode 100755 testcases/kernel/syscalls/syslog/syslog04 delete mode 100755 testcases/kernel/syscalls/syslog/syslog05 delete mode 100755 testcases/kernel/syscalls/syslog/syslog06 delete mode 100755 testcases/kernel/syscalls/syslog/syslog07 delete mode 100755 testcases/kernel/syscalls/syslog/syslog08 delete mode 100755 testcases/kernel/syscalls/syslog/syslog09 delete mode 100755 testcases/kernel/syscalls/syslog/syslog10 delete mode 100755 testcases/kernel/syscalls/syslog/syslogtst.c delete mode 100755 testcases/kernel/syscalls/umount2/umount2.h delete mode 100755 testcases/kernel/syscalls/umount2/umount2_03.c delete mode 100755 testcases/kernel/syscalls/utils/ioprio.h delete mode 100755 testcases/network/nfs/nfslock01/nfslock01 delete mode 100755 testcases/network/nfs/nfsstat01/nfsstat01 delete mode 100755 testcases/network/rpc/basic_tests/rup/Makefile delete mode 100755 testcases/network/rpc/basic_tests/rup/rup01.sh delete mode 100755 testcases/network/rpc/basic_tests/rusers/Makefile delete mode 100755 testcases/network/rpc/basic_tests/rusers/rusers01.sh delete mode 100755 testcases/realtime/m4/ltp-exp10.m4 delete mode 100755 tools/sparse/sparse-src/.gitignore delete mode 100755 tools/sparse/sparse-src/Documentation/.gitignore delete mode 100755 tools/sparse/sparse-src/Documentation/IR.rst delete mode 100755 tools/sparse/sparse-src/Documentation/Makefile delete mode 100755 tools/sparse/sparse-src/Documentation/TODO.md delete mode 100755 tools/sparse/sparse-src/Documentation/annotations.rst delete mode 100755 tools/sparse/sparse-src/Documentation/api.rst delete mode 100755 tools/sparse/sparse-src/Documentation/conf.py delete mode 100755 tools/sparse/sparse-src/Documentation/data-structures.txt delete mode 100755 tools/sparse/sparse-src/Documentation/dev-options.rst delete mode 100755 tools/sparse/sparse-src/Documentation/doc-guide.rst delete mode 100755 tools/sparse/sparse-src/Documentation/index.rst delete mode 100755 tools/sparse/sparse-src/Documentation/logo.svg delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/index.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.1.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.2.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.3.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.4.1.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.4.2.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.4.3.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.4.4.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.4.5-rc1.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.4.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.5.0.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.5.1.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.5.2.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.6.0.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.6.1.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.6.2.rst delete mode 100755 tools/sparse/sparse-src/Documentation/release-notes/v0.6.3.rst delete mode 100755 tools/sparse/sparse-src/Documentation/sphinx/cdoc.py delete mode 100755 tools/sparse/sparse-src/Documentation/sphinx/ir.py delete mode 100755 tools/sparse/sparse-src/Documentation/sphinx/static/theme_overrides.css delete mode 100755 tools/sparse/sparse-src/Documentation/submitting-patches.md delete mode 100755 tools/sparse/sparse-src/Documentation/templates/breadcrumbs.html delete mode 100755 tools/sparse/sparse-src/Documentation/templates/layout.html delete mode 100755 tools/sparse/sparse-src/Documentation/test-suite.rst delete mode 100755 tools/sparse/sparse-src/Documentation/types.rst delete mode 100755 tools/sparse/sparse-src/FAQ delete mode 100755 tools/sparse/sparse-src/LICENSE delete mode 100755 tools/sparse/sparse-src/Makefile delete mode 100755 tools/sparse/sparse-src/README delete mode 100755 tools/sparse/sparse-src/allocate.c delete mode 100755 tools/sparse/sparse-src/allocate.h delete mode 100755 tools/sparse/sparse-src/ast-inspect.c delete mode 100755 tools/sparse/sparse-src/ast-inspect.h delete mode 100755 tools/sparse/sparse-src/ast-model.c delete mode 100755 tools/sparse/sparse-src/ast-model.h delete mode 100755 tools/sparse/sparse-src/ast-view.c delete mode 100755 tools/sparse/sparse-src/ast-view.h delete mode 100755 tools/sparse/sparse-src/bitmap.h delete mode 100755 tools/sparse/sparse-src/bits.h delete mode 100755 tools/sparse/sparse-src/builtin.c delete mode 100755 tools/sparse/sparse-src/builtin.h delete mode 100755 tools/sparse/sparse-src/c2xml.c delete mode 100755 tools/sparse/sparse-src/cgcc delete mode 100755 tools/sparse/sparse-src/cgcc.1 delete mode 100755 tools/sparse/sparse-src/char.c delete mode 100755 tools/sparse/sparse-src/char.h delete mode 100755 tools/sparse/sparse-src/compat-bsd.c delete mode 100755 tools/sparse/sparse-src/compat-cygwin.c delete mode 100755 tools/sparse/sparse-src/compat-linux.c delete mode 100755 tools/sparse/sparse-src/compat-mingw.c delete mode 100755 tools/sparse/sparse-src/compat-solaris.c delete mode 100755 tools/sparse/sparse-src/compat.h delete mode 100755 tools/sparse/sparse-src/compat/bswap.h delete mode 100755 tools/sparse/sparse-src/compat/mmap-blob.c delete mode 100755 tools/sparse/sparse-src/compat/strtold.c delete mode 100755 tools/sparse/sparse-src/compile-i386.c delete mode 100755 tools/sparse/sparse-src/compile.c delete mode 100755 tools/sparse/sparse-src/compile.h delete mode 100755 tools/sparse/sparse-src/cse.c delete mode 100755 tools/sparse/sparse-src/cse.h delete mode 100755 tools/sparse/sparse-src/ctags.c delete mode 100755 tools/sparse/sparse-src/dissect.c delete mode 100755 tools/sparse/sparse-src/dissect.h delete mode 100755 tools/sparse/sparse-src/dominate.c delete mode 100755 tools/sparse/sparse-src/dominate.h delete mode 100755 tools/sparse/sparse-src/evaluate.c delete mode 100755 tools/sparse/sparse-src/evaluate.h delete mode 100755 tools/sparse/sparse-src/example.c delete mode 100755 tools/sparse/sparse-src/expand.c delete mode 100755 tools/sparse/sparse-src/expand.h delete mode 100755 tools/sparse/sparse-src/expression.c delete mode 100755 tools/sparse/sparse-src/expression.h delete mode 100755 tools/sparse/sparse-src/flow.c delete mode 100755 tools/sparse/sparse-src/flow.h delete mode 100755 tools/sparse/sparse-src/flowgraph.c delete mode 100755 tools/sparse/sparse-src/flowgraph.h delete mode 100755 tools/sparse/sparse-src/gcc-attr-list.h delete mode 100755 tools/sparse/sparse-src/gdbhelpers delete mode 100755 tools/sparse/sparse-src/graph.c delete mode 100755 tools/sparse/sparse-src/gvpr/return-paths delete mode 100755 tools/sparse/sparse-src/gvpr/subg-fwd delete mode 100755 tools/sparse/sparse-src/gvpr/subg-rev delete mode 100755 tools/sparse/sparse-src/ident-list.h delete mode 100755 tools/sparse/sparse-src/inline.c delete mode 100755 tools/sparse/sparse-src/ir.c delete mode 100755 tools/sparse/sparse-src/ir.h delete mode 100755 tools/sparse/sparse-src/lib.c delete mode 100755 tools/sparse/sparse-src/lib.h delete mode 100755 tools/sparse/sparse-src/linearize.c delete mode 100755 tools/sparse/sparse-src/linearize.h delete mode 100755 tools/sparse/sparse-src/liveness.c delete mode 100755 tools/sparse/sparse-src/liveness.h delete mode 100755 tools/sparse/sparse-src/machine.h delete mode 100755 tools/sparse/sparse-src/memops.c delete mode 100755 tools/sparse/sparse-src/obfuscate.c delete mode 100755 tools/sparse/sparse-src/opcode.c delete mode 100755 tools/sparse/sparse-src/opcode.def delete mode 100755 tools/sparse/sparse-src/opcode.h delete mode 100755 tools/sparse/sparse-src/optimize.c delete mode 100755 tools/sparse/sparse-src/optimize.h delete mode 100755 tools/sparse/sparse-src/options.c delete mode 100755 tools/sparse/sparse-src/options.h delete mode 100755 tools/sparse/sparse-src/parse.c delete mode 100755 tools/sparse/sparse-src/parse.dtd delete mode 100755 tools/sparse/sparse-src/parse.h delete mode 100755 tools/sparse/sparse-src/pre-process.c delete mode 100755 tools/sparse/sparse-src/predefine.c delete mode 100755 tools/sparse/sparse-src/ptrlist.c delete mode 100755 tools/sparse/sparse-src/ptrlist.h delete mode 100755 tools/sparse/sparse-src/ptrmap.c delete mode 100755 tools/sparse/sparse-src/ptrmap.h delete mode 100755 tools/sparse/sparse-src/scheck.c delete mode 100755 tools/sparse/sparse-src/scope.c delete mode 100755 tools/sparse/sparse-src/scope.h delete mode 100755 tools/sparse/sparse-src/semind.1 delete mode 100755 tools/sparse/sparse-src/semind.c delete mode 100755 tools/sparse/sparse-src/show-parse.c delete mode 100755 tools/sparse/sparse-src/simplify.c delete mode 100755 tools/sparse/sparse-src/simplify.h delete mode 100755 tools/sparse/sparse-src/sort.c delete mode 100755 tools/sparse/sparse-src/sparse-llvm-dis delete mode 100755 tools/sparse/sparse-src/sparse-llvm.c delete mode 100755 tools/sparse/sparse-src/sparse.1 delete mode 100755 tools/sparse/sparse-src/sparse.c delete mode 100755 tools/sparse/sparse-src/sparsec delete mode 100755 tools/sparse/sparse-src/sparsei delete mode 100755 tools/sparse/sparse-src/ssa.c delete mode 100755 tools/sparse/sparse-src/ssa.h delete mode 100755 tools/sparse/sparse-src/stats.c delete mode 100755 tools/sparse/sparse-src/storage.c delete mode 100755 tools/sparse/sparse-src/storage.h delete mode 100755 tools/sparse/sparse-src/symbol.c delete mode 100755 tools/sparse/sparse-src/symbol.h delete mode 100755 tools/sparse/sparse-src/target-alpha.c delete mode 100755 tools/sparse/sparse-src/target-arm.c delete mode 100755 tools/sparse/sparse-src/target-arm64.c delete mode 100755 tools/sparse/sparse-src/target-bfin.c delete mode 100755 tools/sparse/sparse-src/target-default.c delete mode 100755 tools/sparse/sparse-src/target-h8300.c delete mode 100755 tools/sparse/sparse-src/target-m68k.c delete mode 100755 tools/sparse/sparse-src/target-microblaze.c delete mode 100755 tools/sparse/sparse-src/target-mips.c delete mode 100755 tools/sparse/sparse-src/target-nds32.c delete mode 100755 tools/sparse/sparse-src/target-nios2.c delete mode 100755 tools/sparse/sparse-src/target-openrisc.c delete mode 100755 tools/sparse/sparse-src/target-ppc.c delete mode 100755 tools/sparse/sparse-src/target-riscv.c delete mode 100755 tools/sparse/sparse-src/target-s390.c delete mode 100755 tools/sparse/sparse-src/target-sh.c delete mode 100755 tools/sparse/sparse-src/target-sparc.c delete mode 100755 tools/sparse/sparse-src/target-x86.c delete mode 100755 tools/sparse/sparse-src/target-xtensa.c delete mode 100755 tools/sparse/sparse-src/target.c delete mode 100755 tools/sparse/sparse-src/target.h delete mode 100755 tools/sparse/sparse-src/test-dissect.c delete mode 100755 tools/sparse/sparse-src/test-inspect.c delete mode 100755 tools/sparse/sparse-src/test-lexing.c delete mode 100755 tools/sparse/sparse-src/test-linearize.c delete mode 100755 tools/sparse/sparse-src/test-parsing.c delete mode 100755 tools/sparse/sparse-src/test-show-type.c delete mode 100755 tools/sparse/sparse-src/test-sort.c delete mode 100755 tools/sparse/sparse-src/test-unssa.c delete mode 100755 tools/sparse/sparse-src/token.h delete mode 100755 tools/sparse/sparse-src/tokenize.c delete mode 100755 tools/sparse/sparse-src/unssa.c delete mode 100755 tools/sparse/sparse-src/utils.c delete mode 100755 tools/sparse/sparse-src/utils.h delete mode 100755 tools/sparse/sparse-src/validation/.gitignore delete mode 100755 tools/sparse/sparse-src/validation/Waddress-array.c delete mode 100755 tools/sparse/sparse-src/validation/Waddress-function.c delete mode 100755 tools/sparse/sparse-src/validation/Waddress-space-all-attr.c delete mode 100755 tools/sparse/sparse-src/validation/Waddress-space-from.c delete mode 100755 tools/sparse/sparse-src/validation/Waddress-space-strict.c delete mode 100755 tools/sparse/sparse-src/validation/Waddress-weak.c delete mode 100755 tools/sparse/sparse-src/validation/Waddress.c delete mode 100755 tools/sparse/sparse-src/validation/Wcast-to-as.c delete mode 100755 tools/sparse/sparse-src/validation/Woverride-init-def.c delete mode 100755 tools/sparse/sparse-src/validation/Woverride-init-no.c delete mode 100755 tools/sparse/sparse-src/validation/Woverride-init-yes.c delete mode 100755 tools/sparse/sparse-src/validation/Wuniv-init-ko.c delete mode 100755 tools/sparse/sparse-src/validation/Wuniv-init-ok.c delete mode 100755 tools/sparse/sparse-src/validation/Wunknown-attribute-def.c delete mode 100755 tools/sparse/sparse-src/validation/Wunknown-attribute-no.c delete mode 100755 tools/sparse/sparse-src/validation/Wunknown-attribute-yes.c delete mode 100755 tools/sparse/sparse-src/validation/__func__-scope.c delete mode 100755 tools/sparse/sparse-src/validation/__func__.c delete mode 100755 tools/sparse/sparse-src/validation/abi-integer.c delete mode 100755 tools/sparse/sparse-src/validation/abstract-array-declarator-quals.c delete mode 100755 tools/sparse/sparse-src/validation/abstract-array-declarator-star.c delete mode 100755 tools/sparse/sparse-src/validation/abstract-array-declarator-static.c delete mode 100755 tools/sparse/sparse-src/validation/abstract-array-declarator.c delete mode 100755 tools/sparse/sparse-src/validation/address_space.c delete mode 100755 tools/sparse/sparse-src/validation/alloc-align.c delete mode 100755 tools/sparse/sparse-src/validation/alternate-keywords.c delete mode 100755 tools/sparse/sparse-src/validation/anon-union.c delete mode 100755 tools/sparse/sparse-src/validation/arch/arm-predef-float-abi-hard.c delete mode 100755 tools/sparse/sparse-src/validation/arch/arm-predef-float-abi-mixed.c delete mode 100755 tools/sparse/sparse-src/validation/arch/arm-predef-float-abi-soft.c delete mode 100755 tools/sparse/sparse-src/validation/arch/arm-predef-hard-float.c delete mode 100755 tools/sparse/sparse-src/validation/arch/arm-predef-soft-float.c delete mode 100755 tools/sparse/sparse-src/validation/arch/arm.c delete mode 100755 tools/sparse/sparse-src/validation/arch/arm64.c delete mode 100755 tools/sparse/sparse-src/validation/arch/mips32.c delete mode 100755 tools/sparse/sparse-src/validation/arch/riscv64.c delete mode 100755 tools/sparse/sparse-src/validation/arch/short-wchar.c delete mode 100755 tools/sparse/sparse-src/validation/array-implicit-size.c delete mode 100755 tools/sparse/sparse-src/validation/as-name.c delete mode 100755 tools/sparse/sparse-src/validation/asm-bad0.c delete mode 100755 tools/sparse/sparse-src/validation/asm-empty-clobber.c delete mode 100755 tools/sparse/sparse-src/validation/asm-goto-labels.c delete mode 100755 tools/sparse/sparse-src/validation/asm-inline.c delete mode 100755 tools/sparse/sparse-src/validation/attr-context.c delete mode 100755 tools/sparse/sparse-src/validation/attr-inline.c delete mode 100755 tools/sparse/sparse-src/validation/attr-no_sanitize_address.c delete mode 100755 tools/sparse/sparse-src/validation/attr-noclone.c delete mode 100755 tools/sparse/sparse-src/validation/attr-optimize.c delete mode 100755 tools/sparse/sparse-src/validation/attr-visible.c delete mode 100755 tools/sparse/sparse-src/validation/attr-visible2.c delete mode 100755 tools/sparse/sparse-src/validation/attr-warning.c delete mode 100755 tools/sparse/sparse-src/validation/attr_aligned.c delete mode 100755 tools/sparse/sparse-src/validation/attr_in_parameter.c delete mode 100755 tools/sparse/sparse-src/validation/attr_vector_size.c delete mode 100755 tools/sparse/sparse-src/validation/autotype-ko.c delete mode 100755 tools/sparse/sparse-src/validation/autotype.c delete mode 100755 tools/sparse/sparse-src/validation/backend/arithmetic-ops.c delete mode 100755 tools/sparse/sparse-src/validation/backend/array.c delete mode 100755 tools/sparse/sparse-src/validation/backend/bitwise-ops.c delete mode 100755 tools/sparse/sparse-src/validation/backend/bool-test.c delete mode 100755 tools/sparse/sparse-src/validation/backend/call-variadic.c delete mode 100755 tools/sparse/sparse-src/validation/backend/cast.c delete mode 100755 tools/sparse/sparse-src/validation/backend/cmp-ops.c delete mode 100755 tools/sparse/sparse-src/validation/backend/compare-with-null.c delete mode 100755 tools/sparse/sparse-src/validation/backend/constant-pointer.c delete mode 100755 tools/sparse/sparse-src/validation/backend/degenerate-ptr.c delete mode 100755 tools/sparse/sparse-src/validation/backend/extern.c delete mode 100755 tools/sparse/sparse-src/validation/backend/fn-ref.c delete mode 100755 tools/sparse/sparse-src/validation/backend/function-ptr-xtype.c delete mode 100755 tools/sparse/sparse-src/validation/backend/function-ptr.c delete mode 100755 tools/sparse/sparse-src/validation/backend/hello.c delete mode 100755 tools/sparse/sparse-src/validation/backend/int-cond.c delete mode 100755 tools/sparse/sparse-src/validation/backend/label-as-value.c delete mode 100755 tools/sparse/sparse-src/validation/backend/load-global.c delete mode 100755 tools/sparse/sparse-src/validation/backend/load-type.c delete mode 100755 tools/sparse/sparse-src/validation/backend/logical-ops.c delete mode 100755 tools/sparse/sparse-src/validation/backend/loop.c delete mode 100755 tools/sparse/sparse-src/validation/backend/loop2.c delete mode 100755 tools/sparse/sparse-src/validation/backend/pointer-add.c delete mode 100755 tools/sparse/sparse-src/validation/backend/pointer-cmp.c delete mode 100755 tools/sparse/sparse-src/validation/backend/pointer-param.c delete mode 100755 tools/sparse/sparse-src/validation/backend/pointer-sub.c delete mode 100755 tools/sparse/sparse-src/validation/backend/ptrcast.c delete mode 100755 tools/sparse/sparse-src/validation/backend/setval.c delete mode 100755 tools/sparse/sparse-src/validation/backend/shift-special.c delete mode 100755 tools/sparse/sparse-src/validation/backend/store-type.c delete mode 100755 tools/sparse/sparse-src/validation/backend/store-x2.c delete mode 100755 tools/sparse/sparse-src/validation/backend/string-value.c delete mode 100755 tools/sparse/sparse-src/validation/backend/struct-access.c delete mode 100755 tools/sparse/sparse-src/validation/backend/struct.c delete mode 100755 tools/sparse/sparse-src/validation/backend/sum.c delete mode 100755 tools/sparse/sparse-src/validation/backend/switch.c delete mode 100755 tools/sparse/sparse-src/validation/backend/symaddr.c delete mode 100755 tools/sparse/sparse-src/validation/backend/type-constant.c delete mode 100755 tools/sparse/sparse-src/validation/backend/union.c delete mode 100755 tools/sparse/sparse-src/validation/backend/void-return-type.c delete mode 100755 tools/sparse/sparse-src/validation/bad-array-designated-initializer.c delete mode 100755 tools/sparse/sparse-src/validation/bad-assignment.c delete mode 100755 tools/sparse/sparse-src/validation/bad-cast.c delete mode 100755 tools/sparse/sparse-src/validation/bad-check-access0.c delete mode 100755 tools/sparse/sparse-src/validation/bad-return-type.c delete mode 100755 tools/sparse/sparse-src/validation/bad-ternary-cond.c delete mode 100755 tools/sparse/sparse-src/validation/bad-type-twice0.c delete mode 100755 tools/sparse/sparse-src/validation/bad-type-twice1.c delete mode 100755 tools/sparse/sparse-src/validation/bad-type-twice2.c delete mode 100755 tools/sparse/sparse-src/validation/bad-typeof.c delete mode 100755 tools/sparse/sparse-src/validation/badtype1.c delete mode 100755 tools/sparse/sparse-src/validation/badtype2.c delete mode 100755 tools/sparse/sparse-src/validation/badtype3.c delete mode 100755 tools/sparse/sparse-src/validation/badtype4.c delete mode 100755 tools/sparse/sparse-src/validation/badtype5.c delete mode 100755 tools/sparse/sparse-src/validation/binary-constant.c delete mode 100755 tools/sparse/sparse-src/validation/bitfield-bool-layout.c delete mode 100755 tools/sparse/sparse-src/validation/bitfield-kr.c delete mode 100755 tools/sparse/sparse-src/validation/bitfield-sizes.c delete mode 100755 tools/sparse/sparse-src/validation/bitfields.c delete mode 100755 tools/sparse/sparse-src/validation/bitwise-cast-ptr.c delete mode 100755 tools/sparse/sparse-src/validation/bitwise-cast.c delete mode 100755 tools/sparse/sparse-src/validation/bitwise-function-pointer.c delete mode 100755 tools/sparse/sparse-src/validation/bool-array.c delete mode 100755 tools/sparse/sparse-src/validation/bool-cast-bad.c delete mode 100755 tools/sparse/sparse-src/validation/bool-cast-restricted.c delete mode 100755 tools/sparse/sparse-src/validation/bool-float.c delete mode 100755 tools/sparse/sparse-src/validation/bswap-constant-folding.c delete mode 100755 tools/sparse/sparse-src/validation/bug-bad-type.c delete mode 100755 tools/sparse/sparse-src/validation/bug-crash16.c delete mode 100755 tools/sparse/sparse-src/validation/bug-rshift-ub.c delete mode 100755 tools/sparse/sparse-src/validation/bug_inline_switch.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-args-checking.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-arith.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-atomic-clear.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-bswap-constant.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-bswap-variable.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-fp-unop.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-objsize-dyn.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-objsize0.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-objsize1.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-overflow.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-prototype.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-sync-cas.c delete mode 100755 tools/sparse/sparse-src/validation/builtin-sync-fetch.c delete mode 100755 tools/sparse/sparse-src/validation/builtin_atomic.c delete mode 100755 tools/sparse/sparse-src/validation/builtin_bswap.c delete mode 100755 tools/sparse/sparse-src/validation/builtin_inf.c delete mode 100755 tools/sparse/sparse-src/validation/builtin_safe1.c delete mode 100755 tools/sparse/sparse-src/validation/builtin_unreachable.c delete mode 100755 tools/sparse/sparse-src/validation/builtin_va_arg_pack.c delete mode 100755 tools/sparse/sparse-src/validation/c11-alignas.c delete mode 100755 tools/sparse/sparse-src/validation/c11-alignof.c delete mode 100755 tools/sparse/sparse-src/validation/c11-atomic.c delete mode 100755 tools/sparse/sparse-src/validation/c11-noreturn.c delete mode 100755 tools/sparse/sparse-src/validation/c11-stdc-version.c delete mode 100755 tools/sparse/sparse-src/validation/c11-thread-local.c delete mode 100755 tools/sparse/sparse-src/validation/c99-for-loop-decl.c delete mode 100755 tools/sparse/sparse-src/validation/c99-for-loop.c delete mode 100755 tools/sparse/sparse-src/validation/call-inlined.c delete mode 100755 tools/sparse/sparse-src/validation/call-variadic.c delete mode 100755 tools/sparse/sparse-src/validation/calling-convention-attributes.c delete mode 100755 tools/sparse/sparse-src/validation/cast-bad-00.c delete mode 100755 tools/sparse/sparse-src/validation/cast-bad-01.c delete mode 100755 tools/sparse/sparse-src/validation/cast-kinds-check.c delete mode 100755 tools/sparse/sparse-src/validation/cast-weirds.c delete mode 100755 tools/sparse/sparse-src/validation/char-signed-native.c delete mode 100755 tools/sparse/sparse-src/validation/char-signed.c delete mode 100755 tools/sparse/sparse-src/validation/char-unsigned-native.c delete mode 100755 tools/sparse/sparse-src/validation/char-unsigned.c delete mode 100755 tools/sparse/sparse-src/validation/check_access-multi.c delete mode 100755 tools/sparse/sparse-src/validation/check_access-store.c delete mode 100755 tools/sparse/sparse-src/validation/check_byte_count-ice.c delete mode 100755 tools/sparse/sparse-src/validation/choose_expr.c delete mode 100755 tools/sparse/sparse-src/validation/comma.c delete mode 100755 tools/sparse/sparse-src/validation/compare-null-to-int.c delete mode 100755 tools/sparse/sparse-src/validation/compound-assign-type.c delete mode 100755 tools/sparse/sparse-src/validation/compound-sizes.c delete mode 100755 tools/sparse/sparse-src/validation/cond-address.c delete mode 100755 tools/sparse/sparse-src/validation/cond-err-expand.c delete mode 100755 tools/sparse/sparse-src/validation/cond_expr.c delete mode 100755 tools/sparse/sparse-src/validation/cond_expr2.c delete mode 100755 tools/sparse/sparse-src/validation/cond_expr3.c delete mode 100755 tools/sparse/sparse-src/validation/conditional-type.c delete mode 100755 tools/sparse/sparse-src/validation/constant-suffix-32.c delete mode 100755 tools/sparse/sparse-src/validation/constant-suffix-64.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-addr-of-static-member.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-addr-of-static.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-binop.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-cast.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-compound-literal.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-conditional.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-constcond.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-init.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-labelref.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-offsetof.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-pointer-arith.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-pointer-cast.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-preop.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-pure-builtin.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-shift.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-string.c delete mode 100755 tools/sparse/sparse-src/validation/constexpr-types-compatible-p.c delete mode 100755 tools/sparse/sparse-src/validation/context-stmt.c delete mode 100755 tools/sparse/sparse-src/validation/context-unreachable.c delete mode 100755 tools/sparse/sparse-src/validation/context.c delete mode 100755 tools/sparse/sparse-src/validation/crash-add-doms.c delete mode 100755 tools/sparse/sparse-src/validation/crash-bb_target.c delete mode 100755 tools/sparse/sparse-src/validation/crash-ep-active.c delete mode 100755 tools/sparse/sparse-src/validation/crash-ptrlist.c delete mode 100755 tools/sparse/sparse-src/validation/crash-rewrite-branch.c delete mode 100755 tools/sparse/sparse-src/validation/crash-select.c delete mode 100755 tools/sparse/sparse-src/validation/crash-undef-in-parens.c delete mode 100755 tools/sparse/sparse-src/validation/crazy02-not-so.c delete mode 100755 tools/sparse/sparse-src/validation/crazy03.c delete mode 100755 tools/sparse/sparse-src/validation/declaration-after-statement-ansi.c delete mode 100755 tools/sparse/sparse-src/validation/declaration-after-statement-c89.c delete mode 100755 tools/sparse/sparse-src/validation/declaration-after-statement-c99.c delete mode 100755 tools/sparse/sparse-src/validation/declaration-after-statement-default.c delete mode 100755 tools/sparse/sparse-src/validation/definitions.c delete mode 100755 tools/sparse/sparse-src/validation/designated-init.c delete mode 100755 tools/sparse/sparse-src/validation/div.c delete mode 100755 tools/sparse/sparse-src/validation/doc/cdoc.cdoc delete mode 100755 tools/sparse/sparse-src/validation/double-semicolon.c delete mode 100755 tools/sparse/sparse-src/validation/dubious-bitwise-with-not.c delete mode 100755 tools/sparse/sparse-src/validation/dup-defs-local.c delete mode 100755 tools/sparse/sparse-src/validation/empty-assign.c delete mode 100755 tools/sparse/sparse-src/validation/empty-char-constant.c delete mode 100755 tools/sparse/sparse-src/validation/empty-expr.c delete mode 100755 tools/sparse/sparse-src/validation/empty-file delete mode 100755 tools/sparse/sparse-src/validation/empty-initializer.c delete mode 100755 tools/sparse/sparse-src/validation/endian-big.c delete mode 100755 tools/sparse/sparse-src/validation/endian-little.c delete mode 100755 tools/sparse/sparse-src/validation/enum+mode.c delete mode 100755 tools/sparse/sparse-src/validation/enum-base-type.c delete mode 100755 tools/sparse/sparse-src/validation/enum-bitwise-bad.c delete mode 100755 tools/sparse/sparse-src/validation/enum-bitwise-mixed.c delete mode 100755 tools/sparse/sparse-src/validation/enum-bitwise.c delete mode 100755 tools/sparse/sparse-src/validation/enum-bounds.c delete mode 100755 tools/sparse/sparse-src/validation/enum-init-constness.c delete mode 100755 tools/sparse/sparse-src/validation/enum-invalid.c delete mode 100755 tools/sparse/sparse-src/validation/enum-min-size.c delete mode 100755 tools/sparse/sparse-src/validation/enum-mismatch.c delete mode 100755 tools/sparse/sparse-src/validation/enum-same-type.c delete mode 100755 tools/sparse/sparse-src/validation/enum-sign-extend.c delete mode 100755 tools/sparse/sparse-src/validation/enum-sign-gcc.c delete mode 100755 tools/sparse/sparse-src/validation/enum-type-dubious.c delete mode 100755 tools/sparse/sparse-src/validation/enum-type-exotic.c delete mode 100755 tools/sparse/sparse-src/validation/enum-typecheck.c delete mode 100755 tools/sparse/sparse-src/validation/enum_scope.c delete mode 100755 tools/sparse/sparse-src/validation/error-at-eof.c delete mode 100755 tools/sparse/sparse-src/validation/escapes.c delete mode 100755 tools/sparse/sparse-src/validation/eval-bad-assign1.c delete mode 100755 tools/sparse/sparse-src/validation/eval-bad-assign2.c delete mode 100755 tools/sparse/sparse-src/validation/eval-typeof-vla.c delete mode 100755 tools/sparse/sparse-src/validation/eval/addressable-complex.c delete mode 100755 tools/sparse/sparse-src/validation/eval/addressable-degen.c delete mode 100755 tools/sparse/sparse-src/validation/eval/array-quals-node.c delete mode 100755 tools/sparse/sparse-src/validation/eval/array-quals0.c delete mode 100755 tools/sparse/sparse-src/validation/eval/array-quals1.c delete mode 100755 tools/sparse/sparse-src/validation/eval/asm-degen.c delete mode 100755 tools/sparse/sparse-src/validation/eval/asm-memop.c delete mode 100755 tools/sparse/sparse-src/validation/eval/assign-restricted-ok.c delete mode 100755 tools/sparse/sparse-src/validation/eval/not-cast-bool.c delete mode 100755 tools/sparse/sparse-src/validation/eval/not-cast-float.c delete mode 100755 tools/sparse/sparse-src/validation/eval/premature-examination.c delete mode 100755 tools/sparse/sparse-src/validation/eval/typeof0.c delete mode 100755 tools/sparse/sparse-src/validation/eval/undecl-no-indent.c delete mode 100755 tools/sparse/sparse-src/validation/eval/union-cast-no.c delete mode 100755 tools/sparse/sparse-src/validation/eval/union-cast.c delete mode 100755 tools/sparse/sparse-src/validation/eval/unqual-cast.c delete mode 100755 tools/sparse/sparse-src/validation/eval/unqual-comma.c delete mode 100755 tools/sparse/sparse-src/validation/eval/unqual-postop.c delete mode 100755 tools/sparse/sparse-src/validation/eval/unqual-stmt-expr.c delete mode 100755 tools/sparse/sparse-src/validation/eval/unqual02.c delete mode 100755 tools/sparse/sparse-src/validation/expand/asm0.c delete mode 100755 tools/sparse/sparse-src/validation/expand/bad-shift.c delete mode 100755 tools/sparse/sparse-src/validation/expand/builtin-expect.c delete mode 100755 tools/sparse/sparse-src/validation/expand/builtin_constant_inline0.c delete mode 100755 tools/sparse/sparse-src/validation/expand/builtin_constant_inline1.c delete mode 100755 tools/sparse/sparse-src/validation/expand/builtin_fpclassify.c delete mode 100755 tools/sparse/sparse-src/validation/expand/builtin_huge_val.c delete mode 100755 tools/sparse/sparse-src/validation/expand/builtin_isdigit.c delete mode 100755 tools/sparse/sparse-src/validation/expand/builtin_isinf.c delete mode 100755 tools/sparse/sparse-src/validation/expand/builtin_isnan.c delete mode 100755 tools/sparse/sparse-src/validation/expand/builtin_isnormal.c delete mode 100755 tools/sparse/sparse-src/validation/expand/builtin_nan.c delete mode 100755 tools/sparse/sparse-src/validation/expand/compound-literal.c delete mode 100755 tools/sparse/sparse-src/validation/expand/constant-init-array.c delete mode 100755 tools/sparse/sparse-src/validation/expand/constant-init-nested-array.c delete mode 100755 tools/sparse/sparse-src/validation/expand/constant-init-nested-struct.c delete mode 100755 tools/sparse/sparse-src/validation/expand/constant-init-string.c delete mode 100755 tools/sparse/sparse-src/validation/expand/constant-union-flt2int.c delete mode 100755 tools/sparse/sparse-src/validation/expand/constant-union-int2flt.c delete mode 100755 tools/sparse/sparse-src/validation/expand/constant-union-size.c delete mode 100755 tools/sparse/sparse-src/validation/expand/cost-deref-nested.c delete mode 100755 tools/sparse/sparse-src/validation/expand/default-init-array.c delete mode 100755 tools/sparse/sparse-src/validation/expand/default-init-struct.c delete mode 100755 tools/sparse/sparse-src/validation/expand/function-pointer.c delete mode 100755 tools/sparse/sparse-src/validation/expand/union-cast.c delete mode 100755 tools/sparse/sparse-src/validation/extern-array.c delete mode 100755 tools/sparse/sparse-src/validation/extern-inline.c delete mode 100755 tools/sparse/sparse-src/validation/fdiag-prefix.c delete mode 100755 tools/sparse/sparse-src/validation/field-overlap.c delete mode 100755 tools/sparse/sparse-src/validation/field-override.c delete mode 100755 tools/sparse/sparse-src/validation/flex-array-align.c delete mode 100755 tools/sparse/sparse-src/validation/flex-array-array.c delete mode 100755 tools/sparse/sparse-src/validation/flex-array-error.c delete mode 100755 tools/sparse/sparse-src/validation/flex-array-nested.c delete mode 100755 tools/sparse/sparse-src/validation/flex-array-sizeof.c delete mode 100755 tools/sparse/sparse-src/validation/flex-array-union-array-no.c delete mode 100755 tools/sparse/sparse-src/validation/flex-array-union-array-yes.c delete mode 100755 tools/sparse/sparse-src/validation/flex-array-union-array.h delete mode 100755 tools/sparse/sparse-src/validation/fored_arg.c delete mode 100755 tools/sparse/sparse-src/validation/foul-bitwise.c delete mode 100755 tools/sparse/sparse-src/validation/foul-scalar.c delete mode 100755 tools/sparse/sparse-src/validation/fp-ops.c delete mode 100755 tools/sparse/sparse-src/validation/function-attribute-inner.c delete mode 100755 tools/sparse/sparse-src/validation/function-attribute-pointer.c delete mode 100755 tools/sparse/sparse-src/validation/function-attribute-void-ptr.c delete mode 100755 tools/sparse/sparse-src/validation/function-attribute.c delete mode 100755 tools/sparse/sparse-src/validation/function-pointer-inheritance.c delete mode 100755 tools/sparse/sparse-src/validation/function-pointer-type.c delete mode 100755 tools/sparse/sparse-src/validation/function-redecl-funattr.c delete mode 100755 tools/sparse/sparse-src/validation/function-redecl.c delete mode 100755 tools/sparse/sparse-src/validation/function-redecl2.c delete mode 100755 tools/sparse/sparse-src/validation/generic-bad0.c delete mode 100755 tools/sparse/sparse-src/validation/generic-dr481.c delete mode 100755 tools/sparse/sparse-src/validation/generic-functions.c delete mode 100755 tools/sparse/sparse-src/validation/generic-schar.c delete mode 100755 tools/sparse/sparse-src/validation/generic-typename.c delete mode 100755 tools/sparse/sparse-src/validation/goto-label.c delete mode 100755 tools/sparse/sparse-src/validation/goto-reserved.c delete mode 100755 tools/sparse/sparse-src/validation/identifier_list.c delete mode 100755 tools/sparse/sparse-src/validation/implicit-KR-arg-type0.c delete mode 100755 tools/sparse/sparse-src/validation/implicit-KR-arg-type1.c delete mode 100755 tools/sparse/sparse-src/validation/implicit-ret-type.c delete mode 100755 tools/sparse/sparse-src/validation/implicit-type.c delete mode 100755 tools/sparse/sparse-src/validation/inc-dec-float.c delete mode 100755 tools/sparse/sparse-src/validation/include-eval.c delete mode 100755 tools/sparse/sparse-src/validation/include-eval.inc delete mode 100755 tools/sparse/sparse-src/validation/incomplete-struct.c delete mode 100755 tools/sparse/sparse-src/validation/infinite-loop0.c delete mode 100755 tools/sparse/sparse-src/validation/infinite-loop01.c delete mode 100755 tools/sparse/sparse-src/validation/infinite-loop02.c delete mode 100755 tools/sparse/sparse-src/validation/infinite-loop03.c delete mode 100755 tools/sparse/sparse-src/validation/infinite-loop04.c delete mode 100755 tools/sparse/sparse-src/validation/init-char-array.c delete mode 100755 tools/sparse/sparse-src/validation/init-char-array1.c delete mode 100755 tools/sparse/sparse-src/validation/init-wstring.c delete mode 100755 tools/sparse/sparse-src/validation/init_cstring.c delete mode 100755 tools/sparse/sparse-src/validation/initializer-entry-defined-twice.c delete mode 100755 tools/sparse/sparse-src/validation/inline-generic.c delete mode 100755 tools/sparse/sparse-src/validation/inline_base0.c delete mode 100755 tools/sparse/sparse-src/validation/inline_compound_literals.c delete mode 100755 tools/sparse/sparse-src/validation/inline_self.c delete mode 100755 tools/sparse/sparse-src/validation/int128.c delete mode 100755 tools/sparse/sparse-src/validation/integer-const-expr.c delete mode 100755 tools/sparse/sparse-src/validation/integer-promotions.c delete mode 100755 tools/sparse/sparse-src/validation/ioc-typecheck.c delete mode 100755 tools/sparse/sparse-src/validation/kill-computedgoto.c delete mode 100755 tools/sparse/sparse-src/validation/kill-cse.c delete mode 100755 tools/sparse/sparse-src/validation/kill-insert-branch.c delete mode 100755 tools/sparse/sparse-src/validation/kill-load.c delete mode 100755 tools/sparse/sparse-src/validation/kill-phi-node.c delete mode 100755 tools/sparse/sparse-src/validation/kill-phi-ttsbb.c delete mode 100755 tools/sparse/sparse-src/validation/kill-phi-ttsbb2.c delete mode 100755 tools/sparse/sparse-src/validation/kill-phisrc.c delete mode 100755 tools/sparse/sparse-src/validation/kill-pure-call.c delete mode 100755 tools/sparse/sparse-src/validation/kill-replaced-insn.c delete mode 100755 tools/sparse/sparse-src/validation/kill-rewritten-load.c delete mode 100755 tools/sparse/sparse-src/validation/kill-select.c delete mode 100755 tools/sparse/sparse-src/validation/kill-slice.c delete mode 100755 tools/sparse/sparse-src/validation/kill-store.c delete mode 100755 tools/sparse/sparse-src/validation/kill-switch.c delete mode 100755 tools/sparse/sparse-src/validation/kill-unreachable-phi.c delete mode 100755 tools/sparse/sparse-src/validation/knr-attr-crash.c delete mode 100755 tools/sparse/sparse-src/validation/label-asm.c delete mode 100755 tools/sparse/sparse-src/validation/label-attr.c delete mode 100755 tools/sparse/sparse-src/validation/label-redefined.c delete mode 100755 tools/sparse/sparse-src/validation/label-scope-cgoto.c delete mode 100755 tools/sparse/sparse-src/validation/label-scope.c delete mode 100755 tools/sparse/sparse-src/validation/label-scope1.c delete mode 100755 tools/sparse/sparse-src/validation/label-scope2.c delete mode 100755 tools/sparse/sparse-src/validation/label-stmt-expr0.c delete mode 100755 tools/sparse/sparse-src/validation/label-stmt-expr1.c delete mode 100755 tools/sparse/sparse-src/validation/label-stmt-expr2.c delete mode 100755 tools/sparse/sparse-src/validation/label-unused.c delete mode 100755 tools/sparse/sparse-src/validation/linear/asm-memop.c delete mode 100755 tools/sparse/sparse-src/validation/linear/asm-out0.c delete mode 100755 tools/sparse/sparse-src/validation/linear/asm-toplevel.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bitfield-expand-deref.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bitfield-inc.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bitfield-init-mask.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bitfield-preinc.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bitfield-sign-default.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bitfield-sign-signed.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bitfield-sign-unsigned.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bitfield-size.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bitfield-store.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bool-cast-lp32.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bool-cast-lp64.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bool-cast.c delete mode 100755 tools/sparse/sparse-src/validation/linear/bug-assign-op0.c delete mode 100755 tools/sparse/sparse-src/validation/linear/builtin-fma.c delete mode 100755 tools/sparse/sparse-src/validation/linear/builtin_isdigit.c delete mode 100755 tools/sparse/sparse-src/validation/linear/builtin_unreachable0.c delete mode 100755 tools/sparse/sparse-src/validation/linear/builtin_unreachable1.c delete mode 100755 tools/sparse/sparse-src/validation/linear/call-basic.c delete mode 100755 tools/sparse/sparse-src/validation/linear/call-builtin.c delete mode 100755 tools/sparse/sparse-src/validation/linear/call-casted-pointer.c delete mode 100755 tools/sparse/sparse-src/validation/linear/call-complex-pointer.c delete mode 100755 tools/sparse/sparse-src/validation/linear/call-direct.c delete mode 100755 tools/sparse/sparse-src/validation/linear/call-indirect.c delete mode 100755 tools/sparse/sparse-src/validation/linear/call-inline.c delete mode 100755 tools/sparse/sparse-src/validation/linear/cast-constant-to-float.c delete mode 100755 tools/sparse/sparse-src/validation/linear/cast-constants.c delete mode 100755 tools/sparse/sparse-src/validation/linear/cast-volatile.c delete mode 100755 tools/sparse/sparse-src/validation/linear/compound-literal00.c delete mode 100755 tools/sparse/sparse-src/validation/linear/compound-literal01.c delete mode 100755 tools/sparse/sparse-src/validation/linear/compound-literal02.c delete mode 100755 tools/sparse/sparse-src/validation/linear/degen-array.c delete mode 100755 tools/sparse/sparse-src/validation/linear/degen-function.c delete mode 100755 tools/sparse/sparse-src/validation/linear/degen-log-not.c delete mode 100755 tools/sparse/sparse-src/validation/linear/deref-ptr-ptr.c delete mode 100755 tools/sparse/sparse-src/validation/linear/fp-vs-ptrcast.c delete mode 100755 tools/sparse/sparse-src/validation/linear/fp2i-cast.c delete mode 100755 tools/sparse/sparse-src/validation/linear/goto-invalid.c delete mode 100755 tools/sparse/sparse-src/validation/linear/goto-stmt-expr-conditional.c delete mode 100755 tools/sparse/sparse-src/validation/linear/goto-stmt-expr-short-circuit.c delete mode 100755 tools/sparse/sparse-src/validation/linear/inline-definition.c delete mode 100755 tools/sparse/sparse-src/validation/linear/join-cond-discard.c delete mode 100755 tools/sparse/sparse-src/validation/linear/label-scope-cgoto.c delete mode 100755 tools/sparse/sparse-src/validation/linear/label-stmt-dropped.c delete mode 100755 tools/sparse/sparse-src/validation/linear/label-stmt-expr0.c delete mode 100755 tools/sparse/sparse-src/validation/linear/label-unreachable.c delete mode 100755 tools/sparse/sparse-src/validation/linear/logical-phi0.c delete mode 100755 tools/sparse/sparse-src/validation/linear/logical.c delete mode 100755 tools/sparse/sparse-src/validation/linear/missing-insn-size.c delete mode 100755 tools/sparse/sparse-src/validation/linear/missing-return0.c delete mode 100755 tools/sparse/sparse-src/validation/linear/missing-return1.c delete mode 100755 tools/sparse/sparse-src/validation/linear/missing-return2.c delete mode 100755 tools/sparse/sparse-src/validation/linear/missing-return3.c delete mode 100755 tools/sparse/sparse-src/validation/linear/missing-return4.c delete mode 100755 tools/sparse/sparse-src/validation/linear/missing-return5.c delete mode 100755 tools/sparse/sparse-src/validation/linear/non-const-case.c delete mode 100755 tools/sparse/sparse-src/validation/linear/noreturn-unreachable0.c delete mode 100755 tools/sparse/sparse-src/validation/linear/phi-order01.c delete mode 100755 tools/sparse/sparse-src/validation/linear/phi-order02.c delete mode 100755 tools/sparse/sparse-src/validation/linear/phi-order03.c delete mode 100755 tools/sparse/sparse-src/validation/linear/phi-order04.c delete mode 100755 tools/sparse/sparse-src/validation/linear/pointer-arith32.c delete mode 100755 tools/sparse/sparse-src/validation/linear/pointer-arith64.c delete mode 100755 tools/sparse/sparse-src/validation/linear/range-op.c delete mode 100755 tools/sparse/sparse-src/validation/linear/shift-assign1.c delete mode 100755 tools/sparse/sparse-src/validation/linear/shift-assign2.c delete mode 100755 tools/sparse/sparse-src/validation/linear/struct-init-full.c delete mode 100755 tools/sparse/sparse-src/validation/linear/struct-init-partial.c delete mode 100755 tools/sparse/sparse-src/validation/linear/unexamined-base-type.c delete mode 100755 tools/sparse/sparse-src/validation/local-label.c delete mode 100755 tools/sparse/sparse-src/validation/logical.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/address-used00.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/alias-distinct.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/alias-mixed.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/alias-same.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/asm-reload0.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/broken-phi02.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/broken-phi03.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/cond-expr.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/cond-expr5.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/dead-phisrc.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/global-direct-undef.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/global-direct.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/global-loop.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/global-noalias.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/global-pointer.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/if-direct.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/if-pointer.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/init-global-array.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/init-local-array.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/init-local-union0.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/init-local-union1.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/init-local32.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/init-local64.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/load-dead.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/load-deadborn.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/loop00.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/loop01-global.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/loop02-array.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/loop02-global.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/loop02-local.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/loop02-pointer.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/missing-return.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/not-same-memop0.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/packed-bitfield.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/quadra00.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/quadra01.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/quadra02.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/reload-aliasing.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/short-load.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/store-deadborn.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/stray-phisrc.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/struct.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/undef00.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/undef01.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/unused-var.c delete mode 100755 tools/sparse/sparse-src/validation/mem2reg/volatile-store00.c delete mode 100755 tools/sparse/sparse-src/validation/member_of_typeof.c delete mode 100755 tools/sparse/sparse-src/validation/memops-volatile.c delete mode 100755 tools/sparse/sparse-src/validation/memops/kill-dead-loads00.c delete mode 100755 tools/sparse/sparse-src/validation/memops/kill-dead-store-parent0.c delete mode 100755 tools/sparse/sparse-src/validation/memops/kill-dead-store-parent2.c delete mode 100755 tools/sparse/sparse-src/validation/memops/kill-redundant-store0.c delete mode 100755 tools/sparse/sparse-src/validation/memops/partial-load00.c delete mode 100755 tools/sparse/sparse-src/validation/memops/type-punning-flt2int.c delete mode 100755 tools/sparse/sparse-src/validation/memops/type-punning-int2flt.c delete mode 100755 tools/sparse/sparse-src/validation/missing-ident.c delete mode 100755 tools/sparse/sparse-src/validation/missing-return.c delete mode 100755 tools/sparse/sparse-src/validation/multi-input.c delete mode 100755 tools/sparse/sparse-src/validation/multi_typedef.c delete mode 100755 tools/sparse/sparse-src/validation/nested-declarator.c delete mode 100755 tools/sparse/sparse-src/validation/nested-declarator2.c delete mode 100755 tools/sparse/sparse-src/validation/nested-functions.c delete mode 100755 tools/sparse/sparse-src/validation/nocast.c delete mode 100755 tools/sparse/sparse-src/validation/noderef.c delete mode 100755 tools/sparse/sparse-src/validation/non-pointer-null.c delete mode 100755 tools/sparse/sparse-src/validation/old-initializer-nowarn.c delete mode 100755 tools/sparse/sparse-src/validation/old-initializer.c delete mode 100755 tools/sparse/sparse-src/validation/old-style-definition0.c delete mode 100755 tools/sparse/sparse-src/validation/old-style-definition1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/address-used01.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-extend.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-lsr.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-bf0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-bf1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-bf2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-bfs.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-bfu.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-bfx.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-constant0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-constant1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-constant2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-crash.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-lsr0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-lsr1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-lsr2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-lsrx.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-mask.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-mask0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-mask1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-mask2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-mask3s.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-mask3u.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-mask4.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-maskx.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-shl0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-shl1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-shl2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-shlx.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-trunc0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-trunc1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-trunc2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-or-truncx.c delete mode 100755 tools/sparse/sparse-src/validation/optim/and-trunc.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bad-phisrc1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bad-phisrc1a.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bad-phisrc2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bad-phisrc3.c delete mode 100755 tools/sparse/sparse-src/validation/optim/binops-same-args.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bitfield-init-zero.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bitfield-size.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bitfield-store-load0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bitfield-store-loads.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bitfield-store-loadu.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bits-not-zero.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-context-fp.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-context.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-eq0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-int-bool.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-ne0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-neq0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-same-args.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-sext-test.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-simplify.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-simplify2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/bool-zext-test.c delete mode 100755 tools/sparse/sparse-src/validation/optim/call-complex-pointer.c delete mode 100755 tools/sparse/sparse-src/validation/optim/call-inlined.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-abs.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-add.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-arg.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-cmp-zero.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-cmp.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-cmpe-minmax.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-cmps-minmax.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-cmps-sel.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-cmps.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-cmpu.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-fcmp.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-mul.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-not.c delete mode 100755 tools/sparse/sparse-src/validation/optim/canonical-sub-cte.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cast-kinds.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cast-nop.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cgoto01.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cgoto02.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-and-pow2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-op-type.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-sext-sext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-sext-simm.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-sext-uimm.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-sext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-type0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-type1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-zext-simm.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-zext-uimm0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-zext-uimm1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-zext-uimm2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-zext-zext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmp-zext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmpe-and0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmpe-or0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmps-and0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmps-minmax.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmps-or0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmps0-and0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmpu-and0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cmpu-or0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-arg01.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-cmp-next.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-commutativity.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-dual-compare.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-fcmp.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-label.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-not01.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-not02.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-reg01.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-setfval.c delete mode 100755 tools/sparse/sparse-src/validation/optim/cse-size.c delete mode 100755 tools/sparse/sparse-src/validation/optim/double-unop.c delete mode 100755 tools/sparse/sparse-src/validation/optim/dup-cond0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/eqne-select.c delete mode 100755 tools/sparse/sparse-src/validation/optim/ext-trunc-greater.c delete mode 100755 tools/sparse/sparse-src/validation/optim/ext-trunc-same.c delete mode 100755 tools/sparse/sparse-src/validation/optim/ext-trunc-smaller.c delete mode 100755 tools/sparse/sparse-src/validation/optim/fact-add-mul.c delete mode 100755 tools/sparse/sparse-src/validation/optim/fact-and-ior.c delete mode 100755 tools/sparse/sparse-src/validation/optim/fact-and-shift.c delete mode 100755 tools/sparse/sparse-src/validation/optim/fact-ior-and.c delete mode 100755 tools/sparse/sparse-src/validation/optim/fact-ior-shift.c delete mode 100755 tools/sparse/sparse-src/validation/optim/fact-select01.c delete mode 100755 tools/sparse/sparse-src/validation/optim/fact-xor-and.c delete mode 100755 tools/sparse/sparse-src/validation/optim/fact-xor-shift.c delete mode 100755 tools/sparse/sparse-src/validation/optim/fpcast-constant.c delete mode 100755 tools/sparse/sparse-src/validation/optim/fpcast-nop.c delete mode 100755 tools/sparse/sparse-src/validation/optim/inline-return.c delete mode 100755 tools/sparse/sparse-src/validation/optim/kill-casts.c delete mode 100755 tools/sparse/sparse-src/validation/optim/kill-stores0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/kill-stores1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/kill-stores2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/killed-insn.c delete mode 100755 tools/sparse/sparse-src/validation/optim/live-stores0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/load-converted.c delete mode 100755 tools/sparse/sparse-src/validation/optim/load-dead.c delete mode 100755 tools/sparse/sparse-src/validation/optim/load-semi-volatile.c delete mode 100755 tools/sparse/sparse-src/validation/optim/lsr-and0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/lsr-and1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/lsr-asr.c delete mode 100755 tools/sparse/sparse-src/validation/optim/lsr-shl0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/lsr-to-asr.c delete mode 100755 tools/sparse/sparse-src/validation/optim/mask-lsr.c delete mode 100755 tools/sparse/sparse-src/validation/optim/mask-out.c delete mode 100755 tools/sparse/sparse-src/validation/optim/mask1-setne0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/memops-missed01.c delete mode 100755 tools/sparse/sparse-src/validation/optim/memops-missed02.c delete mode 100755 tools/sparse/sparse-src/validation/optim/merge_bbe-adjust_phi.c delete mode 100755 tools/sparse/sparse-src/validation/optim/missing-select.c delete mode 100755 tools/sparse/sparse-src/validation/optim/muldiv-by-one.c delete mode 100755 tools/sparse/sparse-src/validation/optim/muldiv-by-zero.c delete mode 100755 tools/sparse/sparse-src/validation/optim/muldiv-minus-one.c delete mode 100755 tools/sparse/sparse-src/validation/optim/multi-phisrc.c delete mode 100755 tools/sparse/sparse-src/validation/optim/null-phi.c delete mode 100755 tools/sparse/sparse-src/validation/optim/or-and-constant1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/phi-count00.c delete mode 100755 tools/sparse/sparse-src/validation/optim/phi-ret.c delete mode 100755 tools/sparse/sparse-src/validation/optim/range-check1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/range-check2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/reassoc-op-op1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/restrict.c delete mode 100755 tools/sparse/sparse-src/validation/optim/select-and-shift.c delete mode 100755 tools/sparse/sparse-src/validation/optim/select-constant-cond.c delete mode 100755 tools/sparse/sparse-src/validation/optim/select-same-args.c delete mode 100755 tools/sparse/sparse-src/validation/optim/select-select-true-false0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/select-select-true-false1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/select-select-true-true.c delete mode 100755 tools/sparse/sparse-src/validation/optim/select-self-zero.c delete mode 100755 tools/sparse/sparse-src/validation/optim/select-zero.c delete mode 100755 tools/sparse/sparse-src/validation/optim/set-uimm0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/set-uimm1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/set-uimm2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/set-uimm3.c delete mode 100755 tools/sparse/sparse-src/validation/optim/setcc-mask.c delete mode 100755 tools/sparse/sparse-src/validation/optim/setcc-setcc.c delete mode 100755 tools/sparse/sparse-src/validation/optim/setcc-seteq.c delete mode 100755 tools/sparse/sparse-src/validation/optim/setcc-setne.c delete mode 100755 tools/sparse/sparse-src/validation/optim/setne0-sext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/setne0-trunc.c delete mode 100755 tools/sparse/sparse-src/validation/optim/setne0-zext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/sext-sext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/sext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/sh-or-and0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/sh-or-and1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/sh-or-and2.c delete mode 100755 tools/sparse/sparse-src/validation/optim/shift-big.c delete mode 100755 tools/sparse/sparse-src/validation/optim/shift-shift.c delete mode 100755 tools/sparse/sparse-src/validation/optim/shift-zext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/shl-and0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/shl-and1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/shl-lsr0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-add-neg.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-cte-sub-addl.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-cte-sub-addr.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-cte-sub-subr.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-neg-add-cte.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-neg-add.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-neg-not.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-neg-sub.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-not-add-cte.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-not-neg.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-not-sub-cte.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-not-xor-cte.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-same-add-subl.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-same-add-subr.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-same-addl-sub.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-same-sub-addl.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-same-subl-add.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-same-subr-add.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-sub-neg.c delete mode 100755 tools/sparse/sparse-src/validation/optim/simplify-zero-sub.c delete mode 100755 tools/sparse/sparse-src/validation/optim/store-dominated.c delete mode 100755 tools/sparse/sparse-src/validation/optim/testsuite.c delete mode 100755 tools/sparse/sparse-src/validation/optim/trivial-phi01.c delete mode 100755 tools/sparse/sparse-src/validation/optim/trivial-phis.c delete mode 100755 tools/sparse/sparse-src/validation/optim/trunc-mask-zext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/trunc-not0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/trunc-or-shl.c delete mode 100755 tools/sparse/sparse-src/validation/optim/trunc-seteq0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/trunc-setne0.c delete mode 100755 tools/sparse/sparse-src/validation/optim/trunc-trunc.c delete mode 100755 tools/sparse/sparse-src/validation/optim/void-if-convert.c delete mode 100755 tools/sparse/sparse-src/validation/optim/volatile-bitfield.c delete mode 100755 tools/sparse/sparse-src/validation/optim/volatile-side-effect.c delete mode 100755 tools/sparse/sparse-src/validation/optim/volatile-store00.c delete mode 100755 tools/sparse/sparse-src/validation/optim/zext-and.c delete mode 100755 tools/sparse/sparse-src/validation/optim/zext-and1.c delete mode 100755 tools/sparse/sparse-src/validation/optim/zext-asr.c delete mode 100755 tools/sparse/sparse-src/validation/optim/zext-cmpu.c delete mode 100755 tools/sparse/sparse-src/validation/optim/zext-sext.c delete mode 100755 tools/sparse/sparse-src/validation/optim/zext-zext.c delete mode 100755 tools/sparse/sparse-src/validation/option-parsing-00.c delete mode 100755 tools/sparse/sparse-src/validation/option-parsing-01.c delete mode 100755 tools/sparse/sparse-src/validation/outer-scope.c delete mode 100755 tools/sparse/sparse-src/validation/overflow.c delete mode 100755 tools/sparse/sparse-src/validation/packed-bitfield0.c delete mode 100755 tools/sparse/sparse-src/validation/packed-bitfield1.c delete mode 100755 tools/sparse/sparse-src/validation/packed-bitfield2.c delete mode 100755 tools/sparse/sparse-src/validation/packed-bitfield3.c delete mode 100755 tools/sparse/sparse-src/validation/packed-bitfield4.c delete mode 100755 tools/sparse/sparse-src/validation/packed-bitfield5.c delete mode 100755 tools/sparse/sparse-src/validation/packed-deref0.c delete mode 100755 tools/sparse/sparse-src/validation/packed-struct.c delete mode 100755 tools/sparse/sparse-src/validation/parsing/enum-attr.c delete mode 100755 tools/sparse/sparse-src/validation/plain-char-compatibility.c delete mode 100755 tools/sparse/sparse-src/validation/pragma-once.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/bad-cmdline-include.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/base-file.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/base-file.h delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/builtin.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/cli-D-arg.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/cli-D-space.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/counter1.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/counter2.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/counter2.h delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/counter3.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/directive-within-macro.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/dump-macros-empty.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/dump-macros-multi.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/dump-macros-only.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/dump-macros.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/dynamic.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/early-escape.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/empty-char-constant.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/expand-and-nl.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/expand-redef.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/extra-token.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/freestanding.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/has-attribute.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/has-builtin.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/has-feature.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/hosted.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/ident-pragma.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/ident.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/include-level.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/include-level.h delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/missing-delim.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/phase2-backslash.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/phase3-comments.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/predef-llp64.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/predef-lp32.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/predef-lp64.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/predef-token.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/predef-unsigned.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/predef.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor1.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor10.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor11.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor12.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor13.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor14.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor15.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor16.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor17.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor18.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor19.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor2.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor20.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor20.h delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor21.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor22.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor23.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor3.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor4.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor5.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor6.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor7.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor8.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/preprocessor9.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/stringify.c delete mode 100755 tools/sparse/sparse-src/validation/preprocessor/wide.c delete mode 100755 tools/sparse/sparse-src/validation/prototype.c delete mode 100755 tools/sparse/sparse-src/validation/ptr-inherit.c delete mode 100755 tools/sparse/sparse-src/validation/ptr-sub-blows.c delete mode 100755 tools/sparse/sparse-src/validation/pure-function.c delete mode 100755 tools/sparse/sparse-src/validation/range-syntax.c delete mode 100755 tools/sparse/sparse-src/validation/repeat.h delete mode 100755 tools/sparse/sparse-src/validation/reserved.c delete mode 100755 tools/sparse/sparse-src/validation/restrict-array.c delete mode 100755 tools/sparse/sparse-src/validation/restrict.c delete mode 100755 tools/sparse/sparse-src/validation/restricted-typeof.c delete mode 100755 tools/sparse/sparse-src/validation/scheck/ko.c delete mode 100755 tools/sparse/sparse-src/validation/scheck/ok.c delete mode 100755 tools/sparse/sparse-src/validation/self-quote-args.c delete mode 100755 tools/sparse/sparse-src/validation/shift-negative.c delete mode 100755 tools/sparse/sparse-src/validation/shift-undef-long.c delete mode 100755 tools/sparse/sparse-src/validation/shift-undef.c delete mode 100755 tools/sparse/sparse-src/validation/sizeof-bool.c delete mode 100755 tools/sparse/sparse-src/validation/sizeof-builtin.c delete mode 100755 tools/sparse/sparse-src/validation/sizeof-compound-postfix.c delete mode 100755 tools/sparse/sparse-src/validation/sizeof-function.c delete mode 100755 tools/sparse/sparse-src/validation/sizeof-incomplete-type.c delete mode 100755 tools/sparse/sparse-src/validation/sizeof-void.c delete mode 100755 tools/sparse/sparse-src/validation/specifiers1.c delete mode 100755 tools/sparse/sparse-src/validation/specifiers2.c delete mode 100755 tools/sparse/sparse-src/validation/static-forward-decl.c delete mode 100755 tools/sparse/sparse-src/validation/static_assert.c delete mode 100755 tools/sparse/sparse-src/validation/storage-struct-member.c delete mode 100755 tools/sparse/sparse-src/validation/strict-prototypes0.c delete mode 100755 tools/sparse/sparse-src/validation/strict-prototypes1.c delete mode 100755 tools/sparse/sparse-src/validation/struct-as.c delete mode 100755 tools/sparse/sparse-src/validation/struct-attribute-placement.c delete mode 100755 tools/sparse/sparse-src/validation/struct-ns1.c delete mode 100755 tools/sparse/sparse-src/validation/struct-ns2.c delete mode 100755 tools/sparse/sparse-src/validation/struct-size1.c delete mode 100755 tools/sparse/sparse-src/validation/switch-long.c delete mode 100755 tools/sparse/sparse-src/validation/tautological-compare.c delete mode 100755 tools/sparse/sparse-src/validation/test-suite delete mode 100755 tools/sparse/sparse-src/validation/transparent-union.c delete mode 100755 tools/sparse/sparse-src/validation/type-attribute-align.c delete mode 100755 tools/sparse/sparse-src/validation/type-attribute-as.c delete mode 100755 tools/sparse/sparse-src/validation/type-attribute-mod.c delete mode 100755 tools/sparse/sparse-src/validation/type-attribute-qual.c delete mode 100755 tools/sparse/sparse-src/validation/type-compare.c delete mode 100755 tools/sparse/sparse-src/validation/type1.c delete mode 100755 tools/sparse/sparse-src/validation/typedef-redef-c89.c delete mode 100755 tools/sparse/sparse-src/validation/typedef-redef.c delete mode 100755 tools/sparse/sparse-src/validation/typedef_shadow.c delete mode 100755 tools/sparse/sparse-src/validation/typediff-arraysize.c delete mode 100755 tools/sparse/sparse-src/validation/typediff-enum.c delete mode 100755 tools/sparse/sparse-src/validation/typeof-addresspace.c delete mode 100755 tools/sparse/sparse-src/validation/typeof-attribute.c delete mode 100755 tools/sparse/sparse-src/validation/typeof-bad.c delete mode 100755 tools/sparse/sparse-src/validation/typeof-mods.c delete mode 100755 tools/sparse/sparse-src/validation/typeof-noderef.c delete mode 100755 tools/sparse/sparse-src/validation/typeof-safe.c delete mode 100755 tools/sparse/sparse-src/validation/typesign.c delete mode 100755 tools/sparse/sparse-src/validation/usual-conv-lp32.c delete mode 100755 tools/sparse/sparse-src/validation/var-undef-partial.c delete mode 100755 tools/sparse/sparse-src/validation/varargs1.c delete mode 100755 tools/sparse/sparse-src/validation/vla-sizeof-ice.c delete mode 100755 tools/sparse/sparse-src/validation/vla-sizeof.c delete mode 100755 tools/sparse/sparse-src/validation/vla-sizeof0.c delete mode 100755 tools/sparse/sparse-src/validation/vla-sizeof1.c delete mode 100755 tools/sparse/sparse-src/validation/vla-sizeof2.c delete mode 100755 tools/sparse/sparse-src/validation/vla-sizeof3.c delete mode 100755 tools/sparse/sparse-src/validation/vla-sizeof4.c delete mode 100755 tools/sparse/sparse-src/validation/wide.c delete mode 100755 tools/sparse/sparse-src/version.c diff --git a/Makefile.release b/Makefile.release deleted file mode 100755 index c81925de..00000000 --- a/Makefile.release +++ /dev/null @@ -1,46 +0,0 @@ -# -# Release Makefile for LTP. -# -# Copyright (C) 2010, Copyrights-are-for-losers, 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. -# -# Invoke like: -# -# make -f Makefile.release release TARBALL_VERSION=FOO -# -# Cheers. -# - -top_srcdir ?= $(CURDIR) - -include $(top_srcdir)/include/mk/env_pre.mk -include $(top_srcdir)/include/mk/automake.mk - -TARBALL_PREFIX ?= ltp - -ifneq ($(wildcard $(top_srcdir)/Version),) -TARBALL_VERSION ?= $(shell $(top_srcdir)/Version) -endif - -TARBALL_VERSION ?= $(error you must either make Version via make $$PWD/Version or specify an LTP version via TARBALL_VERSION) - -TARBALL := $(TARBALL_PREFIX)-$(TARBALL_VERSION).tgz - -clean: - $(MAKE) -f Makefile $@ - -release: | autotools distclean - tar -cvz --exclude "$(TARBALL)" -f $(TARBALL) . diff --git a/doc/build-system-guide.txt b/doc/build-system-guide.txt deleted file mode 100755 index 166f7fb9..00000000 --- a/doc/build-system-guide.txt +++ /dev/null @@ -1,213 +0,0 @@ -Short introduction into LTP build system -======================================== - -****************************************************************************** -The following document briefly describes the steps and methodologies used for -the new and improved Makefile system. - -Changelog: - - * Initial version: Ngie Cooper - * Reformated for asciidoc: Cyril Hrubis -****************************************************************************** - -The Problem ------------ - -The problem with the old Makefile system is that it was very difficult to -maintain and it lacked any sense of formal structure, thus developing for LTP -and including new targets was more difficult than it should have been -(maintenance). Furthermore, proper option-based cross-compilation was -impossible due to the fact that the Makefiles didn't support a prefixing -system, and the appropriate implicit / static rules hadn't been configured to -compile into multiple object directories for out-of-tree build support (ease of -use / functionality). Finally, there wasn't a means to setup dependencies -between components, such that if a component required libltp.a in order to -compile, it would go off and compile libltp.a first (ease of use). - -These items needed to be fixed to reduce maintenance nightmares for the -development community contributing to LTP, and the project maintainers. - -Design ------- - -The system was designed such that including a single GNU Makefile compatible -set in each new directory component is all that's essentially required to -build the system. - -Say you had a directory like the following (with .c files in them which -directly tie into applications, e.g. baz.c -> baz): - -------------------------------------------------------------------------------- -.../foo/ - |--> Makefile - | - --> bar/ - | - --> Makefile - | - --> baz.c -------------------------------------------------------------------------------- - -Here's an example of how one would accomplish that: - -------------------------------------------------------------------------------- -.../foo/Makefile: -# -# Copyright disclaimer goes here -- please use GPLv2. -# - -top_srcdir ?= .. - -include $(top_srcdir)/include/mk/env_pre.mk -include $(top_srcdir)/include/mk/generic_trunk_target.mk - -.../foo/bar/Makefile: -# -# Copyright disclaimer goes here -- please use GPLv2. -# - -top_srcdir ?= .. - -include $(top_srcdir)/include/mk/env_pre.mk -include $(top_srcdir)/include/mk/generic_leaf_target.mk -------------------------------------------------------------------------------- - -Kernel Modules --------------- - -Some of the tests need to build kernel modules, happily LTP has -infrastructure for this. - -------------------------------------------------------------------------------- -ifneq ($(KERNELRELEASE),) - -obj-m := module01.o - -else - -top_srcdir ?= ../../../.. -include $(top_srcdir)/include/mk/testcases.mk - -REQ_VERSION_MAJOR := 2 -REQ_VERSION_PATCH := 6 -MAKE_TARGETS := test01 test02 module01.ko - -include $(top_srcdir)/include/mk/module.mk -include $(top_srcdir)/include/mk/generic_leaf_target.mk - -endif -------------------------------------------------------------------------------- - -This is example Makefile that allows you build kernel modules inside of LTP. -The prerequisites for the build are detected by the 'configure' script. - -The 'REQ_VERSION_MAJOR' and 'REQ_VERSION_PATCH' describe minimal kernel -version for which the build system tries to build the module. - -The buildsystem is also forward compatible with changes in Linux kernel -internal API so that if modul fails to build the failure is ignored both on -build and installation. If the userspace counterpart of the test fails to load -the module because the file does not exists, the test is skipped. - -Note the 'ifneq($(KERNELRELEASE),)', the reason it's there is that the -Makefile is executed twice, once by LTP build system and once by kernel -kbuild, see 'Documentation/kbuild/modules.txt' in the Linux kernel tree for -details on external module build. - -Make Rules and Make Variables ------------------------------ - -When using make rules, avoid writing ad hoc rules like: - -------------------------------------------------------------------------------- -[prog]: [dependencies] - cc -I../../include $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDLIBS) \ - -o [prog] [dependencies] -------------------------------------------------------------------------------- - -etc. This makes cross-compilation and determinism difficult, if not impossible. -Besides, implicit rules are your friends and as long as you use `MAKEOPTS=;' in -the top-level caller (or do $(subst r,$(MAKEOPTS)) to remove -r), the compile -will complete successfully, assuming all other prerequisites have been -fulfilled (libraries, headers, etc). - -------------------------------------------------------------------------------- -$(AR) : The library archiver. - -$(CC) : The system C compiler. - -$(CPP) : The system C preprocessor. - -$(CFLAGS) : C compiler flags. - -$(CPPFLAGS) : Preprocessor flags, e.g. -I arguments. - -$(DEBUG_CFLAGS) : Debug flags to pass to $(CC), -g, etc. - -$(LD) : The system linker (typically $(CC), but not - necessarily). - -$(LDFLAGS) : What to pass in to the linker, including -L arguments - and other ld arguments, apart from -l library - includes (see $(LDLIBS)). - - This should be done in the $(CC) args passing style - when LD := $(CC), e.g. `-Wl,-foo', as opposed to - `-foo'. - -$(LDLIBS) : Libraries to pass to the linker (e.g. -lltp, etc). - -$(LTPLDLIBS) : LTP internal libraries i.e. these in libs/ directory. - -$(OPT_CFLAGS) : Optimization flags to pass into the C compiler, -O2, - etc. If you specify -O2 or higher, you should also - specify -fno-strict-aliasing, because of gcc - fstrict-aliasing optimization bugs in the tree - optimizer. Search for `fstrict-aliasing optimization - bug' with your favorite search engine. - - Examples of more recent bugs: - 1. tree-optimization/17510 - 2. tree-optimization/39100 - - Various bugs have occurred in the past due to buggy - logic in the tree-optimization portion of the gcc - compiler, from 3.3.x to 4.4. - -$(RANLIB) : What to run after archiving a library. - -$(WCFLAGS) : Warning flags to pass to $(CC), e.g. -Werror, - -Wall, etc. -------------------------------------------------------------------------------- - -Make System Variables ---------------------- - -A series of variables are used within the make system that direct what actions -need to be taken. Rather than me listing the variables here, please with their -intended uses, please refer to the comments contained in -+.../include/mk/env_pre.mk+. - -Guidelines and Recommendations ------------------------------- - -Of course, the GNU Make manual is key to understanding the Make system, but -here are the following sections and chapters I suggest reviewing: - -link:http://www.gnu.org/software/make/manual/make.html#Implicit-Rules[Implicit Rules] -link:http://www.gnu.org/software/make/manual/make.html#Using-Variables[Variables and Expansion] -link:http://www.gnu.org/software/make/manual/make.html#Origin-Function[Origin Use] -link:http://www.gnu.org/software/make/manual/make.html#Directory-Search[VPath Use] - -Before Committing ------------------ - -One should rebuild from scratch before committing. Please see INSTALL for more -details. - -Other Errata ------------- - -Please see TODO for any issues related to the Makefile infrastructure, and -build structure / source tree in general. diff --git a/doc/c-test-api.txt b/doc/c-test-api.txt deleted file mode 100755 index fa1f0fdc..00000000 --- a/doc/c-test-api.txt +++ /dev/null @@ -1,2371 +0,0 @@ -LTP C Test API -============== - -NOTE: See also - https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines[Test Writing Guidelines], - https://github.com/linux-test-project/ltp/wiki/C-Test-Case-Tutorial[C Test Case Tutorial], - https://github.com/linux-test-project/ltp/wiki/Shell-Test-API[Shell Test API]. - -1 Writing a test in C ---------------------- - -1.1 Basic test structure -~~~~~~~~~~~~~~~~~~~~~~~~ - -Let's start with an example, following code is a simple test for a 'getenv()'. - -[source,c] -------------------------------------------------------------------------------- -/* - * This is test for basic functionality of getenv(). - * - * - create an env variable and verify that getenv() can get get it - * - call getenv() with nonexisting variable name, check that it returns NULL - */ - -#include "tst_test.h" - -#define ENV1 "LTP_TEST_ENV" -#define ENV2 "LTP_TEST_THIS_DOES_NOT_EXIST" -#define ENV_VAL "val" - -static void setup(void) -{ - if (setenv(ENV1, ENV_VAL, 1)) - tst_brk(TBROK | TERRNO, "setenv() failed"); -} - -static void test(void) -{ - char *ret; - - ret = getenv(ENV1); - - if (!ret) { - tst_res(TFAIL, "getenv(" ENV1 ") = NULL"); - goto next; - } - - if (!strcmp(ret, ENV_VAL)) { - tst_res(TPASS, "getenv(" ENV1 ") = '"ENV_VAL "'"); - } else { - tst_res(TFAIL, "getenv(" ENV1 ") = '%s', expected '" - ENV_VAL "'", ret); - } - -next: - ret = getenv(ENV2); - - if (ret) - tst_res(TFAIL, "getenv(" ENV2 ") = '%s'", ret); - else - tst_res(TPASS, "getenv(" ENV2 ") = NULL"); -} - -static struct tst_test test = { - .test_all = test, - .setup = setup, -}; -------------------------------------------------------------------------------- - -Each test includes the 'tst_test.h' header and must define the 'struct -tst_test test' structure. - -The overall test initialization is done in the 'setup()' function. - -The overall cleanup is done in a 'cleanup()' function. Here 'cleanup()' is -omitted as the test does not have anything to clean up. If cleanup is set in -the test structure it's called on test exit just before the test library -cleanup. That especially means that cleanup can be called at any point in a -test execution. For example even when a test setup step has failed, therefore -the 'cleanup()' function must be able to cope with unfinished initialization, -and so on. - -The test itself is done in the 'test()' function. The test function must work -fine if called in a loop. - -There are two types of a test function pointers in the test structure. The -first one is a '.test_all' pointer that is used when test is implemented as a -single function. Then there is a '.test' function along with the number of -tests '.tcnt' that allows for more detailed result reporting. If the '.test' -pointer is set the function is called '.tcnt' times with an integer parameter -in range of [0, '.tcnt' - 1]. - -IMPORTANT: Only one of '.test' and '.test_all' can be set at a time. - -Each test has a default timeout set to 300s. The default timeout can be -overridden by setting '.timeout' in the test structure or by calling -'tst_set_timeout()' in the test 'setup()'. There are a few testcases whose run -time may vary arbitrarily, for these timeout can be disabled by setting it to --1. - -Test can find out how much time (in seconds) is remaining to timeout, -by calling 'tst_timeout_remaining()'. - -LAPI headers -++++++++++++ - -Use our LAPI headers ('include "lapi/foo.h"') to keep compatibility with old -distributions. LAPI header should always include original header. Older linux -headers were problematic, therefore we preferred to use libc headers. There are -still some bugs when combining certain glibc headers with linux headers, see -https://sourceware.org/glibc/wiki/Synchronizing_Headers. - -A word about the cleanup() callback -+++++++++++++++++++++++++++++++++++ - -There are a few rules that needs to be followed in order to write correct -cleanup() callback. - -1. Free only resources that were initialized. Keep in mind that callback can - be executed at any point in the test run. - -2. Make sure to free resources in the reverse order they were - initialized. (Some of the steps may not depend on others and everything - will work if there were swapped but let's keep it in order.) - -The first rule may seem complicated at first however, on the contrary, it's -quite easy. All you have to do is to keep track of what was already -initialized. For example file descriptors needs to be closed only if they were -assigned a valid file descriptor. For most of the things you need to create -extra flag that is set right after successful initialization though. Consider, -for example, test setup below. - -We also prefer cleaning up resources that would otherwise be released on the -program exit. There are two main reasons for this decision. Resources such as -file descriptors and mmaped memory could block umounting a block device in -cases where the test library has mounted a filesystem for the test temporary -directory. Not freeing allocated memory would upset static analysis and tools -such as valgrind and produce false-positives when checking for leaks in the -libc and other low level libraries. - -[source,c] -------------------------------------------------------------------------------- -static int fd0, fd1, mount_flag; - -#define MNTPOINT "mntpoint" -#define FILE1 "mntpoint/file1" -#define FILE2 "mntpoint/file2" - -static void setup(void) -{ - SAFE_MKDIR(MNTPOINT, 0777); - SAFE_MKFS(tst_device->dev, tst_device->fs_type, NULL, NULL); - SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, 0); - mount_flag = 1; - - fd0 = SAFE_OPEN(cleanup, FILE1, O_CREAT | O_RDWR, 0666); - fd1 = SAFE_OPEN(cleanup, FILE2, O_CREAT | O_RDWR, 0666); -} -------------------------------------------------------------------------------- - -In this case the 'cleanup()' function may be invoked when any of the 'SAFE_*' -macros has failed and therefore must be able to work with unfinished -initialization as well. Since global variables are initialized to zero we can -just check that fd > 0 before we attempt to close it. The mount function -requires extra flag to be set after device was successfully mounted. - -[source,c] -------------------------------------------------------------------------------- -static void cleanup(void) -{ - if (fd1 > 0) - SAFE_CLOSE(fd1); - - if (fd0 > 0) - SAFE_CLOSE(fd0); - - if (mount_flag && tst_umouont(MNTPOINT)) - tst_res(TWARN | TERRNO, "umount(%s)", MNTPOINT); -} -------------------------------------------------------------------------------- - -IMPORTANT: 'SAFE_MACROS()' used in cleanup *do not* exit the test. Failure - only produces a warning and the 'cleanup()' carries on. This is - intentional as we want to execute as much 'cleanup()' as possible. - -WARNING: Calling tst_brk() in test 'cleanup()' does not exit the test as well - and 'TBROK' is converted to 'TWARN'. - -NOTE: Creation and removal of the test temporary directory is handled in - the test library and the directory is removed recursively. Therefore - we do not have to remove files and directories in the test cleanup. - -1.2 Basic test interface -~~~~~~~~~~~~~~~~~~~~~~~~ - -[source,c] -------------------------------------------------------------------------------- -void tst_res(int ttype, char *arg_fmt, ...); -------------------------------------------------------------------------------- - -Printf-like function to report test result, it's mostly used with ttype: - -|============================== -| 'TPASS' | Test has passed. -| 'TFAIL' | Test has failed. -| 'TINFO' | General message. -| 'TWARN' | Something went wrong but we decided to continue. Mostly used in cleanup functions. -|============================== - -The 'ttype' can be combined bitwise with 'TERRNO' or 'TTERRNO' to print -'errno', 'TST_ERR' respectively. - -[source,c] -------------------------------------------------------------------------------- -void tst_brk(int ttype, char *arg_fmt, ...); -------------------------------------------------------------------------------- - -Printf-like function to report error and exit the test, it can be used with ttype: - -|============================================================ -| 'TBROK' | Something has failed in test preparation phase. -| 'TCONF' | Test is not appropriate for current configuration - (syscall not implemented, unsupported arch, ...) -|============================================================ - -The 'ttype' can be combined bitwise with 'TERRNO' or 'TTERRNO' to print -'errno', 'TST_ERR' respectively. - -There are also 'TST_EXP_*()' macros that can simplify syscall unit tests to a -single line, use them whenever possible. These macros take a function call as -the first parameter and a printf-like format string and parameters as well. -These test macros then expand to a code that runs the call, checks the return -value and errno and reports the test result. - -[source,c] -------------------------------------------------------------------------------- -static void test(void) -{ - ... - TST_EXP_PASS(stat(fname, &statbuf), "stat(%s, ...)", fname); - - if (!TST_PASS) - return; - ... -} -------------------------------------------------------------------------------- - -The 'TST_EXP_PASS()' can be used for calls that return -1 on failure and 0 on -success. It will check for the return value and reports failure if the return -value is not equal to 0. The call also sets the 'TST_PASS' variable to 1 if -the call succeeeded. - -As seen above, this and similar macros take optional variadic arguments. These -begin with a format string and then appropriate values to be formatted. - -[source,c] -------------------------------------------------------------------------------- -static void test(void) -{ - ... - TST_EXP_FD(open(fname, O_RDONLY), "open(%s, O_RDONLY)", fname); - - SAFE_CLOSE(TST_RET); - ... -} -------------------------------------------------------------------------------- - -The 'TST_EXP_FD()' is the same as 'TST_EXP_PASS()' the only difference is that -the return value is expected to be a file descriptor so the call passes if -positive integer is returned. - -[source,c] -------------------------------------------------------------------------------- -static void test(void) -{ - ... - TST_EXP_FAIL(stat(fname, &statbuf), ENOENT, "stat(%s, ...)", fname); - ... -} -------------------------------------------------------------------------------- - -The 'TST_EXP_FAIL()' is similar to 'TST_EXP_PASS()' but it fails the test if -the call haven't failed with -1 and 'errno' wasn't set to the expected one -passed as the second argument. - -[source,c] -------------------------------------------------------------------------------- -static void test(void) -{ - ... - TST_EXP_FAIL2(msgget(key, flags), EINVAL, "msgget(%i, %i)", key, flags); - ... -} -------------------------------------------------------------------------------- - -The 'TST_EXP_FAIL2()' is the same as 'TST_EXP_FAIL()' except the return value is -expected to be non-negative integer if call passes. These macros build upon the -+TEST()+ macro and associated variables. - -[source,c] -------------------------------------------------------------------------------- -TEST(socket(AF_INET, SOCK_RAW, 1)); -if (TST_RET > -1) { - tst_res(TFAIL, "Created raw socket"); - SAFE_CLOSE(TST_RET); -} else if (TST_ERR != EPERM) { - tst_res(TFAIL | TTERRNO, - "Failed to create socket for wrong reason"); -} else { - tst_res(TPASS | TTERRNO, "Didn't create raw socket"); -} -------------------------------------------------------------------------------- - -The +TEST+ macro sets +TST_RET+ to its argument's return value and +TST_ERR+ to -+errno+. The +TTERNO+ flag can be used to print the error number's symbolic -value. - -No LTP library function or macro, except those in 'tst_test_macros.h', will -write to these variables (rule 'LTP-002'). So their values will not be changed -unexpectedly. - -[source,c] -------------------------------------------------------------------------------- -TST_EXP_POSITIVE(wait(&status)); - -if (!TST_PASS) - return; -------------------------------------------------------------------------------- - -If the return value of 'wait' is positive. This macro will print a pass result -and set +TST_PASS+ appropriately. If the return value is zero or negative, then -it will print fail. There are many similar macros to those shown here, please -see 'tst_test_macros.h'. - -[source,c] -------------------------------------------------------------------------------- -const char *tst_strsig(int sig); -------------------------------------------------------------------------------- - -Return the given signal number's corresponding string. - -[source,c] -------------------------------------------------------------------------------- -const char *tst_strerrno(int err); -------------------------------------------------------------------------------- - -Return the given errno number's corresponding string. Using this function to -translate 'errno' values to strings is preferred. You should not use the -'strerror()' function in the testcases. - -[source,c] -------------------------------------------------------------------------------- -const char *tst_strstatus(int status); -------------------------------------------------------------------------------- - -Returns string describing the status as returned by 'wait()'. - -WARNING: This function is not thread safe. - -[source,c] -------------------------------------------------------------------------------- -void tst_set_timeout(unsigned int timeout); -------------------------------------------------------------------------------- - -Allows for setting timeout per test iteration dynamically in the test setup(), -the timeout is specified in seconds. There are a few testcases whose runtime -can vary arbitrarily, these can disable timeouts by setting it to -1. - -[source,c] -------------------------------------------------------------------------------- -void tst_flush(void); -------------------------------------------------------------------------------- - -Flush output streams, handling errors appropriately. - -This function is rarely needed when you have to flush the output streams -before calling 'fork()' or 'clone()'. Note that the 'SAFE_FORK()' and 'SAFE_CLONE()' -calls this function automatically. See 2.4 FILE buffers and fork() for explanation -why is this needed. - -1.3 Test temporary directory -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If '.needs_tmpdir' is set to '1' in the 'struct tst_test' unique test -temporary is created and it's set as the test working directory. Tests *MUST -NOT* create temporary files outside that directory. The flag is not needed to -be set when use these flags: '.all_filesystems', '.format_device', '.mntpoint', -'.mount_device' '.needs_checkpoints', '.needs_device', '.resource_file' -(these flags imply creating temporary directory). - -IMPORTANT: Close all file descriptors (that point to files in test temporary - directory, even the unlinked ones) either in the 'test()' function - or in the test 'cleanup()' otherwise the test may break temporary - directory removal on NFS (look for "NFS silly rename"). - -1.4 Safe macros -~~~~~~~~~~~~~~~ - -Safe macros aim to simplify error checking in test preparation. Instead of -calling system API functions, checking for their return value and aborting the -test if the operation has failed, you just use corresponding safe macro. - -Use them whenever it's possible. - -Instead of writing: - -[source,c] -------------------------------------------------------------------------------- - fd = open("/dev/null", O_RDONLY); - if (fd < 0) - tst_brk(TBROK | TERRNO, "opening /dev/null failed"); -------------------------------------------------------------------------------- - -You write just: - -[source,c] -------------------------------------------------------------------------------- - fd = SAFE_OPEN("/dev/null", O_RDONLY); -------------------------------------------------------------------------------- - -IMPORTANT: The SAFE_CLOSE() function also sets the passed file descriptor to -1 - after it's successfully closed. - -They can also simplify reading and writing of sysfs files, you can, for -example, do: - -[source,c] -------------------------------------------------------------------------------- - SAFE_FILE_SCANF("/proc/sys/kernel/pid_max", "%lu", &pid_max); -------------------------------------------------------------------------------- - -See 'include/tst_safe_macros.h', 'include/tst_safe_stdio.h' and -'include/tst_safe_file_ops.h' and 'include/tst_safe_net.h' for a complete list. - -1.5 Test specific command line options -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -[source,c] -------------------------------------------------------------------------------- -struct tst_option { - char *optstr; - char **arg; - char *help; -}; -------------------------------------------------------------------------------- - -Test specific command line parameters can be passed with the 'NULL' terminated -array of 'struct tst_option'. The 'optstr' is the command line option i.e. "o" -or "o:" if option has a parameter. Only short options are supported. The 'arg' -is where 'optarg' is stored upon match. If option has no parameter it's set to -non-'NULL' value if option was present. The 'help' is a short help string. - -NOTE: The test parameters must not collide with common test parameters defined - in the library the currently used ones are +-i+, +-I+, +-C+, and +-h+. - -[source,c] -------------------------------------------------------------------------------- -int tst_parse_int(const char *str, int *val, int min, int max); -int tst_parse_long(const char *str, long *val, long min, long max); -int tst_parse_float(const char *str, float *val, float min, float max); -int tst_parse_filesize(const char *str, long long *val, long long min, long long max); -------------------------------------------------------------------------------- - -Helpers for parsing the strings returned in the 'struct tst_option'. - -Helpers return zero on success and 'errno', mostly 'EINVAL' or 'ERANGE', on -failure. - -Helpers functions are no-op if 'str' is 'NULL'. - -The valid range for result includes both 'min' and 'max'. - -In particular, 'tst_parse_filesize' function accepts prefix multiplies such as -"k/K for kilobytes, "m/M" for megabytes and "g/G" for gigabytes. For example, -10K are converted into 10240 bytes. - -.Example Usage -[source,c] -------------------------------------------------------------------------------- -#include -#include "tst_test.h" - -static char *str_threads; -static int threads = 10; - -static struct tst_option options[] = { - {"t:", &str_threads, "Number of threads (default 10)"}, - ... - {} -}; - -static void setup(void) -{ - if (tst_parse_int(str_threads, &threads, 1, INT_MAX)) - tst_brk(TBROK, "Invalid number of threads '%s'", str_threads); - - ... -} - -static void test_threads(void) -{ - ... - - for (i = 0; i < threads; i++) { - ... - } - - ... -} - -static struct tst_test test = { - ... - .options = options, - ... -}; -------------------------------------------------------------------------------- - - -1.6 Runtime kernel version detection -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Testcases for newly added kernel functionality require kernel newer than a -certain version to run. All you need to skip a test on older kernels is to -set the '.min_kver' string in the 'struct tst_test' to a minimal required -kernel version, e.g. '.min_kver = "2.6.30"'. - -For more complicated operations such as skipping a test for a certain range -of kernel versions, following functions could be used: - -[source,c] -------------------------------------------------------------------------------- -int tst_kvercmp(int r1, int r2, int r3); - -struct tst_kern_exv { - char *dist_name; - char *extra_ver; -}; - -int tst_kvercmp2(int r1, int r2, int r3, struct tst_kern_exv *vers); -------------------------------------------------------------------------------- - -These two functions are intended for runtime kernel version detection. They -parse the output from 'uname()' and compare it to the passed values. - -The return value is similar to the 'strcmp()' function, i.e. zero means equal, -negative value means that the kernel is older than than the expected value and -positive means that it's newer. - -The second function 'tst_kvercmp2()' allows for specifying per-vendor table of -kernel versions as vendors typically backport fixes to their kernels and the -test may be relevant even if the kernel version does not suggests so. See -'testcases/kernel/syscalls/inotify/inotify04.c' for example usage. - -WARNING: The shell 'tst_kvercmp' maps the result into unsigned integer - the - process exit value. - -1.7 Fork()-ing -~~~~~~~~~~~~~~ - -Be wary that if the test forks and there were messages printed by the -'tst_*()' interfaces, the data may still be in libc/kernel buffers and these -*ARE NOT* flushed automatically. - -This happens when 'stdout' gets redirected to a file. In this case, the -'stdout' is not line buffered, but block buffered. Hence after a fork content -of the buffers will be printed by the parent and each of the children. - -To avoid that you should use 'SAFE_FORK()', 'SAFE_CLONE()' or 'tst_clone()'. - -IMPORTANT: You have to set the '.forks_child' flag in the test structure - if your testcase forks or calls 'SAFE_CLONE()'. - -1.8 Doing the test in the child process -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Results reported by 'tst_res()' are propagated to the parent test process via -block of shared memory. - -Calling 'tst_brk()' causes child process to exit with non-zero exit value. -Which means that it's safe to use 'SAFE_*()' macros in the child processes as -well. - -Children that outlive the 'test()' function execution are waited for in the -test library. Unclean child exit (killed by signal, non-zero exit value, etc.) -will cause the main test process to exit with 'tst_brk()', which especially -means that 'TBROK' propagated from a child process will cause the whole test -to exit with 'TBROK'. - -If a test needs a child that segfaults or does anything else that cause it to -exit uncleanly all you need to do is to wait for such children from the -'test()' function so that it's reaped before the main test exits the 'test()' -function. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -void tst_reap_children(void); -------------------------------------------------------------------------------- - -The 'tst_reap_children()' function makes the process wait for all of its -children and exits with 'tst_brk(TBROK, ...)' if any of them returned -a non zero exit code. - -When using 'SAFE_CLONE' or 'tst_clone', this may not work depending on -the parameters passed to clone. The following call to 'SAFE_CLONE' is -identical to 'fork()', so will work as expected. - -[source,c] --------------------------------------------------------------------------------- -const struct tst_clone_args args = { - .exit_signal = SIGCHLD, -}; - -SAFE_CLONE(&args); --------------------------------------------------------------------------------- - -If 'exit_signal' is set to something else, then this will break -'tst_reap_children'. It's not expected that all parameters to clone will -work with the LTP library unless specific action is taken by the test code. - -.Using 'tst_res()' from binaries started by 'exec()' -[source,c] -------------------------------------------------------------------------------- -/* test.c */ -#define _GNU_SOURCE -#include -#include "tst_test.h" - -static void do_test(void) -{ - char *const argv[] = {"test_exec_child", NULL}; - char path[4096]; - - if (tst_get_path("test_exec_child", path, sizeof(path))) - tst_brk(TCONF, "Couldn't find test_exec_child in $PATH"); - - execve(path, argv, environ); - - tst_res(TFAIL | TERRNO, "EXEC!"); -} - -static struct tst_test test = { - .test_all = do_test, - .child_needs_reinit = 1, -}; - -/* test_exec_child.c */ -#define TST_NO_DEFAULT_MAIN -#include "tst_test.h" - -int main(void) -{ - tst_reinit(); - tst_res(TPASS, "Child passed!"); - return 0; -} -------------------------------------------------------------------------------- - -The 'tst_res()' function can be also used from binaries started by 'exec()', -the parent test process has to set the '.child_needs_reinit' flag so that the -library prepares for it and has to make sure the 'LTP_IPC_PATH' environment -variable is passed down, then the very fist thing the program has to call in -'main()' is 'tst_reinit()' that sets up the IPC. - -1.9 Fork() and Parent-child synchronization -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -As LTP tests are written for Linux, most of the tests involve fork()-ing and -parent-child process synchronization. LTP includes a checkpoint library that -provides wait/wake futex based functions. - -In order to use checkpoints the '.needs_checkpoints' flag in the 'struct -tst_test' must be set to '1', this causes the test library to initialize -checkpoints before the 'test()' function is called. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -TST_CHECKPOINT_WAIT(id) - -TST_CHECKPOINT_WAIT2(id, msec_timeout) - -TST_CHECKPOINT_WAKE(id) - -TST_CHECKPOINT_WAKE2(id, nr_wake) - -TST_CHECKPOINT_WAKE_AND_WAIT(id) -------------------------------------------------------------------------------- - -The checkpoint interface provides pair of wake and wait functions. The 'id' is -unsigned integer which specifies checkpoint to wake/wait for. As a matter of -fact it's an index to an array stored in a shared memory, so it starts on -'0' and there should be enough room for at least of hundred of them. - -The 'TST_CHECKPOINT_WAIT()' and 'TST_CHECKPOINT_WAIT2()' suspends process -execution until it's woken up or until timeout is reached. - -The 'TST_CHECKPOINT_WAKE()' wakes one process waiting on the checkpoint. -If no process is waiting the function retries until it success or until -timeout is reached. - -If timeout has been reached process exits with appropriate error message (uses -'tst_brk()'). - -The 'TST_CHECKPOINT_WAKE2()' does the same as 'TST_CHECKPOINT_WAKE()' but can -be used to wake precisely 'nr_wake' processes. - -The 'TST_CHECKPOINT_WAKE_AND_WAIT()' is a shorthand for doing wake and then -immediately waiting on the same checkpoint. - -Child processes created via 'SAFE_FORK()' are ready to use the checkpoint -synchronization functions, as they inherited the mapped page automatically. - -Child processes started via 'exec()', or any other processes not forked from -the test process must initialize the checkpoint by calling 'tst_reinit()'. - -For the details of the interface, look into the 'include/tst_checkpoint.h'. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -/* - * Waits for process state change. - * - * The state is one of the following: - * - * R - process is running - * S - process is sleeping - * D - process sleeping uninterruptibly - * Z - zombie process - * T - process is traced - */ -TST_PROCESS_STATE_WAIT(pid, state, msec_timeout) -------------------------------------------------------------------------------- - -The 'TST_PROCESS_STATE_WAIT()' waits until process 'pid' is in requested -'state' or timeout is reached. The call polls +/proc/pid/stat+ to get this -information. A timeout of 0 will wait infinitely. - -On timeout -1 is returned and errno set to ETIMEDOUT. - -It's mostly used with state 'S' which means that process is sleeping in kernel -for example in 'pause()' or any other blocking syscall. - -1.10 Signals and signal handlers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you need to use signal handlers, keep the code short and simple. Don't -forget that the signal handler is called asynchronously and can interrupt the -code execution at any place. - -This means that problems arise when global state is changed both from the test -code and signal handler, which will occasionally lead to: - -* Data corruption (data gets into inconsistent state), this may happen, for - example, for any operations on 'FILE' objects. - -* Deadlock, this happens, for example, if you call 'malloc(2)', 'free(2)', - etc. from both the test code and the signal handler at the same time since - 'malloc' has global lock for it's internal data structures. (Be wary that - 'malloc(2)' is used by the libc functions internally too.) - -* Any other unreproducible and unexpected behavior. - -Quite common mistake is to call 'exit(3)' from a signal handler. Note that this -function is not signal-async-safe as it flushes buffers, etc. If you need to -exit a test immediately from a signal handler use '_exit(2)' instead. - -TIP: See 'man 7 signal' for the list of signal-async-safe functions. - -If a signal handler sets a variable, its declaration must be 'volatile', -otherwise compiler may misoptimize the code. This is because the variable may -not be changed in the compiler code flow analysis. There is 'sig_atomic_t' -type defined in C99 but this one *DOES NOT* imply 'volatile' (it's just a -'typedef' to 'int'). So the correct type for a flag that is changed from a -signal handler is either 'volatile int' or 'volatile sig_atomic_t'. - -If a crash (e.g. triggered by signal SIGSEGV) is expected in testing, you -can avoid creation of core files by calling tst_no_corefile() function. -This takes effect for process (and its children) which invoked it, unless -they subsequently modify RLIMIT_CORE. - -Note that LTP library will reap any processes that test didn't reap itself, -and report any non-zero exit code as failure. - -1.11 Kernel Modules -~~~~~~~~~~~~~~~~~~~ - -There are certain cases where the test needs a kernel part and userspace part, -happily, LTP can build a kernel module and then insert it to the kernel on test -start for you. See 'testcases/kernel/device-drivers/block' for details. - -1.12 Useful macros -~~~~~~~~~~~~~~~~~~ - -[source,c] -------------------------------------------------------------------------------- -ARRAY_SIZE(arr) -------------------------------------------------------------------------------- - -Returns the size of statically defined array, i.e. -'(sizeof(arr) / sizeof(*arr))' - -[source,c] -------------------------------------------------------------------------------- -LTP_ALIGN(x, a) -------------------------------------------------------------------------------- - -Aligns the x to be next multiple of a. The a must be power of 2. - -1.13 Filesystem type detection and skiplist -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some tests are known to fail on certain filesystems (you cannot swap on TMPFS, -there are unimplemented 'fcntl()' etc.). - -If your test needs to be skipped on certain filesystems use the -'.skip_filesystems' field in the tst_test structure as follows: - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static struct tst_test test = { - ... - .skip_filesystems = (const char *const []) { - "tmpfs", - "ramfs", - "nfs", - NULL - }, -}; -------------------------------------------------------------------------------- - -When the '.all_filesystems' flag is set the '.skip_filesystems' list is passed -to the function that detects supported filesystems any listed filesystem is -not included in the resulting list of supported filesystems. - -If test needs to adjust expectations based on filesystem type it's also -possible to detect filesystem type at the runtime. This is preferably used -when only subset of the test is not applicable for a given filesystem. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static void run(void) -{ - ... - - switch ((type = tst_fs_type("."))) { - case TST_NFS_MAGIC: - case TST_TMPFS_MAGIC: - case TST_RAMFS_MAGIC: - tst_brk(TCONF, "Subtest not supported on %s", - tst_fs_type_name(type)); - return; - break; - } - - ... -} -------------------------------------------------------------------------------- - -1.14 Thread-safety in the LTP library -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -It is safe to use library 'tst_res()' function in multi-threaded tests. - -Only the main thread must return from the 'test()' function to the test -library and that must be done only after all threads that may call any library -function has been terminated. That especially means that threads that may call -'tst_brk()' must terminate before the execution of the 'test()' function -returns to the library. This is usually done by the main thread joining all -worker threads at the end of the 'test()' function. Note that the main thread -will never get to the library code in a case that 'tst_brk()' was called from -one of the threads since it will sleep at least in 'pthread_join()' on the -thread that called the 'tst_brk()' till 'exit()' is called by 'tst_brk()'. - -The test-supplied cleanup function runs *concurrently* to the rest of the -threads in a case that cleanup was entered from 'tst_brk()'. Subsequent -threads entering 'tst_brk()' must be suspended or terminated at the start of -the user supplied cleanup function. It may be necessary to stop or exit -the rest of the threads before the test cleans up as well. For example threads -that create new files should be stopped before temporary directory is be -removed. - -Following code example shows thread safe cleanup function example using atomic -increment as a guard. The library calls its cleanup after the execution returns -from the user supplied cleanup and expects that only one thread returns from -the user supplied cleanup to the test library. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static void cleanup(void) -{ - static int flag; - - if (tst_atomic_inc(&flag) != 1) - pthread_exit(NULL); - - /* if needed stop the rest of the threads here */ - - ... - - /* then do cleanup work */ - - ... - - /* only one thread returns to the library */ -} -------------------------------------------------------------------------------- - - -1.15 Testing with a block device -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some tests needs a block device (inotify tests, syscall 'EROFS' failures, -etc.). LTP library contains a code to prepare a testing device. - -If '.needs_device' flag in the 'struct tst_test' is set the 'tst_device' -structure is initialized with a path to a test device and default filesystem -to be used. - -You can also request minimal device size in megabytes by setting -'.dev_min_size' the device is guaranteed to have at least the requested size -then. - -If '.format_device' flag is set the device is formatted with a filesystem as -well. You can use '.dev_fs_type' to override the default filesystem type if -needed and pass additional options to mkfs via '.dev_fs_opts' and -'.dev_extra_opts' pointers. Note that '.format_device' implies '.needs_device' -there is no need to set both. - -If '.mount_device' is set, the device is mounted at '.mntpoint' which is used -to pass a directory name that will be created and used as mount destination. -You can pass additional flags and data to the mount command via '.mnt_flags' -and '.mnt_data' pointers. Note that '.mount_device' implies '.needs_device' -and '.format_device' so there is no need to set the later two. - -If '.needs_rofs' is set, read-only filesystem is mounted at '.mntpoint' this -one is supposed to be used for 'EROFS' tests. - -If '.all_filesystems' is set the test function is executed for all supported -filesystems. Supported filesystems are detected based on existence of the -'mkfs.$fs' helper and on kernel support to mount it. For each supported -filesystem the 'tst_device.fs_type' is set to the currently tested fs type, if -'.format_device' is set the device is formatted as well, if '.mount_device' is -set it's mounted at '.mntpoint'. Also the test timeout is reset for each -execution of the test function. This flag is expected to be used for filesystem -related syscalls that are at least partly implemented in the filesystem -specific code e.g. 'fallocate()'. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -struct tst_device { - const char *dev; - const char *fs_type; -}; - -extern struct tst_device *tst_device; - -int tst_umount(const char *path); -------------------------------------------------------------------------------- - -In case that 'LTP_DEV' is passed to the test in an environment, the library -checks that the file exists and that it's a block device, if -'.device_min_size' is set the device size is checked as well. If 'LTP_DEV' -wasn't set or if size requirements were not met a temporary file is created -and attached to a free loop device. - -If there is no usable device and loop device couldn't be initialized the test -exits with 'TCONF'. - -The 'tst_umount()' function works exactly as 'umount(2)' but retries several -times on 'EBUSY'. This is because various desktop daemons (gvfsd-trash is known -for that) may be stupid enough to probe all newly mounted filesystem which -results in 'umount(2)' failing with 'EBUSY'. - -IMPORTANT: All testcases should use 'tst_umount()' instead of 'umount(2)' to - umount filesystems. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_find_free_loopdev(const char *path, size_t path_len); -------------------------------------------------------------------------------- - -This function finds a free loopdev and returns the free loopdev minor (-1 for no -free loopdev). If path is non-NULL, it will be filled with free loopdev path. -If you want to use a customized loop device, we can call 'tst_find_free_loopdev(NULL, 0)' -in tests to get a free minor number and then mknod. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -unsigned long tst_dev_bytes_written(const char *dev); -------------------------------------------------------------------------------- - -This function reads test block device stat file ('/sys/block//stat') and -returns the bytes written since the last invocation of this function. To avoid -FS deferred IO metadata/cache interference, we suggest doing "syncfs" before the -tst_dev_bytes_written first invocation. And an inline function named 'tst_dev_sync()' -is created for that intention. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -voud tst_find_backing_dev(const char *path, char *dev); -------------------------------------------------------------------------------- - -This function finds the block dev that this path belongs to, it uses stat function -to get the major/minor number of the path. Then scan them in '/proc/self/mountinfo' -and list 2th column value after ' - ' string as its block dev if match succeeds. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -uint64_t tst_get_device_size(const char *dev_path); -------------------------------------------------------------------------------- - -This function gets size of the given block device, it checks the 'dev_path' is -valid first, if yes, return the size in MB, otherwise return -1. - -1.16 Formatting a device with a filesystem -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static void setup(void) -{ - ... - SAFE_MKFS(tst_device->dev, tst_device->fs_type, NULL, NULL); - ... -} -------------------------------------------------------------------------------- - -This function takes a path to a device, filesystem type and an array of extra -options passed to mkfs. - -The fs options 'fs_opts' should either be 'NULL' if there are none, or a -'NULL' terminated array of strings such as: -+const char *const opts[] = {"-b", "1024", NULL}+. - -The extra options 'extra_opts' should either be 'NULL' if there are none, or a -'NULL' terminated array of strings such as +{"102400", NULL}+; 'extra_opts' -will be passed after device name. e.g: +mkfs -t ext4 -b 1024 /dev/sda1 102400+ -in this case. - -Note that perfer to store the options which can be passed before or after device -name by 'fs_opts' array. - -1.17 Verifying a filesystem's free space -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some tests have size requirements for the filesystem's free space. If these -requirements are not satisfied, the tests should be skipped. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_fs_has_free(const char *path, unsigned int size, unsigned int mult); -------------------------------------------------------------------------------- - -The 'tst_fs_has_free()' function returns 1 if there is enough space and 0 if -there is not. - -The 'path' is the pathname of any directory/file within a filesystem. - -The 'mult' is a multiplier, one of 'TST_BYTES', 'TST_KB', 'TST_MB' or 'TST_GB'. - -The required free space is calculated by 'size * mult', e.g. -'tst_fs_has_free("/tmp/testfile", 64, TST_MB)' will return 1 if the -filesystem, which '"/tmp/testfile"' is in, has 64MB free space at least, and 0 -if not. - -1.18 Files, directories and fs limits -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some tests need to know the maximum count of links to a regular file or -directory, such as 'rename(2)' or 'linkat(2)' to test 'EMLINK' error. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_fs_fill_hardlinks(const char *dir); -------------------------------------------------------------------------------- - -Try to get maximum count of hard links to a regular file inside the 'dir'. - -NOTE: This number depends on the filesystem 'dir' is on. - -This function uses 'link(2)' to create hard links to a single file until it -gets 'EMLINK' or creates 65535 links. If the limit is hit, the maximum number of -hardlinks is returned and the 'dir' is filled with hardlinks in format -"testfile%i", where i belongs to [0, limit) interval. If no limit is hit or if -'link(2)' failed with 'ENOSPC' or 'EDQUOT', zero is returned and previously -created files are removed. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_fs_fill_subdirs(const char *dir); -------------------------------------------------------------------------------- - -Try to get maximum number of subdirectories in directory. - -NOTE: This number depends on the filesystem 'dir' is on. For current kernel, -subdir limit is not available for all filesystems (available for ext2, ext3, -minix, sysv and more). If the test runs on some other filesystems, like ramfs, -tmpfs, it will not even try to reach the limit and return 0. - -This function uses 'mkdir(2)' to create directories in 'dir' until it gets -'EMLINK' or creates 65535 directories. If the limit is hit, the maximum number -of subdirectories is returned and the 'dir' is filled with subdirectories in -format "testdir%i", where i belongs to [0, limit - 2) interval (because each -newly created dir has two links already - the '.' and the link from parent -dir). If no limit is hit or if 'mkdir(2)' failed with 'ENOSPC' or 'EDQUOT', -zero is returned and previously created directories are removed. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_dir_is_empty(const char *dir, int verbose); -------------------------------------------------------------------------------- - -Returns non-zero if directory is empty and zero otherwise. - -Directory is considered empty if it contains only '.' and '..'. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -void tst_purge_dir(const char *path); -------------------------------------------------------------------------------- - -Deletes the contents of given directory but keeps the directory itself. Useful -for cleaning up the temporary directory and mount points between test cases or -test iterations. Terminates the program with 'TBROK' on error. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_fill_fd(int fd, char pattern, size_t bs, size_t bcount); -------------------------------------------------------------------------------- - -Fill a file with specified pattern using file descriptor. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_prealloc_size_fd(int fd, size_t bs, size_t bcount); -------------------------------------------------------------------------------- - -Preallocate the specified amount of space using 'fallocate()'. Falls back to -'tst_fill_fd()' if 'fallocate()' fails. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_fill_file(const char *path, char pattern, size_t bs, size_t bcount); -------------------------------------------------------------------------------- - -Creates/overwrites a file with specified pattern using file path. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_prealloc_file(const char *path, size_t bs, size_t bcount); -------------------------------------------------------------------------------- - -Create/overwrite a file and preallocate the specified amount of space for it. -The allocated space will not be initialized to any particular content. - -1.19 Getting an unused PID number -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some tests require a 'PID', which is not used by the OS (does not belong to -any process within it). For example, kill(2) should set errno to 'ESRCH' if -it's passed such 'PID'. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -pid_t tst_get_unused_pid(void); -------------------------------------------------------------------------------- - -Return a 'PID' value not used by the OS or any process within it. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_get_free_pids(void); -------------------------------------------------------------------------------- - -Returns number of unused pids in the system. Note that this number may be -different once the call returns and should be used only for rough estimates. - -1.20 Running executables -~~~~~~~~~~~~~~~~~~~~~~~~ - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -int tst_cmd(const char *const argv[], - const char *stdout_path, - const char *stderr_path, - enum tst_cmd_flags flags); -------------------------------------------------------------------------------- - -'tst_cmd()' is a wrapper for 'vfork() + execvp()' which provides a way -to execute an external program. - -'argv[]' is a 'NULL' terminated array of strings starting with the program name -which is followed by optional arguments. - -'TST_CMD_PASS_RETVAL' enum 'tst_cmd_flags' makes 'tst_cmd()' -return the program exit code to the caller, otherwise 'tst_cmd()' exit the -tests on failure. 'TST_CMD_TCONF_ON_MISSING' check for program in '$PATH' and exit -with 'TCONF' if not found. - -In case that 'execvp()' has failed and the enum 'TST_CMD_PASS_RETVAL' flag was set, the -return value is '255' if 'execvp()' failed with 'ENOENT' and '254' otherwise. - -'stdout_path' and 'stderr_path' determine where to redirect the program -stdout and stderr I/O streams. - -The 'SAFE_CMD()' macro can be used automatic handling non-zero exits (exits -with 'TBROK') and 'ENOENT' (exits with 'TCONF'). - -.Example -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -const char *const cmd[] = { "ls", "-l", NULL }; - -... - /* Store output of 'ls -l' into log.txt */ - tst_cmd(cmd, "log.txt", NULL, 0); -... -------------------------------------------------------------------------------- - -1.21 Measuring elapsed time and helper functions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -[source,c] -------------------------------------------------------------------------------- -#include "tst_timer.h" - -void tst_timer_check(clockid_t clk_id); - -void tst_timer_start(clockid_t clk_id); - -void tst_timer_stop(void); - -struct timespec tst_timer_elapsed(void); - -long long tst_timer_elapsed_ms(void); - -long long tst_timer_elapsed_us(void); - -int tst_timer_expired_ms(long long ms); -------------------------------------------------------------------------------- - -The 'tst_timer_check()' function checks if specified 'clk_id' is suppored and -exits the test with 'TCONF' otherwise. It's expected to be used in test -'setup()' before any resources that needs to be cleaned up are initialized, -hence it does not include a cleanup function parameter. - -The 'tst_timer_start()' marks start time and stores the 'clk_id' for further -use. - -The 'tst_timer_stop()' marks the stop time using the same 'clk_id' as last -call to 'tst_timer_start()'. - -The 'tst_timer_elapsed*()' returns time difference between the timer start and -last timer stop in several formats and units. - -The 'tst_timer_expired_ms()' function checks if the timer started by -'tst_timer_start()' has been running longer than ms milliseconds. The function -returns non-zero if timer has expired and zero otherwise. - -IMPORTANT: The timer functions use 'clock_gettime()' internally which needs to - be linked with '-lrt' on older glibc. Please do not forget to add - 'LDLIBS+=-lrt' in Makefile. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" -#include "tst_timer.h" - -static void setup(void) -{ - ... - tst_timer_check(CLOCK_MONOTONIC); - ... -} - -static void run(void) -{ - ... - tst_timer_start(CLOCK_MONOTONIC); - ... - while (!tst_timer_expired_ms(5000)) { - ... - } - ... -} - -struct tst_test test = { - ... - .setup = setup, - .test_all = run, - ... -}; -------------------------------------------------------------------------------- - -Expiration timer example usage. - -[source,c] -------------------------------------------------------------------------------- -long long tst_timespec_to_us(struct timespec t); -long long tst_timespec_to_ms(struct timespec t); - -struct timeval tst_us_to_timeval(long long us); -struct timeval tst_ms_to_timeval(long long ms); - -int tst_timespec_lt(struct timespec t1, struct timespec t2); - -struct timespec tst_timespec_add_us(struct timespec t, long long us); - -struct timespec tst_timespec_diff(struct timespec t1, struct timespec t2); -long long tst_timespec_diff_us(struct timespec t1, struct timespec t2); -long long tst_timespec_diff_ms(struct timespec t1, struct timespec t2); - -struct timespec tst_timespec_abs_diff(struct timespec t1, struct timespec t2); -long long tst_timespec_abs_diff_us(struct timespec t1, struct timespec t2); -long long tst_timespec_abs_diff_ms(struct timespec t1, struct timespec t2); -------------------------------------------------------------------------------- - -The first four functions are simple inline conversion functions. - -The 'tst_timespec_lt()' function returns non-zero if 't1' is earlier than -'t2'. - -The 'tst_timespec_add_us()' function adds 'us' microseconds to the timespec -'t'. The 'us' is expected to be positive. - -The 'tst_timespec_diff*()' functions returns difference between two times, the -'t1' is expected to be later than 't2'. - -The 'tst_timespec_abs_diff*()' functions returns absolute value of difference -between two times. - -NOTE: All conversions to ms and us rounds the value. - -1.22 Datafiles -~~~~~~~~~~~~~~ - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static const char *const res_files[] = { - "foo", - "bar", - NULL -}; - -static struct tst_test test = { - ... - .resource_files = res_files, - ... -} -------------------------------------------------------------------------------- - -If the test needs additional files to be copied to the test temporary -directory all you need to do is to list their filenames in the -'NULL' terminated array '.resource_files' in the tst_test structure. - -When resource files is set test temporary directory is created automatically, -there is need to set '.needs_tmpdir' as well. - -The test library looks for datafiles first, these are either stored in a -directory called +datafiles+ in the +$PWD+ at the start of the test or in -+$LTPROOT/testcases/data/${test_binary_name}+. If the file is not found the -library looks into +$LTPROOT/testcases/bin/+ and to +$PWD+ at the start of the -test. This ensures that the testcases can copy the file(s) effortlessly both -when test is started from the directory it was compiled in as well as when LTP -was installed. - -The file(s) are copied to the newly created test temporary directory which is -set as the test working directory when the 'test()' functions is executed. - -1.23 Code path tracing -~~~~~~~~~~~~~~~~~~~~~~ - -'tst_res' is a macro, so on when you define a function in one file: - -[source,c] -------------------------------------------------------------------------------- -int do_action(int arg) -{ - ... - - if (ok) { - tst_res(TPASS, "check passed"); - return 0; - } else { - tst_res(TFAIL, "check failed"); - return -1; - } -} -------------------------------------------------------------------------------- - -and call it from another file, the file and line reported by 'tst_res' in this -function will be from the former file. - -'TST_TRACE' can make the analysis of such situations easier. It's a macro which -inserts a call to 'tst_res(TINFO, ...)' in case its argument evaluates to -non-zero. In this call to 'tst_res(TINFO, ...)' the file and line will be -expanded using the actual location of 'TST_TRACE'. - -For example, if this another file contains: - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -if (TST_TRACE(do_action(arg))) { - ... -} -------------------------------------------------------------------------------- - -the generated output may look similar to: - -------------------------------------------------------------------------------- -common.h:9: FAIL: check failed -test.c:8: INFO: do_action(arg) failed -------------------------------------------------------------------------------- - -1.24 Tainted kernels -~~~~~~~~~~~~~~~~~~~~ - -If you need to detect whether a testcase triggers a kernel warning, bug or -oops, the following can be used to detect TAINT_W or TAINT_D: - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static struct tst_test test = { - ... - .taint_check = TST_TAINT_W | TST_TAINT_D, - ... -}; - -void run(void) -{ - ... - if (tst_taint_check() != 0) - tst_res(TFAIL, "kernel has issues"); - else - tst_res(TPASS, "kernel seems to be fine"); -} -------------------------------------------------------------------------------- - -To initialize taint checks, you have to set the taint flags you want to test -for in the 'taint_check' attribute of the tst_test struct. LTP library will -then automatically call 'tst_taint_init()' during test setup. The function -will generate a 'TCONF' if the requested flags are not fully supported on the -running kernel, and 'TBROK' if the kernel is already tainted before executing -the test. - -LTP library will then automatically check kernel taint at the end of testing. -If '.all_filesystems' is set in struct tst_test, taint check will be performed -after each file system and taint will abort testing early with 'TFAIL'. You -can optionally also call 'tst_taint_check()' during 'run()', which returns 0 -or the tainted flags set in '/proc/sys/kernel/tainted' as specified earlier. - -Depending on your kernel version, not all tainted-flags will be supported. - -For reference to tainted kernels, see kernel documentation: -Documentation/admin-guide/tainted-kernels.rst or -https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html - -1.25 Checksums -~~~~~~~~~~~~~~ - -CRC32c checksum generation is supported by LTP. In order to use it, the -test should include 'tst_checksum.h' header, then can call 'tst_crc32c()'. - -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. - -Since it relies on modprobe command, the check will be skipped if the command -itself is not available on the system. - -1.27 Saving & restoring /proc|sys values -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -LTP library can be instructed to save and restore value of specified -(/proc|sys) files. This is achieved by initialized tst_test struct -field 'save_restore'. It is a 'NULL' terminated array of strings where -each string represents a file, whose value is saved at the beginning -and restored at the end of the test. Only first line of a specified -file is saved and restored. - -Pathnames can be optionally prefixed to specify how strictly (during -'store') are handled errors: - -* (no prefix) - test ends with 'TCONF', if file doesn't exist -* '?' - test prints info message and continues, - if file doesn't exist or open/read fails -* '!' - test ends with 'TBROK', if file doesn't exist - -'restore' is always strict and will TWARN if it encounters any error. - -[source,c] -------------------------------------------------------------------------------- -static const char *save_restore[] = { - "/proc/sys/kernel/core_pattern", - NULL, -}; - -static void setup(void) -{ - FILE_PRINTF("/proc/sys/kernel/core_pattern", "/mypath"); -} - -static struct tst_test test = { - ... - .setup = setup, - .save_restore = save_restore, -}; -------------------------------------------------------------------------------- - -1.28 Parsing kernel .config -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Generally testcases should attempt to autodetect as much kernel features as -possible based on the currently running kernel. We do have tst_check_driver() -to check if functionality that could be compiled as kernel module is present -on the system, disabled syscalls can be detected by checking for 'ENOSYS' -errno etc. - -However in rare cases core kernel features couldn't be detected based on the -kernel userspace API and we have to resort to parse the kernel .config. - -For this cases the test should set the 'NULL' terminated '.needs_kconfigs' -array of boolean expressions with constraints on the kconfig variables. The -boolean expression consits of variables, two binary operations '&' and '|', -negation '!' and correct sequence of parentesis '()'. Variables are expected -to be in a form of "CONFIG_FOO[=bar]". - -The test will continue to run if all expressions are evaluated to 'True'. -Missing variable is mapped to 'False' as well as variable with different than -specified value, e.g. 'CONFIG_FOO=bar' will evaluate to 'False' if the value -is anything else but 'bar'. If config variable is specified as plain -'CONFIG_FOO' it's evaluated to true it's set to any value (typically =y or =m). - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static const char *kconfigs[] = { - "CONFIG_X86_INTEL_UMIP | CONFIG_X86_UMIP", - NULL -}; - -static struct tst_test test = { - ... - .needs_kconfigs = kconfigs, - ... -}; -------------------------------------------------------------------------------- - -1.29 Changing the Wall Clock Time during test execution -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -There are some tests that, for different reasons, might need to change the -system-wide clock time. Whenever this happens, it is imperative that the clock -is restored, at the end of test's execution, taking in consideration the amount -of time elapsed during that test. - -In order for that to happen, struct tst_test has a variable called -"restore_wallclock" that should be set to "1" so LTP knows it should: (1) -initialize a monotonic clock during test setup phase and (2) use that monotonic -clock to fix the system-wide clock time at the test cleanup phase. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static void setup(void) -{ - ... -} - -static void run(void) -{ - ... -} - -struct tst_test test = { - ... - .setup = setup, - .test_all = run, - .restore_wallclock = 1, - ... -}; -------------------------------------------------------------------------------- - -1.30 Testing similar syscalls in one test -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In some cases kernel has several very similar syscalls that do either the same -or very similar job. This is most noticeable on i386 where we commonly have -two or three syscall versions. That is because i386 was first platform that -Linux was developed on and because of that most mistakes in API happened there -as well. However this is not limited to i386 at all, it's quite common that -version two syscall has added missing flags parameters or so. - -In such cases it does not make much sense to copy&paste the test code over and -over, rather than that the test library provides support for test variants. -The idea behind test variants is simple, we run the test several times each -time with different syscall variant. - -The implementation consist of test_variants integer that, if set, denotes number -of test variants. The test is then forked and executed test_variants times each -time with different value in global tst_variant variable. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static int do_foo(void) -{ - switch (tst_variant) { - case 0: - return foo(); - case 1: - return syscall(__NR_foo); - } - - return -1; -} - -static void run(void) -{ - ... - - TEST(do_foo); - - ... -} - -static void setup(void) -{ - switch (tst_variant) { - case 0: - tst_res(TINFO, "Testing foo variant 1"); - break; - case 1: - tst_res(TINFO, "Testing foo variant 2"); - break; - } -} - -struct tst_test test = { - ... - .setup = setup, - .test_all = run, - .test_variants = 2, - ... -}; -------------------------------------------------------------------------------- - -1.31 Guarded buffers -~~~~~~~~~~~~~~~~~~~~ - -The test library supports guarded buffers, which are buffers allocated so -that: - -* The end of the buffer is followed by a PROT_NONE page - -* The remainder of the page before the buffer is filled with random canary - data - -Which means that the any access after the buffer will yield a Segmentation -fault or EFAULT depending on if the access happened in userspace or the kernel -respectively. The canary before the buffer will also catch any write access -outside of the buffer. - -The purpose of the patch is to catch off-by-one bugs which happens when -buffers and structures are passed to syscalls. New tests should allocate -guarded buffers for all data passed to the tested syscall which are passed by -a pointer. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static struct foo *foo_ptr; -static struct iovec *iov; -static void *buf_ptr; -static char *id; -... - -static void run(void) -{ - ... - - foo_ptr->bar = 1; - foo_ptr->buf = buf_ptr; - - ... -} - -static void setup(void) -{ - ... - - id = tst_strdup(string); - - ... -} - -static struct tst_test test = { - ... - .bufs = (struct tst_buffers []) { - {&foo_ptr, .size = sizeof(*foo_ptr)}, - {&buf_ptr, .size = BUF_SIZE}, - {&iov, .iov_sizes = (int[]){128, 32, -1}, - {} - } -}; -------------------------------------------------------------------------------- - -Guarded buffers can be allocated on runtime in a test setup() by a -'tst_alloc()' or by 'tst_strdup()' as well as by filling up the .bufs array in -the tst_test structure. - -So far the tst_test structure supports allocating either a plain buffer by -setting up the size or struct iovec, which is allocated recursively including -the individual buffers as described by an '-1' terminated array of buffer -sizes. - -1.32 Adding and removing capabilities -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some tests may require the presence or absence of particular -capabilities. Using the API provided by 'tst_capability.h' the test author can -try to ensure that some capabilities are either present or absent during the -test. - -For example; below we try to create a raw socket, which requires -CAP_NET_ADMIN. During setup we should be able to do it, then during run it -should be impossible. The LTP capability library will check before setup that -we have this capability, then after setup it will drop it. - -[source,c] --------------------------------------------------------------------------------- -#include "tst_test.h" -#include "tst_capability.h" -#include "tst_safe_net.h" - -#include "lapi/socket.h" - -static void run(void) -{ - TEST(socket(AF_INET, SOCK_RAW, 1)); - if (TST_RET > -1) { - tst_res(TFAIL, "Created raw socket"); - } else if (TST_ERR != EPERM) { - tst_res(TFAIL | TTERRNO, - "Failed to create socket for wrong reason"); - } else { - tst_res(TPASS | TTERRNO, "Didn't create raw socket"); - } -} - -static void setup(void) -{ - TEST(socket(AF_INET, SOCK_RAW, 1)); - if (TST_RET < 0) - tst_brk(TCONF | TTERRNO, "We don't have CAP_NET_RAW to begin with"); - - SAFE_CLOSE(TST_RET); -} - -static struct tst_test test = { - .setup = setup, - .test_all = run, - .caps = (struct tst_cap []) { - TST_CAP(TST_CAP_REQ, CAP_NET_RAW), - TST_CAP(TST_CAP_DROP, CAP_NET_RAW), - {} - }, -}; --------------------------------------------------------------------------------- - -Look at the test struct at the bottom. We have filled in the 'caps' field with -a 'NULL' terminated array containing two 'tst_cap' structs. 'TST_CAP_REQ' -actions are executed before setup and 'TST_CAP_DROP' are executed after -setup. This means it is possible to both request and drop a capability. - -[source,c] --------------------------------------------------------------------------------- -static struct tst_test test = { - .test_all = run, - .caps = (struct tst_cap []) { - TST_CAP(TST_CAP_REQ, CAP_NET_RAW), - TST_CAP(TST_CAP_DROP, CAP_SYS_ADMIN), - {} - }, -}; --------------------------------------------------------------------------------- - -Here we request 'CAP_NET_RAW', but drop 'CAP_SYS_ADMIN'. If the capability is -in the permitted set, but not the effective set, the library will try to -permit it. If it is not in the permitted set, then it will fail with 'TCONF'. - -This API does not require 'libcap' to be installed. However it has limited -features relative to 'libcap'. It only tries to add or remove capabilities -from the effective set. This means that tests which need to spawn child -processes may have difficulties ensuring the correct capabilities are -available to the children (see the capabilities (7) manual pages). - -However a lot of problems can be solved by using 'tst_cap_action(struct -tst_cap *cap)' directly which can be called at any time. This also helps if -you wish to drop a capability at the begining of setup. - -1.33 Reproducing race-conditions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If a bug is caused by two tasks in the kernel racing and you wish to create a -regression test (or bug-fix validation test) then the 'tst_fuzzy_sync.h' -library should be used. - -It allows you to specify, in your code, two race windows. One window in each -thread's loop (triggering a race usually requires many iterations). These -windows show fuzzy-sync where the race can happen. They don't need to be -exact, hence the 'fuzzy' part. If the race condition is not immediately -triggered then the library will begin experimenting with different timings. - -[source,c] --------------------------------------------------------------------------------- -#include "tst_fuzzy_sync.h" - -static struct tst_fzsync_pair fzsync_pair; - -static void setup(void) -{ - tst_fzsync_pair_init(&fzsync_pair); -} - -static void cleanup(void) -{ - tst_fzsync_pair_cleanup(&fzsync_pair); -} - -static void *thread_b(void *arg) -{ - while (tst_fzsync_run_b(&fzsync_pair)) { - - tst_fzsync_start_race_b(&fzsync_pair); - - /* This is the race window for thread B */ - - tst_fzsync_end_race_b(&fzsync_pair); - } - - return arg; -} - -static void thread_a(void) -{ - tst_fzsync_pair_reset(&fzsync_pair, thread_b); - - while (tst_fzsync_run_a(&fzsync_pair)) { - - tst_fzsync_start_race_a(&fzsync_pair); - - /* This is the race window for thread A */ - - tst_fzsync_end_race_a(&fzsync_pair); - } -} - -static struct tst_test test = { - .test_all = thread_a, - .setup = setup, - .cleanup = cleanup, -}; --------------------------------------------------------------------------------- - -Above is a minimal template for a test using fuzzy-sync. In a simple case, you -just need to put the bits you want to race inbetween 'start_race' and -'end_race'. Meanwhile, any setup you need to do per-iteration goes outside the -windows. - -Fuzzy sync synchronises 'run_a' and 'run_b', which act as barriers, so that -neither thread can progress until the other has caught up with it. There is -also the 'pair_wait' function which can be used to add barriers in other -locations. Of course 'start/end_race_a/b' are also a barriers. - -The library decides how long the test should run for based on the timeout -specified by the user plus some other heuristics. - -For full documentation see the comments in 'include/tst_fuzzy_sync.h'. - -1.34 Reserving hugepages -~~~~~~~~~~~~~~~~~~~~~~~~ - -Many of the LTP tests need to use hugepage in their testing, this allows the -test can reserve hugepages from system only via '.request_hugepages = xx'. - -If set non-zero number of 'request_hugepages', test will try to reserve the -expected number of hugepage for testing in setup phase. If system does not -have enough hpage for using, it will try the best to reserve 80% available -number of hpages. With success test stores the reserved hugepage number in -'tst_hugepages'. For the system without hugetlb supporting, variable -'tst_hugepages' will be set to 0. If the hugepage number needs to be set to 0 -on supported hugetlb system, please use '.request_hugepages = TST_NO_HUGEPAGES'. - -Also, we do cleanup and restore work for the hpages resetting automatically. - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static void run(void) -{ - ... - - if (tst_hugepages == test.request_hugepages) - TEST(do_hpage_test); - else - ... - ... -} - -struct tst_test test = { - .test_all = run, - .request_hugepages = 2, - ... -}; -------------------------------------------------------------------------------- - -or, - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static void run(void) -{ - ... -} - -static void setup(void) -{ -        if (tst_hugepages != test.requested_hugepages) -                tst_brk(TCONF, "..."); -} - -struct tst_test test = { - .test_all = run, - .request_hugepages = 2, - ... -}; -------------------------------------------------------------------------------- - -1.35 Checking for required commands -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Required commands can be checked with '.needs_cmds', which points to a 'NULL' -terminated array of strings such as: - -[source,c] -------------------------------------------------------------------------------- -.needs_cmds = (const char *const []) { - "useradd", - "userdel", - NULL -}, -------------------------------------------------------------------------------- - -Also can check required command version whether is satisfied by using 'needs_cmds' -such as: - -[source,c] -------------------------------------------------------------------------------- -.needs_cmds = (const char *const []) { - "mkfs.ext4 >= 1.43.0", - NULL -}, -------------------------------------------------------------------------------- - -Currently, we only support mkfs.ext4 command version check. -If you want to support more commands, please fill your own .parser and .table_get -method in the version_parsers structure of lib/tst_cmd.c. - -1.36 Assert sys or proc file value -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Using TST_ASSERT_INT/STR(path, val) to assert that integer value or string stored in -the prefix field of file pointed by path equals to the value passed to this function. - -Also having a similar api pair TST_ASSERT_FILE_INT/STR(path, prefix, val) to assert -the field value of file. - -1.36 Using Control Group -~~~~~~~~~~~~~~~~~~~~~~~~ - -Some LTP tests need specific Control Group configurations. tst_cgroup.h provides -APIs to discover and use CGroups. There are many differences between CGroups API -V1 and V2. We encapsulate the details of configuring CGroups in high-level -functions which follow the V2 kernel API. Allowing one to use CGroups without -caring too much about the current system's configuration. - -Also, the LTP library will automatically mount/umount and configure the CGroup -hierarchies if that is required (e.g. if you run the tests from init with no -system manager). - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" -#include "tst_cgroup.h" - -static const struct tst_cgroup_group *cg; - -static void run(void) -{ - ... - // do test under cgroup - ... -} - -static void setup(void) -{ - tst_cgroup_require("memory", NULL); - cg = tst_cgroup_get_test_group(); - SAFE_CGROUP_PRINTF(cg, "cgroup.procs", "%d", getpid()); - SAFE_CGROUP_PRINTF(cg, "memory.max", "%lu", MEMSIZE); - if (SAFE_CGROUP_HAS(cg, "memory.swap.max")) - SAFE_CGROUP_PRINTF(cg, "memory.swap.max", "%zu", memsw); -} - -static void cleanup(void) -{ - tst_cgroup_cleanup(); -} - -struct tst_test test = { - .setup = setup, - .test_all = run, - .cleanup = cleanup, - ... -}; -------------------------------------------------------------------------------- - -Above, we first ensure the memory controller is available on the -test's CGroup with 'tst_cgroup_require'. We then get a structure, -'cg', which represents the test's CGroup. Note that -'tst_cgroup_get_test_group' should not be called many times, as it is -allocated in a guarded buffer (See section 2.2.31). Therefor it is -best to call it once in 'setup' and not 'run' because 'run' may be -repeated with the '-i' option. - -We then write the current processes PID into 'cgroup.procs', which -moves the current process into the test's CGroup. After which we set -the maximum memory size by writing to 'memory.max'. If the memory -controller is mounted on CGroups V1 then the library will actually -write to 'memory.limit_in_bytes'. As a general rule, if a file exists -on both CGroup versions, then we use the V2 naming. - -Some controller features, such as 'memory.swap', can be -disabled. Therefor we need to check if they exist before accessing -them. This can be done with 'SAFE_CGROUP_HAS' which can be called on -any control file or feature. - -Most tests only require setting a few limits similar to the above. In -such cases the differences between V1 and V2 are hidden. Setup and -cleanup is also mostly hidden. However things can get much worse. - -[source,c] -------------------------------------------------------------------------------- -static const struct tst_cgroup_group *cg; -static const struct tst_cgroup_group *cg_drain; -static struct tst_cgroup_group *cg_child; - -static void run(void) -{ - char buf[BUFSIZ]; - size_t mem = 0; - - cg_child = tst_cgroup_group_mk(cg, "child"); - SAFE_CGROUP_PRINTF(cg_child, "cgroup.procs", "%d", getpid()); - - if (!TST_CGROUP_VER_IS_V1(cg, "memory")) - SAFE_CGROUP_PRINT(cg, "cgroup.subtree_control", "+memory"); - if (!TST_CGROUP_VER_IS_V1(cg, "cpuset")) - SAFE_CGROUP_PRINT(cg, "cgroup.subtree_control", "+cpuset"); - - if (!SAFE_FORK()) { - SAFE_CGROUP_PRINTF(cg_child, "cgroup.procs", "%d", getpid()); - - if (SAFE_CGROUP_HAS(cg_child, "memory.swap")) - SAFE_CGROUP_SCANF(cg_child, "memory.swap.current", "%zu", &mem); - SAFE_CGROUP_READ(cg_child, "cpuset.mems", buf, sizeof(buf)); - - // Do something with cpuset.mems and memory.current values - ... - - exit(0); - } - - tst_reap_children(); - SAFE_CGROUP_PRINTF(cg_drain, "cgroup.procs", "%d", getpid()); - cg_child = tst_cgroup_group_rm(cg_child); -} - -static void setup(void) -{ - tst_cgroup_require("memory", NULL); - tst_cgroup_require("cpuset", NULL); - - cg = tst_cgroup_get_test_group(); - cg_drain = tst_cgroup_get_drain_group(); -} - -static void cleanup(void) -{ - if (cg_child) { - SAFE_CGROUP_PRINTF(cg_drain, "cgroup.procs", "%d", getpid()); - cg_child = tst_cgroup_group_rm(cg_child); - } - - tst_cgroup_cleanup(); -} - -struct tst_test test = { - .setup = setup, - .test_all = run, - .cleanup = cleanup, - ... -}; -------------------------------------------------------------------------------- - -Starting with setup; we can see here that we also fetch the 'drain' -CGroup. This is a shared group (between parallel tests) which may -contain processes from other tests. It should have default settings and -these should not be changed by the test. It can be used to remove -processes from other CGroups incase the hierarchy root is not -accessible. - -In 'run', we first create a child CGroup with 'tst_cgroup_mk'. As we -create this CGroup in 'run' we should also remove it at the end of -run. We also need to check if it exists and remove it in cleanup as -well. Because there are 'SAFE_' functions which may jump to cleanup. - -We then move the main test process into the child CGroup. This is -important as it means that before we destroy the child CGroup we have -to move the main test process elsewhere. For that we use the 'drain' -group. - -Next we enable the memory and cpuset controller configuration on the -test CGroup's descendants (i.e. 'cg_child'). This allows each child to -have its own settings. The file 'cgroup.subtree_control' does not -exist on V1. Because it is possible to have both V1 and V2 active at -the same time. We can not simply check if 'subtree_control' exists -before writing to it. We have to check if a particular controller is -on V2 before trying to add it to 'subtree_control'. Trying to add a V1 -controller will result in 'ENOENT'. - -We then fork a child process and add this to the child CGroup. Within -the child process we try to read 'memory.swap.current'. It is possible -that the memory controller was compiled without swap support, so it is -necessary to check if 'memory.swap' is enabled. That is unless the -test will never reach the point where 'memory.swap.*' are used without -swap support. - -The parent process waits for the child process to be reaped before -destroying the child CGroup. So there is no need to transfer the child -to drain. However the parent process must be moved otherwise we will -get 'EBUSY' when trying to remove the child CGroup. - -Another example of an edge case is the following. - -[source,c] -------------------------------------------------------------------------------- - if (TST_CGROUP_VER_IS_V1(cg, "memory")) - SAFE_CGROUP_PRINTF(cg, "memory.swap.max", "%lu", ~0UL); - else - SAFE_CGROUP_PRINT(cg, "memory.swap.max", "max"); -------------------------------------------------------------------------------- - -CGroups V2 introduced a feature where 'memory[.swap].max' could be set to -"max". This does not appear to work on V1 'limit_in_bytes' however. For most -tests, simply using a large number is sufficient and there is no need to use -"max". Importantly though, one should be careful to read both the V1 and V2 -kernel docs. The LTP library can not handle all edge cases. It does the minimal -amount of work to make testing on both V1 and V2 feasible. - -1.37 Require minimum numbers of CPU for a testcase -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some tests require more than specific number of CPU. It can be defined with -`.min_cpus = N`. - -1.38 Test tags -~~~~~~~~~~~~~~ - -Test tags are name-value pairs that can hold any test metadata. - -We have additional support for CVE entries, git commit in mainline kernel, -stable kernel or glibc git repository. If a test is a regression test it -should include these tags. They are printed when test fails and exported -into documentation. - -CVE, mainline and stable kernel git commits in a regression test for a kernel bug: -[source,c] -------------------------------------------------------------------------------- -struct tst_test test = { - ... - .tags = (const struct tst_tag[]) { - {"linux-git", "9392a27d88b9"}, - {"linux-git", "ff002b30181d"}, - {"known-fail", "ustat() is known to fail with EINVAL on Btrfs"}, - {"linux-stable-git", "c4a23c852e80"}, - {"CVE", "2020-29373"}, - {} - } -}; -------------------------------------------------------------------------------- - -NOTE: We don't track all backports to stable kernel but just those which are - stable branch specific (unique), i.e. no commit in mainline. Example of - commits: c4a23c852e80, cac68d12c531. - -Glibc git commit in a regression test for a glibc bug: -[source,c] -------------------------------------------------------------------------------- -struct tst_test test = { - ... - .tags = (const struct tst_tag[]) { - {"glibc-git", "574500a108be"}, - {} - } -}; -------------------------------------------------------------------------------- - -1.39 Testing on the specific architecture -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Testcases for specific arch should be limited on that only being supported -platform to run, we now involve a .supported_archs to achieve this feature -in LTP library. All you need to run a test on the expected arch is to set -the '.supported_archs' array in the 'struct tst_test' to choose the required -arch list. e.g. - - .supported_archs = (const char *const []){"x86_64", "ppc64", NULL} - -This helps move the TCONF info from code to tst_test metadata as well. - -And, we also export a struct tst_arch to save the system architecture for -using in the whole test cases. - - extern const struct tst_arch { - char name[16]; - enum tst_arch_type type; - } tst_arch; - -[source,c] -------------------------------------------------------------------------------- -#include "tst_test.h" - -static struct tst_test test = { - ... - .setup = setup, - .supported_archs = (const char *const []) { - "x86_64", - "ppc64", - "s390x", - NULL - }, -}; -------------------------------------------------------------------------------- - -2. Common problems ------------------- - -This chapter describes common problems/misuses and less obvious design patters -(quirks) in UNIX interfaces. Read it carefully :) - -2.1 umask() -~~~~~~~~~~~ - -I've been hit by this one several times already... When you create files -with 'open()' or 'creat()' etc, the mode specified as the last parameter *is -not* the mode the file is created with. The mode depends on current 'umask()' -settings which may clear some of the bits. If your test depends on specific -file permissions you need either to change umask to 0 or 'chmod()' the file -afterwards or use 'SAFE_TOUCH()' that does the 'chmod()' for you. - -2.2 access() -~~~~~~~~~~~~ - -If 'access(some_file, W_OK)' is executed by root, it will return success even -if the file doesn't have write permission bits set (the same holds for R_OK -too). For sysfs files you can use 'open()' as a workaround to check file -read/write permissions. It might not work for other filesystems, for these you -have to use 'stat()', 'lstat()' or 'fstat()'. - -2.3 umount() EBUSY -~~~~~~~~~~~~~~~~~~ - -Various desktop daemons (gvfsd-trash is known for that) may be stupid enough -to probe all newly mounted filesystem which results in 'umount(2)' failing -with 'EBUSY'; use 'tst_umount()' described in 1.19 that retries in this case -instead of plain 'umount(2)'. - -2.4 FILE buffers and fork() -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Be vary that if a process calls 'fork(2)' the child process inherits open -descriptors as well as copy of the parent memory so especially if there are -any open 'FILE' buffers with a data in them they may be written both by the -parent and children resulting in corrupted/duplicated data in the resulting -files. - -Also open 'FILE' streams are flushed and closed at 'exit(3)' so if your -program works with 'FILE' streams, does 'fork(2)', and the child may end up -calling 'exit(3)' you will likely end up with corrupted files. - -The solution to this problem is either simply call 'fflush(NULL)' that flushes -all open output 'FILE' streams just before doing 'fork(2)'. You may also use -'_exit(2)' in child processes which does not flush 'FILE' buffers and also -skips 'atexit(3)' callbacks. diff --git a/doc/c-test-tutorial-simple.txt b/doc/c-test-tutorial-simple.txt deleted file mode 100755 index 867c2653..00000000 --- a/doc/c-test-tutorial-simple.txt +++ /dev/null @@ -1,1078 +0,0 @@ -C Test Case Tutorial -==================== - -NOTE: See also - https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines[Test Writing Guidelines], - https://github.com/linux-test-project/ltp/wiki/C-Test-API[C Test API]. - -This is a step-by-step tutorial on writing a simple C LTP test, where topics -of the LTP and Linux kernel testing will be introduced gradually using a -concrete example. Most sections will include exercises, some trivial and -others not so much. If you find an exercise is leading you off at too much of -a tangent, just leave it for later and move on. - -LTP tests can be written in C or Shell script. This tutorial is only for tests -written in C using the new LTP test API. Note that while we go into some -detail on using Git, this is not intended as a canonical or complete guide -for Git. - -0. Assumptions & Feedback -------------------------- - -We assume the reader is familiar with C, Git and common Unix/Linux/GNU tools -and has some general knowledge of Operating Systems. Experienced Linux -developers may find it too verbose while people new to system level Linux -development may find it overwhelming. - -Comments and feedback are welcome, please direct them to the mailing list (see -+README+). - -1. Getting Started ------------------- - -Git-clone the main LTP repository as described in the +README+ and change -directory to the checked-out Git repository. We recommend installing the LTP -and running one of the tests mentioned in the Quick guide (in the +README+) to -ensure you are starting from a good state. - -We also recommended cloning the Linux kernel repository for reference, this -guide will refer to files and directories within the mainline kernel 4.12. - -[source,shell] ------------------------------------------------------------------------------- -$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ------------------------------------------------------------------------------- - -There are a number of other repositories which are useful for reference as -well, including the GNU C library +glibc+ and the alternative C library -+musl+. Some system calls are partially or even entirely implemented in user -land as part of the standard C library. So in these cases, the C library is an -important reference. +glibc+ is the most common C library for Linux, however -+musl+ is generally easier to understand. - -How system calls are implemented varies from one architecture to another and -across kernel and C library versions. To find out whether a system call is -actually accessing the kernel (whether it is actually a system call) on any -given machine you can use the +strace+ utility. This intercepts system calls -made by an executable and prints them. We will use this later in the tutorial. - -2. Choose a System Call to test -------------------------------- - -We will use the +statx()+ system call, to provide a concrete example of a -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 -+testcases/kernel/syscalls+, but you should also +git grep+ 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 +include/linux/syscalls.h+ in the kernel tree. - -Something the LTP excels at is ensuring bug-fixes are back ported to -maintenance releases, so targeting a specific regression is another -option. - -2.1. Find an untested System call -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Try to find an untested system call which has a manual page (i.e. +man -syscall+ produces a result). It is a good idea to Git-clone the latest kernel -man-pages repository. - -[source,shell] ------------------------------------------------------------------------------- -$ git clone git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git ------------------------------------------------------------------------------- - -At the time of writing the difference between the latest man-pages release and -the +HEAD+ of the repository (usually the latest commit) is well over 100 -commits. This represents about 9 weeks of changes. If you are using a stable -Linux distribution, your man-pages package may well be years old. So as with -the kernel, it is best to have the Git repository as a reference. - -You could also find a system call with untested parameters or use whatever it -is you are planning to use the LTP for. - -3. Create the test skeleton ---------------------------- - -I shall call my test +statx01.c+, by the time you read this that file name -will probably be taken, so increment the number in the file name as -appropriate or replace +statx+ with the system call chosen in exercise 2.1. - -[source,shell] ------------------------------------------------------------------------------- -$ mkdir testcases/kernel/syscalls/statx -$ cd testcases/kernel/syscalls/statx -$ echo statx >> .gitignore ------------------------------------------------------------------------------- - -Next open +statx01.c+ and add the following boilerplate. Make sure to change -the copy right notice to your name/company, correct the test name and minimum -kernel version if necessary. I will explain what the code does below. - -[source,c] ------------------------------------------------------------------------------- -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2017 Instruction Ignorer <"can't"@be.bothered.com> - */ - -/* - * Test statx - * - * All tests should start with a description of _what_ we are testing. - * Non-trivial explanations of _how_ the code works should also go here. - * Include relevant links, Git commit hashes and CVE numbers. - * Inline comments should be avoided. - */ - -#include "tst_test.h" - -static void run(void) -{ - tst_res(TPASS, "Doing hardly anything is easy"); -} - -static struct tst_test test = { - .test_all = run, - .min_kver = "4.11", -}; ------------------------------------------------------------------------------- - -Starting with the +#include+ statement we copy in the main LTP test library -headers. This includes the most common test API functions and the test harness -initialisation code. It is important to note that this is a completely -ordinary, independent C program, however +main()+ is missing because it is -implemented in +tst_test.h+. - -We specify what code we want to run as part of the test using the +tst_test -test+ structure. Various callbacks can be set by the test writer, including -+test.test_all+, which we have set to +run()+. The test harness will execute -this callback in a separate process (using +fork()+), forcibly terminating it -if it does not return after +test.timeout+ seconds. - -We have also set +test.min_kver+ to the kernel version where +statx+ was -introduced. The test library will determine the kernel version at runtime. If -the version is less than 4.11 then the test harness will return +TCONF+, -indicating that this test is not suitable for the current system -configuration. - -Occasionally features are back ported to older kernel versions, so +statx+ may -exist on kernels with a lower version. However we don't need to worry about -that unless there is evidence of it happening. - -As mentioned in the code itself, you should specify what you are testing and -the expected outcome, even if it is relatively simple. If your program flow is -necessarily complex and difficult to understand (which is often the case when -trying to manipulate the kernel into doing something bad), then a detailed -explanation of how the code works is welcome. - -What you should not do, is use inline comments or include the same level of -explanation which is written here. As a general rule, if something is easy to -document, then the code should also be easy to read. So don't document the easy -stuff (except for the basic test specification). - -Before continuing we should compile this and check that the basics work. In -order to compile the test we need a +Makefile+ in the same subdirectory. If -one already exists, then nothing needs to be done, otherwise add one with the -following contents. - -[source,make] ------------------------------------------------------------------------------- -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2019 Linux Test Project - -top_srcdir ?= ../../../.. - -include $(top_srcdir)/include/mk/testcases.mk - -include $(top_srcdir)/include/mk/generic_leaf_target.mk - ------------------------------------------------------------------------------- - -This will automatically add +statx01.c+ as a build target producing a -+statx01+ executable. Unless you have heavily deviated from the tutorial, and -probably need to change +top_srcdir+, nothing else needs to be done. - -Normally, if you were starting a Makefile from scratch, then you would need to -add +statx01+ as a build target. Specifying that you would like to run some -program (e.g. +gcc+ or +clang+) to transform +statx01.c+ into +statx01+. Here -we don't need to do that, but sometimes it is still necessary. For example, if -we needed to link to the POSIX threading library, then we could add the -following line after +testcases.mk+. - -[source,make] --------------------------------------------------------------------------------- -statx01: CFLAGS += -pthread --------------------------------------------------------------------------------- - -Assuming you are in the test's subdirectory +testcases/kernel/syscalls/statx+, -do - -[source,shell] --------------------------------------------------------------------------------- -$ make -$ ./statx01 --------------------------------------------------------------------------------- - -This should build the test and then run it. However, even though the test is -in the +syscalls+ directory it won't be automatically ran as part of the -_syscalls_ test group (remember +./runltp -f syscalls+ from the +README+?). For -this we need to add it to the +runtest+ file. So open +runtest/statx+ and add -the lines starting with a +++. - -[source,diff] --------------------------------------------------------------------------------- - statvfs01 statvfs01 - statvfs02 statvfs02 - -+statx01 statx01 -+ - stime01 stime01 - stime02 stime02 - --------------------------------------------------------------------------------- - -The +runtest+ files are in a two column format. The first column is the test -name, which is mainly used by test runners for reporting and filtering. It is -just a single string of text with no spaces. The second column, which can -contain spaces, is passed to the shell in order to execute the test. Often it -is just the executable name, but some tests also take arguments (the LTP has a -library for argument parsing, by the way). - -If you haven't done so already, we should add all these new files to Git. It -is vitally important that you do not make changes to the master branch. If you -do then pulling changes from upstream becomes a major issue. So first of all -create a new branch. - -[source,shell] --------------------------------------------------------------------------------- -$ git checkout -b statx01 master --------------------------------------------------------------------------------- - -Now we want to add the files we have created or modified, but before doing a -commit make sure you have configured Git correctly. You need to at least set -your Name and e-mail address in +~/.gitconfig+, but there are some other -settings which come in handy too. My relatively simple configuration is similar to -the below - -[source,conf] --------------------------------------------------------------------------------- -[user] - name = Sarah Jane - email = sjane@e-mail.address -[core] - editor = emacs -[sendemail] - smtpServer = smtp.server.address --------------------------------------------------------------------------------- - -Obviously you need to at least change your name and e-mail. The SMTP server is -useful for +git send-mail+, which we will discuss later. The editor value is -used for things like writing commits (without the +-m+ option). - -[source,shell] --------------------------------------------------------------------------------- -$ git add -v :/testcases/kernel/syscalls/statx :/runtest/syscalls -$ git commit -m "statx01: Add new test for statx syscall" --------------------------------------------------------------------------------- - -This should add all the new files in the +statx+ directory and the +runtest+ -file. It is good practice to commit early and often. Later on we will do a -Git-rebase, which allows us to clean up the commit history. So don't worry -about how presentable your commit log is for now. Also don't hesitate to -create a new branch when doing the exercises or experimenting. This will allow -you to diverge from the tutorial and then easily come back again. - -I can't emphasize enough that Git makes things easy through branching and that -things quickly get complicated if you don't do it. However if you do get into -a mess, Git-reflog and Git-reset, will usually get you out of it. If you also -mess that up then it may be possible to cherry pick 'dangling' commits out of -the database into a branch. - -3.1 Report TCONF instead of TPASS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Maybe the test should report "TCONF: Not implemented" instead or perhaps -+TBROK+. Try changing it do so (see +doc/test-writing-guidelines.txt+ or -https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines[the -Wiki]). - -3.2 Check Git ignores the executable -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Is your +.gitignore+ correct? - -3.3 Run make check -~~~~~~~~~~~~~~~~~~ - -Check coding style with `make check` - (more in https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#21-c-coding-style[C coding style]) - -3.4 Install the LTP and run the test with runtest -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Run +statx01+ on its own; similar to the +madvise+ tests in the +README+. - -4. Call the system call ------------------------ - -At the time of writing +statx+ has no +glibc+ wrapper. It is also fairly common -for a distribution's C library version to be older than its kernel or it may use a -cut down C library in comparison to the GNU one. So we must call +statx()+ -using the general +syscall()+ interface. - -The LTP contains a library for dealing with the +syscall+ interface, which is -located in +include/lapi+. System call numbers are listed against the relevant -call in the +*.in+ files (e.g. +x86_64.in+) which are used to generate -+syscalls.h+, which is the header you should include. On rare occasions you -may find the system call number is missing from the +*.in+ files and will need -to add it (see +include/lapi/syscalls/strip_syscall.awk+). - -System call numbers vary between architectures, hence why there are multiple -+*.in+ files for each architecture. You can find the various values for the -+statx+ system call across a number of +uinstd.h+ files in the Linux kernel. - -Note that we don't use the system-call-identifier value available in -+/usr/include/linux/uinstd.h+ because the kernel might be much newer than the -user land development packages. - -For +statx+ we had to add +statx 332+ to +testcases/kernel/include/x86_64.in+, -+statx 383+ to +testcases/kernel/include/powerpc.in+, etc. Now lets look at -the code, which I will explain in more detail further down. - -[source,c] --------------------------------------------------------------------------------- -/* - * Test statx - * - * Check if statx exists and what error code it returns when we give it dodgy - * data. - */ - -#include -#include "tst_test.h" -#include "lapi/syscalls.h" - -struct statx_timestamp { - int64_t tv_sec; - uint32_t tv_nsec; - int32_t __reserved; -}; - -struct statx { - uint32_t stx_mask; - uint32_t stx_blksize; - uint64_t stx_attributes; - uint32_t stx_nlink; - uint32_t stx_uid; - uint32_t stx_gid; - uint16_t stx_mode; - uint16_t __spare0[1]; - uint64_t stx_ino; - uint64_t stx_size; - uint64_t stx_blocks; - uint64_t stx_attributes_mask; - struct statx_timestamp stx_atime; - struct statx_timestamp stx_btime; - struct statx_timestamp stx_ctime; - struct statx_timestamp stx_mtime; - uint32_t stx_rdev_major; - uint32_t stx_rdev_minor; - uint32_t stx_dev_major; - uint32_t stx_dev_minor; - uint64_t __spare2[14]; -}; - -static int sys_statx(int dirfd, const char *pathname, int flags, - unsigned int mask, struct statx *statxbuf) -{ - return tst_syscall(__NR_statx, dirfd, pathname, flags, mask, statxbuf); -} - -... --------------------------------------------------------------------------------- - -So the top part of the code is now boiler plate for calling +statx+. It is -common for the kernel to be newer than the user land libraries and headers. So -for new system calls like +statx+, we copy, with a few modifications, the -relevant definitions into the LTP. This is somewhat like 'vendoring', although -we are usually just copying headers required for interacting with the Kernel's -ABI (Application Binary Interface), rather than internalising actual -functionality. - -So from the top we include the +stdint.h+ library which gives us the standard -+(u)int*_t+ type definitions. We use these in place of the Kernel type -definitions such as +__u64+ in +linux/types.h+. We then have a couple of -structure definitions which form part of the +statx+ API. These were copied -from +include/uapi/linux/stat.h+ in the Kernel tree. - -After that, there is a wrapper function, which saves us from writing -+tst_syscall(__NR_statx, ...+, every time we want to make a call to -+statx+. This also provides a stub for when +statx+ is eventually integrated -into the LTP library and also implemented by the C library. At that point we -can switch to using the C library implementation if available or fallback to -our own. - -The advantage of using the C library implementation is that it will often be -better supported across multiple architectures. It will also mean we are using -the system call in the same way most real programs would. Sometimes there are -advantages to bypassing the C library, but in general it should not be our -first choice. - -The final test should do a check during configuration (i.e. when we run -+./configure+ before building) which checks if the +statx+ system call and -associated structures exists. This requires writing an +m4+ file for use with -+configure.ac+ which is processed during +make autotools+ and produces the -configure script. - -For the time being though we shall just ignore this. All you need to know for -now is that this is a problem which eventually needs to be dealt with and that -there is a system in place to handle it. - -[source,c] --------------------------------------------------------------------------------- -... - -static void run(void) -{ - struct statx statxbuf = { 0 }; - - TEST(sys_statx(0, NULL, 0, 0, &statxbuf)); - - if (TST_RET == 0) - tst_res(TFAIL, "statx thinks it can stat NULL"); - else if (TST_ERR == EFAULT) - tst_res(TPASS, "statx set errno to EFAULT as expected"); - else - tst_res(TFAIL | TERRNO, "statx set errno to some unexpected value"); -} - -static struct tst_test test = { - .test_all = run, - .min_kver = "4.11", -}; --------------------------------------------------------------------------------- - -The +TEST+ macro sets +TST_RET+ to the return value of +tst_statx()+ and -+TST_ERR+ to the value of +errno+ immediately after the functions -return. This is mainly just for convenience, although it potentially could -have other uses. - -We check whether the return value indicates success and if it doesn't also -check the value of +errno+. The last call to +tst_res+ includes +TERRNO+, -which will print the current error number and associated description in -addition to the message we have provided. Note that it uses the current value -of +errno+ not +TST_ERR+. - -What we should have done in the example above is use +TTERRNO+ which takes the -value of +TST_ERR+. - -If we try to run the test on a kernel where +statx+ does not exist, then -+tst_syscall+ will cause it to fail gracefully with +TCONF+. Where +TCONF+ -indicates the test is not applicable to our configuration. - -The function +tst_syscall+ calls +tst_brk(TCONF,...)+ on failure. +tst_brk+ -causes the test to exit immediately, which prevents any further test code from -being run. - -4.1 What are the differences between tst_brk and tst_res? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -See +include/tst_test.h+ and the -https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines[test -writing guide]. Also what do they have in common? - -4.2 What happens if you call tst_res(TINFO, ...) after sys_statx? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Does the test still function correctly? - -4.3 Extend the test to handle other basic error conditions. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For example, see if you can trigger +ENOENT+ instead. You shouldn't -have to create any files, which is discussed in the next section. - -5. Setup, Cleanup and files ---------------------------- - -Some tests require resources to be allocated, or system settings to be -changed, before the test begins. This 'setup' only has to be done once at the -beginning and at the end of the test needs to be removed or reverted. The -'cleanup' also has to be done regardless of whether the test breaks. - -Fortunately, like most test libraries, we have setup and cleanup (teardown) -callbacks. +setup+ is called once before +run+ and +cleanup+ is called once -afterwards. Note that +run+ itself can be called multiple times by the test -harness, but that +setup+ and +cleanup+ are only called once. - -If either your code, a +SAFE_*+ macro or a library function such as -+tst_syscall+ call +tst_brk+, then +run+ will exit immediately and the -+cleanup+ function is then called. Once 'cleanup' is completed, the test -executable will then exit altogether abandoning any remaining iterations of -+run+. - -For +statx+ we would like to create some files or file like objects which we -have control over. Deciding where to create the files is easy, we just create -it in the current working directory and let the LTP test harness handle where -that should be by setting +.needs_tmpdir = 1+. - -[source,c] --------------------------------------------------------------------------------- -/* - * Test statx - * - * Check if statx exists and what error code it returns when we give it dodgy - * data. Then stat a file and check it returns success. - */ - -#include -#include "tst_test.h" -#include "lapi/syscalls.h" -#include "lapi/fcntl.h" - -#define FNAME "file_to_stat" -#define STATX_BASIC_STATS 0x000007ffU - -/*************** statx structure and wrapper goes here ! ***************/ - -... --------------------------------------------------------------------------------- - -We have added an extra include +lapi/fcntl.h+ which wraps the system header by -the same name (+#include +). This header ensures we have definitions -for recently added macros such as +AT_FDCWD+ by providing fall backs if the -system header does not have them. The +lapi+ directory contains a number of -headers like this. - -At some point we may wish to add +lapi/stat.h+ to provide a fall back for -macros such as +STATX_BASIC_STATS+. However for the time being we have just -defined it in the test. - -[source,c] --------------------------------------------------------------------------------- -... - -static void setup(void) -{ - SAFE_TOUCH(FNAME, 0777, NULL); -} - -static void run(void) -{ - struct statx statxbuf = { 0 }; - - TEST(sys_statx(0, NULL, 0, 0, &statxbuf)); - if (TST_RET == 0) - tst_res(TFAIL, "statx thinks it can stat NULL"); - else if (TST_ERR == EFAULT) - tst_res(TPASS, "statx set errno to EFAULT as expected"); - else - tst_res(TFAIL | TERRNO, "statx set errno to some unexpected value"); - - TEST(sys_statx(AT_FDCWD, FNAME, 0, STATX_BASIC_STATS, &statxbuf)); - if (TST_RET == 0) - tst_res(TPASS, "It returned zero so it must have worked!"); - else - tst_res(TFAIL | TERRNO, "statx can not stat a basic file"); -} - -static struct tst_test test = { - .setup = setup, - .test_all = run, - .min_kver = "4.11", - .needs_tmpdir = 1 -}; --------------------------------------------------------------------------------- - -The +setup+ callback uses one of the LTP's +SAFE+ functions to create an empty -file +file_to_stat+. Because we have set +.needs_tmpdir+, we can just create -this file in the present working directory. We don't need to create a -+cleanup+ callback yet because the LTP test harness will recursively delete -the temporary directory and its contents. - -The +run+ function can be called multiple times by the test harness, however -+setup+ and +cleanup+ callbacks will only be ran once. - -[WARNING] -By this point you may have begun to explore the LTP library headers or older -tests. In which case you will have come across functions from the old API such -as +tst_brkm+. The old API is being phased out, so you should not use these -functions. - -So far we haven't had to do any clean up. So our example doesn't answer the -question "what happens if part of the clean up fails?". To answer this we are -going to modify the test to ask the (highly contrived) question "What happens -if I create and open a file, then create a hard-link to it, then call open -again on the hard-link, then 'stat' the file". - -[source,c] --------------------------------------------------------------------------------- -#define LNAME "file_to_stat_link" - -... - -static void setup(void) -{ - fd = SAFE_OPEN(FNAME, O_CREAT, 0777); - SAFE_LINK(FNAME, LNAME); - lfd = SAFE_OPEN(LNAME, 0); -} - -static void cleanup(void) -{ - if (lfd != 0) - SAFE_CLOSE(lfd); - - if (fd != 0) - SAFE_CLOSE(fd); -} - -static void run(void) -{ - ... - - TEST(sys_statx(AT_FDCWD, LNAME, 0, STATX_BASIC_STATS, &statxbuf)); - if (TST_RET == 0) - tst_res(TPASS, "It returned zero so it must have worked!"); - else - tst_res(TFAIL | TERRNO, "statx can not stat a basic file"); -} - -static struct tst_test test = { - .setup = setup, - .cleanup = cleanup, - .test_all = run, - .tcnt = 2, - .min_kver = "4.11", - .needs_tmpdir = 1 -}; --------------------------------------------------------------------------------- - -Because we are now opening a file, we need a +cleanup+ function to close the -file descriptors. We have to manually close the files to ensure the temporary -directory is deleted by the test harness (see the -https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines[test -writing guidelines] for details). - -As a matter of good practice, the file descriptors are closed in reverse -order. In some circumstances the order in which clean up is performed is -significant. In that case resources created towards the end of 'setup' are -dependent on ones near the beginning. So during 'cleanup' we remove the -dependants before their dependencies. - -If, for some reason, the file descriptor +lfd+ became invalid during the test, -but +fd+ was still open, we do not want +SAFE_CLOSE(lfd)+ to cause the -+cleanup+ function to exit prematurely. If it did, then +fd+ would remain open -which would cause problems on some file systems. - -Nor do we want to call +cleanup+ recursively. So during 'cleanup' +tst_brk+, -and consequently the +SAFE+ functions, do not cause the test to exit with -+TBROK+. Instead they just print an error message with +TWARN+. - -It is not entirely necessary to check if the file descriptors have a none zero -value before attempting to close them. However it avoids a bunch of spurious -warning messages if we fail to open +file_to_stat+. Test case failures can be -difficult to interpret at the best of times, so avoid filling the log with -noise. - -5.1 Check statx returns the correct number of hard links -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The field +statx.stx_nlink+ should be equal to 2, right? - -5.2 Git-branch -~~~~~~~~~~~~~~ - -We are about to make some organisational changes to the test, so now would be -a good time to branch. Then we can switch between the old and new versions, to -check the behavior has not been changed by accident. - -6. Split the test ------------------ - -In our current test, we have essentially rolled two different test cases into -one. Firstly we check if an error is returned when bad arguments are provided -and secondly we check what happens when we stat an actual file. Quite often it -makes sense to call +tst_res+ multiple times in a single test case because we -are checking different properties of the same result, but here we are clearly -testing two different scenarios. - -So we should split the test in two. One obvious way to do this is to create -+statx02.c+, but that seems like overkill in order to separate two simple test -cases. So, for now at least, we are going to do it a different way. - -[source,c] --------------------------------------------------------------------------------- -... - -static void run_stat_null(void) -{ - struct statx statxbuf = { 0 }; - - TEST(sys_statx(0, NULL, 0, 0, &statxbuf)); - if (TST_RET == 0) - tst_res(TFAIL, "statx thinks it can stat NULL"); - else if (TST_ERR == EFAULT) - tst_res(TPASS, "statx set errno to EFAULT as expected"); - else - tst_res(TFAIL | TERRNO, "statx set errno to some unexpected value"); -} - -static void run_stat_symlink(void) -{ - struct statx statxbuf = { 0 }; - - TEST(sys_statx(AT_FDCWD, LNAME, 0, STATX_BASIC_STATS, &statxbuf)); - if (TST_RET == 0) - tst_res(TPASS, "It returned zero so it must have worked!"); - else - tst_res(TFAIL | TERRNO, "statx can not stat a basic file"); -} - -static void run(unsigned int i) -{ - switch(i) { - case 0: run_stat_null(); - case 1: run_stat_symlink(); - } -} - -static struct tst_test test = { - .setup = setup, - .cleanup = cleanup, - .test = run, - .tcnt = 2, - .min_kver = "4.11", - .needs_tmpdir = 1 -}; --------------------------------------------------------------------------------- - -So we have used an alternative form of the +test+ or +run+ callback which -accepts an index. Some tests use this index with an array of parameters and -expected return values. Others do something similar to the above. The index -can be used how you want so long as each iteration calls +tst_res+ in a -meaningful way. - -If an iteration fails to return a result (i.e. call +tst_res+ with a value -other than +TINFO+) then the test harness will report +TBROK+ and print the -iteration which failed. This prevents a scenario in your test from silently -failing due to some faulty logic. - -6.1 What is wrong with the switch statement? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Were you paying attention? Also see the output of +make check+. - -6.2 Test a feature unique to statx -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -So far we have not tested anything which is unique to +statx+. So, for -example, you could check stx_btime is correct (possibly only to within a -margin of error) and that it differs from +stx_mtime+ after writing to the -file. - -Alternatively you could check that +stx_dev_major+ and +stx_dev_minor+ are set -correctly. Note that the LTP has helper functions for creating devices and -file systems (see -https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#2214-testing-with-a-block-device[section -2.2.14] of the Test Writing Guidelines). - -This could be quite a challenging exercise. You may wish to tackle an -altogether different test scenario instead. If you get stuck just move onto -the next section and come back later. - -7. Submitting the test for review ---------------------------------- - -Ignoring the fact we should probably create +lapi/stat.h+ along with a bunch -of fallback logic in the build system. We can now get our test ready for -submission. - -The first thing you need to do before considering submitting your test is run -+make check-statx01+ or + make check+ in the test's directory. Again, we use -the kernel style guidelines where possible. Next you should create a new -branch, this will allow you to reshape your commit history without fear. - -After that we have the pleasure of doing an interactive 'rebase' to clean up -our commit history. In its current form the test only really needs a single -commit, but if you have been using Git correctly then you should have -many. The main reason we want to compress it to a single commit, is to make -the LTP's Git-log readable. It also allows us to write a coherent description -of the work as a whole in retrospective. Although, when adding a new test, the -test description in the code will probably make the commit message redundant. - -Anyway, as an example, we shall look at my personal commit history from this -tutorial and 'rebase' it. You should try following along with your own -repository. First lets look at the commit history since we branched from -master. - -[source,shell] --------------------------------------------------------------------------------- -$ git log -oneline master..HEAD -152d39fe7 (HEAD -> tutorial-rebase2, tutorial-rebase) tutorial: Start Submitting patch section -70f7ce7ce statx01: Stop checkpatch from complaining -bb0332bd7 tutorial: Fix review problems -6a87a084a statx01: Fix review problems -d784b1e85 test-writing-guidelines: Remove old API argument -c26e1be7a fixup! tutorial -1e24a5fb5 (me/tutorial-rebase) fixup! tutorial -568a3f7be fixup! tutorial -09dd2c829 statx: stage 6 -bfeef7902 statx: stage 5b -76e03d714 statx: stage 5a -98f5bc7ac statx: stage 4 -6f8c16438 statx: stage 3 (Add statx01) -5d93b84d8 Add statx and other syscall numbers -5ca627b78 tutorial: Add a step-by-step C test tutorial --------------------------------------------------------------------------------- - -So we have told git to show all the commits which don't exist in 'master', but -are in +HEAD+, where +HEAD+ is the top of the current branch. The current -branch is +tutorial-rebase2+ which I just created. I have already done one -'rebase' and submitted a patch for review, so my original branch was just called -+tutorial+. - -As usual my commit history is starting to look like a bit of mess! There is -even a commit in there which should not be in the this branch (Remove old API -argument), however it can be ignored for now and 'cherry picked' into a new branch -later. - -For my patch I actually need at least two commits, one which contains the -tutorial text and one which contains the test and associated files. So first -of all I want to 'squash' (amalgamate) all the commits appended with -+tutorial:+ into the bottom commit. - -[source,shell] --------------------------------------------------------------------------------- -$ git rebase -i 5ca627b78\^ -... --------------------------------------------------------------------------------- - -This begins an interactive 'rebase' where commit 5ca6427b78 is the earliest -commit we want to edit. The +^+ symbol after the commit hash, specifies the -commit before this one. The interactive 'rebase' command takes the last commit -we want to keep unaltered as it's argument (in other words it takes a -non-inclusive range). - -Upon entering a similar command you will be presented with a text file -similar to the following. The file should be displayed in your text editor of -choice, if it doesn't, then you may change the editor variable in +.gitconfig+ -which was shown in section 3. - -[source,rebase] --------------------------------------------------------------------------------- -pick 5ca627b78 tutorial: Add a step-by-step C test tutorial -pick 5d93b84d8 Add statx and other syscall numbers -pick 6f8c16438 statx: stage 3 (Add statx01) -pick 98f5bc7ac statx: stage 4 -pick 76e03d714 statx: stage 5a -pick bfeef7902 statx: stage 5b -pick 09dd2c829 statx: stage 6 -pick 568a3f7be fixup! tutorial -pick 1e24a5fb5 fixup! tutorial -pick c26e1be7a fixup! tutorial -pick d784b1e85 test-writing-guidelines: Remove old API argument -pick 6a87a084a statx01: Fix review problems -pick bb0332bd7 tutorial: Fix review problems -pick 70f7ce7ce statx01: Stop checkpatch from complaining -pick 152d39fe7 tutorial: Start Submitting patch section --------------------------------------------------------------------------------- - -The last commit from Git-log is shown at the top. The left hand column -contains the commands we want to run on each commit. +pick+ just means we -re-apply the commit as-is. We can reorder the lines to apply the commits in a -different order, but we need to be careful when reordering commits to the same -file. If your 'rebase' results in a merge conflict, then you have probably -reordered some commits which contained changes to the same piece of code. - -Perhaps a better name for the interactive 'rebase' command would be 'replay'. As -we pick a point in the commit history, undo all those commits before that -point, then reapply them one at a time. During the replay we can reorder the -commits, drop, merge, split and edit them, creating a new history. - -The commands I am going to use are +reword+ and +fixup+. The +reword+ command -allows you to edit a single commit's message. The 'fixup' command 'squashes' a -commit into the commit above/preceding it, merging the two commits into -one. The commit which has +fixup+ applied has its commit message deleted. If -you think a commit might have something useful in its message then you can use -+squash+ instead. - -[source,rebase] --------------------------------------------------------------------------------- -reword 5ca627b78 tutorial: Add a step-by-step C test tutorial -fixup 568a3f7be fixup! tutorial -fixup 1e24a5fb5 fixup! tutorial -fixup c26e1be7a fixup! tutorial -fixup bb0332bd7 tutorial: Fix review problems -fixup 152d39fe7 tutorial: Start Submitting patch section -fixup 276edecab tutorial: Save changes before rebase -pick 5d93b84d8 Add statx and other syscall numbers -pick 6f8c16438 statx: stage 3 (Add statx01) -pick 98f5bc7ac statx: stage 4 -pick 76e03d714 statx: stage 5a -pick bfeef7902 statx: stage 5b -pick 09dd2c829 statx: stage 6 -pick d784b1e85 test-writing-guidelines: Remove old API argument -pick 6a87a084a statx01: Fix review problems --------------------------------------------------------------------------------- - -So all the commits marked with +fixup+ will be re-played by Git immediately -after 5ca62 at the top. A new commit will then be created with the amalgamated -changes of all the commits and 5ca62's log message. It turns out that I didn't -need to reword anything, but there is no harm in checking. It is easy to -forget the +Signed-off-by:+ line. - -I could now do the same for the commits to the +statx+ test, making the commit -message prefixes consistent. However I am not actually going to submit the -test (yet). - -I won't attempt to show you this, but if you need to do the opposite and split -apart a commit. It is also possible using Git-rebase by marking a line with -+edit+. This will pause Git just after replaying the marked commit. You can -then use a 'soft' Git-reset to bring the selected commit's changes back into -the 'index' where you are then able to un-stage some parts before -re-committing. - -You can also use +edit+ and +git commit --amend+ together to change a commit -deep in your history, but without reseting the 'index'. The 'index' contains -changes which you have staged with +git add+, 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 -preferred place to make submissions and is more difficult for most people, so -I will only cover that method. - -Just before we create the patch, we need to check that our changes will still -apply to the master branch without problems. To do this we can use another -type of 'rebase' and then try rebuilding and running the test. - -[source,shell] --------------------------------------------------------------------------------- -$ git checkout master -$ git pull origin -$ git checkout tutorial-rebase2 -$ git rebase master --------------------------------------------------------------------------------- - -Above, I update the master branch and then replay our changes onto it using -+git rebase master+. You may find that after the rebase there is a merge -conflict. This will result in something which looks like the following (taken -from a Makefile conflict which was caused by reordering commits in a 'rebase'). - -[source,diff] --------------------------------------------------------------------------------- -<<<<<<< HEAD -cve-2016-7117: LDFLAGS += -lpthread -======= -cve-2014-0196: LDFLAGS += -lpthread -lutil -lrt -cve-2016-7117: LDFLAGS += -lpthread -lrt ->>>>>>> 4dbfb8e79... Add -lrt --------------------------------------------------------------------------------- - -The first line tells us this is the beginning of a conflict. The third line -separates the two conflicting pieces of content and the last line is the end -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 format-patch+, we can then send -that e-mail using +git send-email+. It is also possible to import the patch -(+mbox+) file into a number of e-mail programs. - -[source,shell] --------------------------------------------------------------------------------- -$ git format-patch -1 -v 2 -o output --to ltp@lists.linux.it fd3cc8596 -output/v2-0001-tutorial-Add-a-step-by-step-C-test-tutorial.patch --------------------------------------------------------------------------------- - -The first argument +-1+ specifies we want one commit from fd3cc8596 -onwards. If we wanted this commit and the one after it we could specify +-2+ -instead. - -This is my second patch submission so I have used +-v 2+, which indicates this -is the second version of a patch set. The +-o+ option specifies the output -directory (literally called +output+). The +--to+ option adds the +To:+ e-mail -header, which I have set to the LTP mailing list. - -We can then send this patch with the following command sans +--dry-run+. - -[source,shell] --------------------------------------------------------------------------------- -$ git send-email --dry-run output/v2-0001-tutorial-Add-a-step-by-step-C-test-tutorial.patch --------------------------------------------------------------------------------- - -Git will ask some questions (which you an ignore) and then tell you what it -would do if this weren't a dry-run. In order for this to work you have to have -a valid SMTP server set in +.gitconfig+ and also be signed up to the LTP -mailing list under the same e-mail address you have configured in Git. You can -sign up at https://lists.linux.it/listinfo/ltp. - -8. Doing code review --------------------- - -While waiting for your test to be reviewed, you are invited and encouraged to -review other contributors' code. This may seem bizarre when you are completely -new to the project, but there are two important ways in which you can -contribute here: - -A. Point out logical errors in the code. -B. Improve your own understanding - -It doesn't matter whether you know the canonical way of writing an LTP test in -C. An error of logic, when properly explained, is usually indisputable. These -are the most important errors to find as they always result in false test -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 am+. 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 -the project and for you. - -Style and organisational issues are best left to after you have found logical -errors. - -9. Final notes --------------- - -Hopefully you can now grasp the structure of an LTP test and have some idea of -what is available in the LTP test library. There are a vast number of library -functions available (mainly located in include and lib), some of which are -documented in the test writing guidelines and many of which are not. - -We have only scratched the surface of the immense technical complexity of -systems programming across multiple Kernel and C lib versions as well as -different hardware architectures. The important thing to take away from this -is that you have to be conscientious of what will happen on systems different -from yours. The LTP has a huge and varied user base, so situations you may -thing are unlikely can and do happen to somebody. - -Of course you don't want to spend time allowing for situations which may never -arise either, so you have to do your research and think about each situation -critically. The more systems you can test on before submitting your changes, -the better, although we understand not everyone has access to a lab. - -One important topic which has not been covered by this tutorial, is -multi-process or multi-threaded testing. The LTP library functions work inside -child processes and threads, but their semantics change slightly. There are -also various helper functions for synchronising and forking processes. For -more information see -https://github.com/linux-test-project/ltp/wiki/C-Test-API[C Test API], -in particular sections -https://github.com/linux-test-project/ltp/wiki/C-Test-API#17-fork-ing[1.7 Fork()-ing] to -https://github.com/linux-test-project/ltp/wiki/C-Test-API#110-signals-and-signal-handlers[1.10 Signals and signal handlers] and -https://github.com/linux-test-project/ltp/wiki/C-Test-API#114-thread-safety-in-the-ltp-library[1.14 Thread-safety in the LTP library]. - -When it comes time to submit a test, the preferred way to do it is on the -mailing list although you can also use GitHub. The LTP follows similar rules -to the kernel for formatting and submitting patches. Generally speaking the -review cycle is easier for small patches, so try to make small changes or -additions where possible. diff --git a/doc/library-api-writing-guidelines.txt b/doc/library-api-writing-guidelines.txt deleted file mode 100755 index c8205368..00000000 --- a/doc/library-api-writing-guidelines.txt +++ /dev/null @@ -1,59 +0,0 @@ -LTP Library API Writing Guidelines -================================== - -NOTE: See also - https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines[Test Writing Guidelines], - https://github.com/linux-test-project/ltp/wiki/C-Test-API[C Test API], - https://github.com/linux-test-project/ltp/wiki/Shell-Test-API[Shell Test API]. - -1. General Rules ----------------- - -For extending library API it applies the same general rules as for writing tests, -(see https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines[Test Writing Guidelines], -offline: 'doc/test-writing-guidelines.txt'), -with strong focus on readability and simplicity. - -Library tests are in 'lib/newlib_tests' directory. - -Don't forget to update docs when you change the API. - -2. C API --------- - -2.1 LTP-001: Sources have tst_ prefix -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -API source code is in headers `include/*.h`, `include/lapi/*.h` (backward -compatibility for old kernel and libc) and C sources in `lib/*.c`. Files have -'tst_' prefix. - -2.2 LTP-002: TST_RET and TST_ERR are not modified -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The test author is guaranteed that the test API will not modify these -variables. This prevents silent errors where the return value and -errno are overwritten before the test has chance to check them. - -The macros which are clearly intended to update these variables. That -is +TEST+ and those in 'tst_test_macros.h'. Are of course allowed to -update these variables. - -2.3 LTP-003: Externally visible library symbols have the tst_ prefix -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Functions, types and variables in the public test API should have the -tst_ prefix. With some exceptions for symbols already prefixed with -safe_ or ltp_. - -Static (private) symbols should not have the prefix. - - -3. Shell API ------------- - -API source code is in `tst_test.sh`, `tst_security.sh` and `tst_net.sh` -(all in 'testcases/lib' directory). - -Changes in the shell API should not introduce uncommon dependencies -(use basic commands installed everywhere by default). diff --git a/doc/maintainer-patch-review-checklist.txt b/doc/maintainer-patch-review-checklist.txt deleted file mode 100755 index 4e10dc51..00000000 --- a/doc/maintainer-patch-review-checklist.txt +++ /dev/null @@ -1,59 +0,0 @@ -# Maintainer Patch Review Checklist - -Patchset should be tested locally and ideally also in maintainer's fork in -GitHub Actions on GitHub. - -NOTE: Travis does only build testing, passing the CI means only that the - test compiles fine on variety of different distributions and - releases. - -The test should be executed at least once locally and should PASS as well. - -Commit messages should have - -* Author's `Signed-off-by` tag -* Committer's `Reviewed-by` or `Signed-off-by` tag -* Check also mailing lists for other reviewers / testers tags, notes and failure reports -* `Fixes: hash` if it fixes particular LTP commit -* `Fixes: #N` if it fixes github issue number N, so it's automatically closed - -After patch is accepted or rejected, set correct state and archive in -https://patchwork.ozlabs.org/project/ltp/list/[LTP patchwork instance]. - -Also update `.github/workflows/wiki-mirror.yml` script which mirrors -`doc/*.txt` to LTP wiki (git URL https://github.com/linux-test-project/ltp.wiki.git) -if new wiki page is added. - -## New tests -New test should - -* Have a record in runtest file -* Test should work fine with more than one iteration - (e.g. run with `-i 100`) -* Have a brief description -* License: the default license for new tests is GPL v2 or later, use - GPL-2.0-or-later; the licence for test (e.g. GPL-2.0) should not change - unless test is completely rewritten -* Old copyrights should be kept unless test is completely rewritten - -### C tests -* Use new https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#22-writing-a-test-in-c[C API] -* Test binaries are added into corresponding '.gitignore' files -* Check coding style with `make check` - (more in https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#21-c-coding-style[C coding style]) -* Docparse documentation -* If a test is a regression test it should include tags - (more in https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#2238-test-tags[Test tags]) -* When rewriting old tests, https://en.wikipedia.org/wiki/%CE%9CClinux[uClinux] - support should be removed (project has been discontinued). - E.g. remove `#ifdef UCLINUX`, replace `FORK_OR_VFORK()` with simple `fork()` or `SAFE_FORK()`. - -### Shell tests -* Use new https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#23-writing-a-testcase-in-shell[shell API] -* Check coding style with `make check` - (more in https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#132-shell-coding-style[Shell coding style]) -* If a test is a regression test it should include related kernel or glibc commits as a comment - -## LTP library -For patchset touching library please check also -https://github.com/linux-test-project/ltp/wiki/LTP-Library-API-Writing-Guidelines[LTP Library API Writing Guidelines]. diff --git a/doc/mini-howto-building-ltp-from-git.txt b/doc/mini-howto-building-ltp-from-git.txt deleted file mode 100755 index 28825c20..00000000 --- a/doc/mini-howto-building-ltp-from-git.txt +++ /dev/null @@ -1,62 +0,0 @@ -Mini-Howto: Building LTP from Git -================================= - -****************************************************************************** -The following document briefly describes the single steps to build LTP from -the Git repository located at GitHub. -The instructions here were tested on a Ubuntu/precise Linux system (feel free -to adapt to your distribution). - -Changelog: - * Initial version: Sedat Dilek - * Embedded comments from Cyril Hrubis -****************************************************************************** - -# Export language settings - -export LANG=C -export LC_ALL=C - -# Set some useful variables (adapt if you dislike) - -WORKING_DIR="$HOME/src/ltp" - -PREFIX="/opt/ltp" - -GIT_URL="https://github.com/linux-test-project/ltp.git" - -MAKE_JOBS=$(getconf _NPROCESSORS_ONLN) - -BUILD_LOG_FILE="build-log.txt" -INSTALL_LOG_FILE="install-log.txt" - -# PREREQS on Ubuntu (package-list is incomplete and may vary for other distros) - -sudo apt-get install build-essential -sudo apt-get install autoconf automake autotools-dev m4 -sudo apt-get install git -sudo apt-get install linux-headers-$(uname -r) -sudo apt-get install libaio-dev libattr1-dev libcap-dev - -# Working directory - -mkdir -p $WORKING_DIR -cd $WORKING_DIR - -# Get the LTP source - -git clone $GIT_URL ltp-git - -# Configure LTP - -cd ltp-git/ -make autotools -./configure --prefix=$PREFIX - -# Start building LTP - -make -j$MAKE_JOBS 2>&1 | tee ../$BUILD_LOG_FILE - -# Install LTP (requires superuser privileges) - -sudo make install 2>&1 | tee ../$INSTALL_LOG_FILE diff --git a/doc/network-c-api.txt b/doc/network-c-api.txt deleted file mode 100755 index e910d159..00000000 --- a/doc/network-c-api.txt +++ /dev/null @@ -1,476 +0,0 @@ -LTP C Test Network API -====================== - -NOTE: See also - https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines[Test Writing Guidelines], - https://github.com/linux-test-project/ltp/wiki/C-Test-Case-Tutorial[C Test Case Tutorial], - https://github.com/linux-test-project/ltp/wiki/C-Test-API[C Test API], - https://github.com/linux-test-project/ltp/wiki/Shell-Test-API[Shell Test API]. - -LTP library includes helper functions for configuring sockets and setting up -network devices. - -1 Configuring sockets ---------------------- - -1.1 Safe syscall variants -~~~~~~~~~~~~~~~~~~~~~~~~~ - -+#include "tst_safe_net.h"+ - -Most common standard syscalls and libc functions for configuring sockets have a -"safe" variant in LTP library which will call +tst_brk()+ if the underlying -system function fails. See -https://github.com/linux-test-project/ltp/wiki/C-Test-API[C Test API]. The -safe function names are in uppercase with the +SAFE_+ prefix (e.g. the safe -variant of +socket()+ is called +SAFE_SOCKET()+). For most safe functions, the -parameters and return type are identical to the standard system function: - -- +SAFE_SOCKET()+ -- +SAFE_SOCKETPAIR()+ -- +SAFE_GETSOCKOPT()+ -- +SAFE_SETSOCKOPT()+ -- +SAFE_BIND()+ -- +SAFE_LISTEN()+ -- +SAFE_ACCEPT()+ -- +SAFE_CONNECT()+ -- +SAFE_GETSOCKNAME()+ -- +SAFE_GETHOSTNAME()+ -- +SAFE_GETADDRINFO()+ - -A few safe functions have extra parameters for quick return value validation. -The ellipsis (+...+) represents the standard parameters of the underlying system -function: - -* +SAFE_SEND(char strict, ...)+ -* +SAFE_SENDTO(char strict, ...)+ -** If +strict+ is non-zero, the return value must be equal to the data length - argument. Otherwise the test will fail and exit. - -* +SAFE_SENDMSG(size_t msg_len, ...)+ -* +SAFE_RECV(size_t msg_len, ...)+ -* +SAFE_RECVMSG(size_t msg_len, ...)+ -** If +msg_len+ is non-zero, the return value must be equal to the +msg_len+ - argument. Otherwise the test will fail and exit. - -There are also some custom functions for simpler configuration and queries: - -- +int SAFE_SETSOCKOPT_INT(int sockfd, int level, int optname, int value)+ – - Simple setsockopt() variant for passing integers by value. - -- +int TST_GETSOCKPORT(int sockfd)+ – Get port number (in host byte order) of a - bound socket. - -- +unsigned short TST_GET_UNUSED_PORT(int family, int type)+ – Get a random - port number (in network byte order) which is currently closed for the given - socket family and type. Note that another application may open the port while - the test is still running. The test user is responsible for setting up test - environment without such interference. - -1.2 Address conversion functions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -+#include "tst_net.h"+ - -LTP library also provides helper functions for quick initialization of socket -address structures: - -- +void tst_get_in_addr(const char *ip_str, struct in_addr *ip)+ – Convert - human-readable IPv4 address string +ip_str+ to binary representation in - network byte order. The converted value will be stored in the second argument. - -- +void tst_get_in6_addr(const char *ip_str, struct in6_addr *ip6)+ – Convert - human-readable IPv6 address string +ip_str+ to binary representation in - network byte order. The converted value will be stored in the second argument. - -- +socklen_t tst_get_connect_address(int sock, struct sockaddr_storage *addr)+ – - Find the address which can be used to send data to bound socket +sock+ from - another socket. The address will be stored in the second argument. This - function automatically converts wildcard bind address to localhost. Returns - size of the address in bytes. - -- +void tst_init_sockaddr_inet(struct sockaddr_in *sa, const char *ip_str, - uint16_t port)+ – Initialize socket address structure +sa+ using - human-readable IPv4 address +ip_str+ and port number +port+ in host byte - order. - -- +void tst_init_sockaddr_inet_bin(struct sockaddr_in *sa, uint32_t ip_val, - uint16_t port)+ – Initialize socket address structure +sa+ using binary IPv4 - address +ip_val+ and port number +port+, both in host byte order. - -- +void tst_init_sockaddr_inet6(struct sockaddr_in6 *sa, const char *ip_str, - uint16_t port)+ – Initialize socket address structure +sa+ using - human-readable IPv6 address +ip_str+ and port number +port+ in host byte - order. - -- +void tst_init_sockaddr_inet6_bin(struct sockaddr_in6 *sa, const struct - in6_addr *ip_val, uint16_t port)+ – Initialize socket address structure +sa+ - using binary IPv6 address +ip_val+ and port number +port+, both in host byte - order. - -.Example Usage -[source,c] -------------------------------------------------------------------------------- - -#include -#include - -#include "tst_test.h" -#include "tst_safe_net.h" -#include "tst_net.h" - -static int sockfd = -1; - -static void setup(void) -{ - struct sockaddr_in addr; - - tst_init_sockaddr_inet_bin(&addr, INADDR_ANY, 0); - sockfd = SAFE_SOCKET(AF_INET, SOCK_STREAM, 0); - SAFE_SETSOCKOPT_INT(sockfd, SOL_SOCKET, SO_SNDBUF, 4096); - SAFE_BIND(sockfd, (struct sockaddr *)&addr, sizeof(addr)); - SAFE_LISTEN(sockfd, 8); -} - -------------------------------------------------------------------------------- - -2 Configuring network devices ------------------------------ - -+#include "tst_netdevice.h"+ - -When opening a localhost socket isn't enough and the test needs special device -or routing configuration, the netdevice library can create the required network -setup without calling external programs. Internally, the netdevice functions -use a rtnetlink socket to communicate with the kernel. - -All of these functions will call +tst_brk()+ on failure, unless stated -otherwise. Error values described below are returned only during test cleanup -stage. - -2.1 Network device management -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- +int NETDEV_INDEX_BY_NAME(const char *ifname)+ – Returns the device index for - the given device name, or -1 on error. - -- +int NETDEV_SET_STATE(const char *ifname, int up)+ – Enable or disable a - network device +ifname+. Returns 0 on success, -1 on error. - -- +int CREATE_VETH_PAIR(const char *ifname1, const char *ifname2)+ – Creates a - connected pair of virtual network devices with given device names. Returns 1 - on success, 0 on error. Add +"CONFIG_VETH"+ to +test.needs_kconfigs+ if your - test calls this function. - -- +int NETDEV_ADD_DEVICE(const char *ifname, const char *devtype)+ - Creates - a new network device named +ifname+ of specified device type. Returns 1 on - success, 0 on error. - -- +int NETDEV_REMOVE_DEVICE(const char *ifname)+ – Removes network device - +ifname+. Returns 1 on success, 0 on error. - -2.2 Network address management -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- +int NETDEV_ADD_ADDRESS(const char \*ifname, unsigned int family, const void - *address, unsigned int prefix, size_t addrlen, unsigned int flags)+ – Adds - new address to network device +ifname+. This is a low-level function which - allows setting any type of address. You must specify the protocol +family+, - address length in bytes (+addrlen+) and network prefix length (+prefix+). The - +address+ itself must be in binary representation in network byte order. You - can also pass rtnetlink flags from the +IFA_F_*+ group. Returns 1 on success, - 0 on error. - -- +int NETDEV_ADD_ADDRESS_INET(const char *ifname, in_addr_t address, unsigned - int prefix, unsigned int flags)+ – Adds new IPv4 address to network device - +ifname+. Parameters have the same meaning as in +NETDEV_ADD_ADDRESS()+. - Returns 1 on success, 0 on error. - -- +int NETDEV_REMOVE_ADDRESS(const char *ifname, unsigned int family, const - void *address, size_t addrlen)+ – Removes the specified address from network - device +ifname+. Parameters have the same meaning as in - +NETDEV_ADD_ADDRESS()+. Returns 1 on success, 0 on error. - -- +int NETDEV_REMOVE_ADDRESS_INET(const char *ifname, in_addr_t address)+ – - Removes specified IPv4 +address+ (in network byte order) from network device - +ifname+. Returns 1 on success, 0 on error. - -2.3 Network namespace device assignment -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -WARNING: Moving a network device to another namespace will erase previous - configuration. Move the device to the correct namespace first, then - configure it. - -- +int NETDEV_CHANGE_NS_FD(const char *ifname, int nsfd)+ – Moves network - device +ifname+ to network namespace designated by open file descriptor - +nsfd+. Returns 1 on success, 0 on error. - -- +int NETDEV_CHANGE_NS_PID(const char *ifname, pid_t nspid)+ – Moves network - device +ifname+ to the network namespace currently used by process +nspid+. - Returns 1 on success, 0 on error. - -2.4 Routing table management -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- +int NETDEV_ADD_ROUTE(const char *ifname, unsigned int family, const void - *srcaddr, unsigned int srcprefix, size_t srclen, const void *dstaddr, - unsigned int dstprefix, size_t dstlen, const void *gateway, size_t - gatewaylen)+ – Adds new route to the main routing table. This is a low-level - function which allows creating routes for any protocol. You must specify the - protocol +family+ and either network device name +ifname+ or +gateway+ - address. Both packet source address +srcaddr+ and destination address - +dstaddr+ are optional. You must also specify the corresponding length - and prefix argument for any address which is not +NULL+. All addresses must - be in binary representation in network byte order. Returns 1 on success, - 0 on error. - -- +int NETDEV_ADD_ROUTE_INET(const char *ifname, in_addr_t srcaddr, unsigned - int srcprefix, in_addr_t dstaddr, unsigned int dstprefix, in_addr_t - gateway)+ – Adds new IPv4 route to the main routing table. Parameters have - the same meaning as in +NETDEV_ADD_ROUTE()+. If you do not want to set - explicit +gateway+ address, set it to 0. If the routing rule should ignore - the source or destination address, set the corresponding prefix argument - to 0. Returns 1 on success, 0 on error. - -- +int NETDEV_REMOVE_ROUTE(const char *ifname, unsigned int family, const void - *srcaddr, unsigned int srcprefix, size_t srclen, const void *dstaddr, - unsigned int dstprefix, size_t dstlen, const void *gateway, size_t - gatewaylen)+ – Removes a route from the main routing table. Parameters have - the same meaning as in +NETDEV_ADD_ROUTE()+. Returns 1 on success, 0 on - error. - -- +int NETDEV_REMOVE_ROUTE_INET(const char *ifname, in_addr_t srcaddr, - unsigned int srcprefix, in_addr_t dstaddr, unsigned int dstprefix, in_addr_t - gateway)+ – Removes IPv4 route from the main routing table. Parameters have - the same meaning as in +NETDEV_ADD_ROUTE_INET()+. Returns 1 on success, - 0 on error. - -.Example Usage -[source,c] -------------------------------------------------------------------------------- -#include -#include -#include "tst_test.h" -#include "tst_netdevice.h" - -... - -static void setup(void) -{ - CREATE_VETH_PAIR("ltp_veth1", "ltp_veth2"); - NETDEV_ADD_ADDRESS_INET("ltp_veth2", htonl(DSTADDR), NETMASK, - IFA_F_NOPREFIXROUTE); - NETDEV_SET_STATE("ltp_veth2", 1); - NETDEV_ADD_ROUTE_INET("ltp_veth2", 0, 0, htonl(SRCNET), NETMASK, 0); - - NETDEV_ADD_ADDRESS_INET("ltp_veth1", htonl(SRCADDR), NETMASK, - IFA_F_NOPREFIXROUTE); - NETDEV_SET_STATE("ltp_veth1", 1); - NETDEV_ADD_ROUTE_INET("ltp_veth1", 0, 0, htonl(DSTNET), NETMASK, 0); - ... -} -------------------------------------------------------------------------------- - -3 rtnetlink API ---------------- - -+#include "tst_rtnetlink.h"+ - -The rtnetlink library provides helper functions for constructing and sending -arbitrary messages and parsing kernel responses. - -All of the functions below will call +tst_brk()+ on failure, unless stated -otherwise. Error values described below are returned only during test cleanup -stage. - -3.1 Data structures -~~~~~~~~~~~~~~~~~~~ - -[source,c] -------------------------------------------------------------------------------- -struct tst_rtnl_context; - -struct tst_rtnl_attr_list { - unsigned short type; - const void *data; - ssize_t len; - const struct tst_rtnl_attr_list *sublist; -}; - -struct tst_rtnl_message { - struct nlmsghdr *header; - struct nlmsgerr *err; - void *payload; - size_t payload_size; -}; -------------------------------------------------------------------------------- - -+struct tst_rtnl_context+ is an opaque rtnetlink socket with buffer for -constructing and sending arbitrary messages using the functions described -below. Create a new context using +RTNL_CREATE_CONTEXT()+, then free it using -+RTNL_DESTROY_CONTEXT()+ when you're done with it. - -+struct tst_rtnl_attr_list+ is a helper structure for defining complex -rtnetlink message attribute payloads, including nested attribute lists. Every -list and sublist defined using this structure is terminated by item with -negative +len+. - -- +type+ is the attribute type that will be stored in +struct rtattr.rta_type+. - -- +data+ contains arbitrary attribute payload. - -- +len+ contains length of the +data+ attribute in bytes. If +data+ is +NULL+, - set +len+ to 0. The last item in a list or sublist must have negative length. - -- +sublist+ contains a nested attribute list which will be appended after - +data+ as part of the attribute payload. +struct rtattr.rta_len+ will be - calculated automatically with proper alignment, do _not_ add the sublist size - to the +len+ field. If you do not want to add nested attributes, set - +sublist+ to +NULL+. - -+struct tst_rtnl_message+ is a structure holding partially parsed rtnetlink -messages received from the kernel. +RTNL_RECV()+ returns an array of these -structures with the last item having +NULL+ in the +header+ field. Call -+RTNL_FREE_MESSAGE()+ to free a message list returned by +RTNL_RECV()+. - -- +header+ is the netlink header structure of the message. +NULL+ in the header - field terminates a list of messages. - -- +err+ points to the payload of +NLMSG_ERROR+ messages. It is set to +NULL+ - for all other message types. - -- +payload+ is a pointer to message data. - -- +payload_size+ is the length of +payload+ data in bytes. - -3.2 Sending and receiving messages -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- +struct tst_rtnl_context *RTNL_CREATE_CONTEXT(void)+ – Creates a new - rtnetlink communication context for use with the functions described below. - Returns +NULL+ on error. - -- +void RTNL_FREE_MESSAGE(struct tst_rtnl_message *msg)+ – Frees an array of - messages returned by +RTNL_RECV()+. - -- +void RTNL_DESTROY_CONTEXT(struct tst_rtnl_context *ctx)+ – Closes a - communication context created by +RTNL_CREATE_CONTEXT()+. - -- +int RTNL_SEND(struct tst_rtnl_context *ctx)+ – Sends all messages waiting - in +ctx+ buffer to the kernel. If there are multiple messages to send, a new - +NLMSG_DONE+ message will be added automatically. Returns the number of - bytes sent on success. Return 0 or negative value on error. - -- +int RTNL_SEND_VALIDATE(struct tst_rtnl_context *ctx)+ – Sends all messages - just like +RTNL_SEND()+, then receives the response from the kernel and - validates results of requests sent with the +NLM_F_ACK+ flag. This function - calls +tst_brk()+ as usual if communication fails but it will return error - status without terminating the test if one of the received messages contains - error code. See +RTNL_CHECK_ACKS()+ below for explanation of the return - value. - -- +int RTNL_WAIT(struct tst_rtnl_context *ctx)+ – Waits until data becomes - available to read from the rtnetlink socket (timeout: 1 second). Returns 1 - if there is data to read, 0 on timeout or -1 on error. - -- +struct tst_rtnl_message *RTNL_RECV(struct tst_rtnl_context *ctx)+ – Receives - rtnetlink messages from the kernel. The messages are received in non-blocking - mode so calling +RTNL_WAIT()+ first is recommended. Returns an array of - partially parsed messages terminated by an item with +NULL+ in the +header+ - field. On error or when there are no messages to receive, returns +NULL+. - Call +RTNL_FREE_MESSAGE()+ to free the returned data. - -- +int RTNL_CHECK_ACKS(struct tst_rtnl_context *ctx, struct tst_rtnl_message - *response)+ – Validate results of requests sent with the +NLM_F_ACK+ flag. - Do not call +RTNL_ADD_MESSAGE()+ between +RTNL_SEND()+ and - +RTNL_CHECK_ACKS()+ because it will reset the state of +ctx+ and prevent - result validation. Returns 1 if all messages sent with the +NLM_F_ACK+ flag - have a corresponding message in +response+ and the error code is 0. If any - of the expected response messages is missing, this function will call - +tst_brk()+ (or return 0 during test cleanup phase). If any of the response - messages has non-zero error code, this function will return 0 and store the - first non-zero error code in global variable +tst_rtnl_errno+ (sign-flipped - just like regular libc +errno+). - -3.3 Creating messages -~~~~~~~~~~~~~~~~~~~~~ - -- +int RTNL_ADD_MESSAGE(struct tst_rtnl_context *ctx, const struct nlmsghdr - *header, const void *payload, size_t payload_size)+ – Adds new rtnetlink - message to +ctx+ buffer. You need to provide message +header+ and optional - +payload+. +payload_size+ is the size of +payload+ data in bytes. If you - don't want to add any payload data, set +payload+ to +NULL+ and - +payload_size+ to 0. This function will automatically fill the +nlmsg_len+, - +nlmsg_seq+ and +nlmsg_pid+ fields of the new message header. You don't need - to set those. It'll also automatically add +NLM_F_MULTI+ flag when needed. - Returns 1 on success, 0 on error. Note that the first call of - +RTNL_ADD_MESSAGE()+ after +RTNL_SEND()+ will reset the state of +ctx+ - and +RTNL_CHECK_ACKS()+ will not work correctly until the next +RTNL_SEND()+. - -- +int RTNL_ADD_ATTR(struct tst_rtnl_context *ctx, unsigned short type, const - void *data, unsigned short len)+ – Adds new attribute to the last message - in +ctx+ buffer. See +RTNL_ADD_MESSAGE()+. You need to provide attribute - +type+ which will be stored in +struct rtattr.rta_type+, optional payload - +data+ and payload size +len+ in bytes. If you don't want to add any payload, - set +data+ to +NULL+ and +len+ to 0. Returns 1 on success, 0 on error. - -- +int RTNL_ADD_ATTR_STRING(struct tst_rtnl_context *ctx, unsigned short type, - const char *data)+ – Adds new string attribute to the last message in +ctx+ - buffer. Parameters and return value are the same as for +RTNL_ADD_ATTR()+, - except the payload length is calculated using +strlen()+. - -- +int RTNL_ADD_ATTR_LIST(struct tst_rtnl_context *ctx, const struct - tst_rtnl_attr_list *list)+ – Adds a list of attributes to the last message - in +ctx+ buffer. See description of +struct tst_rtnl_attr_list+ and - +RTNL_ADD_MESSAGE()+ above. Returns the number of added attributes on - success (nested attributes are not counted), -1 on error. - -.Example Usage -[source,c] -------------------------------------------------------------------------------- -#include -#include -#include -#include -#include -#include - -#include "tst_test.h" -#include "tst_rtnetlink.h" -#include "tst_netdevice.h" - -... - -void setup(void) -{ - struct tst_rtnl_context *ctx; - int index, ret; - in_addr_t addr; - - struct nlmsghdr header = { - .nlmsg_type = RTM_NEWADDR, - .nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | - NLM_F_EXCL - }; - - struct ifaddrmsg info = { - .ifa_family = AF_INET, - .ifa_prefixlen = 24 - }; - - index = NETDEV_INDEX_BY_NAME("ltp_veth1"); - info.ifa_index = index; - - ctx = RTNL_CREATE_CONTEXT(); - RTNL_ADD_MESSAGE(ctx, &header, &info, sizeof(info)); - addr = inet_addr("192.168.123.45"); - RTNL_ADD_ATTR(ctx, IFA_LOCAL, &addr, sizeof(addr)); - ret = RTNL_SEND_VALIDATE(ctx); - RTNL_DESTROY_CONTEXT(ctx); - - if (!ret) { - tst_brk(TBROK, "Failed to set ltp_veth1 address"); - } -} -------------------------------------------------------------------------------- diff --git a/doc/shell-test-api.txt b/doc/shell-test-api.txt deleted file mode 100755 index e082808f..00000000 --- a/doc/shell-test-api.txt +++ /dev/null @@ -1,763 +0,0 @@ -LTP Shell Test API -================== - -NOTE: See also - https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines[Test Writing Guidelines], - https://github.com/linux-test-project/ltp/wiki/C-Test-API[C Test API]. - -1 Writing a testcase in shell ------------------------------ - -LTP supports testcases to be written in a portable shell too. - -There is a shell library modeled closely to the C interface at -'testcases/lib/tst_test.sh'. - -WARNING: All identifiers starting with 'TST_' or 'tst_' are reserved for the - test library. - -1.1 Basic test interface -~~~~~~~~~~~~~~~~~~~~~~~~ - -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# This is a basic test for true shell builtin - -TST_TESTFUNC=do_test -. tst_test.sh - -do_test() -{ - true - ret=$? - - if [ $ret -eq 0 ]; then - tst_res TPASS "true returned 0" - else - tst_res TFAIL "true returned $ret" - fi -} - -tst_run -------------------------------------------------------------------------------- - -TIP: To execute this test the 'tst_test.sh' library must be in '$PATH'. If you - are executing the test from a git checkout you can run it as - 'PATH="$PATH:../../lib" ./foo01.sh' - -The shell library expects test setup, cleanup and the test function executing -the test in the '$TST_SETUP', '$TST_CLEANUP' and '$TST_TESTFUNC' variables. - -Both '$TST_SETUP' and '$TST_CLEANUP' are optional. - -The '$TST_TESTFUNC' may be called several times if more than one test -iteration was requested by passing right command line options to the test. - -The '$TST_CLEANUP' may be called even in the middle of the setup and must be -able to clean up correctly even in this situation. The easiest solution for -this is to keep track of what was initialized and act accordingly in the -cleanup. - -WARNING: Similar to the C library, calling 'tst_brk' in the $TST_CLEANUP does - not exit the test and 'TBROK' is converted to 'TWARN'. - -Notice also the 'tst_run' shell API function called at the end of the test that -actually starts the test. - -WARNING: cleanup function is called only after 'tst_run' has been started. -Calling 'tst_brk' in shell libraries, e.g. 'tst_test.sh' or 'tst_net.sh' does -not trigger calling it. - -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Example test with tests in separate functions - -TST_TESTFUNC=test -TST_CNT=2 -. tst_test.sh - -test1() -{ - tst_res TPASS "Test $1 passed" -} - -test2() -{ - tst_res TPASS "Test $1 passed" -} - -tst_run -# output: -# foo 1 TPASS: Test 1 passed -# foo 2 TPASS: Test 2 passed -------------------------------------------------------------------------------- - -If '$TST_CNT' is set, the test library looks if there are functions named -'$\{TST_TESTFUNC\}1', ..., '$\{TST_TESTFUNC\}$\{TST_CNT\}' and if these are -found they are executed one by one. The test number is passed to it in the '$1'. - -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Example test with tests in a single function - -TST_TESTFUNC=do_test -TST_CNT=2 -. tst_test.sh - -do_test() -{ - case $1 in - 1) tst_res TPASS "Test $1 passed";; - 2) tst_res TPASS "Test $1 passed";; - esac -} - -tst_run -# output: -# foo 1 TPASS: Test 1 passed -# foo 2 TPASS: Test 2 passed -------------------------------------------------------------------------------- - -Otherwise, if '$TST_CNT' is set but there is no '$\{TST_TESTFUNC\}1', etc., -the '$TST_TESTFUNC' is executed '$TST_CNT' times and the test number is passed -to it in the '$1'. - -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Example test with tests in a single function, using $TST_TEST_DATA and -# $TST_TEST_DATA_IFS - -TST_TESTFUNC=do_test -TST_TEST_DATA="foo:bar:d dd" -TST_TEST_DATA_IFS=":" -. tst_test.sh - -do_test() -{ - tst_res TPASS "Test $1 passed with data '$2'" -} - -tst_run -# output: -# foo 1 TPASS: Test 1 passed with data 'foo' -# foo 2 TPASS: Test 1 passed with data 'bar' -# foo 3 TPASS: Test 1 passed with data 'd dd' -------------------------------------------------------------------------------- - -It's possible to pass data for function with '$TST_TEST_DATA'. Optional -'$TST_TEST_DATA_IFS' is used for splitting, default value is space. - -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Example test with tests in a single function, using $TST_TEST_DATA and $TST_CNT - -TST_TESTFUNC=do_test -TST_CNT=2 -TST_TEST_DATA="foo bar" -. tst_test.sh - -do_test() -{ - case $1 in - 1) tst_res TPASS "Test $1 passed with data '$2'";; - 2) tst_res TPASS "Test $1 passed with data '$2'";; - esac -} - -tst_run -# output: -# foo 1 TPASS: Test 1 passed with data 'foo' -# foo 2 TPASS: Test 2 passed with data 'foo' -# foo 3 TPASS: Test 1 passed with data 'bar' -# foo 4 TPASS: Test 2 passed with data 'bar' -------------------------------------------------------------------------------- - -'$TST_TEST_DATA' can be used with '$TST_CNT'. If '$TST_TEST_DATA_IFS' not specified, -space as default value is used. Of course, it's possible to use separate functions. - -1.2 Library environment variables and functions for shell -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Similarily to the C library various checks and preparations can be requested -simply by setting right '$TST_NEEDS_FOO'. - -[options="header"] -|============================================================================= -| Variable name | Action done -| 'TST_NEEDS_ROOT' | Exit the test with 'TCONF' unless executed under root. -| | Alternatively the 'tst_require_root' command can be used. -| 'TST_NEEDS_TMPDIR' | Create test temporary directory and cd into it. -| 'TST_NEEDS_DEVICE' | Prepare test temporary device, the path to testing - device is stored in '$TST_DEVICE' variable. - The option implies 'TST_NEEDS_TMPDIR'. -| 'TST_NEEDS_CMDS' | String with command names that has to be present for - the test (see below). -| 'TST_NEEDS_MODULE' | Test module name needed for the test (see below). -| 'TST_NEEDS_DRIVERS' | Checks kernel drivers support for the test. -| 'TST_NEEDS_KCONFIGS' | Checks kernel kconfigs support for the test (see below). -| 'TST_NEEDS_KCONFIGS_IFS' | Used for splitting '$TST_NEEDS_KCONFIGS' variable, - default value is comma, it only supports single character. -| 'TST_TIMEOUT' | Maximum timeout set for the test in sec. Must be int >= 1, - or -1 (special value to disable timeout), default is 300. - Variable is meant be set in tests, not by user. - It's an equivalent of `tst_test.timeout` in C, can be set - via 'tst_set_timeout(timeout)' after test has started. -|============================================================================= - -[options="header"] -|============================================================================= -| Function name | Action done -| 'tst_set_timeout(timeout)' | Maximum timeout set for the test in sec. - See 'TST_TIMEOUT' variable. -|============================================================================= - -NOTE: Network tests (see testcases/network/README.md) use additional variables -and functions in 'tst_net.sh'. - -Checking for presence of commands -+++++++++++++++++++++++++++++++++ - -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh - -... - -TST_NEEDS_CMDS="modinfo modprobe" -. tst_test.sh - -... - -------------------------------------------------------------------------------- - -Setting '$TST_NEEDS_CMDS' to a string listing required commands will check for -existence each of them and exits the test with 'TCONF' on first missing. - -Alternatively the 'tst_require_cmds()' function can be used to do the same on -runtime, since sometimes we need to the check at runtime too. - -'tst_check_cmds()' can be used for requirements just for a particular test -as it doesn't exit (it issues 'tst_res TCONF'). Expected usage is: - -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh - -TST_TESTFUNC=do_test -. tst_test.sh - -do_test() -{ - tst_check_cmds cmd || return - cmd --foo - ... -} - -tst_run -------------------------------------------------------------------------------- - -Locating kernel modules -+++++++++++++++++++++++ - -The LTP build system can build kernel modules as well, setting -'$TST_NEEDS_MODULE' to module name will cause the library to look for the -module in a few possible paths. - -If module was found the path to it will be stored into '$TST_MODPATH' -variable, if module wasn't found the test will exit with 'TCONF'. - -Alternatively the 'tst_require_module()' function can be used to do the same -at runtime. - -1.3 Optional command line parameters -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Optional test command line parameters - -TST_OPTS="af:" -TST_USAGE=usage -TST_PARSE_ARGS=parse_args -TST_TESTFUNC=do_test - -. tst_test.sh - -ALTERNATIVE=0 -MODE="foo" - -usage() -{ - cat << EOF -usage: $0 [-a] [-f ] - -OPTIONS --a Enable support for alternative foo --f Specify foo or bar mode -EOF -} - -parse_args() -{ - case $1 in - a) ALTERNATIVE=1;; - f) MODE="$2";; - esac -} - -do_test() -{ - ... -} - -tst_run -------------------------------------------------------------------------------- - -The 'getopts' string for optional parameters is passed in the '$TST_OPTS' -variable. There are a few default parameters that cannot be used by a test, -these can be listed with passing help '-h' option to any test. - -The function that prints the usage is passed in '$TST_USAGE', the help for -the options implemented in the library is appended when usage is printed. - -Lastly the function '$PARSE_ARGS' is called with the option name in the '$1' -and, if option has argument, its value in the '$2'. - -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Optional test positional parameters - -TST_POS_ARGS=3 -TST_USAGE=usage -TST_TESTFUNC=do_test - -. tst_test.sh - -usage() -{ - cat << EOF -usage: $0 [min] [max] [size] - -EOF -} - -min="$1" -max="$2" -size="$3" - -do_test() -{ - ... -} - -tst_run -------------------------------------------------------------------------------- - -You can also request a number of positional parameters by setting the -'$TST_POS_ARGS' variable. If you do, these will be available as they were -passed directly to the script in '$1', '$2', ..., '$n'. - -1.4 Useful library functions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Retrieving configuration variables -++++++++++++++++++++++++++++++++++ - -You may need to retrieve configuration values such as PAGESIZE, there is -'getconf' but as some system may not have it, you are advised to use -'tst_getconf' instead. Note that it implements subset of 'getconf' -system variables used by the testcases only. - -[source,sh] -------------------------------------------------------------------------------- -# retrieve PAGESIZE -pagesize=`tst_getconf PAGESIZE` -------------------------------------------------------------------------------- - -Sleeping for subsecond intervals -++++++++++++++++++++++++++++++++ - -Albeit there is a sleep command available basically everywhere not all -implementations can support sleeping for less than one second. And most of the -time sleeping for a second is too much. Therefore LTP includes 'tst_sleep' -that can sleep for defined amount of seconds, milliseconds or microseconds. - -[source,sh] -------------------------------------------------------------------------------- -# sleep for 100 milliseconds -tst_sleep 100ms -------------------------------------------------------------------------------- - -Retry a function call multiple times -++++++++++++++++++++++++++++++++++++ - -Sometimes an LTP test needs to retry a function call multiple times because -the system is not ready to process it successfully on the first try. The LTP -library has useful tools to handle the call retry automatically. -'TST_RETRY_FUNC()' will keep retrying for up to 1 second. If you want a custom -time limit use 'TST_RETRY_FN_EXP_BACKOFF()'. Both methods return the value -returned by the last 'FUNC' call. - -The delay between retries starts at 1 microsecond and doubles after each call. -The retry loop ends when the function call succeeds or when the next delay -exceeds the specified time (1 second for 'TST_RETRY_FUNC()'). The maximum -delay is multiplied by TST_TIMEOUT_MUL. The total cumulative delay may be up -to twice as long as the adjusted maximum delay. - -The C version of 'TST_RETRY_FUNC()' is a macro which takes two arguments: - -* 'FUNC' is the complete function call with arguments which should be retried - multiple times. -* 'SUCCESS_CHECK' is a macro or function which will validate 'FUNC' return - value. 'FUNC' call was successful if 'SUCCESS_CHECK(ret)' evaluates to - non-zero. - -Both retry methods clear 'errno' before every 'FUNC' call so your -'SUCCESS_CHECK' can look for specific error codes as well. The LTP library -also includes predefined 'SUCCESS_CHECK' macros for the most common call -conventions: - -* 'TST_RETVAL_EQ0()' - The call was successful if 'FUNC' returned 0 or NULL -* 'TST_RETVAL_NOTNULL()' - The call was successful if 'FUNC' returned any - value other than 0 or NULL. -* 'TST_RETVAL_GE0()' - The call was successful if 'FUNC' returned value >= 0. - -[source,c] -------------------------------------------------------------------------------- -/* Keep trying for 1 second */ -TST_RETRY_FUNC(FUNC, SUCCESS_CHECK) - -/* Keep trying for up to 2*N seconds */ -TST_RETRY_FN_EXP_BACKOFF(FUNC, SUCCESS_CHECK, N) -------------------------------------------------------------------------------- - -The shell version of 'TST_RETRY_FUNC()' is simpler and takes slightly -different arguments: - -* 'FUNC' is a string containing the complete function or program call with - arguments. -* 'EXPECTED_RET' is a single expected return value. 'FUNC' call was successful - if the return value is equal to EXPECTED_RET. - -[source,sh] -------------------------------------------------------------------------------- -# Keep trying for 1 second -TST_RETRY_FUNC "FUNC arg1 arg2 ..." "EXPECTED_RET" - -# Keep trying for up to 2*N seconds -TST_RETRY_FN_EXP_BACKOFF "FUNC arg1 arg2 ..." "EXPECTED_RET" "N" -------------------------------------------------------------------------------- - -Checking for integers -+++++++++++++++++++++ - -[source,sh] -------------------------------------------------------------------------------- -# returns zero if passed an integer parameter, non-zero otherwise -tst_is_int "$FOO" -------------------------------------------------------------------------------- - -Checking for integers and floating point numbers -++++++++++++++++++++++++++++++++++++++++++++++++ - -[source,sh] -------------------------------------------------------------------------------- -# returns zero if passed an integer or floating point number parameter, -# non-zero otherwise -tst_is_num "$FOO" -------------------------------------------------------------------------------- - -Obtaining random numbers -++++++++++++++++++++++++ - -There is no '$RANDOM' in portable shell, use 'tst_random' instead. - -[source,sh] -------------------------------------------------------------------------------- -# get random integer between 0 and 1000 (including 0 and 1000) -tst_random 0 1000 -------------------------------------------------------------------------------- - -Formatting device with a filesystem -+++++++++++++++++++++++++++++++++++ - -The 'tst_mkfs' helper will format device with the filesystem. - -[source,sh] -------------------------------------------------------------------------------- -# format test device with ext2 -tst_mkfs ext2 $TST_DEVICE -# default params are $TST_FS_TYPE $TST_DEVICE -tst_mkfs -# optional parameters -tst_mkfs ext4 /dev/device -T largefile -------------------------------------------------------------------------------- - -Mounting and unmounting filesystems -+++++++++++++++++++++++++++++++++++ - -The 'tst_mount' and 'tst_umount' helpers are a safe way to mount/umount -a filesystem. - -The 'tst_mount' mounts '$TST_DEVICE' of '$TST_FS_TYPE' (optional) to -'$TST_MNTPOINT' (defaults to mntpoint), optionally using the -'$TST_MNT_PARAMS'. The '$TST_MNTPOINT' directory is created if it didn't -exist prior to the function call. - -If the path passed (optional, must be absolute path, defaults to '$TST_MNTPOINT') -to the 'tst_umount' is not mounted (present in '/proc/mounts') it's noop. -Otherwise it retries to umount the filesystem a few times on failure. -This is a workaround since there are daemons dumb enough to probe all newly -mounted filesystems, and prevents them from being umounted shortly after they -were mounted. - -ROD and ROD_SILENT -++++++++++++++++++ - -These functions supply the 'SAFE_MACROS' used in C although they work and are -named differently. - -[source,sh] -------------------------------------------------------------------------------- -ROD_SILENT command arg1 arg2 ... - -# is shorthand for: - -command arg1 arg2 ... > /dev/null 2>&1 -if [ $? -ne 0 ]; then - tst_brk TBROK "..." -fi - - -ROD command arg1 arg2 ... - -# is shorthand for: - -ROD arg1 arg2 ... -if [ $? -ne 0 ]; then - tst_brk TBROK "..." -fi -------------------------------------------------------------------------------- - -WARNING: Keep in mind that output redirection (to a file) happens in the - caller rather than in the ROD function and cannot be checked for - write errors by the ROD function. - -As a matter of a fact doing +ROD echo a > /proc/cpuinfo+ would work just fine -since the 'ROD' function will only get the +echo a+ part that will run just -fine. - -[source,sh] -------------------------------------------------------------------------------- -# Redirect output to a file with ROD -ROD echo foo \> bar -------------------------------------------------------------------------------- - -Note the '>' is escaped with '\', this causes that the '>' and filename are -passed to the 'ROD' function as parameters and the 'ROD' function contains -code to split '$@' on '>' and redirects the output to the file. - -EXPECT_PASS{,_BRK} and EXPECT_FAIL{,_BRK} -+++++++++++++++++++++++++++++++++++++++++ - -[source,sh] -------------------------------------------------------------------------------- -EXPECT_PASS command arg1 arg2 ... [ \> file ] -EXPECT_FAIL command arg1 arg2 ... [ \> file ] -------------------------------------------------------------------------------- - -'EXPECT_PASS' calls 'tst_res TPASS' if the command exited with 0 exit code, -and 'tst_res TFAIL' otherwise. 'EXPECT_FAIL' does vice versa. - -Output redirection rules are the same as for the 'ROD' function. In addition -to that, 'EXPECT_FAIL' always redirects the command's stderr to '/dev/null'. - -There are also 'EXPECT_PASS_BRK' and 'EXPECT_FAIL_BRK', which works the same way -except breaking a test when unexpected action happen. - -It's possible to detect whether expected value happened: -[source,sh] -------------------------------------------------------------------------------- -if ! EXPECT_PASS command arg1 2\> /dev/null; then - continue -fi -------------------------------------------------------------------------------- - -tst_kvcmp -+++++++++ - -This command compares the currently running kernel version given conditions -with syntax similar to the shell test command. - -[source,sh] -------------------------------------------------------------------------------- -# Exit the test if kernel version is older or equal to 2.6.8 -if tst_kvcmp -le 2.6.8; then - tst_brk TCONF "Kernel newer than 2.6.8 is needed" -fi - -# Exit the test if kernel is newer than 3.8 and older than 4.0.1 -if tst_kvcmp -gt 3.8 -a -lt 4.0.1; then - tst_brk TCONF "Kernel must be older than 3.8 or newer than 4.0.1" -fi -------------------------------------------------------------------------------- - -[options="header"] -|======================================================================= -| expression | description -| -eq kver | Returns true if kernel version is equal -| -ne kver | Returns true if kernel version is not equal -| -gt kver | Returns true if kernel version is greater -| -ge kver | Returns true if kernel version is greater or equal -| -lt kver | Returns true if kernel version is lesser -| -le kver | Returns true if kernel version is lesser or equal -| -a | Does logical and between two expressions -| -o | Does logical or between two expressions -|======================================================================= - -The format for kernel version has to either be with one dot e.g. '2.6' or with -two dots e.g. '4.8.1'. - -.tst_fs_has_free -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh - -... - -# whether current directory has 100MB free space at least. -if ! tst_fs_has_free . 100MB; then - tst_brkm TCONF "Not enough free space" -fi - -... -------------------------------------------------------------------------------- - -The 'tst_fs_has_free' shell interface returns 0 if the specified free space is -satisfied, 1 if not, and 2 on error. - -The second argument supports suffixes kB, MB and GB, the default unit is Byte. - -.tst_retry -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh - -... - -# Retry ping command three times -tst_retry "ping -c 1 127.0.0.1" - -if [ $? -ne 0 ]; then - tst_resm TFAIL "Failed to ping 127.0.0.1" -else - tst_resm TPASS "Successfully pinged 127.0.0.1" -fi - -... -------------------------------------------------------------------------------- - -The 'tst_retry' function allows you to retry a command after waiting small -amount of time until it succeeds or until given amount of retries has been -reached (default is three attempts). - -1.5 Restarting daemons -~~~~~~~~~~~~~~~~~~~~~~ - -Restarting system daemons is a complicated task for two reasons. - -* There are different init systems - (SysV init, systemd, etc...) - -* Daemon names are not unified between distributions - (apache vs httpd, cron vs crond, various syslog variations) - -To solve these problems LTP has 'testcases/lib/daemonlib.sh' library that -provides functions to start/stop/query daemons as well as variables that store -correct daemon name. - -.Supported operations -|============================================================================== -| start_daemon() | Starts daemon, name is passed as first parameter. -| stop_daemon() | Stops daemon, name is passed as first parameter. -| restart_daemon() | Restarts daemon, name is passed as first parameter. -| status_daemon() | Detect daemon status (exit code: 0: running, 1: not running). -|============================================================================== - -.Variables with detected names -|============================================================================== -| CROND_DAEMON | Cron daemon name (cron, crond). -| SYSLOG_DAEMON | Syslog daemon name (syslog, syslog-ng, rsyslog). -|============================================================================== - -.Cron daemon restart example -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Cron daemon restart example - -TCID=cron01 -TST_COUNT=1 -. test.sh -. daemonlib.sh - -... - -restart_daemon $CROND_DAEMON - -... - -tst_exit -------------------------------------------------------------------------------- - -1.6 Access to the checkpoint interface -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The shell library provides an implementation of the checkpoint interface -compatible with the C version. All 'TST_CHECKPOINT_*' functions are available. - -In order to initialize checkpoints '$TST_NEEDS_CHECKPOINTS' must be set to '1' -before the inclusion of 'tst_test.sh': - -[source,sh] -------------------------------------------------------------------------------- -#!/bin/sh - -TST_NEEDS_CHECKPOINTS=1 -. tst_test.sh -------------------------------------------------------------------------------- - -Since both the implementations are compatible, it's also possible to start -a child binary process from a shell test and synchronize with it. This process -must have checkpoints initialized by calling 'tst_reinit()'. - -1.7 Parsing kernel .config -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The shell library provides an implementation of the kconfig parsing interface -compatible with the C version. - -It's possible to pass kernel kconfig list for tst_require_kconfigs API with -'$TST_NEEDS_KCONFIGS'. -Optional '$TST_NEEDS_KCONFIGS_IFS' is used for splitting, default value is comma. - -------------------------------------------------------------------------------- -#!/bin/sh -TST_NEEDS_KCONFIGS="CONFIG_EXT4_FS, CONFIG_QUOTACTL=y" - -. tst_test.sh -------------------------------------------------------------------------------- diff --git a/doc/supported-kernel-libc-versions.txt b/doc/supported-kernel-libc-versions.txt deleted file mode 100755 index 7adaf4d1..00000000 --- a/doc/supported-kernel-libc-versions.txt +++ /dev/null @@ -1,66 +0,0 @@ -Supported kernel, libc, toolchain versions -========================================== - -1. Build testing with GitHub Actions ------------------------------------- - -We test master branch in https://github.com/linux-test-project/ltp/actions[GitHub Actions] -to ensure LTP builds on various distributions including old, current and bleeding edge. -We test both gcc and clang toolchains, various architectures with cross-compilation. -For list of tested distros see -https://github.com/linux-test-project/ltp/blob/master/.github/workflows/ci.yml[.github/workflows/ci.yml]. - - -NOTE: GitHub Actions does only build testing, passing the CI means only that - the test compiles fine on variety of different distributions and releases. - GitHub Actions also uses the latest distribution image of a particular release. - -1.1 Oldest tested distributions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -[align="center",options="header"] -|============================================================== -| Distro | kernel | glibc | gcc | clang -| CentOS 7 | 3.10 | 2.17 | 4.8.5 | - -| Ubuntu 16.04 LTS xenial | 4.4 | 2.23 | 5.3.1 | - -| Debian 9 stretch (oldstable) | 4.9.30 | 2.24 | 6.3.0 | 3.8 -|============================================================== - -Older distributions are not officially supported, which means that it -may or may not work. It all depends on your luck. It should be possible -to compile latest LTP even on slightly older distributions than we -support with a few manual tweaks, e.g. disabling manually tests for -newly added syscalls, etc. Trivial fixes/workarounds may be accepted, -but users are encouraged to move to a newer distro. - -If latest LTP cannot be compiled even with some amount of workarounds, -you may result to older LTP releases, however these are _not_ supported -in any way. Also if you are trying to run LTP on more than 10 years old -distribution you may as well reconsider you life choices. - -1.2 Tested architectures -~~~~~~~~~~~~~~~~~~~~~~~~ - -[align="center",options="header"] -|================================== -| arch | build -| x86_64 | native -| x86 emulation | native -| aarch64 | cross compilation -| ppc64le | cross compilation -| s390x | cross compilation -|================================== - -1.3 Supported libc -~~~~~~~~~~~~~~~~~~ - -[align="center",options="header"] -|================================== -| Libc | Note -| https://www.gnu.org/software/libc/[GNU C Library (glibc)] | Targetted libc, tested both compilation and actual test results. -| https://uclibc-ng.org/[uClibc-ng] | Although not being tested it should work as well as it attempt to maintain a glibc compatible interface. -| https://www.uclibc.org/[uClibc] | Older https://www.uclibc.org/[uClibc] might have problems. -| https://musl.libc.org/[musl] | Not yet fully supported (see - https://github.com/linux-test-project/ltp/blob/master/ci/alpine.sh[CI script] - for list of files which need to be deleted in order to compile under musl). -| binder (Android) | Please use https://android.googlesource.com/platform/external/ltp/[AOSP fork]. diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt deleted file mode 100755 index 1fa751ed..00000000 --- a/doc/test-writing-guidelines.txt +++ /dev/null @@ -1,336 +0,0 @@ -LTP Test Writing Guidelines -=========================== - -This document describes LTP guidelines and is intended for anybody who want to -write or modify a LTP testcase. It's not a definitive guide and it's not, by -any means, a substitute for common sense. - -NOTE: See also - https://github.com/linux-test-project/ltp/wiki/C-Test-API[C Test API], - https://github.com/linux-test-project/ltp/wiki/Shell-Test-API[Shell Test API], - https://github.com/linux-test-project/ltp/wiki/LTP-Library-API-Writing-Guidelines[LTP Library API Writing Guidelines]. - -Rules and recommendations which are "machine checkable" should be -tagged with an ID like +LTP-XXX+. There will be a corresponding entry -in -https://github.com/linux-test-project/ltp/tree/master/doc/rules.tsv[doc/rules.tsv]. When -you run 'make check' or 'make check-test' it will display these IDs as -a reference. - -1. Guide to clean and understandable code -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For testcases it's required that the source code is as easy to follow as -possible. When a test starts to fail the failure has to be analyzed, clean -test codebase makes this task much easier and quicker. - -Here are some hints on how to write clean and understandable code, a few of -these points are further discussed below: - -* First of all *Keep things simple* - -* Keep function and variable names short but descriptive - -* Keep functions reasonably short and focused on a single task - -* Do not overcomment - -* Be consistent - -* Avoid deep nesting - -* DRY - -1.1 Keep things simple -~~~~~~~~~~~~~~~~~~~~~~ - -For all it's worth keep the testcases simple or better as simple as possible. - -The kernel and libc are tricky beasts and the complexity imposed by their -interfaces is quite high. Concentrate on the interface you want to test and -follow the UNIX philosophy. - -It's a good idea to make the test as self-contained as possible too, ideally -tests should not depend on tools or libraries that are not widely available. - -Do not reinvent the wheel! - -* Use LTP standard interface - -* Do not add custom PASS/FAIL reporting functions - -* Do not write Makefiles from scratch, use LTP build system instead - -* Etc. - -1.2 Keep functions and variable names short -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Choosing a good name for an API functions or even variables is a difficult -task do not underestimate it. - -There are a couple of customary names for different things that help people to -understand code, for example: - -* For loop variables are usually named with a single letter 'i', 'j', ... - -* File descriptors 'fd' or 'fd_foo'. - -* Number of bytes stored in file are usually named as 'size' or 'len' - -* Etc. - -1.3 Do not overcomment -~~~~~~~~~~~~~~~~~~~~~~ - -Comments can sometimes save you day but they can easily do more harm than -good. There has been several cases where comments and actual implementation -drifted slowly apart which yielded into API misuses and hard to find bugs. -Remember there is only one thing worse than no documentation, wrong -documentation. - -Ideally everybody should write code that is obvious, which unfortunately isn't -always possible. If there is a code that requires to be commented keep it -short and to the point. These comments should explain *why* and not *how* -things are done. - -Never ever comment the obvious. - -In case of LTP testcases it's customary to add an asciidoc formatted comment -paragraph with highlevel test description at the beginning of the file right -under the GPL SPDX header. This helps other people to understand the overall -goal of the test before they dive into the technical details. It's also -exported into generated documentation hence it should mostly explain what is -tested. - -1.4 DRY (Code duplication) -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Copy & paste is a good servant but very poor master. If you are about to copy a -large part of the code from one testcase to another, think what would happen if -you find bug in the code that has been copied all around the tree. What about -moving it to a library instead? - -The same goes for short but complicated parts, whenever you are about to copy & -paste a syscall wrapper that packs arguments accordingly to machine -architecture or similarly complicated code, put it into a header instead. - -2 Coding style -~~~~~~~~~~~~~~ - -2.1 C coding style -^^^^^^^^^^^^^^^^^^ - -LTP adopted Linux kernel coding style: -https://www.kernel.org/doc/html/latest/process/coding-style.html - -If you aren't familiar with its rules please read it, it's a well written -introduction. - -Run `make check` in the test's directory and/or use `make check-$TCID`, -it uses (among other checks) our vendored version of -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/checkpatch.pl[checkpatch.pl] -script from kernel git tree. - -NOTE: If `make check` does not report any problems, the code still may be wrong - as all tools used for checking only look for common mistakes. - -2.1.1 LTP-004: Test executable symbols are marked static -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Test executables should not export symbols unnecessarily. This means -that all top-level variables and functions should be marked with the -static keyword. The only visible symbols should be those included from -shared object files. - -2.2 Shell coding style -^^^^^^^^^^^^^^^^^^^^^^ - -When writing testcases in shell write in *portable shell* only, it's a good -idea to try to run the test using alternative shell (alternative to bash, for -example dash) too. - -*Portable shell* means Shell Command Language as defined by POSIX with a -exception of few widely used extensions, namely 'local' keyword used inside of -functions and '-o' and '-a' test parameters (that are marked as obsolete in -POSIX). - -You can either try to run the testcases on Debian which has '/bin/sh' pointing -to 'dash' by default or install 'dash' on your favorite distribution and use -it to run the tests. If your distribution lacks 'dash' package you can always -compile it from http://gondor.apana.org.au/~herbert/dash/files/[source]. - -Run `make check` in the test's directory and/or use `make check-$TCID.sh`, -it uses (among other checks) our vendored version of -https://salsa.debian.org/debian/devscripts/raw/master/scripts/checkbashisms.pl[checkbashism.pl] -from Debian, that is used to check for non-portable shell code. - -NOTE: If `make check` does not report any problems, the code still may be wrong - as `checkbashisms.pl` used for checking only looks for common mistakes. - -Here are some common sense style rules for shell - -* Keep lines under 80 chars - -* Use tabs for indentation - -* Keep things simple, avoid unnecessary subshells - -* Don't do confusing things (i.e. don't name your functions like common shell - commands, etc.) - -* Quote variables - -* Be consistent - -3 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 -release) or of an embedded platform that needs to use several years old -toolchain supplied by the manufacturer. - -Therefore LTP test for more current features should be able to cope with older -systems. It should at least compile fine and if it's not appropriate for the -configuration it should return 'TCONF'. - -There are several types of checks we use: - -The *configure script* is usually used to detect availability of a function -declarations in system headers. It's used to disable tests at compile time or -to enable fallback definitions. - -Checking the *errno* value is another type of runtime check. Most of the -syscalls returns either 'EINVAL' or 'ENOSYS' when syscall was not implemented -or was disabled upon kernel compilation. - -LTP has kernel version detection that can be used to disable tests at runtime, -unfortunately kernel version does not always corresponds to a well defined -feature set as distributions tend to backport hundreds of patches while the -kernel version stays the same. Use with caution. - -Lately we added kernel '.config' parser, a test can define a boolean -expression of kernel config variables that has to be satisfied in order for a -test to run. This is mostly used for kernel namespaces at the moment. - -Sometimes it also makes sense to define a few macros instead of creating -configure test. One example are Linux specific POSIX clock ids in -'include/lapi/posix_clocks.h'. - -3.1 Dealing with messed up legacy code -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -LTP still contains a lot of old and messy code and we are cleaning it up as -fast as we can but despite the decade of efforts there is still a lot. If you -start modifying old or a messy testcase and your changes are more complicated -than simple typo fixes you should convert the test into a new library first. - -It's also much easier to review the changes if you split them into a smaller -logical groups. The same goes for moving files. If you need a rename or move -file do it in a separate patch. - -4 License -~~~~~~~~~ - -Code contributed to LTP should be licensed under GPLv2+ (GNU GPL version 2 or -any later version). - -Use `SPDX-License-Identifier: GPL-2.0-or-later` - -5 LTP Structure -~~~~~~~~~~~~~~~ - -The structure of LTP is quite simple. Each test is a binary written either in -portable shell or C. The test gets a configuration via environment variables -and/or command line parameters, it prints additional information into the -stdout and reports overall success/failure via the exit value. - -Tests are generally placed under the 'testcases/' directory. Everything that -is a syscall or (slightly confusingly) libc syscall wrapper goes under -'testcases/kernel/syscalls/'. - -Then there is 'testcases/open_posix_testsuite/' which is a well maintained fork -of the upstream project that has been dead since 2005 and also a number of -directories with tests for more specific features. - -5.1 Runtest Files -^^^^^^^^^^^^^^^^^ - -The list of tests to be executed is stored in runtest files under the -'runtest/' directory. The default set of runtest files to be executed is -stored in 'scenario_groups/default'. When you add a test you should add -corresponding entries into some runtest file(s) as well. - -For syscall tests (these placed under 'testcases/kernel/syscalls/') use -'runtest/syscalls' file, for kernel related tests for memory management we -have 'runtest/mm', etc. - -IMPORTANT: The runtest files should have one entry per a test. Creating a - wrapper that runs all your tests and adding it as a single test - into runtest file is strongly discouraged. - -5.2 Datafiles -^^^^^^^^^^^^^ - -If your test needs datafiles to work, these should be put into a subdirectory -named 'datafiles' and installed into the 'testcases/data/$TCID' directory (to -do that you have to add 'INSTALL_DIR := testcases/data/TCID' into the -'datafiles/Makefile'). - -You can obtain path to datafiles via $TST_DATAROOT provided by test.sh -'$TST_DATAROOT/...' -or via C function 'tst_dataroot()' provided by libltp: - -[source,c] -------------------------------------------------------------------------------- -const char *dataroot = tst_dataroot(); -------------------------------------------------------------------------------- - -Datafiles can also be accessed as '$LTPROOT/testcases/data/$TCID/...', -but '$TST_DATAROOT' and 'tst_dataroot()' are preferred as these can be used -when running testcases directly in git tree as well as from install -location. - -The path is constructed according to these rules: - -1. if '$LTPROOT' is set, return '$LTPROOT/testcases/data/$TCID' -2. else if 'tst_tmpdir()' was called return '$STARTWD/datafiles' - (where '$STARTWD' is initial working directory as recorded by 'tst_tmpdir()') -3. else return '$CWD/datafiles' - -See 'testcases/commands/file/' for example. - -5.3 Subexecutables -^^^^^^^^^^^^^^^^^^ - -If you test needs to execute a binary, place it in the same directory as the -testcase and name the file starting with '${test_binary_name}_'. Once the -test is executed by the framework, the path to the directory with all LTP -binaries is added to the '$PATH' and you can execute it just by its name. - -TIP: If you need to execute such test from the LTP tree, you can add path to - current directory to '$PATH' manually with: 'PATH="$PATH:$PWD" ./foo01'. - -6 Test Contribution Checklist ------------------------------- - -NOTE: See also - https://github.com/linux-test-project/ltp/wiki/Maintainer-Patch-Review-Checklist[Maintainer Patch Review Checklist]. - -1. Test compiles and runs fine (check with `-i 10` too) -2. `make check` does not emit any warnings for the test you are working on - (hint: run it in the test's directory and/or use `make check-$TCID`) -3. The runtest entries are in place -4. Test binaries are added into corresponding '.gitignore' files -5. Patches apply over the latest git - -6.1 About .gitignore files -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -There are numerous '.gitignore' files in the LTP tree. Usually there is a -'.gitignore' file per a group of tests. The reason for this setup is simple. -It's easier to maintain a '.gitignore' file per directory with tests, rather -than having single file in the project root directory. This way, we don't have -to update all the gitignore files when moving directories, and they get deleted -automatically when a directory with tests is removed. diff --git a/doc/user-guide.txt b/doc/user-guide.txt deleted file mode 100755 index b1ab1383..00000000 --- a/doc/user-guide.txt +++ /dev/null @@ -1,41 +0,0 @@ -LTP User Guidelines -=================== - -For compiling, installing and running the tests see `README.md`. -For running LTP network tests see `testcases/network/README.md`. - -1. Library environment variables --------------------------------- - -|============================================================================== -| 'KCONFIG_PATH' | The path to the kernel config file, (if not set, it tries - the usual paths '/boot/config-RELEASE' or '/proc/config.gz'). -| 'KCONFIG_SKIP_CHECK' | Skip kernel config check if variable set (not set by default). -| 'LTPROOT' | Prefix for installed LTP, the default is '/opt/ltp'. -| 'LTP_COLORIZE_OUTPUT' | Force colorized output behaviour. 'y' or '1': always colorize - 'n' or '0': never colorize. -| 'LTP_DEV' | Path to the block device to be used - (C: '.needs_device = 1', shell: 'TST_NEEDS_DEVICE=1'). -| 'LTP_SINGLE_FS_TYPE' | Testing only - specifies filesystem instead all - supported (for tests with '.all_filesystems'). -| 'LTP_DEV_FS_TYPE' | Filesystem used for testing (default: 'ext2'). -| 'LTP_TIMEOUT_MUL' | Multiply timeout, must be number >= 1 (> 1 is useful for - slow machines to avoid unexpected timeout). - Variable is also used in shell tests, but ceiled to int. -| 'LTP_VIRT_OVERRIDE' | Overrides virtual machine detection in the test - library. Setting it to empty string tell the library - that system is not a virtual machine. Other possible - values are 'kvm', 'xen', 'zvm' and 'microsoft' that - describe different types supervisors. -| 'PATH' | It's required to addjust path: - `PATH="$PATH:$LTPROOT/testcases/bin"` -| 'TMPDIR' | Base directory for template directory (C: '.needs_tmpdir = 1' - and others, which imply it, shell: 'TST_NEEDS_TMPDIR=1'). -| 'TST_NO_CLEANUP' | Disable running test cleanup (defined in 'TST_CLEANUP'). -|============================================================================== - -2. Colorized output -------------------- - -By default LTP colorizes it's output unless using pipe or redirect to file. -It's possible to force behaviour with 'LTP_COLORIZE_OUTPUT' environment variable. diff --git a/execltp.in b/execltp.in deleted file mode 100755 index 4b647cd1..00000000 --- a/execltp.in +++ /dev/null @@ -1,474 +0,0 @@ -#!/usr/bin/env python3 -""" - An LTP [execution and] parsing wrapper. - - Used as a second layer for ease-of-use with users as many developers - complain about complexity involved with trying to use LTP in my - organization -_-. - - Copyright (C) 2009-2012, Ngie Cooper - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -""" - - -from optparse import OptionGroup, OptionParser -import os -import re -import sys - - -class ResultsParseException(Exception): - """ Extended class for parsing LTP results. """ - - -def parse_ltp_results(exec_log, output_log, verbose=0): - """Function for parsing LTP results. - - 1. The exec log is the log with the results in summary form. - - And now a note from our sponsors about exec logs... - - startup='Thu Oct 1 06:42:07 2009' - tag=abort01 stime=1254379327 dur=2 exit=exited stat=0 core=no cu=0 cs=16 - tag=accept01 stime=1254379329 dur=0 exit=exited stat=0 core=no cu=1 cs=0 - tag=access01 stime=1254379329 dur=0 exit=exited stat=0 core=no cu=0 cs=0 - tag=access02 stime=1254379329 dur=0 exit=exited stat=0 core=no cu=0 cs=0 - tag=access03 stime=1254379329 dur=1 exit=exited stat=0 core=no cu=0 cs=1 - - [...] - - a. tag is the test tag name. - b. stime is the system time at the start of the exec. - c. dur is the total duration of the test. - d. exit tells you what the result was. Valid values are: - - exited - - signaled - - stopped - - unknown - See run_child in pan.c. - e. stat is the exit status. - f. core answers the question: `did I dump core?'. - g. cu is the cutime (cumulative user time). - h. cs is the cstime (cumulative system time). - - 2. The output log is the log with all of the terse results. - 3. verbose tells us whether or not we need to include the passed results. - """ - - if not os.access(exec_log, os.R_OK): - raise ResultsParseException("Exec log - %s - specified doesn't exist" - % exec_log) - elif 1 < verbose and not os.access(output_log, os.R_OK): - # Need the output log for context to the end user. - raise ResultsParseException("Output log - %s - specified doesn't exist" - % output_log) - - context = None - - failed = [] - passed = 0 - - if 2 <= verbose: - passed = [] - - target_vals = ('exited', '0', 'no') - - fd = open(exec_log, 'r') - - try: - content = fd.read() - matches = re.finditer('tag=(?P\w+).+exit=(?P\w+) ' - 'stat=(?P\d+) core=(?P\w+)', content) - finally: - content = None - fd.close() - - if not matches: - raise ResultsParseException("No parseable results were found in the " - "exec log - `%s'." % exec_log) - - for match in matches: - - if ((match.group('exit'), match.group('stat'), match.group('core')) != - target_vals): - failed.append(match.group('tag')) - elif 2 <= verbose: - passed.append(match.group('tag')) - else: - passed += 1 - - # Save memory on large files because lists can eat up a fair amount of - # memory. - matches = None - - if 1 <= verbose: - - context = {} - - search_tags = failed[:] - - if 2 <= verbose: - search_tags += passed - - search_tags.sort() - - fd = open(output_log, 'r') - - try: - - line_iterator = getattr(fd, 'xreadlines', getattr(fd, 'readlines')) - - end_output = '<<>>' - output_start = '<<>>' - - tag_re = re.compile('tag=(\w+)') - - grab_output = False - - local_context = '' - - search_tag = None - - try: - - while True: - - line = next(line_iterator) - - if line.startswith(end_output): - - if search_tag: - context[search_tag] = local_context - - grab_output = False - local_context = '' - search_tag = None - - if not search_tag: - - while True: - - line = next(line_iterator) - - match = tag_re.match(line) - - if match and match.group(1) in search_tags: - search_tag = match.group(1) - break - - elif line.startswith(output_start): - grab_output = True - elif grab_output: - local_context += line - - except StopIteration: - pass - - for k in list(context.keys()): - if k not in search_tags: - raise ResultsParseException('Leftover token in search ' - 'keys: %s' % k) - - except Exception as exc: - # XXX (garrcoop): change from Exception to soft error and print - # out warning with logging module. - raise ResultsParseException('Encountered exception reading output ' - 'for context: %s' % str(exc)) - finally: - fd.close() - - return failed, passed, context - - -def determine_context(output_log, testsuite, test_set, context): - """Return a set of context values mapping test_set -> context.""" - - test_set_context = {} - - for test in test_set: - - if test in context: - test_context = context[test] - del context[test] - else: - test_context = ('Could not determine context for %s; please see ' - 'output log - %s' % (test, output_log)) - - test_set_context['%s : %s' % (testsuite, test)] = test_context - - return test_set_context - - -def print_context(output_dest, header, testsuite_context): - """Print out testsuite_context to output_dest, heading it up with - header. - """ - - output_dest.write('\n'.join(['', '=' * 40, header, '-' * 40, ''])) - - for test, context in list(testsuite_context.items()): - output_dest.write('\n%s\n\n' % - (test, context.strip())) - - -def main(): - """main""" - - parser = OptionParser(prog=os.path.basename(sys.argv[0]), - usage='usage: %prog [options] test ...', - version='0.0.2') - - ltpdir = os.getenv('LTPROOT', '@prefix@') - - parser.add_option('-l', '--ltp-dir', dest='ltp_dir', - default=ltpdir, help='LTP directory [default: %default]') - parser.add_option('-L', '--log-dir', dest='log_dir', - default=None, - help=('directory for [storing and] retrieving logs ' - '[default: %s/output]' % ltpdir), - metavar='DIR') - parser.add_option('-p', '--postprocess-only', dest='postprocess_only', - default=False, action='store_true', - help=("Don't execute runltp; just postprocess logs " - "[default: %default].")) - parser.add_option('-o', '--output-file', dest='output_file', - default=None, - help='File to output results') - parser.add_option('-r', '--runltp-opts', dest='runltp_opts', - default='', - help=('options to pass directly to runltp (will ' - 'suppress -q).')) - - group = OptionGroup(parser, 'Logging', - 'If --summary-mode is 0, then the summary output is ' - 'suppressed. ' - 'If --summary-mode is 1 [the default], then summary ' - 'output will be displayed for test execution' - 'If --summary-mode is 2, then summary output will be ' - 'provided on a per-test suite basis. If only ' - 'one test suite is specified, this has the same net ' - "effect as `--summary-mode 1'" - 'If --verbose is specified once, prints out failed ' - 'test information with additional context. ' - 'If --verbose is specified twice, prints out the ' - 'failed and passed test context, as well as the ' - 'summary.') - - parser.add_option('-s', '--summary-mode', dest='summary_mode', default=1, - type='int', - help='See Logging.') - - parser.add_option('-v', '--verbose', dest='verbose', default=0, - action='count', - help=('Increases context verbosity from tests. See ' - 'Verbosity for more details.')) - parser.add_option_group(group) - - group = OptionGroup(parser, 'Copyright', - '%(prog)s version %(version)s, Copyright (C) ' - '2009-2012, Ngie Cooper %(prog)s comes with ' - 'ABSOLUTELY NO WARRANTY; ' - 'This is free software, and you are welcome to ' - 'redistribute it under certain conditions (See the ' - 'license tort in %(file)s for more details).' - % { 'file' : os.path.abspath(__file__), - 'prog' : parser.prog, - 'version' : parser.version }) - - parser.add_option_group(group) - - opts, args = parser.parse_args() - - # Remove -q from the opts string, as long as it's a standalone option. - runltp_opts = re.sub('^((? -#include -#include -#include - -#include "test.h" - -void cleanup(void); -void setup(void); - -#define SHM_RD 0400 -#define SHM_WR 0200 -#define SHM_RW SHM_RD | SHM_WR - -#define SHM_SIZE 2048 /* a resonable size for a memory segment */ -#define INT_SIZE 4 /* instead of sizeof(int) */ - -#define MODE_MASK 0x01FF /* to get the lower nine permission bits */ - /* from shmid_ds.ipc_perm.mode */ - -key_t shmkey; /* an IPC key generated by ftok() */ - -void rm_shm(int shm_id); - -int getipckey(); -int getuserid(char*); - -#endif /* ipcshm.h */ diff --git a/include/lapi/clone.h b/include/lapi/clone.h deleted file mode 100755 index 437d1376..00000000 --- a/include/lapi/clone.h +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2020 Linaro Limited. All rights reserved. - * Author: Viresh Kumar - */ - -#ifndef LAPI_CLONE_H__ -#define LAPI_CLONE_H__ - -#include -#include -#include -#include - -#include "config.h" -#include "lapi/syscalls.h" - -#ifndef HAVE_CLONE3 -struct clone_args { - uint64_t __attribute__((aligned(8))) flags; - uint64_t __attribute__((aligned(8))) pidfd; - uint64_t __attribute__((aligned(8))) child_tid; - uint64_t __attribute__((aligned(8))) parent_tid; - uint64_t __attribute__((aligned(8))) exit_signal; - uint64_t __attribute__((aligned(8))) stack; - uint64_t __attribute__((aligned(8))) stack_size; - uint64_t __attribute__((aligned(8))) tls; -}; - -static inline int clone3(struct clone_args *args, size_t size) -{ - return tst_syscall(__NR_clone3, args, size); -} -#endif - -#ifndef CLONE_PIDFD -#define CLONE_PIDFD 0x00001000 /* set if a pidfd should be placed in parent */ -#endif - -#ifndef CLONE_NEWUSER -# define CLONE_NEWUSER 0x10000000 -#endif - -static inline void clone3_supported_by_kernel(void) -{ - long ret; - - if ((tst_kvercmp(5, 3, 0)) < 0) { - /* Check if the syscall is backported on an older kernel */ - ret = syscall(__NR_clone3, NULL, 0); - if (ret == -1 && errno == ENOSYS) - tst_brk(TCONF, "Test not supported on kernel version < v5.3"); - } -} - -#endif /* LAPI_CLONE_H__ */ diff --git a/include/lapi/namespaces_constants.h b/include/lapi/namespaces_constants.h deleted file mode 100755 index 447f16c5..00000000 --- a/include/lapi/namespaces_constants.h +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2015 Red Hat, Inc. - */ - -#ifndef LAPI_NAMESPACES_CONSTANTS_H__ -#define LAPI_NAMESPACES_CONSTANTS_H__ - -#ifndef CLONE_NEWIPC -# define CLONE_NEWIPC 0x08000000 -#endif -#ifndef CLONE_NEWNS -# define CLONE_NEWNS 0x00020000 -#endif -#ifndef CLONE_NEWNET -# define CLONE_NEWNET 0x40000000 -#endif -#ifndef CLONE_NEWPID -# define CLONE_NEWPID 0x20000000 -#endif -#ifndef CLONE_NEWUSER -# define CLONE_NEWUSER 0x10000000 -#endif -#ifndef CLONE_NEWUTS -# define CLONE_NEWUTS 0x04000000 -#endif -#ifndef CLONE_NEWTIME -# define CLONE_NEWTIME 0x00000080 -#endif - -#endif /* LAPI_NAMESPACES_CONSTANTS_H__ */ diff --git a/include/lapi/pidfd_open.h b/include/lapi/pidfd_open.h deleted file mode 100755 index 9806c73d..00000000 --- a/include/lapi/pidfd_open.h +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2020 Linaro Limited. All rights reserved. - * Author: Viresh Kumar - */ - -#ifndef LAPI_PIDFD_OPEN_H__ -#define LAPI_PIDFD_OPEN_H__ - -#include -#include - -#include "lapi/syscalls.h" - -#include "config.h" - -#ifndef HAVE_PIDFD_OPEN -static inline int pidfd_open(pid_t pid, unsigned int flags) -{ - return tst_syscall(__NR_pidfd_open, pid, flags); -} -#endif - -#endif /* LAPI_PIDFD_OPEN_H__ */ diff --git a/include/lapi/pidfd_send_signal.h b/include/lapi/pidfd_send_signal.h deleted file mode 100755 index 7426a91d..00000000 --- a/include/lapi/pidfd_send_signal.h +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2019 SUSE LLC - * Author: Christian Amann - */ - -#ifndef LAPI_PIDFD_SEND_SIGNAL_H__ -#define LAPI_PIDFD_SEND_SIGNAL_H__ - -#include "tst_test.h" -#include "lapi/syscalls.h" - -static inline void pidfd_send_signal_supported(void) -{ - /* allow the tests to fail early */ - tst_syscall(__NR_pidfd_send_signal); -} - -#ifndef HAVE_PIDFD_SEND_SIGNAL -static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info, - unsigned int flags) -{ - return tst_syscall(__NR_pidfd_send_signal, pidfd, sig, info, flags); -} -#endif /* HAVE_PIDFD_SEND_SIGNAL */ - -#endif /* LAPI_PIDFD_SEND_SIGNAL_H__ */ diff --git a/lib/newlib_tests/test10.c b/lib/newlib_tests/test10.c deleted file mode 100755 index df61908a..00000000 --- a/lib/newlib_tests/test10.c +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2016 Linux Test Project - */ - -/* - * Test for watchdog timeout. - */ - -#include "tst_test.h" - - -static void do_test(void) -{ - sleep(2); - tst_res(TPASS, "Not reached"); -} - -static struct tst_test test = { - .test_all = do_test, - .timeout = 1, -}; diff --git a/lib/newlib_tests/test12.c b/lib/newlib_tests/test12.c deleted file mode 100755 index b4f0d630..00000000 --- a/lib/newlib_tests/test12.c +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2016 Linux Test Project - */ - -/* - * Test for timeout override. - */ - -#include "tst_test.h" - -static void do_test(void) -{ - sleep(1); - tst_res(TPASS, "Passed!"); -} - -static struct tst_test test = { - .timeout = 2, - .test_all = do_test, -}; diff --git a/lib/newlib_tests/test18.c b/lib/newlib_tests/test18.c deleted file mode 100755 index 026435d7..00000000 --- a/lib/newlib_tests/test18.c +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2018, Linux Test Project - */ - -#include -#include -#include "tst_test.h" - -static void run(void) -{ - do { - sleep(1); - } while (tst_timeout_remaining() >= 4); - - tst_res(TPASS, "Timeout remaining: %d", tst_timeout_remaining()); -} - -static struct tst_test test = { - .test_all = run, - .timeout = 5 -}; diff --git a/m4/ltp-clone7args.m4 b/m4/ltp-clone7args.m4 deleted file mode 100755 index ab55c1e3..00000000 --- a/m4/ltp-clone7args.m4 +++ /dev/null @@ -1,17 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Linux Test Project, 2014 - -AC_DEFUN([LTP_CHECK_CLONE_SUPPORTS_7_ARGS],[ -AH_TEMPLATE(CLONE_SUPPORTS_7_ARGS, -[Define to 1 if clone() supports 7 arguments.]) -AC_MSG_CHECKING([if clone() supports 7 args]) -AC_TRY_LINK([#define _GNU_SOURCE - #include - #include ], - [ - #ifndef __ia64__ - clone(NULL, NULL, 0, NULL, NULL, NULL, NULL); - #endif - ], - AC_DEFINE(CLONE_SUPPORTS_7_ARGS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) -]) diff --git a/m4/ltp-mremap_fixed.m4 b/m4/ltp-mremap_fixed.m4 deleted file mode 100755 index 66548b82..00000000 --- a/m4/ltp-mremap_fixed.m4 +++ /dev/null @@ -1,12 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) Linux Test Project, 2012 -dnl Author: Cyril Hrubis - -AC_DEFUN([LTP_CHECK_MREMAP_FIXED],[ -AH_TEMPLATE(HAVE_MREMAP_FIXED, -[Define to 1 if you have MREMAP_FIXED in .]) -AC_MSG_CHECKING([for MREMAP_FIXED in ]) -AC_TRY_COMPILE([#define _GNU_SOURCE - #include ], [int flags = MREMAP_FIXED;], - AC_DEFINE(HAVE_MREMAP_FIXED) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) -]) diff --git a/m4/ltp-perf_event_open.m4 b/m4/ltp-perf_event_open.m4 deleted file mode 100755 index 6966cf27..00000000 --- a/m4/ltp-perf_event_open.m4 +++ /dev/null @@ -1,16 +0,0 @@ -dnl SPDX-License-Identifier: GPL-2.0-or-later -dnl Copyright (c) 2014 Fujitsu Ltd. -dnl Copyright (c) 2014 Cyril Hrubis -dnl Author: Xiaoguang Wang - -AC_DEFUN([LTP_CHECK_SYSCALL_PERF_EVENT_OPEN],[ -AH_TEMPLATE(HAVE_PERF_EVENT_ATTR, -[Define to 1 if you have struct perf_event_attr]) -AC_MSG_CHECKING([for perf_event_attr in linux/perf_event.h]) -AC_TRY_COMPILE([#include - #include ], - [ - struct perf_event_attr pe; - ], - AC_DEFINE(HAVE_PERF_EVENT_ATTR) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) -]) diff --git a/pan/debug.c b/pan/debug.c deleted file mode 100755 index 9027f9ba..00000000 --- a/pan/debug.c +++ /dev/null @@ -1,84 +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: debug.c,v 1.1 2000/09/21 21:35:06 alaffin Exp $ */ -#include -#include -#include "reporter.h" - -#ifdef DEBUGGING -int Debug[MAXDEBUG]; /* Debug level in their areas */ -#endif - -/* - * set debug areas & levels - * - * Syntax: area[,area]:level[,area[,area]:level]... - */ -int set_debug(char *optarg) -{ -#ifdef DEBUGGING - /* pointers to the debug area and level in the option's arguments */ - char *d_area, *d_level; - /* debug area and level after converted to integers */ - int db_area, db_level; - - d_area = optarg; - - while (*d_area) { - d_level = strchr(d_area, ':'); - *d_level++ = '\0'; - db_level = atoi(d_level); - db_area = atoi(d_area); - - if (db_area > MAXDEBUG) { - printf("Error - Debug area %s > maximum of %d\n", - d_area, MAXDEBUG); - exit(-1); - } - - while (d_area != NULL) { - db_area = atoi(d_area); - printf("Debug area %d set to %d\n", db_area, db_level); - Debug[db_area] = db_level; - if ((d_area = strchr(d_area, ',')) != NULL) - d_area++; - } - if ((d_area = strchr(d_level, ',')) == NULL) - break; - } -#else - printf("Debugging is not enabled. -D has been ignored\n"); -#endif - - return 0; -} diff --git a/pan/debug.h b/pan/debug.h deleted file mode 100755 index fd8182a5..00000000 --- a/pan/debug.h +++ /dev/null @@ -1,67 +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: debug.h,v 1.1 2000/09/21 21:35:06 alaffin Exp $ */ -#ifndef _DEBUG_H_ -#define _DEBUG_H_ - -int set_debug( char * ); - -/* - * DEBUG support - * - * use -DDEBUGGING with cc to enable debugging - */ -#ifdef DEBUGGING - -extern int Debug[]; -#define MAXDEBUG 30 -#define DEBUG(a,l) if (Debug[a] >= l) -#define DEBUGO(a,l,c) if (Debug[a] >= l || c) - -#else - -#define DEBUG(a,l) if (0) -#define DEBUGO(a,l,c) if (0) - -#endif - -#define D_INIT 1 -#define D_SCAN 2 -#define D_SCAN_LEX 3 -#define D_SCAN_CUTS 4 -#define D_REPORT 5 -#define D_REP_H 6 -#define D_REP_CUTS 7 - - -#endif diff --git a/pan/ltp-scanner.c b/pan/ltp-scanner.c deleted file mode 100755 index afdd7577..00000000 --- a/pan/ltp-scanner.c +++ /dev/null @@ -1,175 +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-scanner.c,v 1.1 2009/05/19 09:39:11 subrata_modak Exp $ */ -/* - * An RTS/pan driver output processing program. - * - * This program reads an RTS/pan driver output format file, parses it using lex - * and saves the information into an in-memory hierarchical keyword table. - * - * The reporting segment of the program reads that keyword table to produce - * it's reports. - * - * Synopsis: - * ltp-scanner [ -e ] [ -D area:level ] [ -h ] - * - * Description: - * Scanner is part of the RTS 2.0 reporting mechanism or pan. - * It processes RTS/pan driver format output and produces a single simple report - * of each test tag executed, the TCIDs it executed, and their testcases. - * - * Options: - * -e - * use an "extended" output format - * - * -D - * enable debug statements. Areas are listed in report2.h and levels - * are in the code. Must be compiled with "-DDEBUGGING" - * - * -h - * print out a command usage statement and exit. - * - * INPUT - * The input must conform to the RTS/pan driver format. - * - * Report Format - * A single report style is used. It consists of a header made of all - * keywords in the rts_keywords fields of the driver output, and the test - * information. - * interpretation of CUTS "number of testcases" field when there are - * multiple TCIDs. It must be the sum of all TCIDs' testcases. - * - * System Configuration: - * ARCHITECTURE IOS_MODEL_E CRAY_YMP YMP7XX - * CONFIG JOBCNTL AVL BMD EMA HPM SECURE TFM_UDB_6 SDS SSD - * RELEASE 82 - * UNAME sn1703c cool 8.2.0ae d82.25 - * date 03/24/94 - * - * tag tcid testcase status contact - * ------------------------------------------------------------------------ - * - * When a report is made for only a tag, the TCID and Testcase fields - * contain a dash ( "-" ). The intention is that the output be usable - * by other Unix programs. - * - * When a report is made for all TCIDs and Testcases, a star ( "*" ) is used. - * - * When in extended mode, an additional output line is produced for each - * tag. - * - * This line is identified with a "!" in the TCID and Testcase fields. - * - * It has no minimum and maximum field widths, so the output does not - * line up in columns - * - * the "status" field contains the initiation status - * - * the "contact" field does not expand multiple comma-separated contacts - * - * fields: - * tag, tcid, testcase, status, contact, - * start time, duration, termination type, termination id, - * output starting line, output ending line - * - * RELATED DOCUMENTS - * Regression Test System Phase 2 Test Result Reporting System - * - * AUTHOR - * Glen Overby wrote the code. - * - * Internal Data Format - * All data is maintained in a hierarchical key database. While there are - * many available databases, this impliments a simple ASCII comma-separated - * keyed database. - * - * Key Naming - * - The top-level keys are named after the RTS or pan test tags. - * - The top-level key named "_RTS" contains the RTS Keywords - * - Each tag has a "_keys" tag that contains the key fields from - * the TEST_START and EXECUTION_STATUS fields. - */ - -#include -#include -#include -#include -#include -#include -#include "scan.h" -#include "debug.h" -#include "reporter.h" -#include "symbol.h" - -char *cnf; /* current filename */ -int extended = 0; /* -e option */ - -int main(int argc, char *argv[]) -{ - SYM tags; /* tag data */ - int c; - - while ((c = getopt(argc, argv, "D:ehi")) != -1) { - switch (c) { - case 'i': - set_iscanner(); - break; - case 'D': - set_debug(optarg); - break; - case 'e': - extended++; - break; - case 'h': - fprintf(stderr, - "%s [-e] [-i] [ -D area, level ] input-filenames\n", - argv[0]); - exit(0); - default: - fprintf(stderr, "invalid argument, %c\n", c); - exit(1); - } - } - - lex_files(&argv[optind]); /* I hope that argv[argc+1] == NULL */ - tags = sym_open(0, 0, 0); - - scanner(tags); -#ifdef DEBUGGING - DEBUG(D_INIT, 1) - sym_dump_s(tags, 0); -#endif - reporter(tags); - - exit(0); -} diff --git a/pan/reporter.c b/pan/reporter.c deleted file mode 100755 index b9ec482d..00000000 --- a/pan/reporter.c +++ /dev/null @@ -1,270 +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: reporter.c,v 1.1 2000/09/21 21:35:06 alaffin Exp $ */ -/* - * This is the report generator half of the scanner program. - */ - -#include -#include -#include -#include -#include -#include "reporter.h" -#include "symbol.h" -#include "tag_report.h" -#include "splitstr.h" - -/************************************************************************ - * Report Generation * - ************************************************************************/ - -static int scanner_reporter(SYM); -static int iscanner_reporter(SYM); -static int scanner_test_end(SYM, SYM, SYM); -static int iscanner_test_end(SYM, SYM, SYM); - -static int (*reporter_func) (SYM) = scanner_reporter; -static int (*test_end_func) (SYM, SYM, SYM) = scanner_test_end; - -/* - * Do the report generation. - * - * A problem: I really need multiple cursors. I'd rather not look into - * the depths of the current symbol table implimentation (there are the - * cursors there that I could use) so that a different (faster!) symbol - * table can be used in the future. - * - * I could get a key (tag), get it's sub-keys (TCIDs), then get the key - * again to reset to the top level, _then_ get the next key. That would - * be very inefficient. - * - * The solution I chose is to extract all tags into a list (char array), - * then go thru that list with the cursor free for other levels to use. - * - * (1) make a list (2d char array) of all Tags - * (2) search for the first tag that has a "stime" record, and use that as - * the date (MMDDYY) that the tests were run. - * (3) print the report header - * (4) go thru all tags and report each as described at the beginning of - * this file - */ -static int scanner_reporter(SYM tags) -{ - DBT Key, Data; - SYM Tag, Keys; - - time_t clock; - struct tm *tm; - - /* a list of tags, a count of the number of tags allocated to the list, - and a pointer to go thru the list */ - char **taglist, **tl; - int ntags; - int tagcount; /* how many tags used */ - - char key_get[KEYSIZE]; - char *info; - - /* - * extract tag names from data - */ - ntags = NTAGS_START; - taglist = malloc(sizeof(char *) * ntags); - tagcount = 0; - - tl = taglist; - sym_seq(tags, &Key, &Data, R_FIRST); - do { - if (tagcount == ntags) { - /* exceeded tag array size -- realloc */ - ntags += NTAGS_START; - taglist = - (char **)realloc(taglist, sizeof(char *) * ntags); - tl = taglist + tagcount; - } - - *tl++ = Key.data; - tagcount++; - } while (sym_seq(tags, &Key, &Data, R_NEXT) == 0); - - if (tagcount == ntags) { - /* exceeded tag array size -- realloc */ - ntags += NTAGS_START; - taglist = (char **)realloc(taglist, sizeof(char *) * ntags); - tl = taglist + tagcount; - } - - *tl++ = NULL; - ntags = tagcount; - /* Retrieve one "stime" to get the date. */ - for (tl = taglist; *tl != NULL; tl++) { - strcpy(key_get, *tl); - strcat(key_get, ",_keys,stime"); - if ((info = (char *)sym_get(tags, key_get)) != NULL) { - clock = atoi(info); - tm = gmtime(&clock); - strftime(key_get, KEYSIZE, "%x", tm); - sym_put(tags, strdup("_RTS,date"), strdup(key_get), 0); - break; - } - } - - print_header(tags); - - /* - * The way that I am using 'Keys' and 'Tag' makes assumptions about the - * internals of the sym_* data structure. - */ - /* dump 'em all */ - for (tl = taglist; *tl != NULL; tl++) { - if (!strcmp(*tl, "_RTS")) - continue; - - strcpy(key_get, *tl); - strcat(key_get, ",_keys"); - if ((Keys = sym_get(tags, key_get)) == NULL) { - return 0; - } - - strcpy(key_get, *tl); - if ((Tag = sym_get(tags, key_get)) != NULL) { - tag_report(NULL, Tag, Keys); - } - } - free(taglist); - - return 0; -} - -/* - * End-Of-Test seen, insert this tag into the global tag data. - * (1) Get the test's tag - * (2) insert the keywords in the "_keys" tag - * (3) insert it into the global data under this tag, replacing any existing - * data. - * - * a "feature" of the key implimentation: I can insert a key tree - * under another key tree with almost zero brainwork because a SYM - * is what the DATA area points to. - */ -static int scanner_test_end(SYM alltags, SYM ctag, SYM keys) -{ - static int notag = 0; /* counter for records with no tag (error) */ - char tagname[KEYSIZE]; /* used when creating name (see above) */ - char *tag; /* tag name to look things up in */ - char *status; /* initiation status of old tag */ - SYM rm; /* pointer to old tag -- to remove it */ - - if (alltags == NULL || keys == NULL || ctag == NULL) - return -1; /* for really messed up test output */ - - /* insert keys into tag */ - sym_put(ctag, "_keys", (void *)keys, 0); - - /* get the tag, or build a new one */ - if ((tag = (char *)sym_get(keys, "tag")) == NULL) { - /* this is an "impossible" situation: test_output checks for this - * and creates a dummy tag. */ - sprintf(tagname, "no_tag_%d", notag++); - fprintf(stderr, "No TAG key! Using %s\n", tagname); - sym_put(keys, "tag", strdup(tagname), 0); - tag = strdup(tagname); - } - - /* - * Special case: duplicate tag that has an initiation_status failure - * is thrown away. - */ - if ((rm = (SYM) sym_get(alltags, tag)) != NULL) { - if ((status = - (char *)sym_get(keys, "initiation_status")) != NULL) { - if (strcmp(status, "ok")) { - /* do not take new data. remove new data */ - sym_rm(ctag, RM_KEY | RM_DATA); - return 1; - } else { - /* remove old data in alltags */ - sym_rm(rm, RM_KEY | RM_DATA); - } - } else { - /* new data does not have an initiation_status -- throw it away */ - sym_rm(ctag, RM_KEY | RM_DATA); - return 1; - } - } - - /* put new data.. replaces existing "tag" key if it exists - * (it's data should have been removed above) */ - sym_put(alltags, tag, ctag, PUT_REPLACE); - - return 0; -} - -static int iscanner_reporter(SYM tags) -{ - return 0; -} - -static int iscanner_test_end(SYM alltags, SYM ctag, SYM keys) -{ - if (alltags == NULL || keys == NULL || ctag == NULL) - return -1; /* for really messed up test output */ - - /* insert keys into tag */ - sym_put(ctag, "_keys", (void *)keys, 0); - - return tag_report(alltags, ctag, keys); -} - -int reporter(SYM s) -{ - return reporter_func(s); -} - -int test_end(SYM a, SYM b, SYM c) -{ - return test_end_func(a, b, c); -} - -void set_scanner(void) -{ - reporter_func = scanner_reporter; - test_end_func = scanner_test_end; -} - -void set_iscanner(void) -{ - reporter_func = iscanner_reporter; - test_end_func = iscanner_test_end; -} diff --git a/pan/reporter.h b/pan/reporter.h deleted file mode 100755 index 9af554c6..00000000 --- a/pan/reporter.h +++ /dev/null @@ -1,80 +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: reporter.h,v 1.1 2000/09/21 21:35:06 alaffin Exp $ */ -#ifndef _REPORT_H_ -#define _REPORT_H_ -#include "symbol.h" - -void set_scanner(void); -void set_iscanner(void); - -int reporter( SYM ); -int test_end( SYM, SYM, SYM ); - -/* - * how much TCID space to start with (table) - */ -#define NTCID_START 5 - -/* - * how much tag space to start with (table) - */ -#define NTAGS_START 500 - -/* Return Tokens (from lex) */ -#define KW_START 100 -#define KW_END 101 -#define TEST_START 102 -#define TEST_OUTPUT 103 -#define EXEC_STATUS 104 -#define TEST_END 105 -#define TEXT_LINE 106 -#define KEYWORD 107 -#define KEYWORD_QUOTED 108 -#define CUTS_RESULT 109 -#define CUTS_RESULT_R 110 -#define SPACE 999 - -/* Scan Modes (above and beyond what I use lex for) */ -#define SCAN_OUTSIDE 10 /* not in anything */ -#define SCAN_RTSKEY 20 /* keywords: rts_keyword */ -#define SCAN_TSTKEY 21 /* keywords: either test_start or - execution_status */ -#define SCAN_OUTPUT 30 /* test_output */ - -/* - * Configuration type things - */ -#define KEYSIZE 255 /* maximum key size */ - -#endif diff --git a/pan/scan.h b/pan/scan.h deleted file mode 100755 index 6e01a323..00000000 --- a/pan/scan.h +++ /dev/null @@ -1,42 +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: scan.h,v 1.1 2000/09/21 21:35:06 alaffin Exp $ */ -#ifndef _SCAN_H_ -#define _SCAN_H_ -#include "symbol.h" - -int scanner ( SYM ); -int sym_dump_s ( SYM, int ); -int lex_files( char ** ); - -#endif diff --git a/pan/scan.l b/pan/scan.l deleted file mode 100755 index fdc33f33..00000000 --- a/pan/scan.l +++ /dev/null @@ -1,456 +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: scan.l,v 1.1 2000/09/21 21:35:06 alaffin Exp $ */ -/* - * Lex rules for input processing. - * - * This handles all of the input parsing. The rules liste here properly - * store or process the pertenant input data in the proper ways. The rules - * for the various patterns maintains a "state" to determine if corrupted - * input is seen (%Start keys + internal ones that only flag errors). - * - * See scanner.c for routines called from the actions. - * - * States: - * SCAN_OUTSIDE - * start-up state, inbetween tests - * SCAN_RTSKEY valid from SCAN_OUTSIDE - * from rts_keyword_start to _end - * accompanied by lex KEY state. - * SCAN_TSTKEY valid from SCAN_OUTSIDE - * test_start to test_output or test_end, - * execution_status to test_end - * accompanied by lex KEY state. - * SCAN_OUTPUT - * test_output to execution_status. - * accompanied by lex OUT or CUTS states. - */ - -#include -#include -#include -#include - -#include "scan.h" -#include "reporter.h" -#include "symbol.h" -#include "tag_report.h" - -int scan_mode = SCAN_OUTSIDE; /* current mode */ -char *key, *cont; /* keyword pieces */ -SYM keys=NULL; /* stored keywords */ -SYM ctag=NULL; /* temporary - for storing current tag's info */ -SYM alltags; /* entire tag database. set to scanner 'tags' param.*/ -SYM k; /* temporary sym pointer -- for key removal */ -char info[KEYSIZE]; /* tmp string for inserting line numbers */ -static int test_output( SYM, SYM); -static int check_mode(int, int, ...); - -/* - * Lex Definitions: - * UI Unsigned Integer - * A Alphabetic - * W "Word" characters (Alpha, Numeric, Hyphens, Underscores) - * S Space characters - */ -%} - -%option noc++ -%option noinput -%option nolex-compat -%option nounput -%option yylineno - -UI [0-9]+ -A [a-zA-Z]+ -W [a-zA-Z0-9_-]+ -S [ \t]+ - -%Start KEY OUT CUTS -%% -^<<>>$ { - BEGIN KEY; - check_mode(scan_mode, SCAN_OUTSIDE, 0); - scan_mode = SCAN_RTSKEY; - - /* remove any keys that exist right now */ - if(keys != NULL) - sym_rm(keys, RM_KEY | RM_DATA); - /* start a new table of keys */ - keys = sym_open(0, 0, 0); - return(KW_START); - /* NOTREACHED */ -} - -^<<>>$ { - BEGIN 0; - check_mode(scan_mode, SCAN_RTSKEY, 0); - scan_mode = SCAN_OUTSIDE; -#ifdef DEBUGGING - DEBUG(D_SCAN_LEX, 10) { - printf("RTS Keywords:\n"); - sym_dump_s(keys, 0); - } -#endif - /* remove _RTS key, if it exists, before replacing it */ - if( (k=(SYM)sym_get(alltags, "_RTS")) != NULL) { - sym_rm(k, RM_KEY | RM_DATA); - } - - sym_put(alltags, "_RTS", (void *)keys, PUT_REPLACE); - keys = NULL; - - return(KW_END); - /* NOTREACHED */ -} - -^<<>>$ { - BEGIN KEY; - check_mode(scan_mode, SCAN_OUTSIDE, 0); - scan_mode = SCAN_TSTKEY; - - /* - * set up new "tag" and "keys" tables - * to put the new data into. - */ - - /* remove any keys that exist right now */ - if(keys != NULL) - sym_rm(keys, RM_KEY | RM_DATA); - keys = sym_open(0, 0, 0); - - sprintf(info, "%d", yylineno); - sym_put(keys, "_Start_line", strdup(info), 0); - - /* remove any tag info that exists right now */ - if(ctag != NULL) - sym_rm(ctag, RM_KEY | RM_DATA); - ctag = sym_open(0, 0, 0); - - return(TEST_START); - /* NOTREACHED */ -} - -^<<>>$ { - BEGIN OUT; - check_mode(scan_mode, SCAN_TSTKEY, 0); - scan_mode = SCAN_OUTPUT; - - test_output(ctag, keys); - - return(TEST_OUTPUT); - /* NOTREACHED */ -} - -^<<>>$ { - BEGIN KEY; - check_mode(scan_mode, SCAN_TSTKEY, SCAN_OUTPUT, 0); - scan_mode = SCAN_TSTKEY; - return(EXEC_STATUS); - /* NOTREACHED */ -} - -^<<>>$ { - BEGIN 0; - check_mode(scan_mode, SCAN_TSTKEY, 0); - scan_mode = SCAN_OUTSIDE; - - sprintf(info, "%d", yylineno); - - sym_put(keys, "_End_line", strdup(info), 0); -#ifdef DEBUGGING - DEBUG(D_SCAN_LEX, 10) { - printf("Tag's Keywords:\n"); - sym_dump_s(keys, 0); - } -#endif - test_end(alltags, ctag, keys); - ctag = keys = NULL; - - return(TEST_END); - /* NOTREACHED */ -} - -[a-zA-Z_-]+=\"[^\"\n]+\" { - key = yytext; - cont = strchr(yytext, '='); - *cont++ = '\0'; - if(*cont == '"') cont++; - if(yytext[yyleng-1] == '"') - yytext[yyleng-1] = '\0'; -#ifdef DEBUGGING - DEBUG(D_SCAN_LEX, 5) - printf("A quoted keyword: %s = %s\n", key, cont); -#endif - sym_put(keys, key, strdup(cont), 0); - - return(KEYWORD_QUOTED); - /* NOTREACHED */ -} - -[a-zA-Z_-]+=[^\t \n]+ { - key = yytext; - cont = strchr(yytext, '='); - *cont++ = '\0'; -#ifdef DEBUGGING - DEBUG(D_SCAN_LEX, 5) - printf("A keyword: %s = %s\n", key, cont); -#endif - sym_put(keys, key, strdup(cont), 0); - - return(KEYWORD); - /* NOTREACHED */ -} - -[ \t\n]* { - return(SPACE); - /* NOTREACHED */ -} - -^.+$ { -#ifdef DEBUGGING - DEBUG(D_SCAN_LEX, 5) - printf("TEXT_LINE: %s\n", yytext); -#endif - - return(TEXT_LINE); - /* NOTREACHED */ -} - -^{W}{S}{UI}{S}{A}{S}":" { -#ifdef DEBUGGING - DEBUG(D_SCAN_LEX, 5) - printf("CUTS Result: %s\n", yytext); -#endif - cuts_testcase(ctag, keys); - - return(CUTS_RESULT); - /* NOTREACHED */ -} - -^{W}{S}{UI}-{UI}{S}{A}{S}":" { -#ifdef DEBUGGING - DEBUG(D_SCAN_LEX, 5) - printf("CUTS Result: %s\n", yytext); -#endif - cuts_testcase(ctag, keys); - - return(CUTS_RESULT_R); - /* NOTREACHED */ -} - -. { - return(SPACE); - /* NOTREACHED */ - -} -"\n" { - return(SPACE); - /* NOTREACHED */ -} -%% -/* - * the BEGIN macro only exists in the lex file, so define a routine to - * BEGIN the CUTS state. - */ -int -begin_cuts(void) -{ - BEGIN CUTS; - return 0; -} - -/* - * Calls lex repeatedly until all input is seen. - */ -int -scanner(SYM tags) -{ - alltags = tags; /* move into global scope for lex actions */ - - while(yylex()) - ; - - return 0; -} - -/* - * Test-Output record - * check if this is a CUTS test; if so, enter the lex "cuts" state; - * otherwise do nothing and lex will be in a "data" mode that will just - * toss all the output. - */ -static int -test_output(SYM tag, SYM keys) -{ - char *at; - - if((at=(char *)sym_get(keys, "analysis")) != NULL) { - /* CUTS:number_of_testcases || CUTS-1:number_of_testcases */ - if(strncasecmp("cuts", at, 4) == 0) { - begin_cuts(); - /*printf("CUTS output expected\n");*/ - } - } - return 0; -} - -/* Input Data State Check - * RTS driver output goes thru specific - * phases; this is used to verify that the new state is a legal state - * to change to from the current state. - * This accepts a variable number of arguments (valid states to be - * in). The last argument MUST be zero - */ -struct parse_states { - char *name; - int bits; -} parse_states[] = { - { "outside", SCAN_OUTSIDE }, - { "rts_keyword_start", SCAN_RTSKEY }, - { "test_start | execution_status", SCAN_TSTKEY }, - { "test_output", SCAN_OUTPUT }, - { "unknown", 0 }, /*end sentinel: bits = 0 */ -}; - -static int -check_mode(int scan_mode, int fst, ...) -{ - va_list ap; /* used for variable argument functions*/ - int found=0; /* set to true if a valid state was found */ - int ckm; /* Check Mode: the mode to look for */ - register struct parse_states *ps; /* for looking thru parse_states */ - char exp_mode[KEYSIZE]; /* expected mode list (for error message) */ - - extern int yylineno; /* Line number from Lex */ - - /* look thru parse_states; end sentinel is "bits" = 0 */ - for(ps=parse_states; ps->bits && (ps->bits != fst);ps++) - ; - strcpy(exp_mode, ps->name); - - /* look at first variable argument */ - if(fst == scan_mode) - found++; - else { - /* not first... look at variable args */ - va_start(ap, fst); - while(((ckm = va_arg(ap, int)) != 0) && (ckm != scan_mode)) { - for(ps=parse_states; ps->bits && (ps->bits != ckm);ps++) - ; - strcat(exp_mode, ", "); - strcat(exp_mode, ps->name); - } - va_end(ap); - - if(ckm == scan_mode) - found++; - } - - if(!found) { - for(ps=parse_states; ps->bits && (ps->bits != scan_mode);ps++) - ; - - fprintf(stderr, "PARSE ERROR -- Line %d found %s in mode %s[%d] expected { %s }\n", - yylineno, yytext, ps->name, scan_mode, exp_mode); - } - - return 0; -} - -/* - * This part of the file contains subroutines called by a lex scanner which - * is parsing rts-driver-format input and putting it into a multi-level - * symbol table. - */ - -/* - * References to lex variables - */ -/*extern char yytext[]; / * text matched by last pattern */ -/*extern long yyleng; / * length of above */ - -char **filenames; - -int -lex_files(char **names) -{ - /* lex */ - extern FILE *yyin; - - filenames = names; - - if(*filenames != NULL) { -#ifdef DEBUGGING - DEBUG(D_SCAN, 1) - printf("lex_files: first file is %s\n", *filenames); -#endif - if((yyin = fopen(*filenames, "r")) == NULL) { - printf("Error opening %s for reading\n", *filenames); - exit(1); - } - } - - return 0; -} - -/* - * Called by lex's end-of-file processing. - * Open the next file on the command line. If there is no next file, - * return "-1" and lex will end. - */ -int -yywrap(void) -{ - extern FILE *yyin; - extern int yylineno; /* Line number from Lex */ - - if(*filenames != NULL) - if(*++filenames != NULL) { -#ifdef DEBUGGING - DEBUG(D_SCAN, 1) - printf("yywrap: next file is %s\n", *filenames); -#endif - yylineno=1; - if((yyin = fopen(*filenames, "r")) != NULL) - return(0); - else { - printf("Error opening %s for reading\n", *filenames); - return(1); - } - } - - return(-1); -} - diff --git a/pan/symbol.c b/pan/symbol.c deleted file mode 100755 index 37521143..00000000 --- a/pan/symbol.c +++ /dev/null @@ -1,467 +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: symbol.c,v 1.4 2002/05/28 16:26:16 robbiew Exp $ */ -/* - * Generic Symbol Table - * - * This is intended to look a lot like ndbm, except that all information - * is kept in memory, and a multi-key, hierarchical access mode is provided. - * This is largely patterned after the Berkeley "DB" package. - * - * Requirements - * - * - "key" is ASCII (a C string, in fact) - * - * Symbol Table Structure - * - * Two data structures: - * Symbol Table Header - * Symbol Table Node - * - * A symbol table header consists of a magic number, a pointer to - * the first node in the symbol table, and a cursor that is used - * when sequentialy stepping thru the entire list. - * - * Symbol table nodes contain a pointer to a key, a pointer to this - * key's data, and a pointer to the next node in the chain. - * Note that to create a hierarchical symbol table, a node is created - * whose data points to a symbol table header. - */ - -#include -#include -#include -#include -#include -#include "symbol.h" -#include "splitstr.h" - -#define SYM_MAGIC 0xbadc0de - -/* - * Some functions can report an error message by assigning it to this - * string. - */ - -static char *sym_error = NULL; - -/* - * Memory Allocators - * - * newsym() allocates a new symbol table header node - * mknode(...) allocates a new symbol table entry - */ - -SYM newsym(void) -{ - SYM h; - - if ((h = malloc(sizeof(struct symh))) == NULL) { - sym_error = "sym header malloc failed!"; - return (NULL); - } - - h->magic = SYM_MAGIC; - h->sym = NULL; - h->cursor = NULL; - return (h); -} - -static struct sym *mknode(struct sym *next, char *key, void *data) -{ - struct sym *n; - - if ((n = malloc(sizeof(struct sym))) == NULL) { - sym_error = "sym node malloc failed!"; - return (NULL); - } - - n->next = next; - n->key = strdup(key); - n->data = data; - - if (n->key == NULL) { - sym_error = "sym node strdup(key) failed!"; - free(n); - return (NULL); - } - return (n); -} - -/* - * Search for a key in a single-level symbol table hierarchy. - */ -static struct sym *find_key1(struct sym *sym, char *key) -{ - while (sym != NULL) - if (strcmp(sym->key, key) == 0) - return (sym); - else - sym = sym->next; - return (NULL); -} - -/* - * Create a new key node, add it to the *end* of this list - */ -static int add_key(SYM sym, char *key, void *data) -{ - register struct sym *sn; - - if (sym->sym == NULL) { - sym->sym = mknode(NULL, key, data); - if (sym->sym == NULL) { - return (-1); - } - } else { - for (sn = sym->sym; sn != NULL && sn->next != NULL; - sn = sn->next) ; - sn->next = mknode(NULL, key, data); - assert(sn->next != NULL); - if (sn->next == NULL) - return (-1); - } - return (0); -} - -/* - * Create a new symbol table - */ -SYM sym_open(int flags, int mode, int openinfo) -{ - return (newsym()); -} - -/* - * Add (key, data) to an existing symbol table - * - * If the key does not exist, a new key is added to the end of the list. - * If the key exists and the PUT_REPLACE flag is not supplied, return EEXIST. - * If a symbol table entry in a multi-part key is not a symbol table (i.e. - * element two of a three or more element key), return ENOTDIR. - * - * "data" is not duplicated and must not point to a static area that could - * go away before the element is deleted (such as a local string in a - * function) - * - * "key" is duplicated as needed, and is not modified. - * - * Code: - * chop up key on commas - * - * search until a key element isn't found in the key tree, the key list is - * exhausted, or a key's data element is not a sub-tree - * - * if the key list is exhausted, return a "duplicate entry" error - * - * if the last found key's data element is not a sub-tree, return - * something like "ENOTDIR". - * - * add new keys for sub-trees until key list is exhausted; - * last node gets 'data'. - * - */ -int sym_put(SYM sym, char *key, void *data, int flags) -{ - const char **keys; /* key split into a 2d string array */ - char **kk; - char *nkey; /* copy of 'key' -- before split */ - SYM csym, ncsym; /* search: current symbol table */ - struct sym *nsym = NULL; /* search: found symbol entry */ - - if (sym == NULL) - return (EINVAL); - - nkey = strdup(key); - keys = splitstr(key, ",", NULL); - - if (keys == NULL) { - free(nkey); - return (EINVAL); - } - - for (kk = (char **)keys, csym = sym; - *kk != NULL && (nsym = find_key1(csym->sym, *kk)) != NULL; - csym = nsym->data) { - - if (*++kk == NULL) - break; - - if (nsym->data == NULL) { /* fatal error */ - free(nkey); - splitstr_free(keys); - return (ENOTDIR); - } - if (((SYM) (nsym->data))->magic != SYM_MAGIC) { - free(nkey); - splitstr_free(keys); - return (ENOTDIR); - } - } - - if (*kk == NULL) { /* found a complete match */ - free(nkey); - splitstr_free(keys); - - if (flags == PUT_REPLACE) { - nsym->data = data; - return (0); - } else { - return (EEXIST); - } - } - - /* csym is a ptr to a list */ - for (; *kk != NULL; kk++) { - if (*(kk + 1) != NULL) { - add_key(csym, *kk, (void *)(ncsym = newsym())); - csym = ncsym; - } else { - add_key(csym, *kk, data); /* last key */ - } - } - - free(nkey); - splitstr_free(keys); - return (0); -} - -/* - * Retrieve a Symbol's Contents - * - * "key" is not modified. - * If the key cannot be found, NULL is returned - */ -void *sym_get(SYM sym, char *key) -{ - char *nkey; - const char **keys; /* key split into a 2d string array */ - char **kk; - SYM csym; /* search: current symbol table */ - struct sym *nsym = NULL; /* search: found symbol entry */ - - if (sym == NULL) - return (NULL); - - nkey = strdup(key); - keys = splitstr(nkey, ",", NULL); - if (keys == NULL) - return (NULL); - - for (kk = (char **)keys, csym = sym; - *kk != NULL && (nsym = find_key1(csym->sym, *kk)) != NULL; - csym = nsym->data) { - - if (*++kk == NULL) - break; - - if (nsym->data == NULL) { /* fatal error */ - free(nkey); - splitstr_free(keys); - return (NULL); - } - if (((SYM) (nsym->data))->magic != SYM_MAGIC) { - free(nkey); - splitstr_free(keys); - return (NULL); - } - } - - if (*kk == NULL) { /* found a complete match */ - splitstr_free(keys); - free(nkey); - return (nsym->data); - } else { - splitstr_free(keys); - free(nkey); - return (NULL); - } -} - -/* - * Step thru a symbol table list - * - * The cursor must be set by R_CURSOR, R_FIRST before using R_NEXT. - * NULL is returned when no more items are available. - */ -int sym_seq(SYM sym, DBT * key, DBT * data, int flags) -{ - SYM csym; - - switch (flags) { - /* - * A number of ways to do this: - * specificly: sym_seq( .., "key,key") sets to Nth element of the 2nd - * level symbol table - * sym_seq(.., "key,key,") sets to the first element of the 3rd - * level symbol table - * - * sym_seq(.., "key,key") where both must be complete keys, sets - * cursor to the first element of the 3rd level symbol table; - * if there is no 3rd level, return an error. - */ - case R_CURSOR: - csym = (SYM) sym_get(sym, (char *)key->data); - if (csym == NULL || csym->magic != SYM_MAGIC) { - return (2); - } - sym->cursor = csym->sym; - if (sym->cursor == NULL) - return (1); - key->data = sym->cursor->key; - data->data = sym->cursor->data; - - return (0); - - case R_FIRST: - sym->cursor = sym->sym; - if (sym->cursor == NULL) - return (1); - key->data = sym->cursor->key; - data->data = sym->cursor->data; - - return (0); - - case R_NEXT: - if (sym->cursor == NULL) - return (1); - sym->cursor = sym->cursor->next; - - if (sym->cursor == NULL) - return (1); - - key->data = sym->cursor->key; - data->data = sym->cursor->data; - - return (0); - - case R_LAST: - case R_PREV: - default: - return (-1); - } -} - -/* - * Dump a symbol table's keys. - * Handles hierarchies, using a double quote to indicate depth, one - * double quote for each level. - */ -int sym_dump(SYM sym, int depth) -{ - - register struct sym *se; /* symbol entry */ - register int d; - - if (sym == NULL || sym->magic != SYM_MAGIC) - return -1; - - for (se = sym->sym; se != NULL; se = se->next) { - for (d = 0; d < depth; d++) { - putchar('"'); - putchar(' '); - } - printf("%s\n", se->key); - sym_dump((SYM) se->data, depth + 1); - } - return 0; -} - -/* - * sym dump, but data is _always_ a string (print it) - */ -int sym_dump_s(SYM sym, int depth) -{ - - register struct sym *se; /* symbol entry */ - register int d; - - if (sym == NULL) - return 0; - - if (sym->magic != SYM_MAGIC) { - for (d = 0; d < depth; d++) { - putchar('"'); - putchar(' '); - } - printf(" = %s\n", (char *)sym); - return 0; - } - - for (se = sym->sym; se != NULL; se = se->next) { - for (d = 0; d < depth; d++) { - putchar('"'); - putchar(' '); - } - printf("%s", se->key); - if (((SYM) se->data)->magic == SYM_MAGIC) { - putchar('\n'); - sym_dump_s((SYM) se->data, depth + 1); - } else { - printf("(%p) = %s (%p)\n", se->key, (char *)se->data, - se->data); - } - } - return 0; -} - -/* - * Remove an entire symbol table (done bottom up) - */ -int sym_rm(SYM sym, int flags) -{ - register struct sym *se, *nse; /* symbol entry */ - - if (sym == NULL) - return 0; - - if (sym->magic != SYM_MAGIC) { - if (!(flags & RM_DATA)) - free(sym); - return 0; - } - - for (se = sym->sym; se != NULL;) { - sym_rm((SYM) se->data, flags); - nse = se->next; - if (flags & RM_KEY) - free(se->key); - if (flags & RM_DATA) - free(se->data); - free(se); - se = nse; - } - if (!(flags & RM_DATA)) - free(sym); - return 0; -} diff --git a/pan/symbol.h b/pan/symbol.h deleted file mode 100755 index 7b2d035f..00000000 --- a/pan/symbol.h +++ /dev/null @@ -1,104 +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: symbol.h,v 1.1 2000/09/21 21:35:06 alaffin Exp $ */ -#ifndef _SYMBOL_H_ -#define _SYMBOL_H_ - -/* - * "Generic" Symbol Table - * - * These data structures are the internal part of a library providing - * an in-memory dbm-like (key, content) database with hierarchical - * key names. - */ -struct sym { - struct sym *next; - char *key; - void *data; -}; - -/* - * Symbol Table Header - */ -struct symh { - int magic; - struct sym *sym; - struct sym *cursor; -}; - -/* - * The "SYM" typedef is the only external data type. - */ -typedef struct symh *SYM; - -/* - * Data for keys and contents (lifted from dbopen(3)) - * dbopen(3) uses this for all functions, but I'm hard-wired into chars - * for keys and the like; I just need this for sym_get - */ -typedef struct { - void *data; - int size; -} DBT; - -/* - * Prototypes - */ - -SYM sym_open(int flags, int mode, int openinfo ); -int sym_put (SYM sym, char *key, void *data, int flags ); -void *sym_get (SYM sym, char *key ); -int sym_seq (SYM sym, DBT *key, DBT *data, int flags ); -int sym_rm (SYM sym, int flags ); - -/* - * Flags for sym_put - */ -#define PUT_REPLACE 1 /* replace data on a put */ - -/* - * Flags for sym_rm - */ -#define RM_KEY 001 /* free() on key pointer */ -#define RM_DATA 002 /* free() on data pointer */ - -/* - * Flags for sym_seq (clones of 44BSD dbopen(3)) - */ -#define R_CURSOR 1 /* set "cursor" to where "data" key is */ -#define R_FIRST 2 /* set "cursor" to first item */ -#define R_NEXT 4 /* set "cursor" to next item */ -#define R_LAST 3 /* set "cursor" to last item (UNIMP) */ -#define R_PREV 5 /* set "cursor" to previous item (UNIMP) */ - -#endif diff --git a/pan/tag_report.c b/pan/tag_report.c deleted file mode 100755 index eb8fb3db..00000000 --- a/pan/tag_report.c +++ /dev/null @@ -1,478 +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.c,v 1.2 2006/12/13 22:55:22 vapier Exp $ */ -#include "tag_report.h" -#include "debug.h" -#include "reporter.h" -#include "splitstr.h" - -static char *worst_case(char *, char *); - -/************************************************************************ - * Report Generation * - ************************************************************************/ - -/* - * printf format statement for standard reports - * 5 fields with max/min widths - */ -#define FORMAT "%-20.20s %-15.15s %10.10s %-20.20s %s\n" - -/* - * This is the central results reporting function. All standard report - * format results are printed thru test_result. - */ -int test_result(char *tag, char *tcid, char *tc, char *result, SYM tags) -{ - char *expert, expkey[KEYSIZE]; - register char *c; - char **cont; - const char **cont_save; - - if (tcid == NULL) - tcid = "-"; - if (tc == NULL) - tc = "-"; - if (tag == NULL) - tag = "test_result: no tag"; - if (result == NULL) - result = "(RESULT IS NULL)"; - - strcpy(expkey, "contacts"); - /* note: the sym_get here does _not_ change the "cursor" */ - if ((expert = (char *)sym_get(tags, expkey)) == NULL) { - expert = "UNKNOWN"; - } - - /* ' tr " " "_" ' */ - for (c = result; *c; c++) { - if (*c == ' ') { - *c = '_'; - } - } - if (*result == '\0') - result = "?"; - - /* split contacts on "," and print out a line for each */ - cont_save = splitstr(expert, ",", NULL); - for (cont = (char **)cont_save; *cont != NULL; cont++) { - printf(FORMAT, tag, tcid, tc, result, *cont); - } - splitstr_free(cont_save); - - return 0; -} - -/* - * CUTS test reporting. - * - * (1) make a list (2d char array) of all TCIDs (see above for why) - * (2) look thru the list: - * (a) keep track of the "worst case" in this *TAG* - * (b) report each testcase's results - * (c) if the testcase number is != 0, count it - * (3) report tag's results - * (4) check the number of expected results with the actual results, - * report an error if they don't match. - */ - -int cuts_report(SYM tags, SYM keys, char *at, char *tag) -{ - DBT Key, Data; - - /* analysis type: count of CUTS test cases */ - const char **ant; - char *dat; /* strdup(at) */ - int tccount; /* expected count of testcases */ - int tcnum; /* seen count of testcases */ - - /* a list of tcids */ - char **taglist, **tl; - int ntags, tagcount; - - char key_get[255]; - - char *result = "", *worst_case(); /* overall result */ - - /* parse analysis type: cuts:tc-count */ - ant = splitstr((dat = strdup(at)), ":", NULL); - if (ant[1] != NULL) - tccount = atoi(ant[1]); - else - tccount = 0; - free(dat); - splitstr_free(ant); - - /* extract tcids */ - ntags = NTCID_START; - taglist = (char **)malloc(sizeof(char *) * ntags); - tagcount = 0; - - tl = taglist; - sym_seq(tags, &Key, &Data, R_FIRST); - do { - if (tagcount == ntags) { - /* exceeded tag array size -- realloc */ - ntags += NTCID_START; - taglist = - (char **)realloc(taglist, sizeof(char *) * ntags); - tl = taglist + tagcount; - } - - if (strcmp((char *)Key.data, "_keys") == 0) - continue; - DEBUG(D_REPORT, 10) - printf("cuts_report: tcid %s\n", (char *)Key.data); - *tl++ = Key.data; - tagcount++; - } while (sym_seq(tags, &Key, &Data, R_NEXT) == 0); - - if (tagcount == ntags) { - /* exceeded tag array size -- realloc */ - ntags++; /* need just one more */ - taglist = (char **)realloc(taglist, sizeof(char *) * ntags); - tl = taglist + tagcount; - } - - *tl++ = NULL; - - ntags = tagcount; - - /* dump all found records */ - tcnum = 0; - for (tl = taglist; *tl != NULL; tl++) { - - strcpy(key_get, *tl); - Key.data = (void *)key_get; - - /*sym_dump_s(sym_get(tags, key_get), 0); */ - - sym_seq(tags, &Key, &Data, R_CURSOR); - do { - DEBUG(D_REPORT, 10) - printf("cuts_report: tc %s = %s\n", - (char *)Key.data, (char *)Data.data); - result = worst_case(result, (char *)Data.data); - test_result(tag, *tl, (char *)Key.data, - (char *)Data.data, keys); - if (atoi((char *)Key.data)) - tcnum++; - } while (sym_seq(tags, &Key, &Data, R_NEXT) == 0); - } - - test_result(tag, "*", "*", result, keys); - - if (tccount != 0 && tccount != tcnum) - test_result(tag, "-", "-", "TC count wrong", keys); - - free(taglist); - - return 0; -} - -/* - * Do the report generation. - * - * A problem: I really need multiple cursors. I'd rather not look into - * the depths of the current symbol table implimentation (there are the - * cursors there that I could use) so that a different (faster!) symbol - * table can be used in the future. - * - * I could get a key (tag), get it's sub-keys (TCIDs), then get the key - * again to reset to the top level, _then_ get the next key. That would - * be very inefficient. - * - * The solution I chose is to extract all tags into a list (char array), - * then go thru that list with the cursor free for other levels to use. - * - * (1) make a list (2d char array) of all Tags - * (2) search for the first tag that has a "stime" record, and use that as - * the date (MMDDYY) that the tests were run. - * (3) print the report header - * (4) go thru all tags and report each as described at the beginning of - * this file - */ -int tag_report(SYM alltags, SYM ctag, SYM keys) -{ - - extern int extended; - - char key_get[KEYSIZE]; - char *info; - - /* retrieved _keys values: initation status, start time, duration, - * termination type, termination id, start line, end line. */ - char *tag, *contact, *is, *mystime, *duration, *tt, *ti, *sl, *el; - - /* Check all driver-level status first */ - strcpy(key_get, "tag"); - if ((tag = (char *)sym_get(keys, key_get)) == NULL) { - return -1; - } - - /* Check all driver-level status first */ - strcpy(key_get, "initiation_status"); - if ((is = (char *)sym_get(keys, key_get)) == NULL) { - test_result(tag, NULL, NULL, "no init status", keys); - return -1; - } - - if (strcmp(is, "ok")) { - test_result(tag, NULL, NULL, is, keys); - } else { - - strcpy(key_get, "corefile"); - if ((info = (char *)sym_get(keys, key_get)) != NULL) - if (strcmp(info, "no") != 0) { - test_result(tag, NULL, NULL, "coredump", keys); - } - - strcpy(key_get, "termination_type"); - if ((tt = (char *)sym_get(keys, key_get)) == NULL) { - test_result(tag, NULL, NULL, "no Term Type", keys); - return -1; - } - - if (strcmp(tt, "exited")) { - test_result(tag, NULL, NULL, tt, keys); - } - - strcpy(key_get, "analysis"); - if ((info = (char *)sym_get(keys, key_get)) == NULL) { - test_result(tag, NULL, NULL, "no Analysis Type", keys); - return -1; - } - - /* Getting here indicates that there were no fatal driver-level - * errors. Do the kind of reporting requested by the test. - */ - - if (strncmp(info, "none", 4) == 0) { - /* - * If analysis is 'none', alway report the test as - * a pass regardless of output or exit status. - */ - test_result(tag, NULL, NULL, "pass", keys); - - } else if (strncmp(info, "cuts", 4)) { - - /* - * If analysis is not cuts, assume it is 'exit', thus - * the termination_id is used to determine pass/fail result. - */ - if (strcmp(tt, "timeout")) { - strcpy(key_get, "termination_id"); - if ((info = - (char *)sym_get(keys, key_get)) == NULL) { - test_result(tag, NULL, NULL, - "no_Term_Id", keys); - } else { - if (strcmp(info, "0")) { - test_result(tag, NULL, NULL, - "fail", keys); - } else { - test_result(tag, NULL, NULL, - "pass", keys); - } - } - } - } else { - cuts_report(ctag, keys, info, tag); - } - } - - /* - * Extended Format: - * - tcid+tc = "!" - * - tab separated fields - * - no field widths - * - fields 6 - ~ are: - * start-time (time_t) - * duration - * termination_id - * termination_type - * Start Line (of test results in output file) - * End Line - */ - - if (extended) { - - strcpy(key_get, "termination_id"); - if ((ti = (char *)sym_get(keys, key_get)) == NULL) { - ti = "No_Termination_ID"; - } - - strcpy(key_get, "termination_type"); - if ((tt = (char *)sym_get(keys, key_get)) == NULL) { - tt = "No_Termination_Type"; - } - - strcpy(key_get, "duration"); - if ((duration = (char *)sym_get(keys, key_get)) == NULL) { - duration = "No_Duration"; - } - - strcpy(key_get, "_Start_line"); - if ((sl = (char *)sym_get(keys, key_get)) == NULL) { - sl = "No_Start_line"; - } - - strcpy(key_get, "_End_line"); - if ((el = (char *)sym_get(keys, key_get)) == NULL) { - el = "No_End_line"; - } - - strcpy(key_get, "contacts"); - if ((contact = (char *)sym_get(keys, key_get)) == NULL) { - contact = "No_Contacts"; - } - - strcpy(key_get, "stime"); - if ((mystime = (char *)sym_get(keys, key_get)) == NULL) { - mystime = "No_stime"; - } - - printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t\n", - tag, "!", "!", is, contact, mystime, duration, - ti, tt, sl, el); - } - - return 0; -} - -/* - * Print a header made up of the RTS keywords - * In "extended" mode, print the header to stderr. - */ -int print_header(SYM tags) -{ - DBT Key, Data; - char key_get[255]; - - FILE *out; - - extern int extended; - - if (extended) - out = stderr; - else - out = stdout; - - fprintf(out, "System Configuration:\n"); - /* build header out of RTS keywords */ - sprintf(key_get, "_RTS"); - Key.data = (void *)key_get; - if (sym_seq(tags, &Key, &Data, R_CURSOR) == 0) { - do { - if (strcmp((char *)Key.data, "PATH") == 0) - continue; - fprintf(out, "%-20.20s %s\n", (char *)Key.data, - (char *)Data.data); - } while (sym_seq(tags, &Key, &Data, R_NEXT) == 0); - } - - fprintf(out, "\n"); - fprintf(out, FORMAT, "tag", "tcid", "testcase", "status", "contact"); - fprintf(out, - "-------------------------------------------------------------------------------\n"); - - return 0; -} - -/* - * CUTS testcase record - * - * This is passed s SYM for the current tag and the initiation keys. - * The text seen by lex is in yytext (global). - */ -int cuts_testcase(SYM tag, SYM keys) -{ - char *cuts_info[6]; - char key[KEYSIZE]; - char *oldresult, *newresult, *worst_case(); - int tok_num = 0; - extern char yytext[]; - - cuts_info[tok_num] = strtok(yytext, "\t "); - while (tok_num < 5 && - (cuts_info[++tok_num] = strtok(NULL, "\t ")) != NULL) ; - - strcpy(key, cuts_info[0]); - strcat(key, ","); - strcat(key, cuts_info[1]); - -#ifdef DEBUGGING - DEBUG(D_SCAN_CUTS, 1) { - printf("cuts_testcase: TCID=%s TC=%s Result=%s\n", cuts_info[0], - cuts_info[1], cuts_info[2]); - printf("cuts_testcase: %d %s\n", tok_num, key); - } -#endif - - if ((oldresult = (char *)sym_get(tag, key)) != NULL) { - /* Duplicate -- assume mulitple runs */ - /* keep "worst case" */ - newresult = worst_case(oldresult, cuts_info[2]); - sym_put(tag, key, strdup(newresult), PUT_REPLACE); - free(oldresult); /* remove the "data" portion of the key */ - } else { - sym_put(tag, key, strdup(cuts_info[2]), 0); - } - return 0; -} - -/* - * Determine a "worst case" status from two given statuses. - */ -static char *worst_case(char *t1, char *t2) -{ - /* NULL-terminated table, ordered from worst-case to best-case */ - static char *worst[] = { - "FAIL", "BROK", "PASS", "CONF", - "WARN", "INFO", NULL, - }; - - char **w1, **w2; - - /* Search the table for each status, then use the index to determine - which has a lower precedence */ - for (w1 = worst; *w1 != NULL && strcmp(t1, *w1); w1++) ; - - for (w2 = worst; *w2 != NULL && strcmp(t2, *w2); w2++) ; - - if (w1 < w2) - return (t1); - else - return (t2); - -} diff --git a/runtest/ltp-aio-stress.part1 b/runtest/ltp-aio-stress.part1 deleted file mode 100755 index a770a40a..00000000 --- a/runtest/ltp-aio-stress.part1 +++ /dev/null @@ -1,79 +0,0 @@ -#DESCRIPTION:ltp A-sync IO Stress IO tests -# -# aio-stress [-s size] [-r size] [-a size] [-d num] [-b num] -# [-i num] [-t num] [-c num] [-C size] [-nxhlvOS ] -# file1 [file2 ...] -# -a size in KB at which to align buffers -# -b max number of iocbs to give io_submit at once -# -c number of io contexts per file -# -C offset between contexts, default 2MB -# -s size in MB of the test file(s), default 1024MB -# -r record size in KB used for each io, default 64KB -# -d number of pending aio requests for each file, default 64 -# -i number of ios per file sent before switching -# to the next file, default 8 -# -O Use O_DIRECT (not available in 2.4 kernels), -# -S Use O_SYNC for writes -# -o add an operation to the list: write=0, read=1, -# random write=2, random read=3. -# repeat -o to specify multiple ops: -o 0 -o 1 etc. -# -m shm use ipc shared memory for io buffers instead of malloc -# -m shmfs mmap a file in /dev/shm for io buffers -# -n no fsyncs between write stage and read stage -# -l print io_submit latencies after each stage -# -t number of threads to run -# -v verification of bytes written -# -x turn off thread stonewalling -# -h this message -# -ADS1000 aio-stress -I500 -o2 -S -r4 $TMPDIR/file1 -ADS1001 aio-stress -I500 -o2 -S -r8 $TMPDIR/file1 -ADS1002 aio-stress -I500 -o2 -S -r16 $TMPDIR/file1 -ADS1003 aio-stress -I500 -o2 -S -r32 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1004 aio-stress -I500 -o2 -S -r64 $TMPDIR/junkfile $TMPDIR/file2 -ADS1005 aio-stress -I500 -o3 -S -r4 $TMPDIR/junkfile $TMPDIR/file2 -ADS1006 aio-stress -I500 -o3 -S -r8 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1007 aio-stress -I500 -o3 -S -r16 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1008 aio-stress -I500 -o3 -S -r32 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file3 $TMPDIR/file4 -ADS1009 aio-stress -I500 -o3 -S -r64 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file3 $TMPDIR/file4 -ADS1010 aio-stress -I500 -o3 -S -r128 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file3 $TMPDIR/file4 -ADS1011 aio-stress -I500 -o3 -S -r256 -t8 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file3 $TMPDIR/file4 $TMPDIR/file5 $TMPDIR/file6 $TMPDIR/file7 $TMPDIR/file8 -ADS1012 aio-stress -I500 -o3 -S -r512 -t8 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file3 $TMPDIR/file4 $TMPDIR/file5 $TMPDIR/file6 $TMPDIR/file7 $TMPDIR/file8 -ADS1013 aio-stress -I500 -o2 -O -r4 -t8 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file3 $TMPDIR/file4 $TMPDIR/file5 $TMPDIR/file6 $TMPDIR/file7 $TMPDIR/file8 -ADS1014 aio-stress -I500 -o2 -O -r8 $TMPDIR/file1 $TMPDIR/file2 -ADS1015 aio-stress -I500 -o2 -O -r16 $TMPDIR/file1 $TMPDIR/file2 -ADS1016 aio-stress -I500 -o2 -O -r32 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1017 aio-stress -I500 -o2 -O -r64 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1018 aio-stress -I500 -o3 -O -r4 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1019 aio-stress -I500 -o3 -O -r8 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1020 aio-stress -I500 -o3 -O -r16 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1021 aio-stress -I500 -o3 -O -r32 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 -ADS1022 aio-stress -I500 -o3 -O -r64 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 -ADS1023 aio-stress -I500 -o3 -O -r128 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 -ADS1024 aio-stress -I500 -o3 -O -r256 -t8 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 $TMPDIR/file4 $TMPDIR/file3 $TMPDIR/file5 $TMPDIR/file6 -ADS1025 aio-stress -I500 -o3 -O -r512 -t8 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 $TMPDIR/file3 $TMPDIR/file4 $TMPDIR/file5 $TMPDIR/file6 -ADS1026 aio-stress -I500 -o0 -S -r4 -t8 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 $TMPDIR/file3 $TMPDIR/file4 $TMPDIR/file5 $TMPDIR/file6 -ADS1027 aio-stress -I500 -o0 -S -r8 $TMPDIR/file2 -ADS1028 aio-stress -I500 -o0 -S -r16 $TMPDIR/file2 -ADS1029 aio-stress -I500 -o0 -S -r32 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1030 aio-stress -I500 -o0 -S -r64 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1031 aio-stress -I500 -o1 -S -r4 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1032 aio-stress -I500 -o1 -S -r8 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1033 aio-stress -I500 -o1 -S -r16 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1034 aio-stress -I500 -o1 -S -r32 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 -ADS1035 aio-stress -I500 -o1 -S -r64 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 -ADS1036 aio-stress -I500 -o1 -S -r128 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 -ADS1037 aio-stress -I500 -o1 -S -r256 -t8 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 $TMPDIR/file4 $TMPDIR/file3 $TMPDIR/file5 $TMPDIR/file6 -ADS1038 aio-stress -I500 -o1 -S -r512 -t8 -x $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 $TMPDIR/file3 $TMPDIR/file4 $TMPDIR/file5 $TMPDIR/file6 -ADS1039 aio-stress -I500 -o1 -O -r4 -t8 -x $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 $TMPDIR/file3 $TMPDIR/file4 $TMPDIR/file5 $TMPDIR/file6 -ADS1040 aio-stress -I500 -o1 -O -r8 -t2 -x $TMPDIR/junkfile $TMPDIR/file2 -ADS1041 aio-stress -I500 -o1 -O -r16 -t2 -x $TMPDIR/junkfile $TMPDIR/file2 -ADS1042 aio-stress -I500 -o1 -O -r32 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1043 aio-stress -I500 -o1 -O -r64 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS1044 aio-stress -I500 -o1 -O -r4 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 -ADS1045 aio-stress -I500 -o1 -O -r8 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 -ADS1046 aio-stress -I500 -o1 -O -r16 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 -ADS1047 aio-stress -I500 -o1 -O -r32 -t8 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 $TMPDIR/file4 $TMPDIR/file3 $TMPDIR/file5 $TMPDIR/file6 -ADS1048 aio-stress -I500 -o1 -O -r64 -t8 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 $TMPDIR/file3 $TMPDIR/file4 $TMPDIR/file5 $TMPDIR/file6 -ADS1049 aio-stress -I500 -o1 -O -r128 -t8 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file7 $TMPDIR/file8 $TMPDIR/file3 $TMPDIR/file4 $TMPDIR/file5 $TMPDIR/file6 -ADS1050 aio-stress -I500 -o1 -O -r256 -t2 $TMPDIR/junkfile $TMPDIR/file2 diff --git a/runtest/ltp-aio-stress.part2 b/runtest/ltp-aio-stress.part2 deleted file mode 100755 index 3a60e23e..00000000 --- a/runtest/ltp-aio-stress.part2 +++ /dev/null @@ -1,38 +0,0 @@ -#DESCRIPTION:ltp A-sync IO Stress IO tests -# -# aio-stress [-s size] [-r size] [-a size] [-d num] [-b num] -# [-i num] [-t num] [-c num] [-C size] [-nxhlvOS ] -# file1 [file2 ...] -# -a size in KB at which to align buffers -# -b max number of iocbs to give io_submit at once -# -c number of io contexts per file -# -C offset between contexts, default 2MB -# -s size in MB of the test file(s), default 1024MB -# -r record size in KB used for each io, default 64KB -# -d number of pending aio requests for each file, default 64 -# -i number of ios per file sent before switching -# to the next file, default 8 -# -O Use O_DIRECT (not available in 2.4 kernels), -# -S Use O_SYNC for writes -# -o add an operation to the list: write=0, read=1, -# random write=2, random read=3. -# repeat -o to specify multiple ops: -o 0 -o 1 etc. -# -m shm use ipc shared memory for io buffers instead of malloc -# -m shmfs mmap a file in /dev/shm for io buffers -# -n no fsyncs between write stage and read stage -# -l print io_submit latencies after each stage -# -t number of threads to run -# -v verification of bytes written -# -x turn off thread stonewalling -# -h this message -# -ADS2001 aio-stress -I500 -o2 -S -r32 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS2002 aio-stress -I500 -o3 -S -r8 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS2003 aio-stress -I500 -o3 -S -r16 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS2004 aio-stress -I500 -o3 -S -r32 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file3 $TMPDIR/file4 -ADS2005 aio-stress -I500 -o3 -S -r64 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file3 $TMPDIR/file4 -ADS2006 aio-stress -I500 -o2 -O -r32 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS2007 aio-stress -I500 -o3 -O -r8 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS2008 aio-stress -I500 -o3 -O -r16 -t2 $TMPDIR/junkfile $TMPDIR/file2 -ADS2009 aio-stress -I500 -o3 -O -r32 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file3 $TMPDIR/file4 -ADS2010 aio-stress -I500 -o3 -O -r64 -t4 $TMPDIR/junkfile $TMPDIR/file2 $TMPDIR/file3 $TMPDIR/file4 diff --git a/runtest/net.rpc b/runtest/net.rpc deleted file mode 100755 index fb0665fa..00000000 --- a/runtest/net.rpc +++ /dev/null @@ -1,8 +0,0 @@ -#DESCRIPTION:Remote Procedure Call -# -# PLEASE READ THE README FILE IN /rpc BEFORE RUNNING THESE. -# -rpc01 rpc01.sh -rpcinfo rpcinfo01.sh -rup rup01.sh -rusers rusers01.sh diff --git a/testcases/commands/file/datafiles/in.csh b/testcases/commands/file/datafiles/in.csh deleted file mode 100755 index c475aef9..00000000 --- a/testcases/commands/file/datafiles/in.csh +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/csh - -echo "this is a shell script" -echo "used to test file command" diff --git a/testcases/commands/file/datafiles/in.ksh b/testcases/commands/file/datafiles/in.ksh deleted file mode 100755 index 3ae45125..00000000 --- a/testcases/commands/file/datafiles/in.ksh +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/ksh - -echo "this is a shell script" -echo "used to test file command" diff --git a/testcases/kernel/containers/.gitignore b/testcases/kernel/containers/.gitignore deleted file mode 100755 index 5c2b9031..00000000 --- a/testcases/kernel/containers/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -/check_for_unshare -mountns/mountns01 -mountns/mountns02 -mountns/mountns03 -mountns/mountns04 -userns/userns01 -userns/userns02 -userns/userns03 -userns/userns04 -userns/userns05 -userns/userns06_capcheck -userns/userns06 -userns/userns07 -userns/userns08 diff --git a/testcases/kernel/containers/Makefile.inc b/testcases/kernel/containers/Makefile.inc deleted file mode 100755 index 179809bc..00000000 --- a/testcases/kernel/containers/Makefile.inc +++ /dev/null @@ -1,45 +0,0 @@ -# -# kernel/containers testcase suite common definitions 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 -# - -# DO NOT USE THIS FILE FOR containers / libclone!!! - -LIBDIR := ../libclone - -LIBS := $(LIBDIR)/libclone.a - -CPPFLAGS += -I$(abs_srcdir)/$(LIBDIR) - -LDFLAGS += -L$(abs_builddir)/$(LIBDIR) - -$(LIBDIR): - mkdir -p "$@" - -# Make the target the real lib so we don't have to deal with rebuilding this -# every time the dependency is evaluated, like with PHONY rules. -$(LIBS): $(LIBDIR) - $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all - -INSTALL_TARGETS ?= *.sh - -MAKE_DEPS := $(LIBS) - -# vim: syntax=make diff --git a/testcases/kernel/containers/README b/testcases/kernel/containers/README deleted file mode 100755 index c99cacd9..00000000 --- a/testcases/kernel/containers/README +++ /dev/null @@ -1,50 +0,0 @@ -################################################################################ -## ## -## Copyright (c) International Business Machines Corp., 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 ## -## ## -################################################################################ - -CONTAINER TESTS AUTOMATION SUITE ----------------------------- -The tests requires the Kernel to be compiled with the following configs - -CONFIG_DUMMY=y(or =m) -CONFIG_NAMESPACES=y -CONFIG_UTS_NS=y -CONFIG_IPC_NS=y -CONFIG_USER_NS=y -CONFIG_PID_NS=y -CONFIG_NET_NS=y -CONFIG_VETH=y(or =m) -CONFIG_MACVLAN=y(optional) - -The container test automation suite helps run the container functionality -(e.g: utsname etc..) tests and report results. Please refer the following -each functionality README file for detail: - -sysvipc/* - Contains all the testcases related to IPC NS tests. -posixmq/* - Contains all the testcases related to POSIX MQ NS tests. These - are strictly speaking a part of the ipc namespaces, but can be - enabled in the kernel without SYSV IPC support. -utsname/* - Contains all the testcases related to utsname tests. -libclone/* - Contains the library API for clone() . -netns/* - Contains the testcases related to the network NS tests. diff --git a/testcases/kernel/containers/TEST_PLAN.txt b/testcases/kernel/containers/TEST_PLAN.txt deleted file mode 100755 index 809abaec..00000000 --- a/testcases/kernel/containers/TEST_PLAN.txt +++ /dev/null @@ -1,27 +0,0 @@ -################################################################################ -## Copyright (c) International Business Machines Corp., 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 -################################################################################ - -Following are tentative Testcases to be included into LTP-Containers in future: - -NAME TENTATIVE-TIME -================================================================================= -PID NAMESPACES (NEAR FUTURE) -NETWORK NAMESPACES (NEAR FUTURE) -POSIX IPC NAMESPACES (NEAR FUTURE) -TTY+CONSOLE+DEVPTS NAMESPACES (NEAR FUTURE) -PROC+SYSFS ISOLATION (NEAR FUTURE) -PER-CONTAINER CAPABILITY/SECURITY TESTS (NEAR FUTURE) -================================================================================= diff --git a/testcases/kernel/containers/libclone/Makefile b/testcases/kernel/containers/libclone/Makefile deleted file mode 100755 index 13af52b6..00000000 --- a/testcases/kernel/containers/libclone/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -################################################################################ -## ## -## Copyright (c) International Business Machines Corp., 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 ## -## ## -################################################################################ - -top_srcdir ?= ../../../.. - -include $(top_srcdir)/include/mk/testcases.mk - -INTERNAL_LIB := libclone.a - -include $(top_srcdir)/include/mk/lib.mk diff --git a/testcases/kernel/containers/libclone/libclone.c b/testcases/kernel/containers/libclone/libclone.c deleted file mode 100755 index 239674ff..00000000 --- a/testcases/kernel/containers/libclone/libclone.c +++ /dev/null @@ -1,142 +0,0 @@ -/* -* Copyright (c) International Business Machines Corp., 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 -* -***************************************************************************/ -#include "libclone.h" - -int do_clone_tests(unsigned long clone_flags, - int (*fn1) (void *arg), void *arg1, - int (*fn2) (void *arg), void *arg2) -{ - int ret; - - ret = ltp_clone_quick(clone_flags | SIGCHLD, fn1, arg1); - - if (ret == -1) { - return -1; - } - if (fn2) - ret = fn2(arg2); - else - ret = 0; - - return ret; -} - -int do_unshare_tests(unsigned long clone_flags, - int (*fn1) (void *arg), void *arg1, - int (*fn2) (void *arg), void *arg2) -{ - int pid, ret = 0; - int retpipe[2]; - char buf[2]; - - if (pipe(retpipe) == -1) { - perror("pipe"); - return -1; - } - pid = fork(); - if (pid == -1) { - perror("fork"); - close(retpipe[0]); - close(retpipe[1]); - return -1; - } - if (pid == 0) { - close(retpipe[0]); - ret = ltp_syscall(SYS_unshare, clone_flags); - if (ret == -1) { - if (write(retpipe[1], "0", 2) < 0) { - perror("unshare:write(retpipe[1], ..)"); - } - close(retpipe[1]); - exit(1); - } else { - if (write(retpipe[1], "1", 2) < 0) { - perror("unshare:write(retpipe[1], ..)"); - } - } - close(retpipe[1]); - ret = fn1(arg1); - exit(ret); - } else { - close(retpipe[1]); - if (read(retpipe[0], &buf, 2) < 0) { - perror("unshare:read(retpipe[0], ..)"); - } - close(retpipe[0]); - if (*buf == '0') - return -1; - if (fn2) - ret = fn2(arg2); - } - - return ret; -} - -int do_plain_tests(int (*fn1) (void *arg), void *arg1, - int (*fn2) (void *arg), void *arg2) -{ - int ret = 0, pid; - - pid = fork(); - if (pid == -1) { - perror("fork"); - return -1; - } - if (pid == 0) - exit(fn1(arg1)); - if (fn2) - ret = fn2(arg2); - return ret; -} - -int do_clone_unshare_test(int use_clone, unsigned long clone_flags, - int (*fn1) (void *arg), void *arg1) -{ - switch (use_clone) { - case T_NONE: - return do_plain_tests(fn1, arg1, NULL, NULL); - case T_CLONE: - return do_clone_tests(clone_flags, fn1, arg1, NULL, NULL); - case T_UNSHARE: - return do_unshare_tests(clone_flags, fn1, arg1, NULL, NULL); - default: - printf("%s: bad use_clone option: %d\n", __FUNCTION__, - use_clone); - return -1; - } -} - -/* - * Run fn1 in a unshared environmnent, and fn2 in the original context - */ -int do_clone_unshare_tests(int use_clone, unsigned long clone_flags, - int (*fn1) (void *arg), void *arg1, - int (*fn2) (void *arg), void *arg2) -{ - switch (use_clone) { - case T_NONE: - return do_plain_tests(fn1, arg1, fn2, arg2); - case T_CLONE: - return do_clone_tests(clone_flags, fn1, arg1, fn2, arg2); - case T_UNSHARE: - return do_unshare_tests(clone_flags, fn1, arg1, fn2, arg2); - default: - printf("%s: bad use_clone option: %d\n", __FUNCTION__, - use_clone); - return -1; - } -} diff --git a/testcases/kernel/containers/libclone/libclone.h b/testcases/kernel/containers/libclone/libclone.h deleted file mode 100755 index b8740f1b..00000000 --- a/testcases/kernel/containers/libclone/libclone.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -* Copyright (c) International Business Machines Corp., 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 -* -***************************************************************************/ -#ifndef __LIBCLONE_H -#define __LIBCLONE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lapi/syscalls.h" -#include "test.h" -#include "lapi/namespaces_constants.h" - -#define T_UNSHARE 0 -#define T_CLONE 1 -#define T_NONE 2 - -#ifndef SYS_unshare -#ifdef __NR_unshare -#define SYS_unshare __NR_unshare -#elif __i386__ -#define SYS_unshare 310 -#elif __ia64__ -#define SYS_unshare 1296 -#elif __x86_64__ -#define SYS_unshare 272 -#elif __s390x__ || __s390__ -#define SYS_unshare 303 -#elif __powerpc__ -#define SYS_unshare 282 -#else -#error "unshare not supported on this architecure." -#endif -#endif - -#ifndef __NR_unshare -#define __NR_unshare SYS_unshare -#endif - -/* - * Run fn1 in a unshared environmnent, and fn2 in the original context - * Fn2 may be NULL. - */ - -int do_clone_tests(unsigned long clone_flags, - int(*fn1)(void *arg), void *arg1, - int(*fn2)(void *arg), void *arg2); - -int do_unshare_tests(unsigned long clone_flags, - int (*fn1)(void *arg), void *arg1, - int (*fn2)(void *arg), void *arg2); - -int do_fork_tests(int (*fn1)(void *arg), void *arg1, - int (*fn2)(void *arg), void *arg2); - -int do_clone_unshare_test(int use_clone, unsigned long clone_flags, - int (*fn1)(void *arg), void *arg1); - -int do_clone_unshare_tests(int use_clone, unsigned long clone_flags, - int (*fn1)(void *arg), void *arg1, - int (*fn2)(void *arg), void *arg2); - -#endif diff --git a/testcases/kernel/containers/mountns/mountns_helper.h b/testcases/kernel/containers/mountns/mountns_helper.h deleted file mode 100755 index 4b4538eb..00000000 --- a/testcases/kernel/containers/mountns/mountns_helper.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2014 Red Hat, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of version 2 the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - */ - -#include "libclone.h" -#include "test.h" -#include "safe_macros.h" - -#define DIRA "A" -#define DIRB "B" - -static int dummy_child(void *v) -{ - (void) v; - return 0; -} - -static int check_newns(void) -{ - int pid, status; - - if (tst_kvercmp(2, 4, 19) < 0) - tst_brkm(TCONF, NULL, "CLONE_NEWNS not supported"); - - pid = do_clone_unshare_test(T_CLONE, CLONE_NEWNS, dummy_child, NULL); - if (pid == -1) - tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWNS not supported"); - SAFE_WAIT(NULL, &status); - - return 0; -} - -static void cleanup(void) -{ - umount(DIRA); - umount(DIRB); - tst_rmdir(); -} - -static void setup(void) -{ - tst_require_root(); - check_newns(); - tst_tmpdir(); - TST_CHECKPOINT_INIT(tst_rmdir); - SAFE_MKDIR(cleanup, DIRA, 0777); - SAFE_MKDIR(cleanup, DIRB, 0777); - SAFE_TOUCH(cleanup, DIRA"/A", 0, NULL); - SAFE_TOUCH(cleanup, DIRB"/B", 0, NULL); -} diff --git a/testcases/kernel/containers/mqns/mqns.h b/testcases/kernel/containers/mqns/mqns.h deleted file mode 100755 index 5a905683..00000000 --- a/testcases/kernel/containers/mqns/mqns.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __MQNS_H -#define __MQNS_H - -#define DEV_MQUEUE "/dev/mqueue" -#define DEV_MQUEUE2 "/dev/mqueue2" -#define SLASH_MQ1 "/MQ1" -#define NOSLASH_MQ1 "MQ1" -#define SLASH_MQ2 "/MQ2" -#define NOSLASH_MQ2 "MQ2" - -#endif /* __MQNS_H */ diff --git a/testcases/kernel/containers/mqns/mqns_helper.h b/testcases/kernel/containers/mqns/mqns_helper.h deleted file mode 100755 index 605378d4..00000000 --- a/testcases/kernel/containers/mqns/mqns_helper.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) International Business Machines Corp., 2009 - * Copyright (c) Nadia Derbey, 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 - * - * Author: Serge Hallyn - ***************************************************************************/ -#include -#include -#include -#include -#include "../libclone/libclone.h" -#include "lapi/syscalls.h" -#include "safe_macros.h" -#include "test.h" - -static int dummy_child(void *v) -{ - (void) v; - return 0; -} - -static void check_mqns(void) -{ - int pid, status; - mqd_t mqd; - - if (tst_kvercmp(2, 6, 30) < 0) - tst_brkm(TCONF, NULL, "Kernel version is lower than expected"); - - mq_unlink("/checkmqnsenabled"); - mqd = - mq_open("/checkmqnsenabled", O_RDWR | O_CREAT | O_EXCL, 0777, NULL); - if (mqd == -1) - tst_brkm(TCONF, NULL, "mq_open check failed"); - - mq_close(mqd); - mq_unlink("/checkmqnsenabled"); - - pid = do_clone_unshare_test(T_CLONE, CLONE_NEWIPC, dummy_child, NULL); - if (pid == -1) - tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWIPC not supported"); - - SAFE_WAIT(NULL, &status); -} diff --git a/testcases/kernel/containers/netns/netns_helper.sh b/testcases/kernel/containers/netns/netns_helper.sh deleted file mode 100755 index d7d4d2c2..00000000 --- a/testcases/kernel/containers/netns/netns_helper.sh +++ /dev/null @@ -1,278 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) Linux Test Project, 2014-2021 -# Copyright (c) 2015 Red Hat, Inc. - -TST_CLEANUP=netns_ns_exec_cleanup -TST_NEEDS_ROOT=1 -TST_NEEDS_CMDS="ip ping" -TST_NEEDS_DRIVERS="veth" -. tst_test.sh - -# Set to 1 only for test cases using ifconfig (ioctl). -USE_IFCONFIG=0 - -# Variables which can be used in test cases (set by netns_setup() function): - -# Use in test cases to execute commands inside a namespace. Set to 'ns_exec' or -# 'ip netns exec' command according to NS_EXEC_PROGRAM argument specified in -# netns_setup() function call. -NS_EXEC= - -# Set to "net" for ns_create/ns_exec as their options requires -# to specify a namespace type. Empty for ip command. -NS_TYPE= - -# IP addresses of veth0 (IP0) and veth1 (IP1) devices (ipv4/ipv6 variant -# is determined according to the IP_VERSION argument specified in netns_setup() -# function call. -IP0= -IP1= -NETMASK= - -# 'ping' or 'ping6' according to the IP_VERSION argument specified -# in netns_setup() function call. -tping= - -# Network namespaces handles for manipulating and executing commands inside -# namespaces. For 'ns_exec' handles are PIDs of daemonized processes running -# in namespaces. -NS_HANDLE0= -NS_HANDLE1= - -# Adds "inet6 add" to the 'ifconfig' arguments which is required for the ipv6 -# version. Always use with 'ifconfig', even if ipv4 version of a test case is -# used, in which case IFCONF_IN6_ARG will be empty string. Usage: -# ifconfig $IFCONF_IN6_ARG IP/NETMASK -IFCONF_IN6_ARG= - -# Sets up global variables which can be used in test cases (documented above), -# creates two network namespaces and a pair of virtual ethernet devices, each -# device in one namespace. Each device is then enabled and assigned an IP -# address according to the function parameters. IFCONF_IN6_ARG variable is set -# only if ipv6 variant of test case is used (determined by IP_VERSION argument). -# -# SYNOPSIS: -# netns_setup -# -# -# OPTIONS: -# * NS_EXEC_PROGRAM (ns_exec|ip) -# Program which will be used to enter and run other commands -# inside a network namespace. -# * IP_VERSION (ipv4|ipv6) -# Version of IP. (ipv4|ipv6) -# * COMM_TYPE (netlink|ioctl) -# Communication type between kernel and user space -# for enabling and assigning IP addresses to the virtual -# ethernet devices. Uses 'ip' command for netlink and 'ifconfig' -# for ioctl. (If set to ioctl, function also checks the existance -# of the 'ifconfig' command.) -# * IP4_VETH0, IP4_VETH1 -# IPv4 addresses for veth0 and veth1 devices. -# * IP6_VETH0, IP6_VETH1 -# IPv6 addresses for veth0 and veth1 devices. -# -# On success function returns, on error tst_brk is called and TC is terminated. -netns_setup() -{ - case "$1" in - ns_exec) - setns_check - [ $? -eq 32 ] && tst_brk TCONF "setns not supported" - - NS_TYPE="net" - netns_ns_exec_setup - TST_CLEANUP=netns_ns_exec_cleanup - ;; - ip) - netns_ip_setup - TST_CLEANUP=netns_ip_cleanup - ;; - *) - tst_brk TBROK \ - "first argument must be a program used to enter a network namespace (ns_exec|ip)" - ;; - esac - - case "$3" in - netlink) - ;; - ioctl) - USE_IFCONFIG=1 - tst_require_cmds ifconfig - ;; - *) - tst_brk TBROK \ - "third argument must be a comm. type between kernel and user space (netlink|ioctl)" - ;; - esac - - if [ -z "$4" ]; then - tst_brk TBROK "fourth argument must be the IPv4 address for veth0" - fi - if [ -z "$5" ]; then - tst_brk TBROK "fifth argument must be the IPv4 address for veth1" - fi - if [ -z "$6" ]; then - tst_brk TBROK "sixth argument must be the IPv6 address for veth0" - fi - if [ -z "$7" ]; then - tst_brk TBROK "seventh argument must be the IPv6 address for veth1" - fi - - case "$2" in - ipv4) - IP0=$4 - IP1=$5 - tping="ping" - NETMASK=24 - ;; - ipv6) - IFCONF_IN6_ARG="inet6 add" - IP0=$6 - IP1=$7 - - if tst_cmd_available ping6; then - tping="ping6" - else - tping="ping -6" - tst_res_ TINFO "ping6 binary/symlink is missing, using workaround. Please, report missing ping6 to your distribution." - fi - NETMASK=64 - ;; - *) - tst_brk TBROK "second argument must be an ip version (ipv4|ipv6)" - ;; - esac - - netns_set_ip -} - -# Sets up NS_EXEC to use 'ns_exec', creates two network namespaces and stores -# their handles into NS_HANDLE0 and NS_HANDLE1 variables (in this case handles -# are PIDs of daemonized processes running in these namespaces). Virtual -# ethernet device is then created for each namespace. -netns_ns_exec_setup() -{ - local ret - - NS_EXEC="ns_exec" - - NS_HANDLE0=$(ns_create $NS_TYPE) - if [ $? -eq 1 ]; then - tst_res TINFO "$NS_HANDLE0" - tst_brk TBROK "unable to create a new network namespace" - fi - - NS_HANDLE1=$(ns_create $NS_TYPE) - if [ $? -eq 1 ]; then - tst_res TINFO "$NS_HANDLE1" - tst_brk TBROK "unable to create a new network namespace" - fi - - $NS_EXEC $NS_HANDLE0 $NS_TYPE ip link add veth0 type veth peer name veth1 || \ - tst_brk TBROK "unable to create veth pair devices" - - $NS_EXEC $NS_HANDLE0 $NS_TYPE ns_ifmove veth1 $NS_HANDLE1 - ret=$? - [ $ret -eq 0 ] && return - [ $ret -eq 32 ] && tst_brk TCONF "IFLA_NET_NS_PID not supported" - - tst_brk TBROK "unable to add device veth1 to the separate network namespace" -} - -# Sets up NS_EXEC to use 'ip netns exec', creates two network namespaces -# and stores their handles into NS_HANDLE0 and NS_HANDLE1 variables. Virtual -# ethernet device is then created for each namespace. -netns_ip_setup() -{ - ip netns > /dev/null || \ - tst_brk TCONF "ip without netns support (required iproute2 >= ss111010 - v3.0.0)" - - NS_EXEC="ip netns exec" - - NS_HANDLE0=tst_net_ns0 - NS_HANDLE1=tst_net_ns1 - - ip netns del $NS_HANDLE0 2>/dev/null - ip netns del $NS_HANDLE1 2>/dev/null - - ip netns add $NS_HANDLE0 || \ - tst_brk TBROK "unable to create a new network namespace" - ip netns add $NS_HANDLE1 || \ - tst_brk TBROK "unable to create a new network namespace" - - $NS_EXEC $NS_HANDLE0 ip link add veth0 type veth peer name veth1 || \ - tst_brk TBROK "unable to create veth pair devices" - - $NS_EXEC $NS_HANDLE0 ip link set veth1 netns $NS_HANDLE1 || \ - tst_brk TBROK "unable to add device veth1 to the separate network namespace" -} - -# Enables virtual ethernet devices and assigns IP addresses for both -# of them (IPv4/IPv6 variant is decided by netns_setup() function). -netns_set_ip() -{ - [ "$NS_EXEC" ] || tst_brk TBROK "netns_setup() function must be called first" - - # This applies only for ipv6 variant: - # Do not accept Router Advertisements (accept_ra) and do not use - # Duplicate Address Detection (accept_dad) which uses Neighbor - # Discovery Protocol - the problem is that until DAD can confirm that - # there is no other host with the same address, the address is - # considered to be "tentative" (attempts to bind() to the address fail - # with EADDRNOTAVAIL) which may cause problems for tests using ipv6. - echo 0 | $NS_EXEC $NS_HANDLE0 $NS_TYPE \ - tee /proc/sys/net/ipv6/conf/veth0/accept_dad \ - /proc/sys/net/ipv6/conf/veth0/accept_ra >/dev/null - echo 0 | $NS_EXEC $NS_HANDLE1 $NS_TYPE \ - tee /proc/sys/net/ipv6/conf/veth1/accept_dad \ - /proc/sys/net/ipv6/conf/veth1/accept_ra >/dev/null - - case $USE_IFCONFIG in - 1) - $NS_EXEC $NS_HANDLE0 $NS_TYPE ifconfig veth0 $IFCONF_IN6_ARG $IP0/$NETMASK || - tst_brk TBROK "adding address to veth0 failed" - $NS_EXEC $NS_HANDLE1 $NS_TYPE ifconfig veth1 $IFCONF_IN6_ARG $IP1/$NETMASK || - tst_brk TBROK "adding address to veth1 failed" - $NS_EXEC $NS_HANDLE0 $NS_TYPE ifconfig veth0 up || - tst_brk TBROK "enabling veth0 device failed" - $NS_EXEC $NS_HANDLE1 $NS_TYPE ifconfig veth1 up || - tst_brk TBROK "enabling veth1 device failed" - ;; - *) - $NS_EXEC $NS_HANDLE0 $NS_TYPE ip address add $IP0/$NETMASK dev veth0 || - tst_brk TBROK "adding address to veth0 failed" - $NS_EXEC $NS_HANDLE1 $NS_TYPE ip address add $IP1/$NETMASK dev veth1 || - tst_brk TBROK "adding address to veth1 failed" - $NS_EXEC $NS_HANDLE0 $NS_TYPE ip link set veth0 up || - tst_brk TBROK "enabling veth0 device failed" - $NS_EXEC $NS_HANDLE1 $NS_TYPE ip link set veth1 up || - tst_brk TBROK "enabling veth1 device failed" - ;; - esac -} - -netns_ns_exec_cleanup() -{ - [ "$NS_EXEC" ] || return - - # removes veth0 device (which also removes the paired veth1 device) - $NS_EXEC $NS_HANDLE0 $NS_TYPE ip link delete veth0 - - kill -9 $NS_HANDLE0 2>/dev/null - kill -9 $NS_HANDLE1 2>/dev/null -} - - -netns_ip_cleanup() -{ - [ "$NS_EXEC" ] || return - - # removes veth0 device (which also removes the paired veth1 device) - $NS_EXEC $NS_HANDLE0 ip link delete veth0 - - ip netns del $NS_HANDLE0 2>/dev/null - ip netns del $NS_HANDLE1 2>/dev/null -} diff --git a/testcases/kernel/containers/pidns/pidns_helper.h b/testcases/kernel/containers/pidns/pidns_helper.h deleted file mode 100755 index dad7a6d3..00000000 --- a/testcases/kernel/containers/pidns/pidns_helper.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -* Copyright (c) International Business Machines Corp., 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. -*/ - -#include "../libclone/libclone.h" -#include "test.h" -#include "safe_macros.h" - -static int dummy_child(void *v) -{ - (void) v; - return 0; -} - -static int check_newpid(void) -{ - int pid, status; - - if (tst_kvercmp(2, 6, 24) < 0) - tst_brkm(TCONF, NULL, "CLONE_NEWPID not supported"); - - pid = do_clone_unshare_test(T_CLONE, CLONE_NEWPID, dummy_child, NULL); - if (pid == -1) - tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWPID not supported"); - SAFE_WAIT(NULL, &status); - - return 0; -} diff --git a/testcases/kernel/containers/share/.gitignore b/testcases/kernel/containers/share/.gitignore deleted file mode 100755 index 06615d9e..00000000 --- a/testcases/kernel/containers/share/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/ns_ifmove -/ns_create -/ns_exec -/setns_check diff --git a/testcases/kernel/containers/share/Makefile b/testcases/kernel/containers/share/Makefile deleted file mode 100755 index 962d6889..00000000 --- a/testcases/kernel/containers/share/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2015 Red Hat, Inc. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of version 2 the GNU General Public License as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU 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 . -############################################################################## -top_srcdir ?= ../../../.. - -include $(top_srcdir)/include/mk/testcases.mk -include $(abs_srcdir)/../Makefile.inc - -LDLIBS := -lltp - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/containers/share/ns_common.h b/testcases/kernel/containers/share/ns_common.h deleted file mode 100755 index 69e51ce7..00000000 --- a/testcases/kernel/containers/share/ns_common.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (c) 2015 Red Hat, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of version 2 the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - * - ***********************************************************************/ - -#ifndef __NS_COMMON_H__ -#define __NS_COMMON_H__ -#include -#include "lapi/namespaces_constants.h" - -#define PROC_PATH "/proc" -#define NS_TOTAL 6 - - -struct param { - const char *name; - int flag; -}; - -struct param params[] = { - {"ipc", CLONE_NEWIPC}, - {"mnt", CLONE_NEWNS}, - {"net", CLONE_NEWNET}, - {"pid", CLONE_NEWPID}, - {"user", CLONE_NEWUSER}, - {"uts", CLONE_NEWUTS}, - {NULL, 0} -}; - - -struct param *get_param(const char *name) -{ - int i; - - for (i = 0; params[i].name; i++) { - if (!strcasecmp(params[i].name, name)) - return params + i; - } - - return NULL; -} - - -#endif diff --git a/testcases/kernel/containers/share/ns_create.c b/testcases/kernel/containers/share/ns_create.c deleted file mode 100755 index d4259f38..00000000 --- a/testcases/kernel/containers/share/ns_create.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (c) 2015 Red Hat, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of version 2 the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - * - * Written by Matus Marhefka - * - *********************************************************************** - * Creates a child process in the new specified namespace(s), child is then - * daemonized and is running in the background. PID of the daemonized child - * process is printed on the stdout. As the new namespace(s) is(are) maintained - * by the daemonized child process it(they) can be removed by killing this - * process. - * - */ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include "test.h" -#include "lapi/namespaces_constants.h" -#include "ns_common.h" - -char *TCID = "ns_create"; - - -void print_help(void) -{ - int i; - - printf("usage: ns_create <%s", params[0].name); - - for (i = 1; params[i].name; i++) - printf("|,%s", params[i].name); - printf(">\nThe only argument is a comma separated list " - "of namespaces to create.\nExample: ns_create net,ipc\n"); -} - -static int child_fn(void *arg LTP_ATTRIBUTE_UNUSED) -{ - int i; - - if (setsid() == -1) { - tst_resm(TINFO | TERRNO, "setsid"); - exit(1); - } - - if (chdir("/") == -1) { - tst_resm(TINFO | TERRNO, "chdir"); - exit(1); - } - - /* close all inherrited file descriptors */ - for (i = 0; i < sysconf(_SC_OPEN_MAX); i++) - close(i); - - pause(); - return 0; -} - -/* - * ./ns_create - */ -int main(int argc, char *argv[]) -{ - int pid, flags; - char *token; - - if (argc < 2) { - print_help(); - return 1; - } - - flags = 0; - while ((token = strsep(&argv[1], ","))) { - struct param *p = get_param(token); - - if (!p) { - tst_resm(TINFO, "Unknown namespace: %s", token); - print_help(); - return 1; - } - - flags |= p->flag; - } - - pid = ltp_clone_quick(flags | SIGCHLD, child_fn, NULL); - if (pid == -1) { - tst_resm(TINFO | TERRNO, "ltp_clone_quick"); - return 1; - } - - printf("%d", pid); - return 0; -} diff --git a/testcases/kernel/containers/share/ns_exec.c b/testcases/kernel/containers/share/ns_exec.c deleted file mode 100755 index c492165f..00000000 --- a/testcases/kernel/containers/share/ns_exec.c +++ /dev/null @@ -1,158 +0,0 @@ -/* Copyright (c) 2015 Red Hat, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of version 2 the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - * - * Written by Matus Marhefka - * - *********************************************************************** - * Enters the namespace(s) of a process specified by a PID and then executes - * the indicated program inside that namespace(s). - * - */ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include "test.h" -#include "lapi/syscalls.h" -#include "lapi/namespaces_constants.h" -#include "ns_common.h" - -char *TCID = "ns_exec"; -int ns_fd[NS_TOTAL]; -int ns_fds; - - -void print_help(void) -{ - int i; - - printf("usage: ns_exec <%s", params[0].name); - - for (i = 1; params[i].name; i++) - printf("|,%s", params[i].name); - printf("> [ARGS]\nSecond argument indicates the types" - " of a namespaces maintained by NS_PID\nand is specified" - " as a comma separated list.\nExample: ns_exec 1234 net,ipc" - " ip a\n"); -} - -static int open_ns_fd(const char *pid, const char *ns) -{ - int fd; - char file_buf[30]; - - sprintf(file_buf, "%s/%s/ns/%s", PROC_PATH, pid, ns); - - fd = open(file_buf, O_RDONLY); - if (fd > 0) { - ns_fd[ns_fds] = fd; - ++ns_fds; - return 0; - } else if (fd == -1 && errno != ENOENT) { - tst_resm(TINFO | TERRNO, "open"); - return -1; - } - - return 0; -} - -static void close_ns_fd(void) -{ - int i; - - for (i = 0; i < ns_fds; i++) - close(ns_fd[i]); -} - -static int child_fn(void *arg) -{ - char **args = (char **)arg; - - execvp(args[3], args+3); - tst_resm(TINFO | TERRNO, "execvp"); - return 1; -} - -/* - * ./ns_exec [ARGS] - */ -int main(int argc, char *argv[]) -{ - int i, rv, pid; - char *token; - - rv = syscall(__NR_setns, -1, 0); - if (rv == -1 && errno == ENOSYS) { - tst_resm(TINFO, "setns is not supported in the kernel"); - return 1; - } - - if (argc < 4) { - print_help(); - return 1; - } - - memset(ns_fd, 0, sizeof(ns_fd)); - while ((token = strsep(&argv[2], ","))) { - struct param *p = get_param(token); - - if (!p) { - tst_resm(TINFO, "Unknown namespace: %s", token); - print_help(); - return 1; - } - - if (open_ns_fd(argv[1], token) != 0) - return 1; - } - - if (ns_fds == 0) { - tst_resm(TINFO, "no namespace entries in /proc/%s/ns/", - argv[1]); - return 1; - } - - for (i = 0; i < ns_fds; i++) { - if (syscall(__NR_setns, ns_fd[i], 0) == -1) { - tst_resm(TINFO | TERRNO, "setns"); - close_ns_fd(); - return 1; - } - } - - pid = ltp_clone_quick(SIGCHLD, (void *)child_fn, (void *)argv); - if (pid == -1) { - tst_resm(TINFO | TERRNO, "ltp_clone_quick"); - close_ns_fd(); - return 1; - } - - if (waitpid(pid, &rv, 0) == -1) { - tst_resm(TINFO | TERRNO, "waitpid"); - return 1; - } - - close_ns_fd(); - - if (WIFEXITED(rv)) - return WEXITSTATUS(rv); - - return 0; -} diff --git a/testcases/kernel/containers/share/ns_ifmove.c b/testcases/kernel/containers/share/ns_ifmove.c deleted file mode 100755 index 12642c6f..00000000 --- a/testcases/kernel/containers/share/ns_ifmove.c +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (c) 2015 Red Hat, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of version 2 the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - * - * Written by Matus Marhefka - * - *********************************************************************** - * Moves a network interface to the namespace of a process specified by a PID. - * - */ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "test.h" - -#include "config.h" - -char *TCID = "ns_ifmove"; - -#if HAVE_DECL_IFLA_NET_NS_PID - -struct { - struct nlmsghdr nh; - struct ifinfomsg ifi; - char attrbuf[512]; -} req; - - -int get_intf_index_from_name(const char *intf_name) -{ - struct ifreq ifr; - int sock_fd; - - memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, intf_name, sizeof(ifr.ifr_name) - 1); - ifr.ifr_name[sizeof(ifr.ifr_name)-1] = '\0'; - - sock_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); - if (sock_fd == -1) { - tst_resm(TINFO | TERRNO, "socket"); - return -1; - } - - /* gets interface index */ - if (ioctl(sock_fd, SIOCGIFINDEX, &ifr) == -1) { - tst_resm(TINFO | TERRNO, "ioctl"); - close(sock_fd); - return -1; - } - - close(sock_fd); - return ifr.ifr_ifindex; -} - -/* - * ./ns_ifmove - */ -int main(int argc, char **argv) -{ - struct rtattr *rta; - int intf_index, pid, rtnetlink_socket; - - if (argc != 3) { - tst_resm(TINFO, "%s ", - argv[0]); - return 1; - } - - intf_index = get_intf_index_from_name(argv[1]); - if (intf_index == -1) { - tst_resm(TINFO , "unable to get interface index"); - return 1; - } - - pid = atoi(argv[2]); - - rtnetlink_socket = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); - if (rtnetlink_socket == -1) { - tst_resm(TINFO | TERRNO, "socket"); - return 1; - } - - memset(&req, 0, sizeof(req)); - req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); - req.nh.nlmsg_flags = NLM_F_REQUEST; - req.nh.nlmsg_type = RTM_NEWLINK; - req.ifi.ifi_family = AF_UNSPEC; - req.ifi.ifi_index = intf_index; - req.ifi.ifi_change = 0xffffffff; - rta = (struct rtattr *)(((char *) &req) + - NLMSG_ALIGN(req.nh.nlmsg_len)); - rta->rta_type = IFLA_NET_NS_PID; - rta->rta_len = RTA_LENGTH(sizeof(int)); - req.nh.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) + - RTA_LENGTH(sizeof(pid)); - memcpy(RTA_DATA(rta), &pid, sizeof(pid)); - - if (send(rtnetlink_socket, &req, req.nh.nlmsg_len, 0) == -1) { - tst_resm(TINFO | TERRNO, "send"); - return 1; - } - - close(rtnetlink_socket); - return 0; -} - -#else - -int main(void) -{ - tst_brkm(TCONF, NULL, "IFLA_NET_NS_PID not defined in linux/if_link.h"); -} - -#endif diff --git a/testcases/kernel/containers/share/setns_check.c b/testcases/kernel/containers/share/setns_check.c deleted file mode 100755 index 75aad17f..00000000 --- a/testcases/kernel/containers/share/setns_check.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 2015 Fujitsu Ltd. - * Author: Guangwen Feng - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of version 2 the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - * - *********************************************************************** - * Check for setns() availability, should be called before ns_exec. - * - */ - -#include "test.h" -#include "lapi/syscalls.h" - -char *TCID = "setns_check"; - -int main(void) -{ - if (syscall(__NR_setns, -1, 0) == -1 && errno == ENOSYS) - tst_brkm(TCONF, NULL, "setns is not supported in the kernel"); - else - return 0; -} diff --git a/testcases/kernel/containers/sysvipc/ipcns_helper.h b/testcases/kernel/containers/sysvipc/ipcns_helper.h deleted file mode 100755 index 01ad0fff..00000000 --- a/testcases/kernel/containers/sysvipc/ipcns_helper.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -* Copyright (c) International Business Machines Corp., 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 -* -* Author: Rishikesh K Rajak -***************************************************************************/ -#include -#include "../libclone/libclone.h" -#include "test.h" -#include "safe_macros.h" - -static int dummy_child(void *v) -{ - (void) v; - return 0; -} - -static void check_newipc(void) -{ - int pid, status; - - if (tst_kvercmp(2, 6, 19) < 0) - tst_brkm(TCONF, NULL, "CLONE_NEWIPC not supported"); - - pid = do_clone_unshare_test(T_CLONE, CLONE_NEWIPC, dummy_child, NULL); - if (pid == -1) - tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWIPC not supported"); - - SAFE_WAIT(NULL, &status); -} diff --git a/testcases/kernel/containers/userns/userns_helper.h b/testcases/kernel/containers/userns/userns_helper.h deleted file mode 100755 index 12b491f6..00000000 --- a/testcases/kernel/containers/userns/userns_helper.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd., 2015 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - */ - -#include "../libclone/libclone.h" -#include "test.h" -#include "safe_macros.h" -#include - -#define UID_MAP 0 -#define GID_MAP 1 - -static int dummy_child(void *v) -{ - (void) v; - return 0; -} - -static int check_newuser(void) -{ - int pid, status; - - if (tst_kvercmp(3, 8, 0) < 0) - tst_brkm(TCONF, NULL, "CLONE_NEWUSER not supported"); - - pid = do_clone_unshare_test(T_CLONE, CLONE_NEWUSER, dummy_child, NULL); - if (pid == -1) - tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWUSER not supported"); - SAFE_WAIT(NULL, &status); - - return 0; -} - -LTP_ATTRIBUTE_UNUSED static int updatemap(int cpid, bool type, int idnum, - int parentmappid, void (*cleanup)(void)) -{ - char path[BUFSIZ]; - char content[BUFSIZ]; - int fd; - - if (type == UID_MAP) - sprintf(path, "/proc/%d/uid_map", cpid); - else if (type == GID_MAP) - sprintf(path, "/proc/%d/gid_map", cpid); - else - tst_brkm(TBROK, cleanup, "invalid type parameter"); - - sprintf(content, "%d %d 1", idnum, parentmappid); - fd = SAFE_OPEN(cleanup, path, O_WRONLY, 0644); - SAFE_WRITE(cleanup, 1, fd, content, strlen(content)); - SAFE_CLOSE(cleanup, fd); - return 0; -} diff --git a/testcases/kernel/containers/utsname/runutstests_noltp.sh b/testcases/kernel/containers/utsname/runutstests_noltp.sh deleted file mode 100755 index 43cb7e26..00000000 --- a/testcases/kernel/containers/utsname/runutstests_noltp.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -################################################################################ -## ## -## Copyright (c) International Business Machines Corp., 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 ## -## ## -################################################################################ - -oldhostname=`hostname` -exit_code=0 -echo "unshare tests" -for i in `seq 1 5`; do - echo "test $i (unshare)" - ./utstest_noltp unshare $i - if [ $? -ne 0 ]; then - exit_code=$? - fi -done -echo "clone tests" -for i in `seq 1 5`; do - echo "test $i (clone)" - ./utstest_noltp clone $i - if [ $? -ne 0 ]; then - exit_code=$? - fi -done -hostname "$oldhostname" -exit $exit_code diff --git a/testcases/kernel/containers/utsname/utstest.c b/testcases/kernel/containers/utsname/utstest.c deleted file mode 100755 index d22db79c..00000000 --- a/testcases/kernel/containers/utsname/utstest.c +++ /dev/null @@ -1,356 +0,0 @@ -/* -* Copyright (c) International Business Machines Corp., 2007 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -* the GNU General Public License for more details. -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -*************************************************************************** - * Copyright 2007 IBM - * Author: Serge Hallyn - * - * test1: - P1: A=gethostname - P2: B=gethostname - Ensure(A==B) - - * test2: - P1: sethostname(A); - P2: (wait); B=gethostname - Ensure (A==B) - - * test3: - P1: A=gethostname; unshare(utsname); sethostname(newname); C=gethostname - P2: B=gethostname; (wait); (wait); D=gethostname - Ensure (A==B && A==D && C!=D) - - * test4: - P1: A=gethostname; unshare(utsname); (wait); C=gethostname - P2: B=gethostname; (wait); sethostname(newname); D=gethostname - Ensure (A==B && A==C && C!=D) - - * test5: - P1: drop_privs(); unshare(utsname); (wait); C=gethostname - P2: (wait); sethostname(B); D=gethostname - Ensure (B==C==D) and state is ok. - * - */ - -#define _GNU_SOURCE 1 -#include -#include -#include -#include -#include -#include -#include -#include "libclone.h" -#include "test.h" -#include "safe_macros.h" - -char *TCID = "uts_namespace"; -int TST_TOTAL = 1; - -static int dummy_child(void *v) -{ - (void) v; - return 0; -} - -static void check_newuts(void) -{ - int pid, status; - - if (tst_kvercmp(2, 6, 19) < 0) - tst_brkm(TCONF, NULL, "CLONE_NEWUTS not supported"); - - pid = do_clone_unshare_test(T_CLONE, CLONE_NEWUTS, dummy_child, NULL); - if (pid == -1) - tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWUTS not supported"); - - SAFE_WAIT(NULL, &status); -} - -int drop_root(void) -{ - int ret; - ret = setresuid(1000, 1000, 1000); - if (ret) { - perror("setresuid"); - exit(4); - } - return 1; -} - -#define HLEN 100 -#define NAME1 "serge1" -#define NAME2 "serge2" - -int p1fd[2], p2fd[2]; -static char oldhost[HLEN]; -pid_t cpid; - -void picknewhostname(char *orig, char *new) -{ - memset(new, 0, HLEN); - if (strcmp(orig, NAME1) == 0) - strcpy(new, NAME2); - else - strcpy(new, NAME1); -} - -void zeroize(char *s) -{ - memset(s, 0, HLEN); -} - -char *tsttype; -int P1(void *vtest) -{ - char hostname[HLEN], newhostname[HLEN], rhostname[HLEN]; - int err; - int len; - int testnum; - - testnum = atoi((char *)vtest); - - close(p1fd[1]); - close(p2fd[0]); - - switch (testnum) { - case 1: - gethostname(hostname, HLEN); - zeroize(rhostname); - len = read(p1fd[0], rhostname, HLEN); - if (strcmp(hostname, rhostname) == 0) { - tst_resm(TPASS, "test 1 (%s): success", tsttype); - tst_exit(); - } - tst_brkm(TFAIL, NULL, - "test 1 (%s): hostname 1 %s, hostname 2 %s", - tsttype, hostname, rhostname); - case 2: - gethostname(hostname, HLEN); - picknewhostname(hostname, newhostname); - err = sethostname(newhostname, strlen(newhostname)); - write(p2fd[1], "1", 1); - if (err == -1) { - tst_brkm(TFAIL, NULL, - "test 2 (%s): failed to sethostname", - tsttype); - } - zeroize(rhostname); - len = read(p1fd[0], rhostname, HLEN); - if (strcmp(newhostname, rhostname) == 0) { - tst_resm(TPASS, "test 2 (%s): success", tsttype); - tst_exit(); - } - tst_brkm(TFAIL, NULL, - "test 2 (%s) hostname 1 %s, hostname 2 %s", - tsttype, newhostname, rhostname); - case 3: - gethostname(hostname, HLEN); - picknewhostname(hostname, newhostname); - err = sethostname(newhostname, strlen(newhostname)); - write(p2fd[1], "1", 1); - if (err == -1) { - tst_brkm(TFAIL, NULL, - "test 3 (%s): failed to sethostname", - tsttype); - } - - zeroize(rhostname); - len = read(p1fd[0], rhostname, HLEN); - if (strcmp(newhostname, rhostname) == 0) { - tst_brkm(TFAIL, - NULL, - "test 3 (%s): hostname 1 %s, hostname 2 %s, these should have been different", - tsttype, newhostname, rhostname); - } - if (strcmp(hostname, rhostname) == 0) { - tst_resm(TPASS, "test 3 (%s): success", tsttype); - tst_exit(); - } - tst_brkm(TFAIL, - NULL, - "test 3 (%s): hostname 1 %s, hostname 2 %s, should have been same", - tsttype, hostname, rhostname); - - case 4: - gethostname(hostname, HLEN); - write(p2fd[1], "1", 1); /* tell p2 to go ahead and sethostname */ - zeroize(rhostname); - len = read(p1fd[0], rhostname, HLEN); - gethostname(newhostname, HLEN); - if (strcmp(hostname, newhostname) != 0) { - tst_brkm(TFAIL, - NULL, - "test 4 (%s): hostname 1 %s, hostname 2 %s, should be same", - tsttype, hostname, newhostname); - } - if (strcmp(hostname, rhostname) == 0) { - tst_brkm(TFAIL, - NULL, - "test 4 (%s): hostname 1 %s, hostname 2 %s, should be different", - tsttype, hostname, rhostname); - } - tst_resm(TPASS, "test 4 (%s): successful", tsttype); - tst_exit(); - case 5: - write(p2fd[1], "1", 1); /* tell p2 to go ahead and sethostname */ - zeroize(rhostname); - len = read(p1fd[0], rhostname, HLEN); - gethostname(newhostname, HLEN); - if (strcmp(rhostname, newhostname) != 0) { - tst_brkm(TFAIL, - NULL, - "test 5 (%s): hostnames %s and %s should be same", - tsttype, rhostname, newhostname); - } - tst_resm(TPASS, "test 5 (%s): successful", tsttype); - tst_exit(); - default: - break; - } - tst_exit(); -} - -int P2(void *vtest) -{ - char hostname[HLEN], newhostname[HLEN]; - int len; - int testnum; - - testnum = atoi((char *)vtest); - - close(p1fd[0]); - close(p2fd[1]); - - switch (testnum) { - case 1: - gethostname(hostname, HLEN); - write(p1fd[1], hostname, strlen(hostname)); - break; - case 2: - case 3: - len = 0; - while (!len) { - len = read(p2fd[0], hostname, 1); - } - gethostname(hostname, HLEN); - write(p1fd[1], hostname, strlen(hostname)); - break; - case 4: - case 5: - len = 0; - while (!len) { - len = read(p2fd[0], hostname, 1); - } - if (hostname[0] == '0') { - tst_resm(TPASS, "P2: P1 claims error"); - return 0; - } - gethostname(hostname, HLEN); - picknewhostname(hostname, newhostname); - sethostname(newhostname, strlen(newhostname)); - write(p1fd[1], newhostname, strlen(newhostname)); - break; - default: - tst_resm(TFAIL, "undefined test: %d", testnum); - break; - } - return 0; -} - -static void setup(void) -{ - gethostname(oldhost, HLEN); - tst_require_root(); - check_newuts(); -} - -static void cleanup(void) -{ - sethostname(oldhost, strlen(oldhost)); -} - -#define UNSHARESTR "unshare" -#define CLONESTR "clone" -int main(int argc, char *argv[]) -{ - int r, pid, use_clone = T_UNSHARE; - int testnum; - void *vtest; - - setup(); - if (argc != 3) { - tst_resm(TFAIL, "Usage: %s ", - argv[0]); - tst_resm(TFAIL, - " where clone or unshare specifies unshare method,"); - tst_resm(TFAIL, " and testnum is between 1 and 5 inclusive"); - exit(2); - } - if (pipe(p1fd) == -1) { - perror("pipe"); - exit(EXIT_FAILURE); - } - if (pipe(p2fd) == -1) { - perror("pipe"); - exit(EXIT_FAILURE); - } - - tsttype = UNSHARESTR; - if (strcmp(argv[1], "clone") == 0) { - use_clone = T_CLONE; - tsttype = CLONESTR; - } - - testnum = atoi(argv[2]); - - vtest = (void *)argv[2]; - switch (testnum) { - case 1: - case 2: - r = do_clone_unshare_tests(T_NONE, 0, P1, vtest, P2, vtest); - break; - case 3: - case 4: - r = do_clone_unshare_tests(use_clone, CLONE_NEWUTS, - P1, vtest, P2, vtest); - break; - case 5: - pid = fork(); - if (pid == -1) { - perror("fork"); - exit(2); - } - if (pid == 0) { - if (!drop_root()) { - tst_brkm(TFAIL, NULL, "failed to drop root."); - } - r = do_clone_unshare_test(use_clone, CLONE_NEWUTS, - P1, vtest); - write(p2fd[1], "0", 1); /* don't let p2 hang */ - exit(0); - } else { - P2(vtest); - } - break; - default: - tst_resm(TFAIL, - "testnum should be between 1 and 5 inclusive."); - break; - } - - cleanup(); - tst_exit(); -} diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c b/testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c deleted file mode 100755 index b79b9373..00000000 --- a/testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2009 FUJITSU LIMITED - * Author: Li Zefan - */ - -#define _GNU_SOURCE - -#include -#include -#include -#include "test.h" - -#define DEFAULT_USEC 30000 - -int foo(void __attribute__ ((unused)) * arg) -{ - return 0; -} - -int main(int argc, char **argv) -{ - int usec; - - if (argc == 2) - usec = atoi(argv[1]); - else - usec = DEFAULT_USEC; - - while (1) { - usleep(usec); - ltp_clone_quick(CLONE_NEWNS, foo, NULL); - } - - tst_exit(); -} diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh deleted file mode 100755 index d5a3fa93..00000000 --- a/testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2009 FUJITSU LIMITED -# Author: Li Zefan - -trap exit USR1 - -while true; do - mount -t cgroup xxx cgroup/ > /dev/null 2>&1 - cat cgroup/release_agent > /dev/null 2>&1 - umount cgroup/ > /dev/null 2>&1 -done diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_9_2.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_9_2.sh deleted file mode 100755 index 0a9bbb18..00000000 --- a/testcases/kernel/controllers/cgroup/cgroup_regression_9_2.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2009 FUJITSU LIMITED -# Author: Li Zefan - -trap exit USR1 - -while true; do - mount -t cgroup xxx cgroup/ > /dev/null 2>&1 - umount cgroup/ > /dev/null 2>&1 -done diff --git a/testcases/kernel/fs/fs-bench/.gitignore b/testcases/kernel/fs/fs-bench/.gitignore deleted file mode 100755 index 5824a400..00000000 --- a/testcases/kernel/fs/fs-bench/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/create-files -/random-access -/random-access-del-create diff --git a/testcases/kernel/fs/fs-bench/Makefile b/testcases/kernel/fs/fs-bench/Makefile deleted file mode 100755 index bc570f7e..00000000 --- a/testcases/kernel/fs/fs-bench/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# -# kernel/fs/fs-bench testcases Makefile. -# -# Copyright (C) 2009, Cisco Systems Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Ngie Cooper, July 2009 -# - -top_srcdir ?= ../../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := modaltr.sh fs-bench-test.sh fs-bench-test2.sh - -LDLIBS += -lm - -create-files: boxmuler.o create-files.o - -random-access-del-create: boxmuler.o random-access-del-create.o - -MAKE_TARGETS := create-files random-access\ - random-access-del-create - -dist: clean - (cd $(abs_srcdir); tar zcvf fs-bench.tar.gz $(abs_srcdir)) - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/fs-bench/README b/testcases/kernel/fs/fs-bench/README deleted file mode 100755 index 20d49a95..00000000 --- a/testcases/kernel/fs/fs-bench/README +++ /dev/null @@ -1,45 +0,0 @@ -Programs for File system stress test. - -All of programs are distributed under GPL 2 license -by Hironobu SUZUKI - -HOW TO TEST ------------- - -1: Type "make" - - # cd - # tar zxvf fs-bench.tar.gz - # cd fs-bench - # make - -2: Change directory to terget file system and do-it! - (I always use one-HDD/one-partition for fs stress test.) - - # mount -t jfs /dev/hdc1 /jfs - # cd /jfs - # ~/fs-bench/test.sh 2>&1 | tee ~/fs-bench/jfs-test - - -NOTE ------ - -The size of files that are created for stress test is not fixed. The -file size are determined by probabilistic algorithm, box-muler -algorithm. - -number -of files - ^ - | **** - | * * - | * * - | * * - | ** ** - |** ** - +-------------------> file size - min max - - ------- -$Id: README,v 1.1 2004/11/18 20:23:05 robbiew Exp $ diff --git a/testcases/kernel/fs/fs-bench/boxmuler.c b/testcases/kernel/fs/fs-bench/boxmuler.c deleted file mode 100755 index e923a161..00000000 --- a/testcases/kernel/fs/fs-bench/boxmuler.c +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -#define M_2PI (M_PI*2) - -int box_muler(int min, int max) -{ - double u1, u2, z; - int i; - int ave; - int range; - int ZZ; - if (min >= max) { - return (-1); - } - range = max - min; - ave = range / 2; - for (i = 0; i < 10; i++) { - u1 = ((double)(random() % 1000000)) / 1000000; - u2 = ((double)(random() % 1000000)) / 1000000; - z = sqrt(-2.0 * log(u1)) * cos(M_2PI * u2); - ZZ = min + (ave + (z * (ave / 4))); - if (ZZ >= min && ZZ < max) { - return (ZZ); - } - } - return (-1); -} diff --git a/testcases/kernel/fs/fs-bench/create-files.c b/testcases/kernel/fs/fs-bench/create-files.c deleted file mode 100755 index c6cba6f6..00000000 --- a/testcases/kernel/fs/fs-bench/create-files.c +++ /dev/null @@ -1,119 +0,0 @@ -/* create.c (GPL)*/ -/* Hironobu SUZUKI */ -#include -#include -#include -#include -#include -#include -#include - -#define MAXN 4096 - -#define MAXFSIZE 1024 * 192 - -char wbuf[MAXFSIZE]; -static int filecount = 0; - -void makedir(char *dir1); -void changedir(char *dir); -void create_file(char *filename); - -extern int box_muler(int, int); - -int startc = 0; -int main(int ac, char *av[]) -{ - int i = 0; - int j = 0; - int k = 0; - int l = 0; - char dir1[MAXN]; - char dir2[MAXN]; - char dir3[MAXN]; - char filename[MAXN]; - time_t t; - int maxfiles = 0xFFFFFF; - int createfiles = 0; - - if (ac > 1) { - sscanf(av[1], "%x", &maxfiles); - if (maxfiles == 0) { - printf("maxfile argument error (0 value)\n"); - exit(1); - } - } - time(&t); - srandom((unsigned int)getpid() ^ - (((unsigned int)t << 16) | (unsigned int)t >> 16)); - printf("Create files\n"); - for (i = 0; i < 0xFF; i++) { - sprintf(dir1, "%2.2x", i); - makedir(dir1); - changedir(dir1); - for (j = 0; j < 0xFF; j++) { - sprintf(dir2, "%2.2x", j); - makedir(dir2); - changedir(dir2); - for (k = 0; k < 0xFF; k++) { - sprintf(dir3, "%2.2x", k); - makedir(dir3); - changedir(dir3); - for (l = 0; l < 0xFF; l++) { - sprintf(filename, "%s%s%s%2.2x", dir1, - dir2, dir3, l); - create_file(filename); - if (maxfiles < createfiles++) { - goto end; - } - } - changedir("../"); - } - changedir("../"); - } - changedir("../"); - } -end: - fprintf(stderr, "\nTotal create files: %d\n", filecount); - printf("Done\n"); - return 0; -} - -int showchar[] = { 124, 47, 45, 92, 124, 47, 45, 92 }; - -void makedir(char *dir1) -{ - if (mkdir(dir1, S_IRWXU) < 0) { - perror(dir1); - exit(1); - } -} - -void changedir(char *dir) -{ - if (chdir(dir) < 0) { - perror(dir); - exit(1); - } -} - -void create_file(char *filename) -{ - int fd; - int randomsize; - if ((fd = creat(filename, S_IRWXU)) < 0) { - fprintf(stderr, "\nTotal create files: %d\n", filecount); - perror(filename); - exit(1); - } - if ((randomsize = box_muler(0, MAXFSIZE)) < 0) { - randomsize = MAXFSIZE; - } - if (write(fd, wbuf, randomsize) < 0) { - fprintf(stderr, "\nTotal create files: %d\n", filecount); - perror(filename); - exit(1); - } - filecount++; - close(fd); -} diff --git a/testcases/kernel/fs/fs-bench/fs-bench-test.sh b/testcases/kernel/fs/fs-bench/fs-bench-test.sh deleted file mode 100755 index c2ca767f..00000000 --- a/testcases/kernel/fs/fs-bench/fs-bench-test.sh +++ /dev/null @@ -1,50 +0,0 @@ -#! /bin/bash - -echo "## Start Test" -date -if [ -d ./00 ] ; then - echo -n "Clear old files..." - /bin/rm -fr ./00 >& /dev/null - echo "done" -fi -STARTT=`date +%s` -echo $STARTT -echo "" -echo "## Create files " -time ~/fs-bench/cr - -echo "" -echo "## tar all " -MAXFILE=`tar cBf - 00 | tar tvBf - 2>&1 | tail -n 1 | awk '{print $6;}'| awk -F'/' '{print $4;}'` - -echo "" -echo "## Change owner" -time chown -R $USER ./00 - -echo "" -echo "## random access" -time ~/fs-bench/ra $MAXFILE - -echo "" -echo "## Change mode " -time chmod -R go+rw ./00 - -echo "" -echo "## Random delete and create" -time ~/fs-bench/radc $MAXFILE - -echo "" -echo "## Change mode again" -time chmod -R go-rw ./00 - -echo "" -echo "## Remove all files and directories" -time /bin/rm -fr ./00 -echo "" -echo "## Finish test" -ENDT=`date +%s` -echo $ENDT -date - -echo -n 'TOTAL(seconds): ' -expr $ENDT - $STARTT diff --git a/testcases/kernel/fs/fs-bench/fs-bench-test2.sh b/testcases/kernel/fs/fs-bench/fs-bench-test2.sh deleted file mode 100755 index 25c67afe..00000000 --- a/testcases/kernel/fs/fs-bench/fs-bench-test2.sh +++ /dev/null @@ -1,63 +0,0 @@ -#! /bin/bash - -echo "## Start Test" -date -date +%s -if [ -d ./00 ] ; then -/bin/rm -fr ./00 >& /dev/null -fi -STARTT=`date +%s` -echo $STARTT - -echo "" -echo "## Create files " -time ~/fs-bench/cr - -echo "" -echo "## tar all " -MAXFILE=`tar cBf - 00 | tar tvBf - 2>&1 | tail -n 1 | awk '{print $6;}'| awk -F'/' '{print $4;}'` -HALFFILE=`echo "obase=F;ibase=F;$MAXFILE/2" | bc` - -echo "" -echo "## Remove all files and directories" -/bin/rm -fr ./00 >& /dev/null - -echo "" -echo "## Create half files" -echo create half files -time ~/fs-bench/cr $HALFFILE - -echo "" -echo "## Change owner" -time chown -R $USER ./00 - -echo "" -echo "## random access" -time ~/fs-bench/ra $HALFFILE - - -echo "" -echo "## Change mode " -time chmod -R go+rw ./00 - -echo "" -echo "## Random delete and create" -time ~/fs-bench/radc $HALFFILE - -echo "" -echo "## Change mode again" -time chmod -R go-rw ./00 - -echo "" -echo "## Remove all files and directories" -time /bin/rm -fr ./00 - -echo "" -echo "## Finish test" -date -ENDT=`date +%s` -echo $ENDT -echo -n 'TOTAL(seconds): ' -expr $ENDT - $STARTT - - diff --git a/testcases/kernel/fs/fs-bench/modaltr.sh b/testcases/kernel/fs/fs-bench/modaltr.sh deleted file mode 100755 index e44c17f1..00000000 --- a/testcases/kernel/fs/fs-bench/modaltr.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/sh -#To run this script the following is necessary -# 1.kernel should mtd support as module. -# 2.kernel should hsve jffs2 support as module. -# 3.kernel should have loopback device support . -# 4.you should have fs-bench utility (http://h2np.net/tools/fs-bench-0.2.tar.gz) -# 5.results will be copied to /tmp/log and /tmp/log1 files - -#DESCRIPTION: This testscript creates a jffs2 file system type and tests the filesystem test -#and places the log in the log directory.The file system test actually creates a tree of large -#directories and performs the delete and random delete operations as per the filesystem stress -#algorithim and gives a report of real time ,user time,system time taken to perform the file -#operations. - -#script created G.BANU PRAKASH (mailto:prakash.banu@wipro.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 -# - -MTD_RAM=mtdram -MTD_BLOCK=mtdblock -JFFS2=jffs2 -LOOP=loop -MTD_BLKDEVS=mtd_blkdevs -ZLIB_DEFLATE=zlib_deflate -ZLIB_INFLATE=zlib_inflate -MTD_CORE=mtdcore -MOUNT_DIR=/mnt -LOG_DIR=/tmp/log -LOG_DIR1=/tmp/log1 -HOME_DIR=/home -BLOCK_DIR=/dev/mtdblock -export PATH=$PATH:/sbin - if [ $(id -ru) -ne 0 ]; -then - echo "must be root to run this" - exit -fi - - - -lsmod |grep $MTD_RAM - - if [ $? -ne 0 ]; -then - echo "inserting mtd ram and its dependencies" -fi -modprobe $MTD_RAM total_size=32768 erase_size=256 - if [ $? -ne 0 ]; -then - echo "check wheather MTD -mtdram is been compiled in the kernel" -fi -lsmod |grep $MTD_BLOCK - if [ $? -ne 0 ]; then - echo "inserting mtdblock and its dependencies" -fi -modprobe $MTD_BLOCK - if [ $? -ne 0 ]; then - echo "check wheather mtdblock is been compiled in the kernel" -fi - -lsmod |grep $JFFS2 - if [ $? -ne 0 ]; then - echo "inserting jffs2 and its dependencies" -fi -modprobe $JFFS2 - if [ $? -ne 0 ]; then - echo "check wheather jffs2 is been compiled in the kernel" -fi - -lsmod |grep $LOOP - if [ $? -ne 0 ]; then - echo "inserting loopback device module" -fi -modprobe $LOOP - if [ $? -ne 0 ]; then - echo "check wheather loopback device option is been compiled in the kernel" -fi -mkdir -p $BLOCK_DIR -mknod $BLOCK_DIR/0 b 31 0 >/dev/null 2>&1 -mount -t jffs2 $BLOCK_DIR/0 $MOUNT_DIR -mount|grep $JFFS2 - if [ $? -eq 0 ]; then - echo "jffs2 mounted sucessfully" - else - echo "mount unsucessfull" -fi -cd $MOUNT_DIR -echo "This is will take long time " -./test.sh >log 2>&1 -./test2.sh >log1 2>&1 - -mv log $LOG_DIR -mv log1 $LOG_DIR1 -cd $HOME_DIR - - -#cleanup -echo "unmounting $MOUNT_DIR " -umount $MOUNT_DIR -echo "removing the modules inserted" -rmmod $MTD_BLOCK -rmmod $MTD_BLKDEVS -rmmod $LOOP -rmmod $JFFS2 -rmmod $ZLIB_DEFLATE -rmmod $ZLIB_INFLATE -rmmod $MTD_RAM -rmmod $MTD_CORE -rm -rf /dev/mtdblock -echo "TEST COMPLETE" -echo "RESULTS LOGGED IN FILE /tmp/log and /tmp/log1 " diff --git a/testcases/kernel/fs/fs-bench/random-access-del-create.c b/testcases/kernel/fs/fs-bench/random-access-del-create.c deleted file mode 100755 index 1f62a76b..00000000 --- a/testcases/kernel/fs/fs-bench/random-access-del-create.c +++ /dev/null @@ -1,138 +0,0 @@ -/* random-del-create.c (GPL)*/ -/* Hironobu SUZUKI */ - -#include -#include -#include -#include -#include -#include -#include -#define FAIL 0 -#define SUCCESS 1 - -int openlog[2] = { 0, 0 }; - -#define MAXNUM 0x100000 - -#define MAXERROR 1024 - -extern int box_muler(int, int); -extern void create_or_delete(char *); - -int delete_file(char *filename); -int create_file(char *filename); - -int cfilecount = 0; -int dfilecount = 0; -int errorcount = 0; - -int main(int ac, char **av) -{ - int r; - char fname[1024]; - time_t t; - int i; - int m; - - if (ac != 2) { - printf("%s hex-style-filename \n", av[0]); - printf("ex) %s 00022300\n", av[0]); - exit(1); - } - sscanf(av[1], "%x", &m); - if (m < 1 || m > MAXNUM) { - printf("out of size %d\n", m); - exit(1); - } - - time(&t); - srandom((unsigned int)getpid() ^ - (((unsigned int)t << 16) | (unsigned int)t >> 16)); - - /* 00/00/00/00 */ - for (i = 0; i < m; i++) { - r = random() % m; - sprintf(fname, "00/%2.2x/%2.2x/00%2.2x%2.2x%2.2x", - ((r >> 16) & 0xFF), - ((r >> 8) & 0xFF), - ((r >> 16) & 0xFF), ((r >> 8) & 0xFF), (r & 0xFF)); - create_or_delete(fname); - } - fprintf(stderr, "Total create files: %d\n", cfilecount); - fprintf(stderr, "Total delete files: %d\n", dfilecount); - fprintf(stderr, "Total error : %d\n", errorcount); - exit(0); -} - -#define MAXFSIZE (192*1024) -#define AVEFSIZE (MAXFSIZE/2) -#define POOLDISKSPACE (AVEFSIZE*128) - -static int disk_space_pool = 0; -void create_or_delete(char *fname) -{ - int r; - - r = (random() & 1); - if (r && disk_space_pool > POOLDISKSPACE) { - /* create */ - create_file(fname); - } else { - delete_file(fname); - } - if ((errorcount > dfilecount || errorcount > cfilecount) - && (errorcount > MAXERROR)) { - fprintf(stderr, "too much error -- stop\n"); - fprintf(stderr, "Total create files: %d\n", cfilecount); - fprintf(stderr, "Total delete files: %d\n", dfilecount); - fprintf(stderr, "Total error : %d\n", errorcount); - exit(1); - } -} - -int create_file(char *filename) -{ - int fd; - int randomsize; - char wbuf[MAXFSIZE]; - if ((fd = creat(filename, S_IRWXU)) < 0) { - errorcount++; - return (-1); - } - if ((randomsize = box_muler(0, MAXFSIZE)) < 0) { - randomsize = MAXFSIZE; - } - if (write(fd, wbuf, randomsize) < 0) { - errorcount++; - close(fd); - return (-1); - } - cfilecount++; - disk_space_pool -= randomsize; - close(fd); - - return 0; -} - -#include -#include - -int delete_file(char *filename) -{ - struct stat buf; - int st; - st = stat(filename, &buf); - if (st < 0) { - errorcount++; - return (-1); - } - disk_space_pool += buf.st_size; - if (unlink(filename) < 0) { - errorcount++; - return (-1); - } - dfilecount++; - - return 0; -} diff --git a/testcases/kernel/fs/fs-bench/random-access.c b/testcases/kernel/fs/fs-bench/random-access.c deleted file mode 100755 index cf41d6e8..00000000 --- a/testcases/kernel/fs/fs-bench/random-access.c +++ /dev/null @@ -1,92 +0,0 @@ -/* random-access.c (GPL)*/ -/* Hironobu SUZUKI */ -#include -#include -#include -#include -#include -#include -#include -#include -#define FAIL 0 -#define SUCCESS 1 - -int openlog[2] = { 0, 0 }; - -#define MAXNUM 0x100000 - -void open_read_close(char *fname); - -int nullfd; - -int main(int ac, char **av) -{ - int r; - char fname[1024]; - time_t t; - int i; - int m; - - if (ac != 2) { - printf("%s hex-style-filename \n", av[0]); - printf("ex) %s 00022300\n", av[0]); - exit(1); - } - sscanf(av[1], "%x", &m); - if (m < 1 || m > MAXNUM) { - printf("out of size %d\n", m); - exit(1); - } - - time(&t); - srandom((unsigned int)getpid() ^ - (((unsigned int)t << 16) | (unsigned int)t >> 16)); - - if ((nullfd = open("/dev/null", O_WRONLY)) < 0) { - perror("/dev/null"); - exit(1); - } - - /* 00/00/00/00 */ - for (i = 0; i < m; i++) { - r = random() % m; - sprintf(fname, "00/%2.2x/%2.2x/00%2.2x%2.2x%2.2x", - ((r >> 16) & 0xFF), - ((r >> 8) & 0xFF), - ((r >> 16) & 0xFF), ((r >> 8) & 0xFF), (r & 0xFF)); - open_read_close(fname); - } - close(nullfd); - printf("Success:\t%d\nFail:\t%d\n", openlog[SUCCESS], openlog[FAIL]); - exit(0); -} - -#define BUFS 8192 -void open_read_close(char *fname) -{ - int fd; - char buf[BUFS]; - int c; - - if ((fd = open(fname, O_RDONLY)) < 0) { - openlog[FAIL]++; - close(fd); - return; - } - openlog[SUCCESS]++; - while ((c = read(fd, buf, BUFS)) > 0) { - if (write(nullfd, buf, c) < 0) { - perror("/dev/null"); - printf("Opened\t %d\nUnopend:\t%d\n", openlog[SUCCESS], - openlog[FAIL]); - exit(1); - } - } - if (c < 0) { - perror(fname); - printf("Opened\t %d\nUnopend:\t%d\n", openlog[SUCCESS], - openlog[FAIL]); - exit(1); - } - close(fd); -} diff --git a/testcases/kernel/fs/fs-bench/random-del-create.c b/testcases/kernel/fs/fs-bench/random-del-create.c deleted file mode 100755 index 0a86f976..00000000 --- a/testcases/kernel/fs/fs-bench/random-del-create.c +++ /dev/null @@ -1,134 +0,0 @@ -/* random-del-create.c (GPL)*/ -/* Hironobu SUZUKI */ - -#include -#include -#include -#include -#include -#include -#include -#define FAIL 0 -#define SUCCESS 1 - -int openlog[2] = { 0, 0 }; - -#define MAXNUM 0x100000 - -#define MAXERROR 1024 - -extern int box_muler(int, int); -extern void create_or_delete(char *); - -int cfilecount = 0; -int dfilecount = 0; -int errorcount = 0; - -int main(int ac, char **av) -{ - int r; - char fname[1024]; - time_t t; - int i; - int m; - - if (ac != 2) { - printf("%s hex-style-filename \n", av[0]); - printf("ex) %s 00022300\n", av[0]); - exit(1); - } - sscanf(av[1], "%x", &m); - if (m < 1 || m > MAXNUM) { - printf("out of size %d\n", m); - exit(1); - } - - time(&t); - srandom((unsigned int)getpid() ^ - (((unsigned int)t << 16) | (unsigned int)t >> 16)); - - /* 00/00/00/00 */ - for (i = 0; i < m; i++) { - r = random() % m; - sprintf(fname, "00/%2.2x/%2.2x/00%2.2x%2.2x%2.2x", - ((r >> 16) & 0xFF), - ((r >> 8) & 0xFF), - ((r >> 16) & 0xFF), ((r >> 8) & 0xFF), (r & 0xFF)); - create_or_delete(fname); - } - fprintf(stderr, "Total create files: %d\n", cfilecount); - fprintf(stderr, "Total delete files: %d\n", dfilecount); - fprintf(stderr, "Total error : %d\n", errorcount); - exit(0); -} - -#define MAXFSIZE (192*1024) -#define AVEFSIZE (MAXFSIZE/2) -#define POOLDISKSPACE (AVEFSIZE*128) - -static int disk_space_pool = 0; -void create_or_delete(char *fname) -{ - int r; - int fsize; - - r = (random() & 1); - if (r && disk_space_pool > POOLDISKSPACE) { - /* create */ - create_file(fname); - } else { - delete_file(fname); - } - if ((errorcount > dfilecount || errorcount > cfilecount) - && (errorcount > MAXERROR)) { - fprintf(stderr, "too much error -- stop\n"); - fprintf(stderr, "Total create files: %d\n", cfilecount); - fprintf(stderr, "Total delete files: %d\n", dfilecount); - fprintf(stderr, "Total error : %d\n", errorcount); - exit(1); - } -} - -int create_file(char *filename) -{ - int fd; - int randomsize; - char wbuf[MAXFSIZE]; - if ((fd = creat(filename, S_IRWXU)) < 0) { - errorcount++; - return (-1); - } - if ((randomsize = box_muler(0, MAXFSIZE)) < 0) { - randomsize = MAXFSIZE; - } - if (write(fd, wbuf, randomsize) < 0) { - errorcount++; - close(fd); - return (-1); - } - cfilecount++; - disk_space_pool -= randomsize; - close(fd); - return 0; -} - -#include -#include - -int delete_file(char *filename) -{ - struct stat buf; - int st; - st = stat(filename, &buf); - if (st < 0) { - errorcount++; - return (-1); - } - disk_space_pool += buf.st_size; - if (unlink(filename) < 0) { - errorcount++; - return (-1); - } - dfilecount++; - return 0; -} diff --git a/testcases/kernel/io/ltp-aiodio/read_checkzero.c b/testcases/kernel/io/ltp-aiodio/read_checkzero.c deleted file mode 100755 index b48197a7..00000000 --- a/testcases/kernel/io/ltp-aiodio/read_checkzero.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2004 Daniel McNeil - * 2004 Open Source Development Lab - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Module: .c - */ - -/* - * Change History: - * - * 2/2004 Marty Ridgeway (mridge@us.ibm.com) Changes to adapt to LTP - * - */ -#define _GNU_SOURCE - -#include -#include -#include -#include -#include -#include - -#include "common_checkzero.h" - -int read_eof(char *filename) -{ - int fd; - int i; - int r; - char buf[4096]; - - if ((fd = open(filename, O_RDWR)) < 0) { - fprintf(stderr, "can't open file %s \n", filename); - exit(1); - } - - for (i = 0; i < 100000; i++) { - off_t offset; - char *bufoff; - - offset = lseek(fd, 4096, SEEK_END); - r = write(fd, "A", 1); - - offset = lseek(fd, offset - 4096, SEEK_SET); - - r = read(fd, buf, 4096); - if (r > 0) { - if ((bufoff = check_zero(buf, r))) { - fprintf(stderr, "non-zero read at offset %p\n", - offset + bufoff); - exit(1); - } - } - } - fprintf(stderr, "read_checkzero done\n"); - return 0; -} - -int main(int argc, char **argv) -{ - if (argc < 2) { - printf("You must pass a filename to the test \n"); - exit(1); - } - - char *filename = argv[1]; - - read_eof(filename); - - return 0; -} diff --git a/testcases/kernel/ipc/semaphore/.gitignore b/testcases/kernel/ipc/semaphore/.gitignore deleted file mode 100755 index 944e5ca1..00000000 --- a/testcases/kernel/ipc/semaphore/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/sem01 -/sem02 diff --git a/testcases/kernel/ipc/semaphore/Makefile b/testcases/kernel/ipc/semaphore/Makefile deleted file mode 100755 index 9ab85745..00000000 --- a/testcases/kernel/ipc/semaphore/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# -# testcases/kernel/ipc/semaphore Makefile. -# -# Copyright (C) 2009, Cisco Systems Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Ngie Cooper, July 2009 -# - -top_srcdir ?= ../../../.. - -include $(top_srcdir)/include/mk/testcases.mk - -CPPFLAGS += -I../include -LDLIBS += -lpthread - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/ipc/semaphore/sem01.c b/testcases/kernel/ipc/semaphore/sem01.c deleted file mode 100755 index 582624d6..00000000 --- a/testcases/kernel/ipc/semaphore/sem01.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * - * Copyright (c) International Business Machines Corp., 2001 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * FILE : sem01.c - * DESCRIPTION : Creates a semaphore and two processes. The processes - * each go through a loop where they semdown, delay for a - * random amount of time, and semup, so they will almost - * always be fighting for control of the semaphore. - * HISTORY: - * 01/15/2001 Paul Larson (plars@us.ibm.com) - * -written - * 11/09/2001 Manoj Iyer (manjo@ausin.ibm.com) - * Modified. - * - Removed compiler warnings. - * added exit to the end of function main() - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include "lapi/sem.h" - -int verbose = 0; -int loops = 100; -int errors = 0; - -int semup(int semid) -{ - struct sembuf semops; - semops.sem_num = 0; - semops.sem_op = 1; - semops.sem_flg = SEM_UNDO; - if (semop(semid, &semops, 1) == -1) { - perror("semup"); - errors++; - return 1; - } - return 0; -} - -int semdown(int semid) -{ - struct sembuf semops; - semops.sem_num = 0; - semops.sem_op = -1; - semops.sem_flg = SEM_UNDO; - if (semop(semid, &semops, 1) == -1) { - perror("semdown"); - errors++; - return 1; - } - return 0; -} - -void delayloop() -{ - int delay; - delay = 1 + ((100.0 * rand()) / RAND_MAX); - if (verbose) - printf("in delay function for %d microseconds\n", delay); - usleep(delay); -} - -void mainloop(int semid) -{ - int i; - for (i = 0; i < loops; i++) { - if (semdown(semid)) { - printf("semdown failed\n"); - } - if (verbose) - printf("sem is down\n"); - delayloop(); - if (semup(semid)) { - printf("semup failed\n"); - } - if (verbose) - printf("sem is up\n"); - } -} - -int main(int argc, char *argv[]) -{ - int semid, opt; - union semun semunion; - extern char *optarg; - pid_t pid; - int chstat; - - while ((opt = getopt(argc, argv, "l:vh")) != EOF) { - switch ((char)opt) { - case 'l': - loops = atoi(optarg); - break; - case 'v': - verbose = 1; - break; - case 'h': - default: - printf("Usage: -l loops [-v]\n"); - exit(1); - } - } - - /* set up the semaphore */ - if ((semid = semget((key_t) 9142, 1, 0666 | IPC_CREAT)) < 0) { - printf("error in semget()\n"); - exit(-1); - } - semunion.val = 1; - if (semctl(semid, 0, SETVAL, semunion) == -1) { - printf("error in semctl\n"); - } - - if ((pid = fork()) < 0) { - printf("fork error\n"); - exit(-1); - } - if (pid) { - /* parent */ - srand(pid); - mainloop(semid); - waitpid(pid, &chstat, 0); - if (!WIFEXITED(chstat)) { - printf("child exited with status\n"); - exit(-1); - } - if (semctl(semid, 0, IPC_RMID, semunion) == -1) { - printf("error in semctl\n"); - } - if (errors) { - printf("FAIL: there were %d errors\n", errors); - } else { - printf("PASS: error count is 0\n"); - } - exit(errors); - } else { - /* child */ - mainloop(semid); - } - exit(0); -} diff --git a/testcases/kernel/ipc/semaphore/sem02.c b/testcases/kernel/ipc/semaphore/sem02.c deleted file mode 100755 index 34b714bf..00000000 --- a/testcases/kernel/ipc/semaphore/sem02.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * - * Copyright (c) International Business Machines Corp., 2002 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * FILE : sem02.c - * - * DESCRIPTION : The application creates several threads using pthread_create(). - * One thread performs a semop() with the SEM_UNDO flag set. The change in - * sempaphore value performed by that semop should be "undone" only when the - * last pthread exits. - * - * EXPECTED OUTPUT: - * Waiter, pid = - * Poster, pid = , posting - * Poster posted - * Poster exiting - * Waiter waiting, pid = - * Waiter done waiting - * - * HISTORY: - * written by Dave Olien (oliend@us.ibm.com) - * 03/06/2002 Robbie Williamson (robbiew@us.ibm.com) - * -ported - * 07/04/2003 Paul Larson (plars@linuxtestproject.org) - * -ported to LTP - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include "lapi/sem.h" -#include "test.h" - -#define KEY IPC_PRIVATE - -#define NUMTHREADS 2 - -void *retval[NUMTHREADS]; -void *waiter(void *); -void *poster(void *); -void cleanup(void); - -char *TCID = "sem02"; -int TST_TOTAL = 1; - -struct sembuf Psembuf = { 0, -1, SEM_UNDO }; -struct sembuf Vsembuf = { 0, 1, SEM_UNDO }; - -int sem_id; -int err_ret; /* This is used to determine PASS/FAIL status */ -int main(int argc, char **argv) -{ - int i, rc; - union semun semunion; - - pthread_t pt[NUMTHREADS]; - pthread_attr_t attr; - - tst_parse_opts(argc, argv, NULL, NULL); - /* Create the semaphore set */ - sem_id = semget(KEY, 1, 0666 | IPC_CREAT); - if (sem_id < 0) { - printf("semget failed, errno = %d\n", errno); - exit(1); - } - /* initialize data structure associated to the semaphore */ - semunion.val = 1; - semctl(sem_id, 0, SETVAL, semunion); - - /* setup the attributes of the thread */ - /* set the scope to be system to make sure the threads compete on a */ - /* global scale for cpu */ - pthread_attr_init(&attr); - pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); - - err_ret = 1; /* Set initial error value to 1 */ - /* Create the threads */ - for (i = 0; i < NUMTHREADS; i++) { - if (i == 0) - rc = pthread_create(&pt[i], &attr, waiter, retval[i]); - else - rc = pthread_create(&pt[i], &attr, poster, retval[i]); - } - - /* Sleep long enough to see that the other threads do what they are supposed to do */ - sleep(20); - semunion.val = 1; - semctl(sem_id, 0, IPC_RMID, semunion); - if (err_ret == 1) - tst_resm(TFAIL, "failed"); - else - tst_resm(TPASS, "passed"); - cleanup(); - - tst_exit(); -} - -/* This thread sleeps 10 seconds then waits on the semaphore. As long - as someone has posted on the semaphore, and no undo has taken - place, the semop should complete and we'll print "Waiter done - waiting." */ -void *waiter(void *foo) -{ - int pid; - pid = getpid(); - - tst_resm(TINFO, "Waiter, pid = %d", pid); - sleep(10); - - tst_resm(TINFO, "Waiter waiting, pid = %d", pid); - semop(sem_id, &Psembuf, 1); - tst_resm(TINFO, "Waiter done waiting"); - err_ret = 0; /* If the message above is displayed, the test is a PASS */ - pthread_exit(0); -} - -/* This thread immediately posts on the semaphore and then immediately - exits. If the *thread* exits, the undo should not happen, and the - waiter thread which will start waiting on it in 10 seconds, should - still get it. */ -void *poster(void *foo) -{ - int pid; - - pid = getpid(); - tst_resm(TINFO, "Poster, pid = %d, posting", pid); - semop(sem_id, &Vsembuf, 1); - tst_resm(TINFO, "Poster posted"); - tst_resm(TINFO, "Poster exiting"); - - pthread_exit(0); -} - -void cleanup(void) -{ -} diff --git a/testcases/kernel/mce-test/COPYING b/testcases/kernel/mce-test/COPYING deleted file mode 100755 index 60549be5..00000000 --- a/testcases/kernel/mce-test/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/testcases/kernel/mce-test/Makefile b/testcases/kernel/mce-test/Makefile deleted file mode 100755 index f0cdc218..00000000 --- a/testcases/kernel/mce-test/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -.PHONY: test clean distclean reset test-simple test-kdump - -all: - $(MAKE) -C tools - $(MAKE) -C tsrc - $(MAKE) -C stress - -clean: - $(MAKE) -C tools clean - $(MAKE) -C tsrc clean - $(MAKE) -C stress clean - $(MAKE) reset - -distclean: - $(MAKE) -C tools distclean - $(MAKE) -C tsrc distclean - $(MAKE) -C stress distclean - $(MAKE) reset - rm -rf bin/* - -reset: - rm -rf work/* - rm -rf results/* - -test: test-simple test-stress - -test-simple: - $(MAKE) reset - ./drivers/simple/driver.sh simple.conf - $(MAKE) -C tsrc test - -# requires LTP & page-types to be installed -test-stress: - $(MAKE) -C stress test - -# requires special packages to be installed -test-kdump: - $(MAKE) reset - ./drivers/simple/driver.sh simple.conf - ./drivers/kdump/driver.sh kdump.conf - $(MAKE) -C tsrc test diff --git a/testcases/kernel/mce-test/README b/testcases/kernel/mce-test/README deleted file mode 100755 index 4d1b1fe9..00000000 --- a/testcases/kernel/mce-test/README +++ /dev/null @@ -1,115 +0,0 @@ -MCE test suite ---------------- - -The MCE test suite is a collection of tools and test scripts for -testing the Linux kernel machine check error recovery -features. This is the code that deals with recovery from memory -bit errors and other hardware problems. - -For some more details on machine checks see http://www.mcelog.org - -The goal is to cover most Linux kernel MCE processing code paths -and features with automation tests. - -In the Package --------------- - -Here is a short description of what is included in the package - -README - This document - -COPYING - GNU General Public License - -Makefile - Top level make file for MCE test suite - -drivers/* - Contains test drivers, which drive test procedure and do some - common works for test drivers. There is one directory for each - test driver, the user interface of a driver is the driver.sh - in corresponding directory, such as: - drivers/kdump/driver.sh - is user interface of kdump test driver. - -cases/* - Contains all test cases, which may be organized in - sub-directories, the interface of a class of test cases is a - shell script under cases/, such as: - -- cases/soft-inj/panic/cases.sh - is for test cases triggered by soft-inject and may cause system - panic during testing. - -- cases/apei-inj/ucr/cases.sh - is for test cases triggered by apei-inject. - -config/* - Contains test configuration files, which specifies the - parameters for test driver, which test cases are used in test, - the parameters for test cases, etc. - -tsrc/* - Some standalone test programs for various parts of the machine - check code. - -lib/* - Contains some shell scripts, in which some common shell - functions and variable definitions are defined to be used by - multiple test drivers or test cases. - -tools/* - Some tools used by MCE test suites. - -doc/* - Documentation for MCE test suites include howto and - descriptions of every test case. - -results/ - When test is done, the test result will be placed in this - directory, test results for a specific test driver will be - placed in corresponding directory, such as test results of - kdump test driver will be placed in "results/kdump". General - test result is in results/$driver/result; additional results - of various cases may be in corresponding directory, for - example, files in - results/kdump/soft-inj/panic/fatal/ - is for additional result for test case soft-inj/panic/fatal. - -work/ - During test, some temporary file will be put in work - directory, temporary files for a specific test driver will be - placed in corresponding directory, such as temporary files of - kdump test driver will be placed in "work/kdump". Test log is - in work/$driver/log. - -bin/ - Some tools used by test drivers or test cases will be - installed into this directory. - -stress/ - Linux MCE stress test suite. - -Test Instruction ----------------- - -Please refer to corresponding section in doc/howto.txt. - -Very quick way to test this: - be root - make sure you have a kernel with CONFIG_X86_MCE_INJECT - and CONFIG_HWPOISON_INJECT and soft-offlining support - run "make test" - -Futher Information ------------------- - -For futher information about MCE test suite, please refer to documents -in doc sub-directory. - -doc/howto.txt: a more detailed HOWTO document - -doc/stress-howto.txt: Detailed HOWTO document for MCE stress test suite - -doc/cases/*.txt: Description of every test case, including test - objective, code patch tested, reference and - expected results diff --git a/testcases/kernel/mce-test/cases/apei-inj/README b/testcases/kernel/mce-test/cases/apei-inj/README deleted file mode 100755 index 3ae91b45..00000000 --- a/testcases/kernel/mce-test/cases/apei-inj/README +++ /dev/null @@ -1,33 +0,0 @@ -MCE APEI INJ testing cases -========================= - -Nov 6th, 2009 - -Jiajia Zheng - -Start ------------- -This test suite is based on apei-inj APEI haredware injection tool. -It's structure and usage are the same with soft-inj test suite. -To be root and invoke simple test driver on test configuration file as follow - drivers/simple/driver.sh config/simple_apei_ucr.conf - -Test Dependencies ------------------ -MCE APEI INJ test suite has following dependencies on kernel and other tools: - -* Make sure following configuration options are enabled in linux kernel: - CONFIG_FTRACE=y - CONFIG_FUNCTION_TRACER=y - -* page-types: - A tool to query page types, which is accompanied with Linux kernel - source (2.6.32 or newer, $KERNEL_SRC/Documentation/vm/page-types.c). - For detail, please see 3.4 in doc/howto.txt. - -* simple-process: - APEI hardware injection will inject an error to a page used by this simple-process. Intall simple-process. - cd mce-test/tools/simple_process - make - - diff --git a/testcases/kernel/mce-test/cases/apei-inj/ucr/cases.sh b/testcases/kernel/mce-test/cases/apei-inj/ucr/cases.sh deleted file mode 100755 index 2364bdc8..00000000 --- a/testcases/kernel/mce-test/cases/apei-inj/ucr/cases.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# -# APEI injection based test cases : memory patrol scrub cases: test cases -# are triggered via the apei-inject, and they will not trigger kernel panic. -# -# Copyright (C) 2008, Intel Corp. -# Author: Huang Ying -# Zheng Jiajia -# -# This file is released under the GPLv2. -# - -. $ROOT/lib/functions.sh -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh -. $ROOT/lib/apei-inject.sh - -enumerate() -{ - apei_inject_enumerate -} - -trigger() -{ - case "$bcase" in - mem_uncorrected) - start_tracing "do_machine_check" - ;; - *) - echo '!!! Unknown case: $this_case !!!' - esac - apei_inject_trigger - stop_tracing -} - -get_result() -{ - apei_inject_get_klog - get_gcov drivers/acpi/apei/einj.c - - case "$bcase" in - mem_uncorrected) - get_mcelog_from_dev $mcelog_result - ;; - *) - echo '!!! Unknown case: $this_case !!!' - esac -} - -verify() -{ - case "$bcase" in - mem_uncorrected) - apei_inject_verify_mcelog - verify_klog $klog - apei_inject_verify_trace "do_machine_check" - ;; - *) - echo "!!! Unknown case: $this_case !!!" - esac -} - -apei_inject_main "$@" diff --git a/testcases/kernel/mce-test/cases/apei-inj/ucr/data/mem_uncorrected b/testcases/kernel/mce-test/cases/apei-inj/ucr/data/mem_uncorrected deleted file mode 100755 index a6601e98..00000000 --- a/testcases/kernel/mce-test/cases/apei-inj/ucr/data/mem_uncorrected +++ /dev/null @@ -1 +0,0 @@ -TYPE 0x10 diff --git a/testcases/kernel/mce-test/cases/apei-inj/ucr/refer/mem_uncorrected b/testcases/kernel/mce-test/cases/apei-inj/ucr/refer/mem_uncorrected deleted file mode 100755 index 43889f19..00000000 --- a/testcases/kernel/mce-test/cases/apei-inj/ucr/refer/mem_uncorrected +++ /dev/null @@ -1,10 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO 0xcf -MCGSTATUS RIPV MCIP -MISC 0x8c -ADDR 0x1234 -RIP 0x73:0x2eadbabe - - - - diff --git a/testcases/kernel/mce-test/cases/soft-inj/non-panic/cases.sh b/testcases/kernel/mce-test/cases/soft-inj/non-panic/cases.sh deleted file mode 100755 index d277e119..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/non-panic/cases.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# Software injection based test cases - non-panic cases: test cases -# are triggered via the mce-inject tool, and they will not trigger kernel -# panic. -# -# Copyright (C) 2008, Intel Corp. -# Author: Huang Ying -# -# This file is released under the GPLv2. -# - -. $ROOT/lib/functions.sh -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh -. $ROOT/lib/soft-inject.sh - -enumerate() -{ - soft_inject_enumerate -} - -trigger() -{ - soft_inject_trigger -} - -get_result() -{ - soft_inject_get_klog - get_gcov arch/x86/kernel/cpu/mcheck/mce.c - - case "$bcase" in - corrected|corrected_hold|corrected_over|corrected_no_en) - get_mcelog_from_dev $mcelog_result - ;; - *) - echo '!!! Unknown case: $this_case !!!' - esac -} - -verify() -{ - local removes="TSC TIME PROCESSOR" - case "$bcase" in - corrected|corrected_hold|corrected_over|corrected_no_en) - soft_inject_verify_mcelog - verify_klog $klog - ;; - *) - echo "!!! Unknown case: $this_case !!!" - esac -} - -soft_inject_main "$@" diff --git a/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected b/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected deleted file mode 100755 index 22af584e..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected +++ /dev/null @@ -1,14 +0,0 @@ -# -# log corrected machine checks -CPU 0 BANK 1 -STATUS CORRECTED -ADDR 0xabcd -HOLD -CPU 1 BANK 0 -# -CPU 1 BANK 2 -STATUS CORRECTED -MISC 0xabcd -ADDR 0x1234 -HOLD -CPU 0 BANK 0 diff --git a/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_hold b/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_hold deleted file mode 100755 index 1c9da734..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_hold +++ /dev/null @@ -1,10 +0,0 @@ -# -# log two corrected machine checks -CPU 0 BANK 1 -STATUS CORRECTED -ADDR 0xabcd -HOLD -# -CPU 1 BANK 2 -STATUS CORRECTED -ADDR 0x1234 diff --git a/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_no_en b/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_no_en deleted file mode 100755 index 9ea50c2a..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_no_en +++ /dev/null @@ -1,5 +0,0 @@ -# -CPU 0 BANK 3 -STATUS VAL -HOLD -CPU 1 BANK 0 \ No newline at end of file diff --git a/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_over b/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_over deleted file mode 100755 index 21214cfd..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/non-panic/data/corrected_over +++ /dev/null @@ -1,4 +0,0 @@ -CPU 0 BANK 2 -STATUS VAL OVER EN -HOLD -CPU 1 BANK 0 diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/cases.sh b/testcases/kernel/mce-test/cases/soft-inj/panic/cases.sh deleted file mode 100755 index 919f8337..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/cases.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -# -# Software injection based test cases - panic cases: test cases are -# triggered via the mce-inject tool, and they will trigger kernel panic. -# -# Copyright (C) 2008, Intel Corp. -# Author: Huang Ying -# -# This file is released under the GPLv2. -# - -. $ROOT/lib/functions.sh -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh -. $ROOT/lib/soft-inject.sh - -enumerate() -{ - soft_inject_enumerate -} - -trigger() -{ - reset_severity_cov - soft_inject_trigger -} - -get_result() -{ - soft_inject_get_klog - get_gcov arch/x86/kernel/cpu/mcheck/mce.c - get_severity_cov - - case "$bcase" in - fatal*) - soft_inject_get_mcelog - ;; - *) - echo '!!! Unknown case: $this_case !!!' - esac -} - -verify() -{ - local removes="TSC TIME PROCESSOR" - local curr_cpu_panic=": Fatal machine check on current CPU" - local fatal_panic="Fatal Machine check" - local pcc_exp="Processor context corrupt" - case "$bcase" in - fatal|fatal_irq|fatal_over) - removes="$removes RIP" - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "$pcc_exp" - ;; - fatal_ripv|fatal_eipv|fatal_userspace) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "$pcc_exp" - ;; - fatal_no_en) - removes="$removes RIP" - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "Machine check from unknown source" - ;; - fatal_timeout) - removes="$removes RIP" - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$curr_cpu_panic" - soft_inject_verify_timeout - soft_inject_verify_exp "$pcc_exp" - ;; - fatal_timeout_ripv) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$curr_cpu_panic" - soft_inject_verify_timeout - soft_inject_verify_exp "$pcc_exp" - ;; - *) - echo "!!! Unknown case: $this_case !!!" - esac -} - -soft_inject_main "$@" diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal b/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal deleted file mode 100755 index b24942b7..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal +++ /dev/null @@ -1,8 +0,0 @@ -# WARNING -# this will panic your machine! -# don't try casually -CPU 0 BANK 4 -MCGSTATUS MCIP -STATUS FATAL S -RIP 12343434 -MISC 11 diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_eipv b/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_eipv deleted file mode 100755 index 7e6a93ab..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_eipv +++ /dev/null @@ -1,7 +0,0 @@ -# WARNING -# this will panic your machine! -# don't try casually -CPU 1 BANK 4 -MCGSTATUS MCIP EIPV -STATUS FATAL S -RIP 0x10:0x12343434 diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_irq b/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_irq deleted file mode 100755 index 63ef36ba..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_irq +++ /dev/null @@ -1,9 +0,0 @@ -# WARNING -# this will panic your machine! -# don't try casually -CPU 0 BANK 4 -MCGSTATUS MCIP -STATUS FATAL S -RIP 12343434 -MISC 11 -IN_IRQ diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_no_en b/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_no_en deleted file mode 100755 index 12da4967..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_no_en +++ /dev/null @@ -1,8 +0,0 @@ -# WARNING -# this will panic your machine! -# don't try casually -CPU 0 BANK 4 -MCGSTATUS MCIP -STATUS UC VAL PCC S -RIP 0x10:12343434 -MISC 11 diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_over b/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_over deleted file mode 100755 index 6f444199..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_over +++ /dev/null @@ -1,9 +0,0 @@ -# WARNING -# this will panic your machine! -# don't try casually -CPU 0 BANK 4 -MCGSTATUS MCIP -STATUS FATAL OVER S -RIP 12343434 -MISC 11 - diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_ripv b/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_ripv deleted file mode 100755 index 19787472..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_ripv +++ /dev/null @@ -1,7 +0,0 @@ -# WARNING -# this will panic your machine! -# don't try casually -CPU 1 BANK 4 -MCGSTATUS MCIP RIPV -STATUS FATAL S -RIP 0x10:0x12343434 diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_timeout b/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_timeout deleted file mode 100755 index c910141b..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_timeout +++ /dev/null @@ -1,9 +0,0 @@ -# WARNING -# this will panic your machine! -# don't try casually -CPU 0 BANK 4 -MCGSTATUS MCIP -STATUS FATAL S -RIP 0x10:0x12343434 -MISC 0xb -NOBROADCAST diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_timeout_ripv b/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_timeout_ripv deleted file mode 100755 index 0e34e001..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_timeout_ripv +++ /dev/null @@ -1,9 +0,0 @@ -# WARNING -# this will panic your machine! -# don't try casually -CPU 0 BANK 4 -MCGSTATUS MCIP RIPV -STATUS FATAL S -RIP 0x10:0x12343434 -MISC 0xb -NOBROADCAST diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_userspace b/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_userspace deleted file mode 100755 index 3b8fe7fc..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/data/fatal_userspace +++ /dev/null @@ -1,7 +0,0 @@ -# WARNING -# this will panic your machine! -# don't try casually -CPU 1 BANK 4 -MCGSTATUS MCIP EIPV -STATUS FATAL S -RIP 0x73:0x12343434 diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic/refer/fatal_no_en b/testcases/kernel/mce-test/cases/soft-inj/panic/refer/fatal_no_en deleted file mode 100755 index 893cc073..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic/refer/fatal_no_en +++ /dev/null @@ -1 +0,0 @@ -# empty mcelog diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_noser/cases.sh b/testcases/kernel/mce-test/cases/soft-inj/panic_noser/cases.sh deleted file mode 100755 index 9637b9b5..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_noser/cases.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# Software injection based test cases: test cases are triggered via -# the mce-inject tool. -# -# Copyright (C) 2009, Intel Corp. -# Author: Huang Ying -# -# This file is released under the GPLv2. -# - -. $ROOT/lib/functions.sh -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh -. $ROOT/lib/soft-inject.sh - -enumerate() -{ - soft_inject_enumerate -} - -trigger() -{ - reset_severity_cov - soft_inject_trigger -} - -get_result() -{ - soft_inject_get_klog - get_gcov arch/x86/kernel/cpu/mcheck/mce.c - soft_inject_get_mcelog - get_severity_cov -} - -verify() -{ - local removes="TSC TIME PROCESSOR" - local over_exp="Overflowed uncorrected" - local fatal_panic=": Fatal Machine check" - local curr_cpu_panic=": Fatal machine check on current CPU" - case "$bcase" in - uc_over|uc_over_corrected) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "$over_exp" - ;; - uc_over_timeout) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$curr_cpu_panic" - soft_inject_verify_exp "$over_exp" - soft_inject_verify_timeout - ;; - *) - echo "!!! Unknown case: $this_case !!!" - esac -} - -soft_inject_main "$@" diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over b/testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over deleted file mode 100755 index 397c48a6..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over +++ /dev/null @@ -1,6 +0,0 @@ -# this should just kill the process -CPU 0 BANK 2 -STATUS UNCORRECTED OVER -MCGSTATUS RIPV EIPV MCIP -ADDR 0x1234 -RIP 0x10:0xdeadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over_corrected b/testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over_corrected deleted file mode 100755 index 3dac1ce3..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over_corrected +++ /dev/null @@ -1,13 +0,0 @@ -CPU 1 BANK 1 -MCGSTATUS RIPV MCIP -STATUS CORRECTED -RIP 0x13:0x12345678 -IN_PROC -EXCP -HOLD - -CPU 0 BANK 2 -STATUS UNCORRECTED OVER -MCGSTATUS RIPV EIPV MCIP -ADDR 0x1234 -RIP 0x10:0xdeadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over_timeout b/testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over_timeout deleted file mode 100755 index 3b89831a..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_noser/data/uc_over_timeout +++ /dev/null @@ -1,6 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED OVER -MCGSTATUS RIPV EIPV MCIP -ADDR 0x1234 -RIP 0x10:0xdeadbabe -NOBROADCAST diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/cases.sh b/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/cases.sh deleted file mode 100755 index 35cc343c..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/cases.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# -# Software injection based test cases: test cases are triggered via -# the mce-inject tool. -# -# Copyright (C) 2008, Intel Corp. -# Author: Huang Ying -# -# This file is released under the GPLv2. -# - -. $ROOT/lib/functions.sh -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh -. $ROOT/lib/soft-inject.sh - -enumerate() -{ - soft_inject_enumerate -} - -trigger() -{ - reset_severity_cov - soft_inject_trigger -} - -get_result() -{ - soft_inject_get_klog - get_gcov arch/x86/kernel/cpu/mcheck/mce.c - soft_inject_get_mcelog - get_severity_cov -} - -verify() -{ - local mce_panic - local removes="TSC TIME PROCESSOR" - local pcc_exp="Processor context corrupt" - local knoripv_exp="In kernel and no restart IP" - local no_mcip_exp="MCIP not set in MCA handler" - local no_eripv_exp="Neither restart nor error IP" - local over_exp="Overflowed uncorrected" - local fatal_panic=": Fatal Machine check" - local curr_cpu_panic=": Fatal machine check on current CPU" - local unknown_src_panic=": Machine check from unknown source" - case "$bcase" in - fatal_severity) - removes="$removes RIP" - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "$pcc_exp" - ;; - uncorrected) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "$knoripv_exp" - ;; - uncorrected_timeout*) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$curr_cpu_panic" - soft_inject_verify_timeout - soft_inject_verify_exp "$knoripv_exp" - ;; - uc_no_mcip) - removes="$removes RIP" - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "$no_mcip_exp" - ;; - uc_no_mcip_timeout) - removes="$removes RIP" - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$curr_cpu_panic" - soft_inject_verify_exp "$no_mcip_exp" - soft_inject_verify_timeout - ;; - uc_no_eripv) - removes="$removes RIP" - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "$no_eripv_exp" - ;; - uc_no_eripv_timeout) - removes="$removes RIP" - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$curr_cpu_panic" - soft_inject_verify_exp "$no_eripv_exp" - soft_inject_verify_timeout - ;; - unknown) - verify_klog $klog - soft_inject_verify_panic "$unknown_src_panic" - ;; - *) - echo "!!! Unknown case: $this_case !!!" - esac -} - -soft_inject_main "$@" diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/fatal_severity b/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/fatal_severity deleted file mode 100755 index 4dfd8ed1..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/fatal_severity +++ /dev/null @@ -1,16 +0,0 @@ -# WARNING -# this will panic your machine! -# don't try casually -CPU 0 BANK 3 -MCGSTATUS RIPV EIPV MCIP -# S is regarded as SRAO for SER_P = 1 and ignored otherwise -STATUS UNCORRECTED S -RIP 0x10:0x12343434 -MISC 0x2314 -ADDR 0xabcd1234 -HOLD - -CPU 1 BANK 1 -MCGSTATUS MCIP -STATUS FATAL S -RIP 0x10:0xabcdcdcd diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_eripv b/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_eripv deleted file mode 100755 index 91f3b172..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_eripv +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 1 -STATUS UNCORRECTED S -MCGSTATUS MCIP -ADDR 0x1234 -RIP 0x10:0xdeadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_eripv_timeout b/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_eripv_timeout deleted file mode 100755 index 23cd0987..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_eripv_timeout +++ /dev/null @@ -1,6 +0,0 @@ -CPU 0 BANK 1 -STATUS UNCORRECTED S -MCGSTATUS MCIP -ADDR 0x1234 -RIP 0x10:0xdeadbabe -NOBROADCAST diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_mcip b/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_mcip deleted file mode 100755 index c4ac81ac..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_mcip +++ /dev/null @@ -1,4 +0,0 @@ -CPU 0 BANK 1 -STATUS UNCORRECTED S -ADDR 0x1234 -RIP 0x10:0xdeadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_mcip_timeout b/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_mcip_timeout deleted file mode 100755 index 3f31a4ff..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uc_no_mcip_timeout +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 1 -STATUS UNCORRECTED S -ADDR 0x1234 -RIP 0x10:0xdeadbabe -NOBROADCAST diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uncorrected b/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uncorrected deleted file mode 100755 index 3917b760..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uncorrected +++ /dev/null @@ -1,7 +0,0 @@ -# this should just kill the process -CPU 0 BANK 2 -STATUS UNCORRECTED S -MCGSTATUS EIPV MCIP -ADDR 0x1234 -RIP 0x10:0xdeadbabe -IN_PROC \ No newline at end of file diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uncorrected_timeout b/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uncorrected_timeout deleted file mode 100755 index 4a469cdc..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/uncorrected_timeout +++ /dev/null @@ -1,8 +0,0 @@ -# this should just kill the process -CPU 0 BANK 2 -STATUS UNCORRECTED S -MCGSTATUS EIPV MCIP -ADDR 0x1234 -RIP 0x10:0xdeadbabe -IN_PROC -NOBROADCAST diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/unknown b/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/unknown deleted file mode 100755 index 25ecb5b1..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_npcc/data/unknown +++ /dev/null @@ -1,3 +0,0 @@ -# this should just kill the process -CPU 0 BANK 2 -STATUS UC S diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/cases.sh b/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/cases.sh deleted file mode 100755 index 8aec7dfa..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/cases.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# -# Software injection based test cases: test cases are triggered via -# mce-inject tool. -# -# Copyright (C) 2009, Intel Corp. -# Author: Huang Ying -# -# This file is released under the GPLv2. -# - -. $ROOT/lib/functions.sh -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh -. $ROOT/lib/soft-inject.sh - -enumerate() -{ - soft_inject_enumerate -} - -trigger() -{ - reset_severity_cov - soft_inject_trigger -} - -get_result() -{ - soft_inject_get_klog - get_gcov arch/x86/kernel/cpu/mcheck/mce.c - soft_inject_get_mcelog - get_severity_cov -} - -verify() -{ - local removes="TSC TIME PROCESSOR" - local fatal_panic=": Fatal Machine check" - local curr_cpu_panic=": Fatal machine check on current CPU" - local unknown_src_panic=": Machine check from unknown source" - local no_eripv_exp="Neither restart nor error IP" - case "$bcase" in - s0_ar1) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "Illegal combination (UCNA with AR=1)" - ;; - srar_over) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "Action required with lost events" - ;; - srar_unkown) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "Action required; unknown MCACOD" - ;; - srar_no_en) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "Machine check from unknown source" - ;; - srao_mem_scrub_noripv|srao_ewb_noripv) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_panic "$fatal_panic" - soft_inject_verify_exp "$no_eripv_exp" - ;; - *) - echo "!!! Unknown case: $this_case !!!" - esac -} - -soft_inject_main "$@" diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/s0_ar1 b/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/s0_ar1 deleted file mode 100755 index 85e931af..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/s0_ar1 +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED AR -MCGSTATUS RIPV EIPV MCIP -ADDR 0x1234 -RIP 0x10:0xdeadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srao_ewb_noripv b/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srao_ewb_noripv deleted file mode 100755 index 4518ff11..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srao_ewb_noripv +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO 0x17a -MCGSTATUS MCIP -ADDR 0x1234 -MISC 0x8c diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srao_mem_scrub_noripv b/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srao_mem_scrub_noripv deleted file mode 100755 index c9e2fd41..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srao_mem_scrub_noripv +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO 0xc0 -MCGSTATUS MCIP -ADDR 0x1234 -MISC 0x8c diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_no_en b/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_no_en deleted file mode 100755 index 378e58c6..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_no_en +++ /dev/null @@ -1,6 +0,0 @@ -CPU 0 BANK 2 -STATUS VAL UC SRAR -MCGSTATUS EIPV MCIP -ADDR 0x1234 -RIP 0x73:0x2eadbabe - diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_over b/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_over deleted file mode 100755 index 9e341d59..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_over +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAR OVER -MCGSTATUS EIPV MCIP -ADDR 0x1234 -RIP 0x73:0x1eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_unkown b/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_unkown deleted file mode 100755 index e3d42a63..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/data/srar_unkown +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAR -MCGSTATUS EIPV MCIP -ADDR 0x1234 -RIP 0x73:0x2eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/refer/srar_no_en b/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/refer/srar_no_en deleted file mode 100755 index ea30561d..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/panic_ucr/refer/srar_no_en +++ /dev/null @@ -1 +0,0 @@ -#empty diff --git a/testcases/kernel/mce-test/cases/soft-inj/poll_noser/cases.sh b/testcases/kernel/mce-test/cases/soft-inj/poll_noser/cases.sh deleted file mode 100755 index 4a3b285c..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/poll_noser/cases.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# Software injection based test cases: test cases are triggered via -# the mce-inject tool. -# -# Copyright (C) 2009, Intel Corp. -# Author: Jiajia Zheng -# -# This file is released under the GPLv2. -# - -. $ROOT/lib/functions.sh -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh -. $ROOT/lib/soft-inject.sh - -enumerate() -{ - soft_inject_enumerate -} - -trigger() -{ - reset_severity_cov - soft_inject_trigger -} - -get_result() -{ - soft_inject_get_klog - get_gcov arch/x86/kernel/cpu/mcheck/mce.c - soft_inject_get_mcelog - get_severity_cov -} - -verify() -{ - local removes="TSC TIME PROCESSOR" - case "$bcase" in - uc_poll) - soft_inject_verify_mcelog - verify_klog $klog - ;; - *) - echo "!!! Unknown case: $this_case !!!" - esac -} - -soft_inject_main "$@" diff --git a/testcases/kernel/mce-test/cases/soft-inj/poll_noser/data/uc_poll b/testcases/kernel/mce-test/cases/soft-inj/poll_noser/data/uc_poll deleted file mode 100755 index ef81543b..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/poll_noser/data/uc_poll +++ /dev/null @@ -1,6 +0,0 @@ -CPU 1 BANK 4 -MCGSTATUS MCIP -STATUS UNCORRECTED -RIP 12343434 -MISC 11 -POLL diff --git a/testcases/kernel/mce-test/cases/soft-inj/poll_noser/refer/uc_poll b/testcases/kernel/mce-test/cases/soft-inj/poll_noser/refer/uc_poll deleted file mode 100755 index ea30561d..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/poll_noser/refer/uc_poll +++ /dev/null @@ -1 +0,0 @@ -#empty diff --git a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/cases.sh b/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/cases.sh deleted file mode 100755 index dc9fc6ac..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/cases.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# Software injection based test cases: test cases are triggered via -# mce-inject tool. -# -# Copyright (C) 2009, Intel Corp. -# Author: Huang Ying -# -# This file is released under the GPLv2. -# - -. $ROOT/lib/functions.sh -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh -. $ROOT/lib/soft-inject.sh - -enumerate() -{ - soft_inject_enumerate -} - -trigger() -{ - reset_severity_cov - soft_inject_trigger -} - -get_result() -{ - soft_inject_get_klog - get_gcov arch/x86/kernel/cpu/mcheck/mce.c - soft_inject_get_mcelog - get_severity_cov -} - -verify() -{ - local removes="TSC TIME PROCESSOR" - case "$bcase" in - ucna|ucna_over|srar_poll) - soft_inject_verify_mcelog - verify_klog $klog - ;; - fatal_poll) - removes="$removes RIP" - soft_inject_verify_mcelog - verify_klog $klog - ;; - *) - echo "!!! Unknown case: $this_case !!!" - esac -} - -soft_inject_main "$@" diff --git a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/fatal_poll b/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/fatal_poll deleted file mode 100755 index 7efb3160..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/fatal_poll +++ /dev/null @@ -1,6 +0,0 @@ -CPU 1 BANK 4 -MCGSTATUS MCIP -STATUS FATAL -RIP 12343434 -MISC 11 -POLL diff --git a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/srar_poll b/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/srar_poll deleted file mode 100755 index f57b5dee..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/srar_poll +++ /dev/null @@ -1,9 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAR -MCGSTATUS EIPV MCIP -ADDR 0x1234 -RIP 0x73:0x2eadbabe -POLL -HOLD -CPU 1 BANK 0 - diff --git a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/ucna b/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/ucna deleted file mode 100755 index 2419b639..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/ucna +++ /dev/null @@ -1,7 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED UCNA -ADDR 0x1234 -MISC 0x8c -POLL -HOLD -CPU 1 BANK 0 \ No newline at end of file diff --git a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/ucna_over b/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/ucna_over deleted file mode 100755 index c630057d..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/data/ucna_over +++ /dev/null @@ -1,6 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED UCNA OVER -ADDR 0x1234 -MISC 0x8c -POLL - diff --git a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/refer/srar_poll b/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/refer/srar_poll deleted file mode 100755 index ea30561d..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/poll_ucr/refer/srar_poll +++ /dev/null @@ -1 +0,0 @@ -#empty diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/cases.sh b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/cases.sh deleted file mode 100755 index ee74ccbd..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/cases.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# Software injection based test cases: test cases are triggered via -# mce-inject tool. -# -# Copyright (C) 2009, Intel Corp. -# Author: Huang Ying -# -# This file is released under the GPLv2. -# - -. $ROOT/lib/functions.sh -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh -. $ROOT/lib/soft-inject.sh - -enumerate() -{ - soft_inject_enumerate -} - -trigger() -{ - reset_severity_cov - soft_inject_trigger -} - -get_result() -{ - soft_inject_get_klog - soft_inject_get_mcelog - get_gcov arch/x86/kernel/cpu/mcheck/mce.c - get_severity_cov -} - -verify() -{ - local removes="TSC TIME PROCESSOR" - case "$bcase" in - srao_*|srar_*) - soft_inject_verify_mcelog - verify_klog $klog - soft_inject_verify_return_val - ;; - *) - echo "!!! Unknown case: $this_case !!!" - esac -} - -soft_inject_main "$@" diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_corrected b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_corrected deleted file mode 100755 index ec24a0d1..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_corrected +++ /dev/null @@ -1,11 +0,0 @@ -CPU 1 BANK 1 -MCGSTATUS RIPV MCIP -STATUS CORRECTED -EXCP -HOLD - -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO -MCGSTATUS RIPV MCIP -ADDR 0x1234 -RIP 0x73:0x1eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_ewb b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_ewb deleted file mode 100755 index 7dba8c07..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_ewb +++ /dev/null @@ -1,6 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO 0x17a -MCGSTATUS RIPV MCIP -ADDR 0x1234 -MISC 0x8c -RIP 0x73:0x1eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_mem_scrub b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_mem_scrub deleted file mode 100755 index b4704b6f..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_mem_scrub +++ /dev/null @@ -1,6 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO 0xc0 -MCGSTATUS RIPV MCIP -ADDR 0x1234 -MISC 0x8c -RIP 0x73:0x1eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_no_en b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_no_en deleted file mode 100755 index afac76b2..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_no_en +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 2 -STATUS VAL UC SRAO -MCGSTATUS RIPV MCIP -ADDR 0x1234 -RIP 0x73:0x1eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_over b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_over deleted file mode 100755 index c5b337d4..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_over +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO OVER -MCGSTATUS RIPV MCIP -ADDR 0x1234 -RIP 0x73:0x1eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_ucna b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_ucna deleted file mode 100755 index 80afaca0..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_ucna +++ /dev/null @@ -1,11 +0,0 @@ -CPU 1 BANK 1 -MCGSTATUS RIPV MCIP -STATUS UNCORRECTED UCNA -EXCP -HOLD - -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO -MCGSTATUS RIPV MCIP -ADDR 0x1234 -RIP 0x73:0x1eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_unknown b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_unknown deleted file mode 100755 index 63e465a2..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srao_unknown +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO -MCGSTATUS RIPV MCIP -ADDR 0x1234 -RIP 0x73:0x1eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu deleted file mode 100755 index 335b6bc2..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu +++ /dev/null @@ -1,7 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAR 0x134 -MCGSTATUS RIPV MCIP EIPV -ADDR 0x12345000 -MISC 0x8c -RIP 0x73:0x1eadbabe -NOBROADCAST diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu_irq b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu_irq deleted file mode 100755 index 5572bf61..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu_irq +++ /dev/null @@ -1,7 +0,0 @@ -CPU 3 BANK 2 -STATUS UNCORRECTED SRAR 0x134 -MCGSTATUS RIPV MCIP EIPV -ADDR 0x12345000 -MISC 0x8c -RIP 0x73:0x1eadbabe -IRQBROADCAST diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu_nmi b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu_nmi deleted file mode 100755 index 3af1cc72..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/data/srar_usr_dcu_nmi +++ /dev/null @@ -1,6 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAR 0x134 -MCGSTATUS RIPV MCIP EIPV -ADDR 0x12345000 -MISC 0x8c -RIP 0x73:0x1eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_corrected b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_corrected deleted file mode 100755 index 63e465a2..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_corrected +++ /dev/null @@ -1,5 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO -MCGSTATUS RIPV MCIP -ADDR 0x1234 -RIP 0x73:0x1eadbabe diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_no_en b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_no_en deleted file mode 100755 index ea30561d..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_no_en +++ /dev/null @@ -1 +0,0 @@ -#empty diff --git a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_ucna b/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_ucna deleted file mode 100755 index 65d78c8c..00000000 --- a/testcases/kernel/mce-test/cases/soft-inj/recoverable_ucr/refer/srao_ucna +++ /dev/null @@ -1,6 +0,0 @@ -CPU 0 BANK 2 -STATUS UNCORRECTED SRAO -MCGSTATUS RIPV MCIP -ADDR 0x1234 -RIP 0x73:0x1eadbabe - diff --git a/testcases/kernel/mce-test/config/kdump.conf b/testcases/kernel/mce-test/config/kdump.conf deleted file mode 100755 index e87ddc56..00000000 --- a/testcases/kernel/mce-test/config/kdump.conf +++ /dev/null @@ -1,6 +0,0 @@ - -CASES="soft-inj/panic/cases.sh soft-inj/panic_npcc/cases.sh" -COREDIR="/var/crash" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build -VMLINUX=$KSRC_DIR/vmlinux diff --git a/testcases/kernel/mce-test/config/kdump_noser.conf b/testcases/kernel/mce-test/config/kdump_noser.conf deleted file mode 100755 index e44a135e..00000000 --- a/testcases/kernel/mce-test/config/kdump_noser.conf +++ /dev/null @@ -1,6 +0,0 @@ - -CASES="soft-inj/panic/cases.sh soft-inj/panic_npcc/cases.sh soft-inj/panic_noser/cases.sh" -COREDIR="/var/crash" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build -VMLINUX=$KSRC_DIR/vmlinux diff --git a/testcases/kernel/mce-test/config/kdump_panic.conf b/testcases/kernel/mce-test/config/kdump_panic.conf deleted file mode 100755 index b2acc63a..00000000 --- a/testcases/kernel/mce-test/config/kdump_panic.conf +++ /dev/null @@ -1,6 +0,0 @@ - -CASES="soft-inj/panic/cases.sh" -COREDIR="/var/crash" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build -VMLINUX=$KSRC_DIR/vmlinux diff --git a/testcases/kernel/mce-test/config/kdump_panic_noser.conf b/testcases/kernel/mce-test/config/kdump_panic_noser.conf deleted file mode 100755 index b4562d32..00000000 --- a/testcases/kernel/mce-test/config/kdump_panic_noser.conf +++ /dev/null @@ -1,6 +0,0 @@ - -CASES="soft-inj/panic_noser/cases.sh" -COREDIR="/var/crash" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build -VMLINUX=$KSRC_DIR/vmlinux diff --git a/testcases/kernel/mce-test/config/kdump_panic_npcc.conf b/testcases/kernel/mce-test/config/kdump_panic_npcc.conf deleted file mode 100755 index b5c5e8cc..00000000 --- a/testcases/kernel/mce-test/config/kdump_panic_npcc.conf +++ /dev/null @@ -1,6 +0,0 @@ - -CASES="soft-inj/panic_npcc/cases.sh" -COREDIR="/var/crash" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build -VMLINUX=$KSRC_DIR/vmlinux diff --git a/testcases/kernel/mce-test/config/kdump_panic_ucr.conf b/testcases/kernel/mce-test/config/kdump_panic_ucr.conf deleted file mode 100755 index c7508b22..00000000 --- a/testcases/kernel/mce-test/config/kdump_panic_ucr.conf +++ /dev/null @@ -1,6 +0,0 @@ - -CASES="soft-inj/panic_ucr/cases.sh" -COREDIR="/var/crash" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build -VMLINUX=$KSRC_DIR/vmlinux diff --git a/testcases/kernel/mce-test/config/kdump_ser.conf b/testcases/kernel/mce-test/config/kdump_ser.conf deleted file mode 100755 index 71182a66..00000000 --- a/testcases/kernel/mce-test/config/kdump_ser.conf +++ /dev/null @@ -1,6 +0,0 @@ - -CASES="soft-inj/panic/cases.sh soft-inj/panic_npcc/cases.sh soft-inj/panic_ucr/cases.sh" -COREDIR="/var/crash" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build -VMLINUX=$KSRC_DIR/vmlinux diff --git a/testcases/kernel/mce-test/config/simple.conf b/testcases/kernel/mce-test/config/simple.conf deleted file mode 100755 index be6d2f10..00000000 --- a/testcases/kernel/mce-test/config/simple.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/non-panic/cases.sh soft-inj/panic/cases.sh soft-inj/panic_npcc/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_non_panic.conf b/testcases/kernel/mce-test/config/simple_non_panic.conf deleted file mode 100755 index 7d1a5d3b..00000000 --- a/testcases/kernel/mce-test/config/simple_non_panic.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/non-panic/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_nopanic_noser.conf b/testcases/kernel/mce-test/config/simple_nopanic_noser.conf deleted file mode 100755 index 835d9e62..00000000 --- a/testcases/kernel/mce-test/config/simple_nopanic_noser.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/non-panic/cases.sh soft-inj/poll_noser/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_nopanic_ser.conf b/testcases/kernel/mce-test/config/simple_nopanic_ser.conf deleted file mode 100755 index a82cdb71..00000000 --- a/testcases/kernel/mce-test/config/simple_nopanic_ser.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/non-panic/cases.sh soft-inj/poll_ucr/cases.sh soft-inj/recoverable_ucr/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_noser.conf b/testcases/kernel/mce-test/config/simple_noser.conf deleted file mode 100755 index b562070b..00000000 --- a/testcases/kernel/mce-test/config/simple_noser.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/non-panic/cases.sh soft-inj/panic/cases.sh soft-inj/panic_npcc/cases.sh soft-inj/panic_noser/cases.sh soft-inj/poll_noser/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_panic.conf b/testcases/kernel/mce-test/config/simple_panic.conf deleted file mode 100755 index 35e96c80..00000000 --- a/testcases/kernel/mce-test/config/simple_panic.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/panic/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_panic_noser.conf b/testcases/kernel/mce-test/config/simple_panic_noser.conf deleted file mode 100755 index 6694b314..00000000 --- a/testcases/kernel/mce-test/config/simple_panic_noser.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/panic_noser/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_panic_npcc.conf b/testcases/kernel/mce-test/config/simple_panic_npcc.conf deleted file mode 100755 index 04a3f235..00000000 --- a/testcases/kernel/mce-test/config/simple_panic_npcc.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/panic_npcc/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_panic_ucr.conf b/testcases/kernel/mce-test/config/simple_panic_ucr.conf deleted file mode 100755 index 84d0d006..00000000 --- a/testcases/kernel/mce-test/config/simple_panic_ucr.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/panic_ucr/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_poll_noser.conf b/testcases/kernel/mce-test/config/simple_poll_noser.conf deleted file mode 100755 index 6b7eb797..00000000 --- a/testcases/kernel/mce-test/config/simple_poll_noser.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/poll_noser/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_poll_ucr.conf b/testcases/kernel/mce-test/config/simple_poll_ucr.conf deleted file mode 100755 index f21038c4..00000000 --- a/testcases/kernel/mce-test/config/simple_poll_ucr.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/poll_ucr/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_recoverable_ucr.conf b/testcases/kernel/mce-test/config/simple_recoverable_ucr.conf deleted file mode 100755 index d140845f..00000000 --- a/testcases/kernel/mce-test/config/simple_recoverable_ucr.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/recoverable_ucr/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/config/simple_ser.conf b/testcases/kernel/mce-test/config/simple_ser.conf deleted file mode 100755 index b6a3bf23..00000000 --- a/testcases/kernel/mce-test/config/simple_ser.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CASES="soft-inj/non-panic/cases.sh soft-inj/panic/cases.sh soft-inj/panic_npcc/cases.sh soft-inj/poll_ucr/cases.sh soft-inj/panic_ucr/cases.sh soft-inj/recoverable_ucr/cases.sh" -GCOV=1 -KSRC_DIR=/lib/modules/$(uname -r)/build diff --git a/testcases/kernel/mce-test/doc/cases/soft-inj_non-panic.txt b/testcases/kernel/mce-test/doc/cases/soft-inj_non-panic.txt deleted file mode 100755 index df89dfbe..00000000 --- a/testcases/kernel/mce-test/doc/cases/soft-inj_non-panic.txt +++ /dev/null @@ -1,66 +0,0 @@ -Overall:(4 cases) - -- Test method - * Preparation - + Disable mcelog cron job - * Add cases/soft-inj/non-panic/cases.sh into configuration file, and invoke - a test driver on it. -- Common - * Test script of test cases in this file can be found in - cases/soft-inj/non-panic/cases.sh - - -1. corrected - -- Objective: - * Test machine_check_poll() and mce_log() -- Code path tested: - * machine_check_poll() - * mce_get_rip(), branch without EIPV, RIPV, rip_msr - * mce_log() -- Reference: - * Inject data file: cases/soft-inj/non-panic/data/corrected -- Expected results: - * MCE records gotten via /dev/mcelog is same as injected ones - * No warning or bug during kernel processing - - -2. corrected hold - -- Objective: - * Whether is there race condition in machine_check_poll() and mce_log(), - multiple machine_check_poll() or mce_log() may be run simultaneously - on difference CPU. -- Code path tested: - * same as corrected -- Reference: - * Inject data file: cases/soft-inj/non-panic/data/corrected_hold -- Expected results: - * MCE records gotten via /dev/mcelog is same as injected ones - * No warning or bug during kernel processing - - -3. corrected over - -- Objective: - * Test OVER processing -- Code path tested: - * same as 1 -- Reference: - * Inject data file: cases/soft-inj/non-panic/data/corrected_over -- Expected results: - * MCE records gotten via /dev/mcelog is same as injected ones - * No warning or bug during kernel processing - - -4. corrected without EN - -- Objective: - * Test no EN processing -- Code path tested: - * same as 1 -- Reference: - * Inject data file: cases/soft-inj/non-panic/data/corrected_no_en -- Expected results: - * MCE records gotten via /dev/mcelog is same as injected ones - * No warning or bug during kernel processing diff --git a/testcases/kernel/mce-test/doc/cases/soft-inj_panic.txt b/testcases/kernel/mce-test/doc/cases/soft-inj_panic.txt deleted file mode 100755 index f068d8d4..00000000 --- a/testcases/kernel/mce-test/doc/cases/soft-inj_panic.txt +++ /dev/null @@ -1,173 +0,0 @@ -Overall: (9 cases) - -- Test method - * Add cases/soft-inj/panic/cases.sh into configuration file, and invoke - a test driver on it. -- Common - * Test script of test cases in this file can be found in - cases/soft-inj/panic/cases.sh - -1. fatal - -- Objective: - * Test MSR read logic of MCE handler - * Test synchronization between monarch and subject - * Test logic to recognize a fatal (PCC) MCE -- Code path tested: - * do_machine_check() - * mce_start() - * mce_end() - * mce_reign() until mce_panic("Fatal Machine check",) - * mce_severity() - * mce_timeout() except if (*t <= 0) branch - * mce_panic() - * print_mce() - * mce_log() -- Reference: - * Inject data file: cases/soft-inj/panic/data/fatal -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Processor context corrupt" - - -2. fatal timeout - -- Objective: - * Test logic of timeout during monarch/subject synchronization - * Test logic to recognize a fatal (PCC) MCE -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() if (*t <= 0) branch - * mce_severity() - * mce_panic("Fatal machine check on current CPU",); - * print_mce() - * mce_log() -- Reference: - * Inject data file: cases/soft-inj/panic/data/fatal_timeout -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal machine check on current CPU" - * Exception message is "Processor context corrupt" - * Timeout message is "Some CPUs didn't answer in synchronization" - - -3. fatal in irq - -- Objective: - * Test fatal MCE occur in IRQ context - * Test logic to recognize a fatal (PCC) MCE -- Code path tested: - * Same as fatal -- Reference: - * Inject data file: cases/soft-inj/panic/data/fatal_irq -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Processor context corrupt" - - -4. fatal with RIPV - -- Objective: - * Test combination of PCC and RIPV - * Test logic to recognize a fatal (PCC) MCE -- Code path tested: - * MCG_STATUS_RIPV branch of switch(m.mcgstatus) in do_machine_check - * Others are same as fatal -- Reference: - * Inject data file: cases/soft-inj/panic/data/fatal_ripv -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Processor context corrupt" - - -5. fatal timeout with RIPV - -- Objective: - * Test timeout logic of combination of PCC and RIPV - * Test logic to recognize a fatal (PCC) MCE -- Code path tested: - * MCG_STATUS_RIPV branch of switch(m.mcgstatus) in do_machine_check - * Others are same as fatal_timeout -- Reference: - * Inject data file: cases/soft-inj/panic/data/fatal_timeout_ripv -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal machine check on current CPU" - * Exception message is "Processor context corrupt" - * Timeout message is "Some CPUs didn't answer in synchronization" - - -6. fatal with OVER - -- Objective: - * Test OVER flag in MCI_STATUS processing - * Test logic to recognize a fatal (PCC) MCE -- Code path tested: - * Same as fatal -- Reference: - * Inject data file: cases/soft-inj/panic/data/fatal_over -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Processor context corrupt" - - -7. fatal and UC without EN - -- Objective: - * Test no EN processing. Only one MCE can be injected on one CPU, so - a MCE without EN are injected on other CPU. - * Test logic to recognize a fatal (PCC) MCE -- Code path tested: - * Same as fatal except no EN branch in do_machine_check() -- Reference: - * Inject data file: cases/soft-inj/panic/data/fatal_no_en - * Reference MCE records: cases/soft-inj/panic/refer/fatal_no_en -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Machine check from unknown source" - * No exception message - -8. fatal with EIPV - -- Objective: - * Test combination of PCC and EIPV - * Test logic to recognize a fatal (PCC) MCE -- Code path tested: - * Same as fatal -- Reference: - * Inject data file: cases/soft-inj/panic/data/fatal_eipv -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Processor context corrupt" - - -9. fatal in userspace - -- Objective: - * Test of PCC in userspace - * Test logic to recognize a fatal (PCC) MCE -- Code path tested: - * Same as fatal -- Reference: - * Inject data file: cases/soft-inj/panic/data/fatal_eipv -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Processor context corrupt" - - diff --git a/testcases/kernel/mce-test/doc/cases/soft-inj_panic_noser.txt b/testcases/kernel/mce-test/doc/cases/soft-inj_panic_noser.txt deleted file mode 100755 index 27a5735d..00000000 --- a/testcases/kernel/mce-test/doc/cases/soft-inj_panic_noser.txt +++ /dev/null @@ -1,83 +0,0 @@ -Overall: (3 cases) - -- Test method - * Add cases/soft-inj/panic_noser/cases.sh into configuration file, and invoke - a test driver on it. -- Common - * Test script of test cases in this file can be found in - cases/soft-inj/panic_noser/cases.sh - -1. uc_over - -- Objective: - * Test MSR read logic of MCE handler - * Test synchronization between monarch and subject - * Test logic of uncorrected with UC and OVER -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_log() - * mce_end() - * mce_severity() - * mce_reign() until mce_panic("Fatal Machine check",) - * mce_panic() - * print_mce() -- Reference: - * Inject data file: cases/soft-inj/panic_noser/data/uc_over -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Overflowed uncorrected" - - -2. uc_over_corrected - -- Objective: - * Test synchronization between monarch and subject - * Test logic of uncorrected and corrected - * Test logic of uncorrected with UC and OVER - * Test logic of corrected with EXCP -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_log() - * mce_end() - * mce_severity() - * mce_reign() until mce_panic("Fatal Machine check",) - * mce_panic() - * print_mce() -- Reference: - * Inject data file: cases/soft-inj/panic_noser/data/uc_over_corrected -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Overflowed uncorrected" - - -3. uc_over_timeout - -- Objective: - * Test logic of timeout during monarch/subject synchronization - * Test logic of uncorrected with UC and OVER -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() if (*t <= 0) branch - * mce_log() - * mce_severity() - * mce_panic("Fatal machine check on current CPU",) - * print_mce() -- Reference: - * Inject data file: cases/soft-inj/panic_noser/data/uc_over_timeout -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal machine check on current CPU" - * Exception message is "Overflowed uncorrected" - * Timeout message is "Some CPUs didn't answer in synchronization" - - diff --git a/testcases/kernel/mce-test/doc/cases/soft-inj_panic_npcc.txt b/testcases/kernel/mce-test/doc/cases/soft-inj_panic_npcc.txt deleted file mode 100755 index fa4b5a14..00000000 --- a/testcases/kernel/mce-test/doc/cases/soft-inj_panic_npcc.txt +++ /dev/null @@ -1,145 +0,0 @@ -Overall:(8 cases) - -- Test method - * Preparation - + Disable mcelog cron job - * Add cases/soft-inj/panic_npcc/cases.sh into configuration file, and invoke - a test driver on it. -- Common - * Test script of test cases in this file can be found in - cases/soft-inj/panic_npcc/cases.sh - - -1. fatal severity - -- Objective: - * Test severity comparison logic of MCE handler -- Code path tested: - * do_machine_check() - * mce_start() - * mce_end() - * mce_severity() - * mce_regin() for_each_possible_loops loops(check mce-severity message) - * mce_panic() - * mce_log() - * print_mce() -- Reference: - * Inject data file: cases/soft-inj/panic_npcc/data/fatal_severity -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Processor context corrupt" - - -2. uncorrected - -- Objective: - * Test MCE handler logic for EIPV MCE in kernel space -- Code path tested: - * Same as falta severity -- Reference: - * Inject data file: cases/soft-inj/panic_npcc/data/uncorrected -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "In kernel and no restart IP" - - -3. uncorrected timeout - -- Objective: - * Test MCE handler timeout logic for EIPV MCE in kernel space -- Code path tested: - * do_machine_check() - * mce_start() until timeout - * mce_severity() - * mce_panic("Fatal machine check on current CPU", ) - * mce_log() - * print_mce() -- Reference: - * Inject data file: cases/soft-inj/panic_npcc/data/uncorrected_timeout -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal machine check on current CPU" - * Exception message is "In kernel and no restart IP" - * Timeout message is "Some CPUs didn't answer in synchronization" - - -4. uncorrected without MCIP - -- Objective: - * Test MCE handler logic for MCE without PCC, MCIP, EIPV and RIPV -- Code path tested: - * Same as fatal severity -- Reference: - * Inject data file: cases/soft-inj/panic_npcc/data/uncorrected_no_mcip -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "MCIP not set in MCA handler" - - -5. uncorrect timeout without MCIP - -- Objective: - * Test MCE handler timeout logic for MCE without PCC, MCIP, EIPV and RIPV -- Code path tested: - * Same as uncorrected timeout -- Reference: - * Inject data file: cases/soft-inj/panic_npcc/data/uncorrected_no_mcip_timeout -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal machine check on current CPU" - * Kernel panic message is "MCIP not set in MCA handler" - * Timeout message is "Some CPUs didn't answer in synchronization" - - -6. uncorrected without EIPV and RIPV - -- Objective: - * Test MCE handler logic for EIPV and RIPV MCE in kernel space -- Code path tested: - * Same as uncorrected -- Reference: - * Inject data file: cases/soft-inj/panic_npcc/data/uncorrected_no_eripv -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Neither restart nor error IP" - - -7. uncorrected timeout without EIPV and RIPV - -- Objective: - * Test MCE handler timout logic for EIPV|RIPV MCE in kernel space -- Code path tested: - * Same as uncorrected timeout -- Reference: - * Inject data file: cases/soft-inj/panic_npcc/data/uncorrected_no_eripv_timeout -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "In kernel and no restart IP" - * Timeout message is "Some CPUs didn't answer in synchronization" - - -8. unknown - -- Objective: - * Test logic for MCE from unknown source (external?) -- Code path tested: - * mce_reign(), mce_panic("Machine check from unknown source") branch - * Others are same as fatal severity -- Reference: - * Inject data file: cases/soft-inj/panic_npcc/data/unknown -- Expected result: - * No warning or bug during kernel processing. - * Kernel panic message is "Machine check from unknown source" - * No exception and timeout message. diff --git a/testcases/kernel/mce-test/doc/cases/soft-inj_panic_ucr.txt b/testcases/kernel/mce-test/doc/cases/soft-inj_panic_ucr.txt deleted file mode 100755 index 867c0b71..00000000 --- a/testcases/kernel/mce-test/doc/cases/soft-inj_panic_ucr.txt +++ /dev/null @@ -1,135 +0,0 @@ -Overall: (6 cases) - -- Test method - * Add cases/soft-inj/panic_ucr/cases.sh into configuration file, and invoke - a test driver on it. -- Common - * Test script of test cases in this file can be found in - cases/soft-inj/panic_ucr/cases.sh - -1. s0_ar1 - -- Objective: - * Test MSR read logic of MCE handler - * Test synchronization between monarch and subject -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_log() - * mce_end() - * mce_severity() - * mce_reign() until mce_panic("Fatal Machine check",) - * mce_panic() - * print_mce() -- Reference: - * Inject data file: cases/soft-inj/panic_ucr/data/s0_ar1 -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Illegal combination (UCNA with AR=1)" - - -2. srar_over - -- Objective: - * Test logic of timeout during monarch/subject synchronization -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_log() - * mce_end() - * mce_severity() - * mce_reign() until mce_panic("Fatal Machine check",) - * mce_panic(); - * print_mce() -- Reference: - * Inject data file: cases/soft-inj/panic_ucr/data/srar_over -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Action required with lost events" - - -3. srar_unknown - -- Objective: - * Test fatal MCE occur in IRQ context -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_log() - * mce_end() - * mce_severity() - * mce_reign() until mce_panic("Fatal Machine check",) - * mce_panic() - * print_mce() -- Reference: - * Inject data file: cases/soft-inj/panic_ucr/data/srar_unknown -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Action required; unknown MCACOD" - - -4. srar_no_en - -- Objective: - * Test fatal MCE occur -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_log() - * mce_end() - * mce_severity() - * mce_reign() until mce_panic("Machine check from unknown source",) - * mce_panic() - * print_mce() -- Reference: - * Inject data file: cases/soft-inj/panic_ucr/data/srar_no_en - * Reference MCE records: cases/soft-inj/panic_ucr/refer/srar_no_en -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Machine check from unknown source" - -5.srao_ewb_noripv -- Objective: - * Test MCE handler logic for EIPV and RIPV MCE in kernel space -- Code path tested: - * do_machine_check() - * mce_start() - * mce_end() - * mce_severity() - * mce_regin() for_each_possible_loops loops(check mce-severity message) - * mce_panic() - * mce_log() - * print_mce() -- Reference: - * Inject data file: cases/soft-inj/recoverable_ucr/data/srao_ewb_noripv -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Neither restart nor error IP" - -6.srao_mem_scrub_noripv -- Objective: - * Test MCE handler logic for EIPV and RIPV MCE in kernel space -- Code path tested: - * the same as srao_ewb_noripv -- Reference: - * Inject data file: - * cases/soft-inj/recoverable_ucr/data/srao_mem_scrub_noripv -- Expected result: - * No warning or bug during kernel processing. - * MCE records collected via kernel panic log is same as reference ones. - * Kernel panic message is "Fatal Machine check" - * Exception message is "Neither restart nor error IP" - diff --git a/testcases/kernel/mce-test/doc/cases/soft-inj_poll_ucr.txt b/testcases/kernel/mce-test/doc/cases/soft-inj_poll_ucr.txt deleted file mode 100755 index ed41a107..00000000 --- a/testcases/kernel/mce-test/doc/cases/soft-inj_poll_ucr.txt +++ /dev/null @@ -1,44 +0,0 @@ -Overall:(2 cases) - -- Test method - * Preparation - + Disable mcelog cron job - * Add cases/soft-inj/panic_ucr/cases.sh into configuration file, and invoke - a test driver on it. -- Common - * Test script of test cases in this file can be found in - cases/soft-inj/panic_ucr/cases.sh - - -1. ucna - -- Objective: - * Test severity comparison logic of MCE handler - * Test logic of uncorrected with POLL -- Code path tested: - * machine_check_poll() except - if (!(flags & MCP_UC) && - (m.status & (mce_ser ? MCI_STATUS_S : MCI_STATUS_UC)) - * mce_log() -- Reference: - * Inject data file: cases/soft-inj/poll_ucr/data/ucna -- Expected result: - * MCE records collected via kernel panic log is same as reference ones. - * No warning or bug during kernel processing. - - -2. ucna_over - -- Objective: - * Test severity comparison logic of MCE handler - * Test logic of uncorrected with POLL -- Code path tested: - * machine_check_poll() except - if (!(flags & MCP_UC) && - (m.status & (mce_ser ? MCI_STATUS_S : MCI_STATUS_UC)) - * mce_log() -- Reference: - * Inject data file: cases/soft-inj/poll_ucr/data/ucna_over -- Expected result: - * MCE records collected via kernel panic log is same as reference ones. - * No warning or bug during kernel processing. diff --git a/testcases/kernel/mce-test/doc/cases/soft-inj_recoverable_ucr.txt b/testcases/kernel/mce-test/doc/cases/soft-inj_recoverable_ucr.txt deleted file mode 100755 index 47a3a099..00000000 --- a/testcases/kernel/mce-test/doc/cases/soft-inj_recoverable_ucr.txt +++ /dev/null @@ -1,192 +0,0 @@ -overall: (7 cases) - -- Test method - * Add cases/soft-inj/recoverable_ucr/cases.sh into configuration file, and invoke a test driver on it. -- Common - * Test script of test cases in this file can be found in - cases/soft-inj/recoverable_ucr/cases.sh - -1.srao_corrected - -- Objective: - * Test logic of uncorrected and corrected - * Test logic of uncorrected with S - * Test logic of corrected with EXCP -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_severity() - * mce_log() - * mce_end() - * mce_reign() - * mce_report_event() -- Reference: - * Inject data file: cases/soft-inj/recoverable_uc/data/srao_corrected -- Expected result: - * No warning or bug during kernel processing. - * Exception message is "Action optional unknown MCACOD" - -2.srao_ewb -- Objective: - * Test logic of uncorrected with S - * Test logic of UCR errors detected during last level cache(LLC) explicit writebacks. -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_severity() - * mce_ring_add() - * mce_log() - * mce_end() - * mce_reign() -- Reference: - * Inject data file: cases/soft-inj/recoverable_uc/data/srao_ewb -- Expected result: - * No warning or bug during kernel processing. - * Exception message is "Action optional: last level cache writeback error" - -3.srao_mem_scrub -- Objective: - * Test logic of uncorrected with S - * Test logic of UCR errors detected on data load -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_severity() - * mce_ring_add() - * mce_log() - * mce_end() - * mce_reign() -- Reference: - * Inject data file: cases/soft-inj/recoverable_uc/data/srao_mem_scrub -- Expected result: - * No warning or bug during kernel processing. - * Exception message is "Action optional: memory scrubbing error" - -4.srao_no_en -- Objective: - * Test no EN processing. -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_severity() - * mce_end() - * mce_reign() - * mce_panic() -- Reference: - * Inject data file: cases/soft-inj/recoverable_uc/data/srao_no_en -- Expected result: - * No warning or bug during kernel processing. - * Kernel panic message is "Machine check from unknown source" - -5.srao_over -- Objective: - * Test logic of uncorrected with S and OVER -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_severity() - * mce_log() - * mce_end() - * mce_reign() -- Reference: - * Inject data file: cases/soft-inj/recoverable_uc/data/srao_over -- Expected result: - * No warning or bug during kernel processing. - * Exception message is "Action optional with lost events" - -6.srao_ucna -- Objective: - * Test logic of uncorrected with S - * Test logic of ucna -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_severity() - * mce_get_rip() - * mce_log() - * mce_end() - * mce_reign() -- Reference: - * Inject data file: cases/soft-inj/recoverable_uc/data/srao_ucna -- Expected result: - * No warning or bug during kernel processing. - * Exception message is "Action optional with unknown MCACOD" - -7.srao_unknown -- Objective: - * Test logic of uncorrected with S -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_severity() - * mce_get_rip() - * mce_log() - * mce_end() - * mce_reign() -- Reference: - * Inject data file: cases/soft-inj/recoverable_uc/data/srao_unknown -- Expected result: - * No warning or bug during kernel processing. - * Exception message is "Action optional with unknown MCACOD" - -8.srar_usr_dcu -- Objective: - * Test logic of uncorrected with S & AR -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_severity() - * mce_get_rip() - * mce_log() - * mce_end() - * mce_reign() -- Reference: - * Inject data file: cases/soft-inj/recoverable_uc/data/srar_usr_dcu -- Expected result: - * No warning or bug during kernel processing. - * Exception message is "Data CACHE Level-0 Data-Read Error" - -9.srar_usr_dcu_nmi -- Objective: - * Test logic of uncorrected with S & AR -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_severity() - * mce_get_rip() - * mce_log() - * mce_end() - * mce_reign() -- Reference: - * Inject data file: cases/soft-inj/recoverable_uc/data/srar_usr_dcu_nmi -- Expected result: - * No warning or bug during kernel processing. - * Exception message is "Data CACHE Level-0 Data-Read Error" - -10.srar_dcu_irq -- Objective: - * Test logic of uncorrected with S & AR -- Code path tested: - * do_machine_check() - * mce_start() - * mce_timeout() except if (*t <= 0) branch - * mce_severity() - * mce_get_rip() - * mce_log() - * mce_end() - * mce_reign() -- Reference: - * Inject data file: cases/soft-inj/recoverable_uc/data/srar_dcu_irq -- Expected result: - * No warning or bug during kernel processing. - * Exception message is "Data CACHE Level-0 Data-Read Error" - diff --git a/testcases/kernel/mce-test/doc/howto.txt b/testcases/kernel/mce-test/doc/howto.txt deleted file mode 100755 index 418e728a..00000000 --- a/testcases/kernel/mce-test/doc/howto.txt +++ /dev/null @@ -1,516 +0,0 @@ - -MCE test suite HOWTO -==================== - -11 November 2008 - -Huang Ying - -Section 4.2 (Test with kdump test driver) is based on the README of -LTP kdump test case. - -Abstract --------- - -This document explains the structure and design of MCE test suite, the -kernel patch and user space tools needed for automatic tests, usage -guide and how to add new test cases into test suite. - -0. Quick shortcut ------------------- - -- Install the Linux kernel with full MCE injection support, including - latest Linux kernel (2.6.31) and MCE injection enhancement patchset - in: http://ftp.kernel.org/pub/linux/kernel/people/yhuang/mce/. Make - sure following configuration options are enabled: - - CONFIG_X86_MCE=y - CONFIG_X86_MCE_INTEL=y - CONFIG_X86_MCE_INJECT=y or CONFIG_X86_MCE_INJECT=m - -- Get mcelog git version from - git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git. - and install in /usr/sbin (or rather first in your $PATH) - - git clone git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git - cd mcelog - make - sudo make install - -- Get mce-inject git version from - git://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git. - - git clone git://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git - cd mce-inject - make - sudo make install - -- Install page-types tool (sec 3.4), which is accompanied with Linux kernel - source (2.6.32 or newer). - - cd $KERNEL_SRC/Documentation/vm/ - gcc -o page-types page-types.c - cp page-types /usr/bin/ - -- Run make test - This will do the basic tests, but not the more complicated kdump ones. - For more information on those read below. - -1. Introduction ---------------- - -The MCE test suite is a collection of tools and test scripts for -testing the Linux kernel MCE processing features. The goal is to cover -most Linux kernel MCE processing code paths and features with -automation tests. - -If you just want to start testing as quickly as possible, you can skip -section 2 and section 3, and go section 4.1 directly. - - -2. Structure ------------- - -The main intention behind the design is to re-use test cases amongst -various test methods (represented as test drivers), such as kdump -based, kernel MCE panic log (tolerant=3) based, etc. - -2.1 Test cases - -Test cases are grouped into test case classes. The test cases in one -class share the similar triggering, result collecting and result -verifying methods. They can be used in same set of test drivers. The -interface of a test case class is a shell script, usually named as -cases.sh under a sub-directory of cases/. The following command line -option should be supported by the test case class shell script: - -cases.sh enumerate enumerate test cases in class, print test - case names to stdout -cases.sh trigger trigger the test case -cases.sh get_result get the result of test case -cases.sh verify verify the result of test case, and print - the verify result to stdout - -When execute cases.sh [trigger|get_result|verify], the test case is -specified via environment variable this_case, which must be one of the -test case names returned by "cases.sh enumerate". - -Other environment variables are also used to pass some information -from driver to test cases, such as: - -this_case name current test case -driver name of test driver -klog file name which holds kernel log during test -KSRC_DIR (for gcov) kernel source code directory -GCOV (for gcov) gcov collection method -vmcore (for kdump) vmcore file name -reboot (for kdump) indicate there is a reboot between test - case trigger and test case verify, some - context has been gone. - -Several test case classes are provided with the test suite. -cases/soft-inj/* is based on mce-inject MCE software injection tool. -cases/apei-inj/* is based on apei-inj APEI haredware injection tool. - -cases///cases.sh Interface of the test case class -cases///data/ Directory contains data file -cases///refer/ Directory contains data file for - reference MCE records if necessary. - -For document of various test cases, please refer to doc/cases/*. - -2.2 Test drivers - -Test drivers drive the test procedure, its main structure is a loop -over test case classes specified in configuration file. For each test -case class, test driver loops over test cases returned by "cases.sh -enumerate". And, for each test case, it calls "cases.sh" to trigger, -get_result and verify the test case. Test driver also do some common -work for test cases, such as kdump driver collects vmcore file, and -invoking gcovdump command to get gcov data file. - -The interface of test driver is driver.sh, which is usually put in -drivers// directory. The test configuration file should -be used as the only command line parameter for driver.sh. Test case -classes should be specified in test configuration file as CASES -variable, details below. - -2.3 Test configuration file - -Test configuration file is a shell script to specify parameters for -test drivers and test cases. It must be put in config/ directory. The -parameters are represented as shell variables as follow: - -CASES Name of test case classes, separate by - white space. -START_BACKGROUND Shell command to start a background process - during testing, used for random testing.* -STOP_BACKGROUND Shell command to stop the background process - during testing. -COREDIR (for kdump) directory contains Linux kernel crash core - dump after kdump. -VMLINUX (for kdump, gcov) vmlinux of Linux kernel -GCOV (for gcov) Enable GCOV if set none zero. -KSRC_DIR (for gcov) Kernel source code directory - -* To test MCE processing under random environment, a background - process can be automatically run simultaneously during MCE - testing. The start/stop command is specified via START_BACKGROUND - and STOP_BACKGROUND. - -2.4 Test result - -After test, the general test result will go results//result. -The format of general test result is as follow: - -: - Passed: item 1 description - Failed: item 2 description - ... - Passed: item n description - -One blank line is used to separate test cases. - -Additional test result for various test cases will go -"results///. For in-package test case -class, additional test results include: - -results////klog - Kernel log during testing -results////mcelog - mcelog output during testing -results////mcelog_refer - mcelog output reference -results////mce_64.c.gcov (for gcov) - gcov output file - - -3. Tools --------- - -3.1 mce-inject - -mce-inject is a software MCE injection tool, which is based on Linux -kernel software MCE injection mechanism. To inject a MCE into Linux -kernel via mce-inject, a data file should be provided. The syntax is -similar to the logging output by mcelog with some extensions. -Please refer to the documentation of mce-inject for more information. - -The mce-inject program must be executable in $PATH. - -3.2 mcelog - -mcelog read /dev/mcelog and prints the stored machine check records to -stdout. It is used by MCE test suite to verify MCE records generated -by kernel is same as reference records, at most time, same as input -records. The current git mcelog version is needed for MCE test suite to -work properly. Please refer to document of mcelog for more -information. The latest mcelog can be gotten via git snapshot from -git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git. - -Note you need the git version of mcelog available in $PATH. - -3.3 gcovdump - -gcov is a test coverage tool, the original implementation is used for -user space program only. LTP (Linux Test Project) provides the kernel -gcov support. But MCE test involves panic or kdump, so gcovdump is -developed to dump gcov data from kdump crash dump core. gcovdump has -been merged by LTP cvs. For more information please refer to gcovdump -document. The latest gcovdump can be gotten from cvs: -http://ltp.cvs.sourceforge.net/viewvc/ltp/utils/analysis/gcov-kdump/. - -3.4 page-types -A tool to query page types, which is accompanied with Linux kernel -source (2.6.32 or newer, $KERNEL_SRC/Documentation/vm/page-types.c). -It is required for MCE apei-inj testing. - -4. Usage Guide --------------- - -4.1 Test with simple test driver - -4.1.1 Simple test driver - -The simple test driver just call cases.sh of test cases one by one in -a loop. So it is not permitted for test cases to trigger real panic or -reboot during test. For MCE testing, a special processing mode to just -log everything in case of MCE is used for the simple test driver, it -is enabled via set MCE parameter "tolerant=3" during -testing. "tolerant" can be set via writing: - /sys/devices/system/machinecheck/machinecheck0/tolerant - -4.1.2 test instruction - -The following is the basic test instruction, for some additional -features such as gcov support, please refer to corresponding -instructions. - -a. Linux kernel and user space tools as follow should be installed - - - A Linux kernel with full MCE injection support (see 0) - - mce-inject tool (see 3.1) - - mcelog with proper version (see 3.2) - - page-types (see 3.4) - -b. Modify config/simple.conf or create a new test configuration - file. Refer to section 2.3 for more instruction about test - configuration file. - -c. Run "make". Carefully check for any errors. - -d. It is recommended to stop cron before testing. Because there - might be another mcelog reading events running on background - by cron, which will upset the test. - - /etc/init.d/crond stop - -e. To be root and invoke simple test driver on test configuration file - as follow - - Run "make test" to do all the standard tests that do not require - special set up. - -f. General test result will go results/simple/result. Test log will go - work/simple/log. Additional test results for various test cases - will go results/simple//. For more details about - in-package test case class, please refer to section 2.1. - - -4.2 Test with kdump test driver - -4.2.1 kdump test driver - -The kdump test driver is based on the kdump test case in Linux Test -Project, thank LTP for their excellent work! - -The kdump driver helps run tests which trigger crash/panic and -generate result and report via kdump. The test scripts cycle through a -series of crash/panic scenarios. Each test cycle does the following: - -a. Triggers a test case which triggers crash/panic (MCE with tolerant=1). -b. Kdump kernel boots and saves a vmcore. -c. System reboots to 1st kernel. -d. Verifies test case, generate result and report. -e. After a 1 to 2 minute delay, the next test case is run. - -4.2.2 test instruction - -Follow the steps to setup kdump test driver. - -The test driver is written for SuSE Linux Enterprise Server 10 (and -onward releases), OpenSUSE, Fedora, Debian, as well as RedHat -Enterprise Linux 5. Since KDUMP is supported by the above mentioned -distro's the test driver was written and tested on them. Contribution -towards supporting more distributions are welcome. - -a. Install Linux kernel with full MCE injection and KDUMP support. In - addition to MCE injection support in section 0, the following - configuration options should be enabled too: - - CONFIG_KEXEC=y - CONFIG_CRASH_DUMP=y - -b. Install these additional packages: - - For SLES10 or OpenSUSE Distro: - - * kernel-kdump - * kernel-source - * kexec-tools - - For RHEL5 or Fedora distro: - - * kexec-tools - * kernel-devel - -c. Configure where to put the kdump /proc/vmcore files. The path should be - specified via COREDIR in test configuration file. - By default, the kdump /proc/vmcore files will be put into /var/crash. - - For SLES10 or OpenSUSE Distro: - * edit KDUMP_SAVEDIR in /etc/sysconfig/kdump - For RHEL5 or Fedora distro: - * edit path in /etc/kdump.conf - -d. In addition to bzImage and modules of Linux kernel should be - installed on test machine, the vmlinux of Linux kernel should be - put on test machine and specified via VMLINUX in test configuration - file. - -e. Make sure the partition where the test driver is running has space - for the tests results and one vmcore file (size of physical - memory). - -f. Now, reboot system. Test if kdump works by starting kdump and triggering - kernel panic. - - For SLES10 or OpenSUSE Distro: - service boot.kdump restart - chkconfig boot.kdump on - echo "c" > /proc/sysrq-trigger - - For RHEL5 or Fedora distro: - service kdump restart - /sbin/chkconfig kdump on - echo "c" > /proc/sysrq-trigger - - After system reboot, check if there are vmcore files. By default, they are in /var/crash/*/. If yes, "kdump" works in the system. - -g. Create a new test configuration file or use a existing one in - config/, such as kdump.conf. Note: not all test case classes can be - used with kdump test driver, see "important points" below. - -h. Run "make". Carefully check for any errors. - -i. To be root and run "drivers/kdump/driver.sh " or "make test-kdump" (for a full test) - -j. After test is done, the test log of the last run of kdump driver will - be displayed on main console. - -Few Important points to remember: - -- kdump test driver request that a real panic should be triggered when - test case is triggered. So not all test case classes can be used - with kdump test driver, for example, all test case classes for - corrected MCE can not be used with kdump test driver. - -- If you need to stop the tests before all test cases have run, run - "crontab -r" and "killall driver.sh" within 1 minute after the 1st - kernel reboots. Then, if you'd like to carry on tests from that point - on, run: - rm work/kdump/stamps/setupped - drivers/kdump/driver.sh - If you'd like to start tests from the beginning, run: - make reset - drivers/kdump/driver.sh - -- If a failure occurs when booting the kdump kernel, you'll need to - manually reset the system so it reboots back to the 1st kernel and - continues on to the next test. For this reason, it's best to monitor - the tests from a console. If possible, setup a serial console (not a - must, any type of console setup will do). If using minicom, enable - saving of kernel messages displayed on minicom into a file, by - pressing ctrl+a+l on the console. Else, when it is observed that the - kdump kernel has failed to boot, manually copy the boot message into - a file to enable the debugging the cause of the hang. - -- The results are saved in results/kdump/result, which also shows - where you are in the test run. When the "Test run complete" entry - appears in that file, you're done. Verbose log can be found at - work/log. - -- The test machine would be unavailable for any other work during the - period of the test run. - -4.3 Gcov support - -Gcov is a test coverage tool. It can be used to discover untested -parts of program, collect branch taken statistics to optimize program, -etc. In MCE test suite, it is used to get test coverage, that is, -which C statements are covered by each test case. - -Gcov support is optional, if you don't care about test coverage -information, just skip this section. - -a. Make sure your kernel has gcov support. You can find lasted kernel - gcov patches from: - http://ltp.sourceforge.net/coverage/gcov.php - - A README for kernel gcov can be found from: - http://ltp.sourceforge.net/coverage/gcov/readme.php - - Notes: CONFIG_GCOV_ALL does not work for me. Add the line - EXTRA_CFLAGS += $(KBUILD_GCOV_FLAGS) - to the respective Makefiles are more stable. For example, this line - can be added into "linux/arch/x86/kernel/cpu/mcheck/Makefile" - -b. If you want to use gcov with kdump test driver, please install - gcovdump tool(see section 3.4). The latest gcovdump can be gotten - from cvs: - http://ltp.cvs.sourceforge.net/viewvc/ltp/utils/analysis/gcov-kdump/. - -c. Linux kernel source source code should be put on the test - machine. Its root directory should be specified in test - configuration file via KSRC_DIR. - -d. In addition to bzImage and modules of Linux kernel should be - installed on test machine, the vmlinux of Linux kernel should be - put on test machine and specified via VMLINUX of test configuration - file. - -e. Make sure gcov is available in your test system. It comes with gcc - package normally. If kdump test driver is used, a tool named - gcovdump is also needed to dump *.gcda from crash dump image. - -f. In test configuration file, make sure the following setting is - available: - - # enable GCOV support - GCOV=1 - # kernel source is needed to get gcov graph - KSRC_DIR= - VMLINUX= - -g. After testing, *.c.gcov will be generated in test case result - directory, such as - results/kdump/soft-inj/non-panic/corrected/mce_64.c.gcov. - -h. To merge gcov graph data from several test cases, a tool named - gcov_merge.py in tools sub-directory can be used. For example, - - tools/gcov_merge results/kdump/soft-inj/*/*/mce_64.c.gcov - - Will output merged gcov graph from all test cases under - soft-inj. This can be used to check coverage of several test cases. - -4.4 tool - -Some tools are provided to help analyze test result. - -- tools/grep_result.sh - - Grep from general test result (results//result) in - terms of test case instead of line, because the result of one test - case may span several line. - - Usage: - cat results//result | tools/grep_result.sh - - Where are same as options available to /bin/grep. - -- tools/loop-mce-test - - Run mce test cases in a loop. It exits on failure of any one of the test - cases. This script is using simple test driver. - - Usage: - ./loop-mce-test - - Note that only simple test configure file can be used here. - -5. Add test cases ------------------ - -5.1 Add test case to in-package test class - -All in-package test classes use mce-inject software injection tool and -follows same structure. The steps to add a new test case is as follow: - -a. Find an appropriate test case class to add your test case. - -b. Add a new mce-inject data file into to cases/soft-inj//data/. - -c. If the reference mcelog is different from mce-inject input data - file, put that reference file into cases/soft-inj//refer/. - -d. In cases/soft-inj//cases.sh, there are shell commands - "case" in shell functions get_result() and verify(). Add a branch - in each shell command "case" for your test case. - -5.2 Add test class - -To add a new test class, add a cases.sh under a sub-directory of -cases/, and follow the test case class interface definition in section -2.1. The general result output format should follow that in section -2.4. diff --git a/testcases/kernel/mce-test/doc/stress-howto.txt b/testcases/kernel/mce-test/doc/stress-howto.txt deleted file mode 100755 index f96a0ecc..00000000 --- a/testcases/kernel/mce-test/doc/stress-howto.txt +++ /dev/null @@ -1,340 +0,0 @@ -MCE Stress Test HOWTO -==================== - -Oct 10th, 2009 - -Haicheng Li - - -Abstract --------- - -This document explains the design and structure of MCE stress test suite, -the kernel configurations and user space tools required for automated -stress testing, as well as usage guide and etc. - - -0. Quick Shortcut ------------------ - -- Install the Linux kernel (2.6.32 or newer) with full MCA recovery support. - Make sure following configuration options are enabled: - - CONFIG_X86_MCE=y - CONFIG_MEMORY_FAILURE=y - - With these two options enabled, you can do stress testing thru madvise - syscall (sec 4.1). - -- Install page-types tool (sec 3.3), which is accompanied with Linux kernel - source (2.6.32 or newer). - - # cd $KERNEL_SRC/Documentation/vm/ - # gcc -o page-types page-types.c - # cp page-types /usr/bin/ - -- Get latest LTP (Linux Test Project) image from http://ltp.sf.net. Refer - to INSTALL of LTP to install LTP on your machine. - -- Build and run stress testing - - # make - # cd stress - # ./hwpoison.sh -d $YOUR_PARTITION -M -o $YOUR_LTP_DIR -N - - Note here, '-d $YOUR_PARTITION' is a mandatory option. Test will create - all temporary files on $YOUR_PARTITION, and error injection will just - affect the pages associated with $$YOUR_PARTITION. So you must provide a - free disk partition to stress test driver! - - This will do the stress testing thru madvise syscall (sec 4.1). However, - there are more advanced test methods provided (sec 4.2, 4.3). - -Note, for all examples in the rest of this doc, it is supposed that $PWD is -the stress subdir. - -1. Overview ------------ - -The MCE stress test suite is a collection of tools and test scripts, which -intends to achieve stress testing on Linux kernel MCA high level handlers -that include HWPosion page recovery, soft page offline, and so on. - -In general, this test suite is designed to do stress testing thru various -test interfaces, i.e. madvise syscall, HWPoison page injector, and APEI -injector (see ACPI4.0 spec). And it's able to support most of popular -Linux File Systems (FS), that is, there is an option for user to specify which -FS type they want the test to be running on. - -If you just want to start testing as quickly as possible, you can skip -section 2 & 3, just go to section 4 directly. - - -2. Design Details ------------------ - -The MCE stress test suite consists of four parts: test driver, workload -controller, customized workloads, and background workloads. - -The main test idea is described as below: -- Test driver launchs various customized workloads to continuously generate - lots of pages with expected page states, Note, all of these workloads know - about their expected results that should not be affected by Linux MCE high - level handlers. -- Then test driver injects MCE errors to these pages thru either madvise - syscall or HWPoison injector or APEI injector. While Linux Kernel handling - these MCE errors, all the workloads continue running normally, -- After long time running, test driver will collect test result of each - workload to see if any unexpected failures happened. In such a way, it can - decide if any bug is found. -- If any system panics or FS corruption happens, that means there must be a - bug. It's the bottom line to decide if test gets pass. - -2.1 Test Driver - -Test driver (a.k.a hwpoison.sh) drives the whole test procedure. It's -responsible for managing test environment, setting up error injection -interface, controlling test progress, launching workloads, injecting page -errors, as well as recording test logs and reporting test result. - -For detailed usage of hwpoison.sh test driver, please refer to: -# ./hwpoison.sh -h - -2.2 Workload Controller - -Workload controller needs to have various test workloads running parallelly -and continuously within a required duration time. We select ltp-pan -program of Linux Test Project (LTP) as the workload controller of this -stress test suite. - -Test driver (hwpoison.sh) interacts with ltp-pan in following ways: -- hwpoison.sh generates a test config file that lists the workload type - to be launched by ltp-pan. -- hwpoison also passes test duration time and other workload specific - parameters to ltp-pan via test config file. -- ltp-pan makes each workload run and get finished in time, then test driver - can get the result of each workload via corresponding result files. -- finally, hwpoison.sh will decide the overall test result based on each - workload result, and report final result out. - -2.3 Customized Workloads - -There are three types of customized workloads, which are intended to generate -pages with various page state. - -* Type0: page-poisoning workload, meant to cover: - - anonymous pages operations. - - file data operations. - -* Type1: fs-metadata workload, meant to cover: - - inode operations. - -* Type2: fs_type specific workload, meant to cover: - - extended functions of some special FS. - -2.4 Background Workloads - -LTP is selected as the background workload to simulate normal system -operations in background while stress testing is running. - -Besides LTP, there are also some alternatives, like AIM. We might extend more -background workloads in future. - -2.5 Test Result - -How to determine that stress testing gets pass? -- at least no kernel panics happens during stress testing. -- fsck on the target disk at the end of stress testing should get pass. -- there is no failure found by customized workloads, especially for - page-poisoning workload. - -Where to get detailed test result? -- When stress testing is done, the general test result is recorded in - result/hwpoison.result, and the general test log is in result/hwpoison.log. - However, you can specify them in following way: - # hwpoison.sh -r $YOUR_RESULT -l $YOUR_LOG -- The test result and test log of each workload are recorded as - log/$workload/$workload.result and log/$workload/$workload.log. - For example, for page-poisoning workload, its test result and test logs are - log/page-poisoning/page-poisoning.result and - log/page-poisoning/page-poisoning.log. -- Besides, under each workload result dir, you can find other extra logs - like pan_log, pan_output and etc. These logs are generated by ltp-pan - workload controller. Usually they can help you understand what has been - going on with ltp-pan while workload is running. Pls. refer to ltp-pan doc - for details. - - -3. Tools --------- - -3.1 page-poisoning - -It is the page-poisoning workload. page-poisoning workload is an extension of -tinjpage test program with a multi-process model. It spawns thousands of -processes that inject HWPosion error to various pages simultaneously thru -madvise syscall. Then it checks if these errors get handled correctly, -i.e. whether each test process receives or doesn't receive SIGBUS signal as -expected. - -For more info about page-poisoning workload, pls. read through README file -under stress/tools/page-poisoning/. - -3.2 fs-metadata - -It is the fs-metadata workload. fs-metadata is designed to test i-node -operations with heavy workload and make sure every i-node operation gets -the expected result. In details, it firstly generates a huge directory -hierarchy on the target disk, then it performs unlink operations on this -directory hierarchy and duplicate a copy of the directory, finally it -checks if these two directories are same as expected. - -For more info about fs-metadata workload, pls. read through README file -under stress/tools/fs-metadata/. - -3.3 page-types - -page-types is a tool to query the page type of every memory page in the -system. We use it to filter out pages with required page types. Test will -inject error to these pages via error injector, although the page filter -of HWPosion handler in Linux Kernel will filter them out for a second -time. Note, the reason we need to use page-types to do first time filtering -is just about performance. - -To install page-types on your test machine: - - # cd $KERNEL_SRC/Documentation/vm/ - # gcc -o page-types page-types.c - # cp page-types /usr/bin/ - -3.4 ltp-pan - -It's the workload controller of this stress test suite. In fact, ltp-pan -is the test harness of LTP (Linux Test Project), and is included in -LTP package. For more information, please refer to ltp-pan document of LTP. - - -4. Usage Guide --------------- - -This section is trying to show you how to conduct the stress testing thru -various test interfaces. - -As an example, we choose to run stress testing based on partition /dev/sda1 -for 1 hour. Note, we've installed LTP to /ltp. - -4.1 Stress Test thru Madvise Syscall. - -To run this stress testing, you need to strictly follow below test -instructions. - -* Test instructions: - -- make sure following kernel options are enabled: - CONFIG_X86_MCE=y - CONFIG_MEMORY_FAILURE=y - -- build and run stress testing - # make - # ./hwpoison.sh -d $YOUR_PARTITION -M -o $YOUR_LTP_DIR - -* Example: - -- launch testing - # ./hwpoison.sh -d /dev/sda1 -M -t 3600 - -- general test results - result: result/hwpoison.result - logs: result/hwpoison.log - -- detailed workload results - result: log/page-poisoning/page-poisoning.result - log: log/page-poisoning/page-poisoning.log - -4.2 Stress Test thru HWPosion Page Injector - -This is the default test method of this stress test suite. - -To run this stress testing, you need to strictly follow below test -instructions. - -* Test instructions: - -- make sure following kernel options are enabled: - CONFIG_X86_MCE=y - CONFIG_MEMORY_FAILURE=y - CONFIG_DEBUG_KERNEL=y - CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y - CONFIG_HWPOISON_INJECT=y - -- build and run stress testing - # make - # ./hwpoison.sh -d $YOUR_PARTITION -o $YOUR_LTP_DIR -L - -* Example: - -- launch testing - # ./hwpoison.sh -d /dev/sda1 -t 3600 -L - -- general test results - result: result/hwpoison.result - logs: result/hwpoison.log - -- detailed workload results - fs-metadata result: log/fs-metadata/fs-metadata.result - fs-metadata log: log/fs-metadata/fs-metadata.log - ltp result: log/ltp/ltp.result - ltp log: log/ltp/ltp.log - fs-specific result: log/fs-specific/fs-specific.result - fs-specific log: log/fs-specific/fs-specific.log - -4.3 Stress Test thru APEI Injector - -To run this stress testing, you need to follow below test instructions. - -* Test instructions: - -- make sure following kernel options are enabled: - CONFIG_X86_MCE=y - CONFIG_X86_MCE_INTEL=y - CONFIG_MEMORY_FAILURE=y - CONFIG_ACPI_APEI=y - CONFIG_ACPI_APEI_EINJ=y - -- build and run stress testing - # make - # ./hwpoison.sh -d $YOUR_PARTITION -o $YOUR_LTP_DIR -L -A - -* Example: - -- launch testing - # ./hwpoison.sh -d /dev/sda1 -t 3600 -L -A - -- general test results - result: result/hwpoison.result - logs: result/hwpoison.log - -- detailed workload results - fs-metadata result: log/fs-metadata/fs-metadata.result - fs-metadata log: log/fs-metadata/fs-metadata.log - ltp result: log/ltp/ltp.result - ltp log: log/ltp/ltp.log - fs-specific result: log/fs-specific/fs-specific.result - fs-specific log: log/fs-specific/fs-specific.log - - -5. FAQs -------- - -Here is a collection of frequently asked questions: - -Q: How to tell test driver not to format my disk partition? -A: Use the option '-N'. - -Q: Can three types of tests run on same sytem simultaneously? -A: No. There are limitations in Linux Kernel HWPoison page filtering. - -Q: Can I run this stress testing on multiple disks parallely? -A: Yes. But it requires updated Kernel patches for HWPosion page filtering. - Now, it just supports one same test with same pagetype flags specified. - diff --git a/testcases/kernel/mce-test/doc/verify.txt b/testcases/kernel/mce-test/doc/verify.txt deleted file mode 100755 index 129d93bd..00000000 --- a/testcases/kernel/mce-test/doc/verify.txt +++ /dev/null @@ -1,33 +0,0 @@ -To verify the result of MCE testing, the MCE record from kernel (via -/dev/mcelog or panic information) should be compared with reference -MCE record (for software inject error: the input MCE record). To -compare MCE record, the following scheme is proposed: - -- Define a standard MCE record representation format. It should be - human readable, compatible with MCE parser in mce-inject, easy to - manipulate in shell (such as remove a field), easy to compare - (literally). - - One MCE record is as follow: - - CPU NUMBER - BANK NUMBER - TSC NUMBER - RIP NUMBER - ADDR NUMBER - MISC NUMBER - STATUS NUMBER - MCGSTATUS NUMBER - - Multiple MCE records are separated by one empty line. - -- Enhance mce-inject or develop a new tool to convert from other - format to standard format. - -- Develop a new tool based on /usr/sbin/mcelog to output mce-inject - compatible MCE record. Because there may be different (uncompatible - version) /usr/sbin/mcelog on different machine. - -- During verifying, firstly convert various MCE recoards from kernel - and reference MCE records to standard format, then compare the - standard format MCE records in shell. diff --git a/testcases/kernel/mce-test/drivers/kdump/driver.sh b/testcases/kernel/mce-test/drivers/kdump/driver.sh deleted file mode 100755 index 60165828..00000000 --- a/testcases/kernel/mce-test/drivers/kdump/driver.sh +++ /dev/null @@ -1,299 +0,0 @@ -#!/bin/bash -xe -# -# Kdump test driver: test case will trigger panic, and then crash -# dump. The test result is collected via dumped vmcore. For more -# information about kdump dirver please refer to doc/README.kdump. -# -# Copyright (C) 2008, Intel Corp. -# Author: Huang Ying -# -# This file is based on kdump test case in LTP. -# -# This file is released under the GPLv2. -# - -sd=$(dirname "$0") -export ROOT=`(cd $sd/../..; pwd)` - -export driver=kdump - -. $ROOT/lib/functions.sh -setup_path -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh - -setup_crontab () -{ - echo "Setup crontab." - - set +e - crontab -r - set -e - - # crontab in some distros will not read from STDIN. - - cat < $WDIR/kdump.cron -SHELL=/bin/bash -PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin -MAILTO=root -@reboot cd "$(pwd)"; ${0} $conf >> $WDIR/log 2>&1; cat $WDIR/log > /dev/console -EOF - - crontab $WDIR/kdump.cron - - echo "Enable cron daemon by default." - - if [ -f /etc/init.d/crond ]; then - cron=crond - else - # SUSE - cron=cron - fi - - # Red Hat and SUSE. - if [ -x "/sbin/chkconfig" ]; then - /sbin/chkconfig "${cron}" on - - # Debian and Ubuntu. - elif [ -x "/sbin/update-rc.d" ]; then - /sbin/update-rc.d "${cron}" defaults - fi -} - -setup_kdump () -{ - echo "Start kdump daemon." - - if [ -f /etc/init.d/kdump ]; then - daemon=kdump - else - #SLE11 - daemon=boot.kdump - fi - - /etc/init.d/"${daemon}" restart - - echo "Enable kdump daemon by default." - # Red Hat and SUSE. - if [ -x "/sbin/chkconfig" ]; then - /sbin/chkconfig "${daemon}" on - - # Debian and Ubuntu. - elif [ -x "/sbin/update-rc.d" ]; then - /sbin/update-rc.d "${daemon}" defaults - fi -} - -get_klog() -{ - klog=$RDIR/$this_case/klog - cat < $WDIR/get_klog_gdb.cmd -dump memory $klog log_buf log_buf+log_end -EOF - set +e - gdb -batch -batch-silent -x $WDIR/get_klog_gdb.cmd $VMLINUX $vmcore \ - > /dev/null 2>&1 - ret=$? - set -e - if [ $ret -eq 0 -a -s $klog ]; then - export klog - else - echo " Failed: can not get kernel log" - rm -rf $klog - fi -} - -dump_gcov() -{ - if [ -z "$GCOV" ]; then - return - fi - if ! chk_gcov; then - echo "gcov is not supported by kernel or there is no " \ - "gcov utility installed" - echo "disabling gcov support" - unset GCOV - return - fi - if [ -z "$KSRC_DIR" ]; then - echo " Failed: please set KSRC_DIR for GCOV" - return - else - KSRC_DIR=$(set -P && cd "$KSRC_DIR" && pwd) - if [ -z "$KSRC_DIR"]; then - echo " Failed: Invalid KSRC_DIR, please check your setup" - return - fi - fi - export KSRC_DIR - local gcov_head_raw=$WDIR/dump_gcov_head_raw - cat < $WDIR/dump_gcov_gdb.cmd -dump value $gcov_head_raw (void *)gcov_info_head -EOF - set +e - gdb -batch -batch-silent -x $WDIR/dump_gcov_gdb.cmd $VMLINUX $vmcore \ - > /dev/null 2>&1 - ret=$? - set -e - if [ $ret -ne 0 -o ! -s $gcov_head_raw ]; then - echo " Failed: can not get kernel gcov_info_head" - return - fi - wl=$(stat -c '%s' $gcov_head_raw) - h=$(echo -n 0x; od -A n -t x$wl $gcov_head_raw | tr -d ' ') - if ! gcovdump -g $h $vmcore &> /dev/null; then - echo " Failed: can not dump kernel gcov info" - return - fi -cat <<"EOF" > $WDIR/dump_gcov_deskew.sh - fn="$1" - bfn=$(basename "$fn") - dbfn="${bfn##\.tmp_}" - if [ -z "$dbfn" ]; then - return - fi - d=$(dirname "$fn") - cp $fn "$d/$dbfn" -EOF - chmod +x $WDIR/dump_gcov_deskew.sh - find $KSRC_DIR \( -name '*.tmp_*gcno' -o -name '*.tmp_*gcda' \) \ - -exec $WDIR/dump_gcov_deskew.sh \{\} \; - - export GCOV=dump -} - -get_result () -{ - vmcore=$(ls -t "${COREDIR}"/*/vmcore* 2>/dev/null | head -1) - - if [ -n "$vmcore" -a -f "$vmcore" ]; then - export vmcore - get_klog - dump_gcov - else - echo " Failed: can not get vmcore" - fi - - export reboot=1 - - $CDIR/$case_sh get_result -} - -verify_case () -{ - if [ -z "$vmcore" ]; then - echo " Failed: can not got vmcore" - fi - $CDIR/$case_sh verify -} - -trigger_case () -{ - # Be careful to define COREDIR. - rm -rf "${COREDIR}"/* - - # Save STDIO buffers. - sync - $CDIR/$case_sh trigger -} - -# Start test. -if [ $# -lt 1 ]; then - die "Usage: $0 " -fi - -conf=$(basename "$1") - -. $CONF_DIR/$conf - -driver_prepare -set_tolerant 1 -set_panic_on_oops 0 - -# Check mandatory variables. -if [ -z "${COREDIR}" ]; then - die "Fail: some mandatory variables are missing from configuration file." -fi - -# Reboot the machine first to take advantage of boot parameter -# changes. -if [ ! -f $WDIR/stamps/setupped ]; then - echo "Setup test environment." - - setup_crontab - - $SDIR/setup.sh $CONF_DIR/$conf - - echo > $WDIR/stamps/setupped - - echo "System is going to reboot." - /sbin/shutdown -r now - sleep 60 - exit -1 -fi - -#if mce_inject is a module, it is ensured to have been loaded -if modinfo mce_inject > /dev/null 2>&1; then - if ! lsmod | grep -q mce_inject; then - if ! modprobe mce_inject; then - die "module mce_inject isn't supported ?" - fi - fi -fi - -for case_sh in ${CASES}; do - for this_case in $($CDIR/$case_sh enumerate); do - export this_case - _this_case=$(echo $this_case | tr '/' '_') - - if [ -f $WDIR/stamps/${_this_case}_done ]; then - continue - fi - - # First Test. - if [ ! -f $WDIR/stamps/first_test_checked ]; then - echo "First test..." - echo "Verify Boot Loader." - if ! grep 'crashkernel=' /proc/cmdline; then - die "Fail: error changing Boot Loader, no crashkernel=." - fi - setup_kdump - echo > $WDIR/stamps/first_test_checked - fi - - if [ ! -f $WDIR/stamps/${_this_case}_triggered ]; then - echo > $WDIR/stamps/${_this_case}_triggered - - mkdir -p $RDIR/$this_case - rm -rf $RDIR/$this_case/* - echo -e "\n$this_case:" | tee -a $RDIR/result - - echo "Running current test $this_case." - - trigger_case | tee -a $RDIR/result - - triggering=1 - fi - - sleep 5 - - if [ -z "$triggering" ]; then - (get_result; verify_case) | tee -a $RDIR/result - else - echo " Failed: Failed to trigger kdump" | tee -a $RDIR/result - fi - echo > $WDIR/stamps/${_this_case}_done - - # Wait for system to fully boot and leave a chance for user to - # stop test - sleep 55 - done -done - -echo "Test run complete" | tee -a $RDIR/result - -# We are done. -# Reset. -crontab -r - -exit 0 diff --git a/testcases/kernel/mce-test/drivers/kdump/setup.sh b/testcases/kernel/mce-test/drivers/kdump/setup.sh deleted file mode 100755 index f90742cd..00000000 --- a/testcases/kernel/mce-test/drivers/kdump/setup.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash -ex -# -# Setup for kdump test driver. -# -# This file is copied from kdump test case of LTP. -# -# This file is released under the GPLv2. -# - -conf=${1} -arch=$(uname -m) -kver=$(uname -r) - -. "${conf}" - -echo "Verify Kernel version >= 2.6.16." -# Kernel might in the following format. -# x.y.z-1.el -# x.y.z.1.el -kx=${kver%%.*} -tmp=${kver#*.} -ky=${tmp%%.*} -tmp=${tmp#*.} -tmp=${tmp%%.*} -kz=${tmp%%-*} - -if [ "${kx}" -lt 2 ]; then - error=1 - -elif [ "${kx}" -eq 2 ]; then - if [ "${ky}" -lt 6 ]; then - error=1 - - elif [ "${ky}" -eq 6 ]; then - if [ "${kz}" -lt 16 ]; then - error=1 - fi - fi -fi - -if [ "${error}" ]; then - echo "Fail: kernel version ${kver} is less than 2.6.16." -fi - - -echo "Verify user is root." -if [ $(id -u) != 0 ]; then - echo "Fail: root is required." - error=1 -fi - - -echo "Verify prerequisite." -if [ ! -x "/sbin/kexec" ]; then - echo "Fail: kexec-tools not found." - error=1 -fi - -if [ ! -d "/lib/modules/${kver}/build" ]; then - echo "Fail: kernel-devel not found." - error=1 -fi - -if [ "${CRASH}" ] && [ "${CRASH}" -eq 1 ]; then - if [ ! -x "/usr/bin/crash" ]; then - echo "Fail: crash not found." - error=1 - fi - - if [ ! -f "${VMLINUX}" ]; then - echo "Fail: kernel-debuginfo not found." - error=1 - fi -fi - -# Final result. -if [ "${error}" ]; then - echo "Please fixed the above failures before continuing." - exit 1 -fi - -echo "Modify Boot Loader." -if [ "${arch}" = "ppc64" ]; then - args="crashkernel=256M@32M xmon=off" -elif [ "${arch}" = "i686" ]; then - args="crashkernel=128M@16M nmi_watchdog=1" -elif [ "${arch}" = "ia64" ]; then - args="crashkernel=512M@256M" -else - args="crashkernel=128M@16M" -fi - -if [ -x "/sbin/grubby" ]; then - /sbin/grubby --default-kernel | - xargs /sbin/grubby --args="${args}" --update-kernel - -else - echo "Warn: please make sure the following arguments are in Boot\ - Loader:" - echo "$args" - echo "Hit any key when ready." - read -fi - -exit 0 diff --git a/testcases/kernel/mce-test/drivers/simple/driver.sh b/testcases/kernel/mce-test/drivers/simple/driver.sh deleted file mode 100755 index ebc9d2ad..00000000 --- a/testcases/kernel/mce-test/drivers/simple/driver.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# -# Simple test driver: run test cases one by one, assuming test case -# will not trigger panic or reboot. -# -# Copyright (C) 2008, Intel Corp. -# Author: Huang Ying -# -# This file is released under the GPLv2. -# - -sd=$(dirname "$0") -export ROOT=`(cd $sd/../..; pwd)` - -export driver=simple - -. $ROOT/lib/functions.sh -setup_path -. $ROOT/lib/dirs.sh -. $ROOT/lib/mce.sh - -tmp_klog=$WDIR/simple_klog_tmp - -chk_err() -{ - if [ \( -n "$DEBUG_MCE_TEST" \) -a \( -s $err_log \) ]; then - cat $err_log - fi -} - -klog_begin() -{ - dmesg > $tmp_klog.1 -} - -klog_end() -{ - dmesg | sed -e '1d' > $tmp_klog.2 - diff $tmp_klog.1 $tmp_klog.2 | grep '^> ' | sed 's/> \(.*\)/\1/' > $klog -} - -trigger() -{ - reset_gcov - - $CDIR/$case_sh trigger -} - -get_result() -{ - $CDIR/$case_sh get_result -} - -test_all() -{ - if [ -n "$GCOV" ]; then - if chk_gcov; then - export GCOV=copy - export KSRC_DIR - else - echo "gcov is not supported by kernel or there is no " \ - "gcov utility installed" - echo "disabling gcov support." - unset GCOV - fi - fi - - #if mce_inject is a module, it is ensured to have been loaded - modinfo mce_inject > /dev/null 2>&1 - if [ $? -eq 0 ]; then - lsmod | grep mce_inject > /dev/null 2>&1 - [ $? -eq 0 ] || modprobe mce_inject - [ $? -eq 0 ] || die "module mce_inject isn't supported ?" - fi - - for case_sh in $CASES; do - for this_case in $($CDIR/$case_sh enumerate); do - set_fake_panic 1 - - export this_case - mkdir -p $RDIR/$this_case - rm -rf $RDIR/$this_case/* - echo -e "\n$this_case:" | tee -a $RDIR/result - klog=$RDIR/$this_case/klog - - mkdir -p $WDIR/$this_case - rm -rf $WDIR/$this_case/* - local err_log=$WDIR/$this_case/err_log - - klog_begin - trigger 2>$err_log | tee -a $RDIR/result - chk_err - random_sleep - klog_end - get_result 2>$err_log | tee -a $RDIR/result - chk_err - $CDIR/$case_sh verify 2>$err_log | tee -a $RDIR/result - chk_err - - set_fake_panic 0 - done - done -} - -if [ $# -lt 1 ]; then - die "Usage: $0 " -fi - -conf=$(basename "$1") - -. $CONF_DIR/$conf - -driver_prepare -set_panic_on_oops 0 - -if [ -n "$START_BACKGROUND" ]; then - eval $START_BACKGROUND -else - start_background -fi - -[ -d $RDIR ] && mv $RDIR --backup=numbered -T $RDIR.old -[ -d $WDIR ] && mv $WDIR --backup=numbered -T $WDIR.old - -test_all - -if [ -n "$STOP_BACKGROUND" ]; then - eval $STOP_BACKGROUND -else - stop_background -fi - diff --git a/testcases/kernel/mce-test/hwpoison b/testcases/kernel/mce-test/hwpoison deleted file mode 120000 index 1a952550..00000000 --- a/testcases/kernel/mce-test/hwpoison +++ /dev/null @@ -1 +0,0 @@ -tsrc/ \ No newline at end of file diff --git a/testcases/kernel/mce-test/kvm/README b/testcases/kernel/mce-test/kvm/README deleted file mode 100755 index d79fb527..00000000 --- a/testcases/kernel/mce-test/kvm/README +++ /dev/null @@ -1,149 +0,0 @@ -KVM RAS Test Suite -================== -The KVM RAS Test Suite is a collection of test scripts for testing the -Linux kernel MCE processing features in KVM guest system. - -Jan 26th, 2010 - -Jiajia Zheng - - -In the Package ----------------- - -Here is a short description of what is included in the package - -host/* - Contains host test scripts, which drive test procedure on host system. -guest/* - Contains guest test scripts, which drive test procedure on guest system. - -Dependencies ----------------- - -KVM RAS Test Suite has following dependencies on kernel and other tools: - -* Linux Kernel: - Version 2.6.32 or newer, with MCA high level handlers enabled. - -* mce-inject - A tool to inject mce error into kernel - -* page-types: - A tool to query page types, which is accompanied with Linux kernel - source (2.6.32 or newer, $KERNEL_SRC/Documentation/vm/page-types.c). - -* simple_process: - A process constantly access the allocated memeory. (../tools/simple_process) - -* kpartx: - A tool to list partition mappings from partition tables - -* (optionally) losetup - A tool to set up and control loop devices - -* (optionally) pvdisplay/vgchange: - A tool to display/change physical volume attribute - -* (optionally) ssh-keygen - A tool to provide the authentication key generation, management and conversion - -Test method ---------------- -- Start a process in the guest OS, get a virtual address from guest OS - -- Translate this address untill we get the physical address on the host OS - -- Software injects an SRAO MCE at that physical address from host OS - -- (optionally) Write to the address from the guest, i.e attempt to - write to the poisoned page from the guest. - -the expected result: - -HOST system dmesg: - -... -Machine check injector initialized -Triggering MCE exception on CPU 0 -Disabling lock debugging due to kernel taint -[Hardware Error]: Machine check events logged -MCE exception done on CPU 0 -MCE 0x806324: Killing qemu-system-x86:8829 early due to hardware memory corruption -MCE 0x806324: dirty LRU page recovery: Recovered -... - - -GUEST system dmesg: -... -[Hardware Error]: Machine check events logged -MCE 0x75925: Killing simple_process:2273 early due to hardware memory corruption -MCE 0x75925: dirty LRU page recovery : Recovered -... - - -Installation ---------------- -1. Build *host* kernel with - CONFIG_KVM=y - CONFIG_KVM_INTEL=y - CONFIG_X86_MCE=y - CONFIG_X86_MCE_INTEL=y - CONFIG_X86_MCE_INJECT=y or CONFIG_X86_MCE_INJECT=m - - and following config both on *host* and *guest* - CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y - CONFIG_MEMORY_FAILURE=y - - NOTE: if the host machine doesn't support software error recovery - (MCG_SER_P in IA32_MCG_CAP[24]), please apply the patch fake_ser_p.patch - under ./patches/ -2. Use ssh-keygen to generate public and privite keys on the host OS, - and copy id_rsa and id_rsa.pub from ~/.ssh/ into the testing directory - on the host system. -3. compile and install qemu-kvm - the qemu-kvm source can be got from git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git. - Before compile qemu-kvm, a patch p2v.patch should be applied. This patch - is located under ./patches/ - Please ensure *SDL-devel* library is installed on the host machine, otherwise - only VNC can be used substituing local graphic output. -4. install the guest OS on the qemu - e.g. - step 1: qemu-img create -f qcow2 test.img 10G - step 2: qemu-system-x86_64 -hda ./test.img -m 2048 -cdrom rhel6.iso -boot d - after the installation, please be sure to execute the following check: - a) add necessary command line parameters under your boot item. - This is to enable console output redirection to the serial. - e.g. - before: - title Red Hat Enterprise Linux Server (2.6.32kvm) - root (hd0,1) - kernel /boot/vmlinuz-2.6.32kvm ro root=/dev/sda1 - initrd /boot/initramfs-2.6.32kvm.img - after: - title Red Hat Enterprise Linux Server (2.6.32kvm) - root (hd0,1) - kernel /boot/vmlinuz-2.6.32kvm ro root=/dev/sda1 console=tty0 console=ttyS0,115200n8 - initrd /boot/initramfs-2.6.32kvm.img - b) DHCP guest ethernet card. This operation is to ensure the network connection - is OK. - e.g. - bash> dhclient eth0 - c) enable SSH public/private key authorization, otherwise, the SSH connection password - is necessary to be provided in the test progress. - please check /etc/ssh/ssd_config and ensure related options are opened. - e.g. - RSAAuthentication yes - PubkeyAuthentication yes - after the related options are opened, please restart ssh service - e.g. - bash> service sshd restart - - -Start Testing ---------------- -Run testing by - ./host_run.sh