From 0130acd41340c6af69ab226fda766931e9305ff5 Mon Sep 17 00:00:00 2001 From: Jiri Palecek Date: Wed, 4 Nov 2009 14:27:24 +0100 Subject: [PATCH] Imported Upstream version 20091031 --- ChangeLog | 1092 +++ INSTALL | 203 +- Makefile | 360 +- README | 18 + README.ltp-devel | 48 - README.ltp-devel.in | 48 + README.mk-devel | 173 + TODO | 266 + config.mk.in | 13 - configure | 4826 +++++++++++--- configure.ac | 59 +- doc/Makefile | 29 + doc/man1/Makefile | 39 +- doc/man3/Makefile | 42 +- include/Makefile | 74 +- include/config.h.in | 121 +- include/mk/automake.mk | 117 + include/mk/config.mk.default | 69 + include/mk/config.mk.in | 69 + include/mk/env_post.mk | 78 + include/mk/env_pre.mk | 69 + include/mk/functions.mk | 83 + include/mk/generic_leaf_target.inc | 102 + include/mk/generic_leaf_target.mk | 24 + include/mk/generic_trunk_target.inc | 94 + include/mk/generic_trunk_target.mk | 24 + include/mk/lib.mk | 55 + include/mk/man.mk | 35 + include/mk/testcases.mk | 58 + lib/Makefile | 69 +- lib/ltp.pc | 11 - lib/ltp.pc.in | 10 + lib/tst_res.c | 42 +- ltp-devel.spec | 68 - ltp-devel.spec.in | 68 + m4/GNUmakefile | 49 +- m4/ac_prog_ar.m4 | 7 - m4/ltp-cap.m4 | 43 + m4/ltp-crypto.m4 | 4 +- m4/ltp-eventfd.m4 | 1 - m4/ltp-numa.m4 | 38 + m4/ltp-ptrace.m4 | 38 + m4/ltp-quota.m4 | 53 + m4/ltp-swaponoff.m4 | 48 + m4/ltp-taskstats.m4 | 17 +- m4/ltp-unshare.m4 | 27 +- m4/ltp-version.m4 | 1 + pan/Makefile | 73 +- pan/ltp-pan.c | 11 +- runltp | 38 +- runltplite.sh | 13 +- runtest/Makefile | 39 + runtest/fs | 76 +- runtest/fs_ext4 | 1 + runtest/io | 2 +- runtest/ipv6_expect | 2 + runtest/ipv6_noexpect | 22 +- runtest/ltp-aiodio.part4 | 138 +- runtest/ltplite | 10 +- runtest/lvm.part1 | 60 +- runtest/lvm.part2 | 20 +- runtest/nfs | 14 +- runtest/numa | 6 +- runtest/rpc | 18 +- runtest/scsi_debug.part1 | 50 +- runtest/stress.part1 | 14 +- runtest/stress.part3 | 2 +- runtest/syscalls | 9 +- runtest/tcp_cmds_expect | 8 + runtest/tcp_cmds_noexpect | 36 +- testcases/Makefile | 62 +- testcases/ballista/ballista/Makefile | 4 +- testcases/commands/Makefile | 38 +- testcases/commands/ade/Makefile | 40 +- testcases/commands/ade/ar/Makefile | 56 +- testcases/commands/ade/file/Makefile | 38 +- testcases/commands/ade/file/file_test.sh | 2 +- testcases/commands/ade/ld/Makefile | 52 +- testcases/commands/ade/ldd/Makefile | 50 +- testcases/commands/ade/nm/Makefile | 51 +- testcases/commands/ade/objdump/Makefile | 61 +- testcases/commands/ade/objdump/test.c | 13 +- testcases/commands/ade/size/Makefile | 45 +- testcases/commands/ade/size/test.c | 10 +- testcases/commands/at/Makefile | 37 +- testcases/commands/cpio/Makefile | 37 +- testcases/commands/cron/Makefile | 49 +- testcases/commands/cron/cron02 | 7 +- testcases/commands/cron/cron_allow01 | 2 +- testcases/commands/cron/cron_deny01 | 2 +- testcases/commands/cron/cron_pos_tests.sh | 2 +- testcases/commands/eject/Makefile | 43 +- testcases/commands/fileutils/Makefile | 36 +- testcases/commands/fileutils/cp/Makefile | 38 +- testcases/commands/fileutils/ln/Makefile | 38 +- testcases/commands/fileutils/mkdir/Makefile | 38 +- testcases/commands/fileutils/mv/Makefile | 38 +- testcases/commands/gzip/Makefile | 37 +- testcases/commands/logrotate/Makefile | 37 +- testcases/commands/mail/Makefile | 37 +- testcases/commands/mail/mail_tests.sh | 2 +- testcases/commands/su/Makefile | 38 +- testcases/commands/su/su01 | 6 +- testcases/commands/tar/Makefile | 37 +- testcases/commands/tpm-tools/Makefile | 36 +- testcases/commands/tpm-tools/tpm/Makefile | 42 +- .../commands/tpm-tools/tpm/tpm_changeauth/Makefile | 41 +- .../commands/tpm-tools/tpm/tpm_clear/Makefile | 39 +- .../commands/tpm-tools/tpm/tpm_getpubek/Makefile | 39 +- .../tpm-tools/tpm/tpm_restrictpubek/Makefile | 41 +- .../commands/tpm-tools/tpm/tpm_selftest/Makefile | 38 +- .../tpm-tools/tpm/tpm_takeownership/Makefile | 39 +- .../commands/tpm-tools/tpm/tpm_version/Makefile | 38 +- testcases/commands/tpm-tools/tpmtoken/Makefile | 40 +- .../tpm-tools/tpmtoken/tpmtoken_import/Makefile | 47 +- .../tpm-tools/tpmtoken/tpmtoken_init/Makefile | 42 +- .../tpm-tools/tpmtoken/tpmtoken_objects/Makefile | 39 +- .../tpm-tools/tpmtoken/tpmtoken_protect/Makefile | 41 +- .../tpm-tools/tpmtoken/tpmtoken_setpasswd/Makefile | 42 +- testcases/commands/unzip/Makefile | 77 +- testcases/kernel/Makefile | 73 +- testcases/kernel/connectors/Makefile | 47 +- testcases/kernel/connectors/pec/Makefile | 43 +- testcases/kernel/connectors/pec/pec_listener.c | 7 +- testcases/kernel/containers/Makefile | 83 +- testcases/kernel/containers/Makefile.inc | 45 + testcases/kernel/containers/check_for_unshare.c | 55 - testcases/kernel/containers/libclone/Makefile | 26 +- testcases/kernel/containers/libclone/libnetns.c | 170 - testcases/kernel/containers/mqns/Makefile | 23 +- .../kernel/containers/mqns/check_mqns_enabled.c | 55 - testcases/kernel/containers/netns/Makefile | 33 +- testcases/kernel/containers/netns/childns.sh | 87 +- testcases/kernel/containers/netns/common.c | 172 + .../kernel/containers/netns/create_container.c | 2 +- testcases/kernel/containers/netns/crtchild.c | 2 +- .../kernel/containers/netns/crtchild_delchild.c | 2 +- testcases/kernel/containers/netns/initialize.sh | 99 +- testcases/kernel/containers/netns/nw_under_ns.sh | 5 +- testcases/kernel/containers/netns/par_chld_ftp.c | 2 +- testcases/kernel/containers/netns/par_chld_ipv6.c | 23 +- testcases/kernel/containers/netns/sysfsview.c | 2 +- .../kernel/containers/netns/two_children_ns.c | 43 +- testcases/kernel/containers/pidns/Makefile | 23 +- .../kernel/containers/pidns/check_pidns_enabled.c | 69 - testcases/kernel/containers/sysvipc/Makefile | 22 +- testcases/kernel/containers/utsname/Makefile | 23 +- testcases/kernel/controllers/Makefile | 137 +- testcases/kernel/controllers/Makefile.inc | 46 + testcases/kernel/controllers/cgroup/Makefile | 46 +- testcases/kernel/controllers/cgroup/getdelays.c | 96 +- testcases/kernel/controllers/cgroup_fj/Makefile | 51 +- .../controllers/cgroup_fj/cgroup_fj_utility.sh | 2 +- .../controllers/cgroup_fj/run_cgroup_test_fj.sh | 8 +- testcases/kernel/controllers/cpuacct/Makefile | 48 +- testcases/kernel/controllers/cpuctl/Makefile | 50 +- testcases/kernel/controllers/cpuctl_fj/Makefile | 55 +- .../controllers/cpuctl_fj/run_cpuctl_test_fj.sh | 51 +- testcases/kernel/controllers/cpuset/Makefile | 62 +- testcases/kernel/controllers/cpuset/Makefile.inc | 41 + .../cpuset/cpuset_base_ops_test/Makefile | 42 +- .../cpuset/cpuset_exclusive_test/Makefile | 42 +- .../kernel/controllers/cpuset/cpuset_funcs.sh | 265 + .../cpuset/cpuset_hierarchy_test/Makefile | 42 +- .../cpuset/cpuset_hotplug_test/Makefile | 52 +- .../cpuset/cpuset_inherit_test/Makefile | 42 +- .../kernel/controllers/cpuset/cpuset_lib/Makefile | 48 +- .../controllers/cpuset/cpuset_lib/libcpuset.c | 2 + .../cpuset/cpuset_load_balance_test/Makefile | 54 +- .../cpuset/cpuset_memory_pressure_test/Makefile | 43 +- .../cpuset/cpuset_memory_spread_test/Makefile | 43 +- .../controllers/cpuset/cpuset_memory_test/Makefile | 50 +- .../cpuset/cpuset_syscall_test/Makefile | 45 +- .../cpuset_syscall_test/cpuset_syscall_test.c | 3 + testcases/kernel/controllers/freezer/Makefile | 61 +- testcases/kernel/controllers/freezer/run.sh | 132 - .../kernel/controllers/freezer/run_freezer.sh | 132 + testcases/kernel/controllers/freezer/vfork.c | 70 +- testcases/kernel/controllers/io-throttle/Makefile | 48 +- .../kernel/controllers/libcontrollers/Makefile | 44 +- testcases/kernel/controllers/memcg/Makefile | 39 +- .../kernel/controllers/memcg/functional/Makefile | 54 +- .../memcg/functional/memcg_function_test.sh | 11 +- .../kernel/controllers/memcg/regression/Makefile | 49 +- testcases/kernel/controllers/memcg/stress/Makefile | 56 +- .../controllers/memcg/stress/memcg_stress_test.sh | 18 +- testcases/kernel/controllers/memctl/Makefile | 46 +- testcases/kernel/controllers/test_controllers.sh | 4 +- testcases/kernel/fs/Makefile | 44 +- testcases/kernel/fs/acls/Makefile | 64 +- testcases/kernel/fs/acls/acl_test01 | 12 +- testcases/kernel/fs/dmapi/Makefile | 94 +- testcases/kernel/fs/dmapi/dm_test.h | 4 + testcases/kernel/fs/doio/Makefile | 60 +- testcases/kernel/fs/doio/rwtest.sh | 101 +- testcases/kernel/fs/ext4-new-features/Makefile | 38 + testcases/kernel/fs/ext4-new-features/README | 147 + testcases/kernel/fs/ext4-new-features/configure | 23 + .../ext4-delalloc-mballoc/Makefile | 25 + .../ext4-delalloc-mballoc/ext4-alloc-test.sh | 167 + .../fs/ext4-new-features/ext4-ffsb-config/Makefile | 25 + .../ext4-ffsb-config/ffsb-config0 | 23 + .../ext4-ffsb-config/ffsb-config1 | 23 + .../ext4-ffsb-config/ffsb-config2 | 23 + .../ext4-ffsb-config/ffsb-config3 | 29 + .../ext4-ffsb-config/ffsb-config4 | 29 + .../ext4-ffsb-config/ffsb-config5 | 29 + .../ext4-ffsb-config/ffsb-config6 | 29 + .../ext4-ffsb-config/ffsb-config7 | 29 + .../ext4-new-features/ext4-inode-version/Makefile | 25 + .../ext4-inode-version/ext4_get_inode_version.sh | 41 + .../ext4-inode-version/ext4_inode_version_test.sh | 205 + .../ext4-inode-version/ext4_test_inode_version.c | 219 + .../ext4-journal-checksum/Makefile | 25 + .../ext4-journal-checksum/ext4_journal_checksum.sh | 148 + .../ext4-nsec-timestamps/Makefile | 25 + .../ext4-nsec-timestamps/ext4_file_time.c | 70 + .../ext4_nsec_timestamps_test.sh | 196 + .../ext4-new-features/ext4-online-defrag/Makefile | 25 + .../ext4-online-defrag/e4defrag.c | 2171 ++++++ .../ext4-online-defrag/ext4_online_defrag_test.sh | 192 + .../ext4-persist-prealloc/Makefile | 25 + .../ext4_persist_prealloc_test.sh | 113 + .../ext4-new-features/ext4-subdir-limit/Makefile | 25 + .../ext4-subdir-limit/create_long_dirs.c | 156 + .../ext4-subdir-limit/create_short_dirs.c | 158 + .../ext4-subdir-limit/ext4_subdir_limit_test.sh | 167 + .../ext4-new-features/ext4-uninit-groups/Makefile | 25 + .../ext4-uninit-groups/ext4_uninit_groups_test.sh | 161 + .../kernel/fs/ext4-new-features/ext4_funcs.sh | 47 + .../fs/ext4-new-features/ffsb-6.0-rc2/AUTHORS | 7 + .../fs/ext4-new-features/ffsb-6.0-rc2/COPYING | 340 + .../fs/ext4-new-features/ffsb-6.0-rc2/INSTALL | 182 + .../fs/ext4-new-features/ffsb-6.0-rc2/LICENSE | 347 + .../fs/ext4-new-features/ffsb-6.0-rc2/Makefile.am | 46 + .../fs/ext4-new-features/ffsb-6.0-rc2/Makefile.in | 628 ++ .../fs/ext4-new-features/ffsb-6.0-rc2/README | 413 ++ .../fs/ext4-new-features/ffsb-6.0-rc2/cirlist.c | 107 + .../fs/ext4-new-features/ffsb-6.0-rc2/cirlist.h | 41 + .../fs/ext4-new-features/ffsb-6.0-rc2/config.h.in | 130 + .../fs/ext4-new-features/ffsb-6.0-rc2/configure | 7000 ++++++++++++++++++++ .../fs/ext4-new-features/ffsb-6.0-rc2/configure.in | 49 + .../fs/ext4-new-features/ffsb-6.0-rc2/depcomp | 472 ++ .../ffsb-6.0-rc2/examples/profile_everything | 119 + .../fs/ext4-new-features/ffsb-6.0-rc2/ffsb.h | 105 + .../fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fc.c | 112 + .../fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.c | 634 ++ .../fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.h | 184 + .../fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.c | 178 + .../fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.h | 102 + .../fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.c | 241 + .../fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.h | 109 + .../fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.c | 369 ++ .../fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.h | 206 + .../ext4-new-features/ffsb-6.0-rc2/ffsb_thread.c | 171 + .../ext4-new-features/ffsb-6.0-rc2/ffsb_thread.h | 108 + .../kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.c | 278 + .../kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.h | 41 + .../fs/ext4-new-features/ffsb-6.0-rc2/filelist.c | 503 ++ .../fs/ext4-new-features/ffsb-6.0-rc2/filelist.h | 145 + .../fs/ext4-new-features/ffsb-6.0-rc2/fileops.c | 547 ++ .../fs/ext4-new-features/ffsb-6.0-rc2/fileops.h | 51 + .../fs/ext4-new-features/ffsb-6.0-rc2/list.c | 55 + .../fs/ext4-new-features/ffsb-6.0-rc2/list.h | 53 + .../fs/ext4-new-features/ffsb-6.0-rc2/main.c | 258 + .../fs/ext4-new-features/ffsb-6.0-rc2/metaops.c | 112 + .../fs/ext4-new-features/ffsb-6.0-rc2/metaops.h | 28 + .../ext4-new-features/ffsb-6.0-rc2/mkinstalldirs | 40 + .../fs/ext4-new-features/ffsb-6.0-rc2/parser.c | 1033 +++ .../fs/ext4-new-features/ffsb-6.0-rc2/parser.h | 151 + .../ffsb-6.0-rc2/public-description | 4 + .../fs/ext4-new-features/ffsb-6.0-rc2/rand.c | 188 + .../fs/ext4-new-features/ffsb-6.0-rc2/rand.h | 60 + .../kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.c | 1040 +++ .../kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.h | 316 + .../ffsb-6.0-rc2/registration-description | 7 + .../fs/ext4-new-features/ffsb-6.0-rc2/rwlock.c | 109 + .../fs/ext4-new-features/ffsb-6.0-rc2/rwlock.h | 51 + .../fs/ext4-new-features/ffsb-6.0-rc2/stamp-h.in | 1 + .../fs/ext4-new-features/ffsb-6.0-rc2/util.c | 351 + .../fs/ext4-new-features/ffsb-6.0-rc2/util.h | 94 + .../kernel/fs/ext4-new-features/run_ext4_test.sh | 179 + testcases/kernel/fs/fs-bench/Makefile | 66 +- testcases/kernel/fs/fs-bench/modaltr.sh | 2 +- .../kernel/fs/fs-bench/random-access-del-create.c | 135 + testcases/kernel/fs/fs_bind/Makefile | 40 +- testcases/kernel/fs/fs_bind/bin/Makefile | 55 +- testcases/kernel/fs/fs_di/Makefile | 42 +- testcases/kernel/fs/fs_di/fs_di | 6 +- testcases/kernel/fs/fs_inod/Makefile | 39 +- testcases/kernel/fs/fs_perms/Makefile | 44 +- testcases/kernel/fs/fs_perms/fs_perms.c | 22 +- .../kernel/fs/fs_perms/fs_perms_simpletest.sh | 2 +- testcases/kernel/fs/fsstress/Makefile | 45 +- testcases/kernel/fs/fsx-linux/Makefile | 51 +- testcases/kernel/fs/ftest/Makefile | 69 +- testcases/kernel/fs/inode/Makefile | 65 +- testcases/kernel/fs/lftest/Makefile | 40 +- testcases/kernel/fs/linktest/Makefile | 37 +- testcases/kernel/fs/linktest/linktest.pl | 89 - testcases/kernel/fs/linktest/linktest.sh | 91 + testcases/kernel/fs/mongo/test.sh | 8 +- testcases/kernel/fs/openfile/Makefile | 42 +- testcases/kernel/fs/openfile/openfile.c | 249 +- testcases/kernel/fs/proc/Makefile | 16 +- testcases/kernel/fs/proc/proc01.c | 30 +- testcases/kernel/fs/quota_remount/Makefile | 51 +- .../fs/quota_remount/quota_remount_test01.sh | 5 +- testcases/kernel/fs/racer/Makefile | 12 +- testcases/kernel/fs/racer/fs_racer.sh | 2 +- testcases/kernel/fs/scsi/ltpscsi/Makefile | 5 - testcases/kernel/fs/stream/Makefile | 20 +- testcases/kernel/fs/stream/stream03.c | 182 +- .../hotplug/cpu_hotplug/functional/hotplug02.sh | 6 +- .../hotplug/cpu_hotplug/functional/hotplug03.sh | 16 +- .../hotplug/cpu_hotplug/functional/hotplug04.sh | 10 +- .../cpu_hotplug/functional/hotplug06.sar.sh | 6 +- .../cpu_hotplug/functional/hotplug06.top.sh | 6 +- .../hotplug/cpu_hotplug/functional/hotplug07.sh | 6 +- testcases/kernel/include/Makefile | 53 +- testcases/kernel/include/ia64.in | 1 + testcases/kernel/include/order | 1 - testcases/kernel/include/powerpc.in | 3 + testcases/kernel/include/powerpc64.in | 3 + testcases/kernel/include/regen.sh | 8 +- testcases/kernel/include/s390.in | 3 + testcases/kernel/include/sh.in | 1 + testcases/kernel/include/sparc.in | 1 + testcases/kernel/include/sparc64.in | 1 + testcases/kernel/include/x86_64.in | 1 + testcases/kernel/io/Makefile | 39 +- testcases/kernel/io/aio/Makefile | 35 +- testcases/kernel/io/aio/aio01/Makefile | 17 +- testcases/kernel/io/aio/aio02/Makefile | 58 +- testcases/kernel/io/aio/aio02/aio_tio.c | 279 + testcases/kernel/io/aio/aio02/cases/aio_tio.c | 281 - testcases/kernel/io/aio/aio02/cases/common.h | 6 + testcases/kernel/io/aio/aio02/common.h | 28 + testcases/kernel/io/aio/aio02/main.c | 32 +- testcases/kernel/io/direct_io/Makefile | 91 +- .../io/direct_io/test_dma_thread_diotest7.sh | 4 + testcases/kernel/io/disktest/Makefile | 89 +- testcases/kernel/io/ltp-aiodio/Makefile | 74 +- testcases/kernel/io/ltp-aiodio/aio-stress.c | 4 - testcases/kernel/io/ltp-aiodio/aiocp.c | 14 +- testcases/kernel/io/stress_cd/Makefile | 39 +- testcases/kernel/io/stress_floppy/Makefile | 49 +- testcases/kernel/io/stress_floppy/generate.sh | 61 +- testcases/kernel/io/writetest/Makefile | 39 +- testcases/kernel/io/writetest/writetest.c | 90 +- testcases/kernel/ipc/Makefile | 37 +- testcases/kernel/ipc/ipc_stress/Makefile | 46 +- testcases/kernel/ipc/pipeio/Makefile | 14 +- testcases/kernel/ipc/semaphore/Makefile | 44 +- testcases/kernel/mem/Makefile | 54 +- testcases/kernel/mem/Makefile.inc | 39 + testcases/kernel/mem/hugetlb/Makefile | 44 +- testcases/kernel/mem/hugetlb/Makefile.inc | 46 + testcases/kernel/mem/hugetlb/hugemmap/Makefile | 40 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c | 3 +- testcases/kernel/mem/hugetlb/hugeshmat/Makefile | 40 +- testcases/kernel/mem/hugetlb/hugeshmctl/Makefile | 40 +- testcases/kernel/mem/hugetlb/hugeshmdt/Makefile | 40 +- testcases/kernel/mem/hugetlb/hugeshmget/Makefile | 36 +- testcases/kernel/mem/hugetlb/lib/Makefile | 25 +- testcases/kernel/mem/libmm/Makefile | 20 +- testcases/kernel/mem/libmm/mm_core_apis.c | 10 +- testcases/kernel/mem/mem/Makefile | 21 +- testcases/kernel/mem/mmapstress/Makefile | 23 +- testcases/kernel/mem/mmapstress/mmapstress02.c | 6 +- testcases/kernel/mem/mmapstress/mmapstress05.c | 6 +- testcases/kernel/mem/mtest01/Makefile | 40 +- testcases/kernel/mem/mtest05/Makefile | 44 +- testcases/kernel/mem/mtest06/Makefile | 44 +- testcases/kernel/mem/mtest06/mmap1.c | 5 +- testcases/kernel/mem/mtest07/Makefile | 43 +- testcases/kernel/mem/page/Makefile | 66 +- testcases/kernel/mem/shmt/Makefile | 61 +- testcases/kernel/mem/shmt/shmt05.c | 4 +- testcases/kernel/mem/shmt/shmt09.c | 6 +- testcases/kernel/mem/vmtests/Makefile | 21 +- testcases/kernel/mem/vmtests/data_space.c | 6 +- testcases/kernel/mem/vmtests/stack_space.c | 6 +- testcases/kernel/module/Makefile | 41 +- testcases/kernel/module/delete_module/Makefile | 56 +- .../kernel/module/delete_module/delete_module01.c | 196 +- .../kernel/module/delete_module/delete_module02.c | 299 +- .../kernel/module/delete_module/delete_module03.c | 480 +- .../kernel/module/delete_module/dummy_del_mod.c | 3 + .../module/delete_module/dummy_del_mod_dep.c | 2 + testcases/kernel/numa/Makefile | 23 +- testcases/kernel/numa/numa_node_size.c | 58 +- testcases/kernel/performance_counters/Makefile | 58 +- .../performance_counters/performance_counter01.c | 5 +- .../performance_counters/performance_counter02.c | 7 +- testcases/kernel/power_management/Makefile | 42 +- .../kernel/power_management/cpu_consolidation.py | 80 +- testcases/kernel/power_management/ilb_test.py | 8 +- testcases/kernel/power_management/lib/sched_mc.py | 273 +- testcases/kernel/power_management/pm_include.sh | 26 +- .../kernel/power_management/pwkm_load_unload.sh | 4 +- testcases/kernel/power_management/runpwtests.sh | 185 +- testcases/kernel/power_management/sched_domain.py | 2 +- testcases/kernel/pty/Makefile | 53 +- testcases/kernel/sched/Makefile | 39 +- testcases/kernel/sched/cfs-scheduler/Makefile | 14 +- testcases/kernel/sched/clisrv/Makefile | 57 +- testcases/kernel/sched/hyperthreading/Makefile | 37 +- .../sched/hyperthreading/ht_affinity/HTaffinity.c | 268 - .../sched/hyperthreading/ht_affinity/HTutils.c | 127 - .../sched/hyperthreading/ht_affinity/Makefile | 53 +- .../sched/hyperthreading/ht_affinity/ht_affinity.c | 268 + .../sched/hyperthreading/ht_affinity/ht_utils.c | 127 + .../ht_affinity/{HTutils.h => ht_utils.h} | 0 .../sched/hyperthreading/ht_enabled/HTenabled.c | 31 - .../sched/hyperthreading/ht_enabled/HTutils.c | 131 - .../sched/hyperthreading/ht_enabled/Makefile | 53 +- .../sched/hyperthreading/ht_enabled/ht_enabled.c | 31 + .../sched/hyperthreading/ht_enabled/ht_utils.c | 131 + .../ht_enabled/{HTutils.h => ht_utils.h} | 0 .../hyperthreading/ht_interrupt/HTinterrupt.c | 134 - .../sched/hyperthreading/ht_interrupt/HTutils.c | 259 - .../sched/hyperthreading/ht_interrupt/Makefile | 49 +- .../hyperthreading/ht_interrupt/ht_interrupt.c | 134 + .../sched/hyperthreading/ht_interrupt/ht_utils.c | 259 + .../ht_interrupt/{HTutils.h => ht_utils.h} | 0 testcases/kernel/sched/nptl/Makefile | 28 +- testcases/kernel/sched/nptl/nptl01.c | 1 + testcases/kernel/sched/process_stress/Makefile | 41 +- testcases/kernel/sched/pthreads/Makefile | 43 +- testcases/kernel/sched/sched_stress/Makefile | 61 +- testcases/kernel/sched/tool/Makefile | 42 +- testcases/kernel/security/Makefile | 52 +- testcases/kernel/security/cap_bound/Makefile | 39 +- testcases/kernel/security/cap_bound/cap_bounds_r.c | 7 + .../kernel/security/cap_bound/cap_bounds_rw.c | 3 + .../security/cap_bound/cap_bset_inh_bounds.c | 68 +- testcases/kernel/security/cap_bound/check_pe.c | 22 +- testcases/kernel/security/cap_bound/dummy.c | 26 + .../kernel/security/cap_bound/exec_with_inh.c | 50 +- .../kernel/security/cap_bound/exec_without_inh.c | 49 +- testcases/kernel/security/filecaps/Makefile | 45 +- .../kernel/security/filecaps/check_simple_capset.c | 17 +- testcases/kernel/security/filecaps/check_xattr.c | 9 - .../kernel/security/filecaps/checkforfilecaps.sh | 4 +- testcases/kernel/security/filecaps/inh_capped.c | 16 +- testcases/kernel/security/filecaps/makenumcapsh.c | 21 - testcases/kernel/security/filecaps/print_caps.c | 10 +- .../kernel/security/filecaps/verify_caps_exec.c | 53 +- testcases/kernel/security/integrity/Makefile | 33 +- testcases/kernel/security/integrity/ima/Makefile | 40 +- testcases/kernel/security/integrity/ima/README | 10 +- .../kernel/security/integrity/ima/policy/Makefile | 37 +- .../kernel/security/integrity/ima/src/Makefile | 45 +- .../integrity/ima/src/ima_boot_aggregate.c | 21 +- .../security/integrity/ima/src/ima_measure.c | 32 +- .../kernel/security/integrity/ima/src/ima_mmap.c | 9 +- .../kernel/security/integrity/ima/tests/Makefile | 35 +- .../integrity/ima/tests/ima_measurements.sh | 20 +- .../security/integrity/ima/tests/ima_policy.sh | 7 +- .../security/integrity/ima/tests/ima_setup.sh | 91 +- .../kernel/security/integrity/ima/tests/ima_tpm.sh | 30 +- .../security/integrity/ima/tests/ima_violations.sh | 6 +- testcases/kernel/security/mmc_security/Makefile | 37 +- testcases/kernel/security/p9auth/Makefile | 21 +- testcases/kernel/security/p9auth/checkp9auth.sh | 78 - .../kernel/security/selinux-testsuite/Makefile | 39 +- .../security/selinux-testsuite/policy/Makefile | 70 +- .../security/selinux-testsuite/refpolicy/Makefile | 114 +- .../security/selinux-testsuite/tests/Makefile | 63 +- .../security/selinux-testsuite/tests/Makefile.inc | 35 + .../selinux-testsuite/tests/bounds/Makefile | 41 +- .../selinux-testsuite/tests/capable_file/Makefile | 41 +- .../selinux-testsuite/tests/capable_net/Makefile | 37 +- .../selinux-testsuite/tests/capable_sys/Makefile | 36 +- .../selinux-testsuite/tests/domain_trans/Makefile | 31 +- .../selinux-testsuite/tests/dyntrace/Makefile | 41 +- .../selinux-testsuite/tests/dyntrans/Makefile | 41 +- .../selinux-testsuite/tests/entrypoint/Makefile | 31 +- .../selinux-testsuite/tests/execshare/Makefile | 42 +- .../selinux-testsuite/tests/exectrace/Makefile | 42 +- .../tests/execute_no_trans/Makefile | 31 +- .../selinux-testsuite/tests/fdreceive/Makefile | 37 +- .../security/selinux-testsuite/tests/file/Makefile | 41 +- .../selinux-testsuite/tests/inherit/Makefile | 46 +- .../selinux-testsuite/tests/ioctl/Makefile | 37 +- .../security/selinux-testsuite/tests/link/Makefile | 31 +- .../selinux-testsuite/tests/mkdir/Makefile | 31 +- .../security/selinux-testsuite/tests/msg/Makefile | 37 +- .../security/selinux-testsuite/tests/open/Makefile | 37 +- .../selinux-testsuite/tests/ptrace/Makefile | 38 +- .../selinux-testsuite/tests/readlink/Makefile | 32 +- .../selinux-testsuite/tests/relabel/Makefile | 32 +- .../selinux-testsuite/tests/rename/Makefile | 32 +- .../selinux-testsuite/tests/rxdir/Makefile | 32 +- .../security/selinux-testsuite/tests/sem/Makefile | 37 +- .../selinux-testsuite/tests/setattr/Makefile | 33 +- .../selinux-testsuite/tests/setnice/Makefile | 41 +- .../security/selinux-testsuite/tests/shm/Makefile | 37 +- .../selinux-testsuite/tests/sigkill/Makefile | 37 +- .../security/selinux-testsuite/tests/stat/Makefile | 33 +- .../selinux-testsuite/tests/sysctl/Makefile | 32 +- .../selinux-testsuite/tests/task_create/Makefile | 36 +- .../selinux-testsuite/tests/task_getpgid/Makefile | 37 +- .../tests/task_getscheduler/Makefile | 38 +- .../selinux-testsuite/tests/task_getsid/Makefile | 37 +- .../selinux-testsuite/tests/task_setnice/Makefile | 37 +- .../selinux-testsuite/tests/task_setpgid/Makefile | 35 +- .../tests/task_setscheduler/Makefile | 38 +- .../security/selinux-testsuite/tests/wait/Makefile | 40 +- testcases/kernel/security/smack/Makefile | 45 +- testcases/kernel/security/smack/smack_common.sh | 48 + .../kernel/security/smack/smack_file_access.sh | 67 +- .../kernel/security/smack/smack_set_ambient.sh | 33 +- testcases/kernel/security/smack/smack_set_cipso.sh | 59 +- .../kernel/security/smack/smack_set_current.sh | 34 +- .../kernel/security/smack/smack_set_direct.sh | 34 +- testcases/kernel/security/smack/smack_set_doi.sh | 32 +- testcases/kernel/security/smack/smack_set_load.sh | 44 +- .../kernel/security/smack/smack_set_netlabel.sh | 41 +- .../kernel/security/smack/smack_set_onlycap.sh | 77 +- testcases/kernel/security/tomoyo/Makefile | 52 +- testcases/kernel/security/tomoyo/include.h | 12 + testcases/kernel/syscalls/Makefile | 90 +- testcases/kernel/syscalls/abort/Makefile | 14 +- testcases/kernel/syscalls/accept/Makefile | 14 +- testcases/kernel/syscalls/accept4/Makefile | 14 +- testcases/kernel/syscalls/access/Makefile | 14 +- testcases/kernel/syscalls/acct/Makefile | 14 +- testcases/kernel/syscalls/add_key/Makefile | 14 +- testcases/kernel/syscalls/adjtimex/Makefile | 14 +- testcases/kernel/syscalls/alarm/Makefile | 14 +- testcases/kernel/syscalls/asyncio/Makefile | 14 +- testcases/kernel/syscalls/bdflush/Makefile | 14 +- testcases/kernel/syscalls/bind/Makefile | 14 +- testcases/kernel/syscalls/brk/Makefile | 14 +- testcases/kernel/syscalls/cacheflush/Makefile | 14 +- testcases/kernel/syscalls/capget/Makefile | 14 +- testcases/kernel/syscalls/capset/Makefile | 14 +- testcases/kernel/syscalls/chdir/Makefile | 14 +- testcases/kernel/syscalls/chmod/Makefile | 15 +- testcases/kernel/syscalls/chown/Makefile | 17 +- testcases/kernel/syscalls/chroot/Makefile | 14 +- testcases/kernel/syscalls/clock_getres/Makefile | 14 +- .../kernel/syscalls/clock_getres/clock_getres01.c | 7 +- testcases/kernel/syscalls/clock_nanosleep/Makefile | 14 +- .../syscalls/clock_nanosleep/clock_nanosleep01.c | 28 +- .../kernel/syscalls/clock_nanosleep2/Makefile | 14 +- testcases/kernel/syscalls/clone/Makefile | 14 +- testcases/kernel/syscalls/close/Makefile | 14 +- testcases/kernel/syscalls/close/close08.c | 4 +- testcases/kernel/syscalls/confstr/Makefile | 14 +- testcases/kernel/syscalls/connect/Makefile | 14 +- testcases/kernel/syscalls/creat/Makefile | 14 +- testcases/kernel/syscalls/dup/Makefile | 14 +- testcases/kernel/syscalls/dup/dup01.c | 4 +- testcases/kernel/syscalls/dup/dup02.c | 6 +- testcases/kernel/syscalls/dup/dup03.c | 6 +- testcases/kernel/syscalls/dup/dup04.c | 10 +- testcases/kernel/syscalls/dup/dup05.c | 4 +- testcases/kernel/syscalls/dup2/Makefile | 14 +- testcases/kernel/syscalls/dup3/Makefile | 14 +- testcases/kernel/syscalls/epoll/Makefile | 14 +- testcases/kernel/syscalls/epoll_create1/Makefile | 14 +- testcases/kernel/syscalls/eventfd/Makefile | 19 +- testcases/kernel/syscalls/eventfd2/Makefile | 14 +- testcases/kernel/syscalls/execl/Makefile | 14 +- testcases/kernel/syscalls/execle/Makefile | 14 +- testcases/kernel/syscalls/execlp/Makefile | 14 +- testcases/kernel/syscalls/execv/Makefile | 14 +- testcases/kernel/syscalls/execve/Makefile | 14 +- testcases/kernel/syscalls/execvp/Makefile | 14 +- testcases/kernel/syscalls/exit/Makefile | 14 +- testcases/kernel/syscalls/exit_group/Makefile | 14 +- testcases/kernel/syscalls/faccessat/Makefile | 14 +- testcases/kernel/syscalls/fadvise/Makefile | 17 +- .../kernel/syscalls/fadvise/posix_fadvise01.c | 2 +- .../kernel/syscalls/fadvise/posix_fadvise02.c | 4 +- .../kernel/syscalls/fadvise/posix_fadvise03.c | 4 +- .../kernel/syscalls/fadvise/posix_fadvise04.c | 4 +- testcases/kernel/syscalls/fallocate/Makefile | 15 +- testcases/kernel/syscalls/fchdir/Makefile | 14 +- testcases/kernel/syscalls/fchmod/Makefile | 15 +- testcases/kernel/syscalls/fchmod/fchmod01.c | 4 +- testcases/kernel/syscalls/fchmod/fchmod06.c | 2 +- testcases/kernel/syscalls/fchmodat/Makefile | 14 +- testcases/kernel/syscalls/fchown/Makefile | 19 +- testcases/kernel/syscalls/fchown/fchown01.c | 4 +- testcases/kernel/syscalls/fchown/fchown04.c | 2 +- testcases/kernel/syscalls/fchownat/Makefile | 14 +- testcases/kernel/syscalls/fcntl/Makefile | 19 +- testcases/kernel/syscalls/fcntl/fcntl02.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl03.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl04.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl05.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl08.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl09.c | 6 +- testcases/kernel/syscalls/fcntl/fcntl10.c | 6 +- testcases/kernel/syscalls/fcntl/fcntl22.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl23.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl24.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl25.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl26.c | 4 +- testcases/kernel/syscalls/fdatasync/Makefile | 14 +- testcases/kernel/syscalls/fdatasync/fdatasync02.c | 2 +- testcases/kernel/syscalls/flock/Makefile | 14 +- testcases/kernel/syscalls/fmtmsg/Makefile | 14 +- testcases/kernel/syscalls/fork/Makefile | 14 +- testcases/kernel/syscalls/fork/fork01.c | 6 +- testcases/kernel/syscalls/fpathconf/Makefile | 14 +- testcases/kernel/syscalls/fpathconf/fpathconf01.c | 4 +- testcases/kernel/syscalls/fstat/Makefile | 18 +- testcases/kernel/syscalls/fstatat/Makefile | 19 +- testcases/kernel/syscalls/fstatfs/Makefile | 18 +- testcases/kernel/syscalls/fstatfs/fstatfs01.c | 4 +- testcases/kernel/syscalls/fsync/Makefile | 14 +- testcases/kernel/syscalls/fsync/fsync01.c | 4 +- testcases/kernel/syscalls/ftruncate/Makefile | 22 +- testcases/kernel/syscalls/futimesat/Makefile | 14 +- testcases/kernel/syscalls/get_mempolicy/Makefile | 14 +- testcases/kernel/syscalls/get_robust_list/Makefile | 14 +- .../syscalls/get_robust_list/get_robust_list01.c | 28 +- testcases/kernel/syscalls/getcontext/Makefile | 16 +- testcases/kernel/syscalls/getcpu/Makefile | 22 +- testcases/kernel/syscalls/getcwd/Makefile | 14 +- testcases/kernel/syscalls/getdents/Makefile | 18 +- testcases/kernel/syscalls/getdomainname/Makefile | 14 +- .../syscalls/getdomainname/getdomainname01.c | 2 +- testcases/kernel/syscalls/getdtablesize/Makefile | 16 +- testcases/kernel/syscalls/getegid/Makefile | 18 +- testcases/kernel/syscalls/getegid/getegid01.c | 4 +- testcases/kernel/syscalls/getegid/getegid02.c | 4 +- testcases/kernel/syscalls/geteuid/Makefile | 17 +- testcases/kernel/syscalls/geteuid/compat_16.h | 48 + testcases/kernel/syscalls/geteuid/geteuid01.c | 10 +- testcases/kernel/syscalls/getgid/Makefile | 18 +- testcases/kernel/syscalls/getgid/getgid01.c | 4 +- testcases/kernel/syscalls/getgid/getgid03.c | 4 +- testcases/kernel/syscalls/getgroups/Makefile | 18 +- testcases/kernel/syscalls/gethostid/Makefile | 14 +- testcases/kernel/syscalls/gethostname/Makefile | 14 +- .../kernel/syscalls/gethostname/gethostname01.c | 4 +- testcases/kernel/syscalls/getitimer/Makefile | 14 +- testcases/kernel/syscalls/getpagesize/Makefile | 16 +- testcases/kernel/syscalls/getpeername/Makefile | 14 +- testcases/kernel/syscalls/getpgid/Makefile | 14 +- testcases/kernel/syscalls/getpgrp/Makefile | 14 +- testcases/kernel/syscalls/getpgrp/getpgrp01.c | 4 +- testcases/kernel/syscalls/getpid/Makefile | 14 +- testcases/kernel/syscalls/getpid/getpid01.c | 4 +- testcases/kernel/syscalls/getppid/Makefile | 14 +- testcases/kernel/syscalls/getppid/getppid01.c | 4 +- testcases/kernel/syscalls/getpriority/Makefile | 14 +- .../kernel/syscalls/getpriority/getpriority01.c | 2 +- .../kernel/syscalls/getpriority/getpriority02.c | 2 +- testcases/kernel/syscalls/getresgid/Makefile | 14 +- testcases/kernel/syscalls/getresuid/Makefile | 14 +- testcases/kernel/syscalls/getrlimit/Makefile | 14 +- testcases/kernel/syscalls/getrusage/Makefile | 14 +- testcases/kernel/syscalls/getrusage/getrusage01.c | 2 +- testcases/kernel/syscalls/getrusage/getrusage02.c | 2 +- testcases/kernel/syscalls/getsid/Makefile | 14 +- testcases/kernel/syscalls/getsockname/Makefile | 14 +- .../kernel/syscalls/getsockname/getsockname01.c | 2 +- testcases/kernel/syscalls/getsockopt/Makefile | 14 +- .../kernel/syscalls/getsockopt/getsockopt01.c | 2 +- testcases/kernel/syscalls/gettid/Makefile | 14 +- testcases/kernel/syscalls/gettid/gettid01.c | 4 +- testcases/kernel/syscalls/gettimeofday/Makefile | 14 +- testcases/kernel/syscalls/getuid/Makefile | 18 +- testcases/kernel/syscalls/getuid/compat_16.h | 60 + testcases/kernel/syscalls/getuid/getuid01.c | 9 +- testcases/kernel/syscalls/getuid/getuid02.c | 14 +- testcases/kernel/syscalls/getuid/getuid03.c | 16 +- testcases/kernel/syscalls/inotify/Makefile | 14 +- testcases/kernel/syscalls/inotify_init/Makefile | 14 +- testcases/kernel/syscalls/io_cancel/Makefile | 21 +- testcases/kernel/syscalls/io_cancel/io_cancel01.c | 6 +- testcases/kernel/syscalls/io_destroy/Makefile | 22 +- .../kernel/syscalls/io_destroy/io_destroy01.c | 6 +- testcases/kernel/syscalls/io_getevents/Makefile | 22 +- .../kernel/syscalls/io_getevents/io_getevents01.c | 6 +- testcases/kernel/syscalls/io_setup/Makefile | 22 +- testcases/kernel/syscalls/io_setup/io_setup01.c | 14 +- testcases/kernel/syscalls/io_submit/Makefile | 23 +- testcases/kernel/syscalls/io_submit/io_submit01.c | 24 +- testcases/kernel/syscalls/ioctl/Makefile | 15 +- testcases/kernel/syscalls/ioperm/Makefile | 14 +- testcases/kernel/syscalls/ioperm/ioperm02.c | 2 +- testcases/kernel/syscalls/iopl/Makefile | 14 +- testcases/kernel/syscalls/iopl/iopl01.c | 2 +- testcases/kernel/syscalls/iopl/iopl02.c | 2 +- testcases/kernel/syscalls/ipc/Makefile | 27 +- testcases/kernel/syscalls/ipc/Makefile.inc | 42 + testcases/kernel/syscalls/ipc/lib/Makefile | 20 +- testcases/kernel/syscalls/ipc/msgctl/Makefile | 16 +- testcases/kernel/syscalls/ipc/msgctl/msgctl01.c | 4 +- testcases/kernel/syscalls/ipc/msgctl/msgctl02.c | 4 +- testcases/kernel/syscalls/ipc/msgctl/msgctl03.c | 3 +- testcases/kernel/syscalls/ipc/msgctl/msgctl04.c | 13 +- testcases/kernel/syscalls/ipc/msgctl/msgctl05.c | 4 +- testcases/kernel/syscalls/ipc/msgctl/msgctl06.c | 8 +- testcases/kernel/syscalls/ipc/msgctl/msgctl07.c | 22 +- testcases/kernel/syscalls/ipc/msgctl/msgctl08.c | 22 +- testcases/kernel/syscalls/ipc/msgctl/msgctl09.c | 41 +- testcases/kernel/syscalls/ipc/msgctl/msgctl10.c | 24 +- testcases/kernel/syscalls/ipc/msgctl/msgctl11.c | 41 +- testcases/kernel/syscalls/ipc/msgget/Makefile | 16 +- testcases/kernel/syscalls/ipc/msgrcv/Makefile | 16 +- testcases/kernel/syscalls/ipc/msgsnd/Makefile | 16 +- testcases/kernel/syscalls/ipc/semctl/Makefile | 16 +- testcases/kernel/syscalls/ipc/semget/Makefile | 16 +- testcases/kernel/syscalls/ipc/semop/Makefile | 16 +- testcases/kernel/syscalls/ipc/shmat/Makefile | 16 +- testcases/kernel/syscalls/ipc/shmctl/Makefile | 16 +- testcases/kernel/syscalls/ipc/shmdt/Makefile | 16 +- testcases/kernel/syscalls/ipc/shmget/Makefile | 16 +- testcases/kernel/syscalls/keyctl/Makefile | 14 +- testcases/kernel/syscalls/kill/Makefile | 28 +- testcases/kernel/syscalls/lchown/Makefile | 23 +- .../kernel/syscalls/lchown/create_link.mode.sh | 15 - testcases/kernel/syscalls/lchown/lchown02.c | 22 +- testcases/kernel/syscalls/link/Makefile | 14 +- testcases/kernel/syscalls/link/link02.c | 6 +- testcases/kernel/syscalls/link/link03.c | 6 +- testcases/kernel/syscalls/link/link04.c | 4 +- testcases/kernel/syscalls/link/link05.c | 6 +- testcases/kernel/syscalls/link/link06.c | 2 +- testcases/kernel/syscalls/link/link07.c | 2 +- testcases/kernel/syscalls/linkat/Makefile | 14 +- testcases/kernel/syscalls/listen/Makefile | 14 +- testcases/kernel/syscalls/listen/listen01.c | 2 +- testcases/kernel/syscalls/llseek/Makefile | 14 +- testcases/kernel/syscalls/llseek/llseek02.c | 2 +- testcases/kernel/syscalls/lseek/Makefile | 14 +- testcases/kernel/syscalls/lseek/lseek02.c | 4 +- testcases/kernel/syscalls/lseek/lseek03.c | 4 +- testcases/kernel/syscalls/lseek/lseek04.c | 4 +- testcases/kernel/syscalls/lseek/lseek05.c | 4 +- testcases/kernel/syscalls/lseek/lseek06.c | 2 +- testcases/kernel/syscalls/lseek/lseek08.c | 2 +- testcases/kernel/syscalls/lseek/lseek09.c | 2 +- testcases/kernel/syscalls/lseek/lseek10.c | 2 +- testcases/kernel/syscalls/lstat/Makefile | 18 +- testcases/kernel/syscalls/lstat/lstat01.c | 4 +- testcases/kernel/syscalls/lstat/lstat02.c | 2 +- testcases/kernel/syscalls/madvise/Makefile | 14 +- testcases/kernel/syscalls/madvise/madvise01.c | 2 +- testcases/kernel/syscalls/madvise/madvise02.c | 2 +- testcases/kernel/syscalls/madvise/madvise03.c | 2 +- testcases/kernel/syscalls/mallopt/Makefile | 14 +- testcases/kernel/syscalls/mbind/Makefile | 21 +- testcases/kernel/syscalls/mbind/mbind01.c | 25 +- testcases/kernel/syscalls/memcmp/Makefile | 14 +- testcases/kernel/syscalls/memcpy/Makefile | 14 +- testcases/kernel/syscalls/memmap/Makefile | 14 +- testcases/kernel/syscalls/memset/Makefile | 14 +- testcases/kernel/syscalls/mincore/Makefile | 14 +- testcases/kernel/syscalls/mkdir/Makefile | 14 +- testcases/kernel/syscalls/mkdirat/Makefile | 14 +- testcases/kernel/syscalls/mknod/Makefile | 14 +- testcases/kernel/syscalls/mknodat/Makefile | 14 +- testcases/kernel/syscalls/mlock/Makefile | 14 +- testcases/kernel/syscalls/mlock/mlock01.c | 2 +- testcases/kernel/syscalls/mlock/mlock02.c | 2 +- testcases/kernel/syscalls/mlockall/Makefile | 14 +- testcases/kernel/syscalls/mmap/Makefile | 14 +- testcases/kernel/syscalls/modify_ldt/Makefile | 14 +- testcases/kernel/syscalls/mount/Makefile | 20 +- testcases/kernel/syscalls/mount/mount03.c | 33 +- .../kernel/syscalls/mount/setuid_test.mode.sh | 15 - testcases/kernel/syscalls/move_pages/Makefile | 49 +- .../kernel/syscalls/move_pages/move_pages01.c | 11 +- .../kernel/syscalls/move_pages/move_pages02.c | 16 +- .../kernel/syscalls/move_pages/move_pages03.c | 16 +- .../syscalls/move_pages/move_pages03.mode.sh | 18 - .../kernel/syscalls/move_pages/move_pages04.c | 26 +- .../kernel/syscalls/move_pages/move_pages05.c | 16 +- .../kernel/syscalls/move_pages/move_pages06.c | 16 +- .../kernel/syscalls/move_pages/move_pages07.c | 16 +- .../kernel/syscalls/move_pages/move_pages08.c | 16 +- .../kernel/syscalls/move_pages/move_pages09.c | 14 +- .../kernel/syscalls/move_pages/move_pages10.c | 16 +- .../kernel/syscalls/move_pages/move_pages11.c | 16 +- .../syscalls/move_pages/move_pages11.mode.sh | 18 - .../syscalls/move_pages/move_pages_support.c | 37 +- .../syscalls/move_pages/move_pages_support.h | 2 + testcases/kernel/syscalls/mprotect/Makefile | 14 +- testcases/kernel/syscalls/mq_notify/Makefile | 15 +- testcases/kernel/syscalls/mq_open/Makefile | 14 +- testcases/kernel/syscalls/mq_timedreceive/Makefile | 15 +- .../syscalls/mq_timedreceive/mq_timedreceive01.c | 49 +- testcases/kernel/syscalls/mq_timedsend/Makefile | 14 +- .../kernel/syscalls/mq_timedsend/mq_timedsend01.c | 48 +- testcases/kernel/syscalls/mq_unlink/Makefile | 15 +- testcases/kernel/syscalls/mremap/Makefile | 28 +- testcases/kernel/syscalls/msync/Makefile | 14 +- testcases/kernel/syscalls/munlock/Makefile | 14 +- testcases/kernel/syscalls/munlockall/Makefile | 14 +- testcases/kernel/syscalls/munmap/Makefile | 14 +- testcases/kernel/syscalls/nanosleep/Makefile | 14 +- testcases/kernel/syscalls/newuname/Makefile | 14 +- testcases/kernel/syscalls/nftw/Makefile | 84 +- testcases/kernel/syscalls/nftw/nftw.c | 11 +- testcases/kernel/syscalls/nftw/nftw64.c | 4 - testcases/kernel/syscalls/nice/Makefile | 14 +- testcases/kernel/syscalls/open/Makefile | 14 +- testcases/kernel/syscalls/openat/Makefile | 14 +- testcases/kernel/syscalls/paging/Makefile | 14 +- testcases/kernel/syscalls/pathconf/Makefile | 14 +- testcases/kernel/syscalls/pause/Makefile | 14 +- testcases/kernel/syscalls/personality/Makefile | 14 +- testcases/kernel/syscalls/pipe/Makefile | 14 +- testcases/kernel/syscalls/pipe2/Makefile | 14 +- testcases/kernel/syscalls/poll/Makefile | 14 +- testcases/kernel/syscalls/ppoll/Makefile | 14 +- testcases/kernel/syscalls/ppoll/ppoll01.c | 4 + testcases/kernel/syscalls/prctl/Makefile | 14 +- testcases/kernel/syscalls/pread/Makefile | 17 +- testcases/kernel/syscalls/profil/Makefile | 14 +- testcases/kernel/syscalls/pselect/Makefile | 19 +- testcases/kernel/syscalls/ptrace/Makefile | 36 +- .../kernel/syscalls/ptrace/make_syscall_list.sh | 7 + testcases/kernel/syscalls/ptrace/ptrace04.c | 19 +- testcases/kernel/syscalls/ptrace/ptrace05.c | 199 + testcases/kernel/syscalls/ptrace/ptrace06.c | 7 +- testcases/kernel/syscalls/ptrace/simple_tracer.c | 99 + .../kernel/syscalls/ptrace/spawn_ptrace_child.h | 21 +- testcases/kernel/syscalls/ptrace/syscalls.h | 17 + testcases/kernel/syscalls/pwrite/Makefile | 14 +- testcases/kernel/syscalls/quotactl/Makefile | 14 +- testcases/kernel/syscalls/quotactl/quotactl01.c | 370 +- testcases/kernel/syscalls/read/Makefile | 14 +- testcases/kernel/syscalls/readdir/Makefile | 14 +- testcases/kernel/syscalls/readlink/Makefile | 14 +- testcases/kernel/syscalls/readlinkat/Makefile | 14 +- testcases/kernel/syscalls/readv/Makefile | 14 +- testcases/kernel/syscalls/reboot/Makefile | 14 +- testcases/kernel/syscalls/recv/Makefile | 14 +- testcases/kernel/syscalls/recvfrom/Makefile | 14 +- testcases/kernel/syscalls/recvmsg/Makefile | 14 +- .../kernel/syscalls/remap_file_pages/Makefile | 14 +- testcases/kernel/syscalls/rename/Makefile | 14 +- testcases/kernel/syscalls/renameat/Makefile | 14 +- testcases/kernel/syscalls/rmdir/Makefile | 14 +- testcases/kernel/syscalls/rt_sigaction/Makefile | 14 +- testcases/kernel/syscalls/rt_sigprocmask/Makefile | 14 +- testcases/kernel/syscalls/rt_sigqueueinfo/Makefile | 14 +- testcases/kernel/syscalls/rt_sigsuspend/Makefile | 14 +- testcases/kernel/syscalls/sbrk/Makefile | 14 +- .../syscalls/sched_get_priority_max/Makefile | 14 +- .../syscalls/sched_get_priority_min/Makefile | 14 +- .../kernel/syscalls/sched_getaffinity/Makefile | 14 +- testcases/kernel/syscalls/sched_getparam/Makefile | 14 +- .../kernel/syscalls/sched_getscheduler/Makefile | 14 +- .../kernel/syscalls/sched_rr_get_interval/Makefile | 14 +- testcases/kernel/syscalls/sched_setparam/Makefile | 14 +- .../kernel/syscalls/sched_setscheduler/Makefile | 15 +- testcases/kernel/syscalls/sched_yield/Makefile | 14 +- testcases/kernel/syscalls/select/Makefile | 14 +- testcases/kernel/syscalls/send/Makefile | 14 +- testcases/kernel/syscalls/sendfile/Makefile | 19 +- testcases/kernel/syscalls/sendmsg/Makefile | 14 +- testcases/kernel/syscalls/sendto/Makefile | 14 +- testcases/kernel/syscalls/set_robust_list/Makefile | 14 +- testcases/kernel/syscalls/set_thread_area/Makefile | 14 +- .../syscalls/set_thread_area/set_thread_area.h | 2 +- .../syscalls/set_thread_area/set_thread_area01.c | 359 +- .../syscalls/set_thread_area/set_thread_area02.c | 392 +- testcases/kernel/syscalls/set_tid_address/Makefile | 14 +- testcases/kernel/syscalls/setdomainname/Makefile | 14 +- testcases/kernel/syscalls/setegid/Makefile | 14 +- testcases/kernel/syscalls/setfsgid/Makefile | 18 +- testcases/kernel/syscalls/setfsuid/Makefile | 18 +- testcases/kernel/syscalls/setgid/Makefile | 18 +- testcases/kernel/syscalls/setgroups/Makefile | 18 +- testcases/kernel/syscalls/sethostname/Makefile | 14 +- testcases/kernel/syscalls/setitimer/Makefile | 14 +- testcases/kernel/syscalls/setpgid/Makefile | 14 +- testcases/kernel/syscalls/setpgrp/Makefile | 14 +- testcases/kernel/syscalls/setpriority/Makefile | 14 +- testcases/kernel/syscalls/setregid/Makefile | 18 +- testcases/kernel/syscalls/setresgid/Makefile | 18 +- testcases/kernel/syscalls/setresuid/Makefile | 18 +- testcases/kernel/syscalls/setreuid/Makefile | 18 +- testcases/kernel/syscalls/setrlimit/Makefile | 14 +- testcases/kernel/syscalls/setsid/Makefile | 14 +- testcases/kernel/syscalls/setsockopt/Makefile | 14 +- testcases/kernel/syscalls/settimeofday/Makefile | 14 +- testcases/kernel/syscalls/setuid/Makefile | 18 +- testcases/kernel/syscalls/sgetmask/Makefile | 14 +- testcases/kernel/syscalls/sigaction/Makefile | 18 +- testcases/kernel/syscalls/sigaltstack/Makefile | 14 +- testcases/kernel/syscalls/sighold/Makefile | 14 +- testcases/kernel/syscalls/signal/Makefile | 14 +- testcases/kernel/syscalls/signalfd/Makefile | 13 +- testcases/kernel/syscalls/signalfd4/Makefile | 14 +- testcases/kernel/syscalls/sigpending/Makefile | 14 +- testcases/kernel/syscalls/sigprocmask/Makefile | 14 +- testcases/kernel/syscalls/sigrelse/Makefile | 14 +- testcases/kernel/syscalls/sigreturn/Makefile | 31 - testcases/kernel/syscalls/sigreturn/sigreturn01.c | 172 - testcases/kernel/syscalls/sigsuspend/Makefile | 14 +- testcases/kernel/syscalls/socket/Makefile | 14 +- testcases/kernel/syscalls/socketcall/Makefile | 14 +- testcases/kernel/syscalls/socketpair/Makefile | 14 +- testcases/kernel/syscalls/sockioctl/Makefile | 14 +- testcases/kernel/syscalls/splice/Makefile | 16 +- testcases/kernel/syscalls/ssetmask/Makefile | 14 +- testcases/kernel/syscalls/stat/Makefile | 18 +- testcases/kernel/syscalls/statfs/Makefile | 18 +- testcases/kernel/syscalls/statvfs/Makefile | 14 +- testcases/kernel/syscalls/stime/Makefile | 14 +- testcases/kernel/syscalls/string/Makefile | 14 +- testcases/kernel/syscalls/swapoff/Makefile | 14 +- testcases/kernel/syscalls/swapoff/swapoff01.c | 12 +- testcases/kernel/syscalls/swapoff/swapoff02.c | 10 + testcases/kernel/syscalls/swapon/Makefile | 21 +- testcases/kernel/syscalls/swapon/swapon01.c | 14 +- testcases/kernel/syscalls/swapon/swapon02.c | 15 +- testcases/kernel/syscalls/swapon/swapon03.c | 24 +- testcases/kernel/syscalls/switch/Makefile | 55 +- testcases/kernel/syscalls/symlink/Makefile | 14 +- testcases/kernel/syscalls/symlinkat/Makefile | 14 +- testcases/kernel/syscalls/sync/Makefile | 14 +- testcases/kernel/syscalls/sync_file_range/Makefile | 14 +- testcases/kernel/syscalls/syscall/Makefile | 14 +- testcases/kernel/syscalls/sysconf/Makefile | 14 +- testcases/kernel/syscalls/sysctl/Makefile | 14 +- testcases/kernel/syscalls/sysfs/Makefile | 14 +- testcases/kernel/syscalls/sysinfo/Makefile | 14 +- testcases/kernel/syscalls/syslog/Makefile | 17 +- testcases/kernel/syscalls/tee/Makefile | 16 +- testcases/kernel/syscalls/time/Makefile | 14 +- .../kernel/syscalls/timer_getoverrun/Makefile | 14 +- testcases/kernel/syscalls/timer_gettime/Makefile | 14 +- testcases/kernel/syscalls/timerfd/Makefile | 14 +- testcases/kernel/syscalls/times/Makefile | 14 +- testcases/kernel/syscalls/times/times01.c | 4 +- testcases/kernel/syscalls/times/times03.c | 13 +- testcases/kernel/syscalls/tkill/Makefile | 14 +- testcases/kernel/syscalls/truncate/Makefile | 19 +- testcases/kernel/syscalls/ulimit/Makefile | 14 +- testcases/kernel/syscalls/umask/Makefile | 14 +- testcases/kernel/syscalls/umount/Makefile | 15 +- testcases/kernel/syscalls/uname/Makefile | 14 +- testcases/kernel/syscalls/unlink/Makefile | 14 +- testcases/kernel/syscalls/unlinkat/Makefile | 14 +- testcases/kernel/syscalls/unshare/Makefile | 14 +- testcases/kernel/syscalls/ustat/Makefile | 14 +- testcases/kernel/syscalls/utils/compat_16.mk | 36 +- testcases/kernel/syscalls/utils/compat_uid.h | 51 + testcases/kernel/syscalls/utils/newer_64.mk | 30 +- testcases/kernel/syscalls/utime/Makefile | 14 +- testcases/kernel/syscalls/utimensat/Makefile | 23 +- .../utimensat/check_for_utimensat_support.c | 14 - testcases/kernel/syscalls/utimes/Makefile | 14 +- testcases/kernel/syscalls/utimes/utimes01.c | 12 +- testcases/kernel/syscalls/vfork/Makefile | 14 +- testcases/kernel/syscalls/vhangup/Makefile | 15 +- testcases/kernel/syscalls/vmsplice/Makefile | 15 +- testcases/kernel/syscalls/wait/Makefile | 14 +- testcases/kernel/syscalls/wait/wait02.c | 4 +- testcases/kernel/syscalls/wait4/Makefile | 14 +- testcases/kernel/syscalls/waitid/Makefile | 14 +- testcases/kernel/syscalls/waitpid/Makefile | 14 +- testcases/kernel/syscalls/write/Makefile | 14 +- testcases/kernel/syscalls/writev/Makefile | 14 +- testcases/kernel/timers/Makefile | 52 +- testcases/kernel/timers/clock_gettime/Makefile | 16 +- testcases/kernel/timers/clock_settime/Makefile | 16 +- testcases/kernel/timers/timer_create/Makefile | 16 +- testcases/kernel/timers/timer_delete/Makefile | 16 +- testcases/kernel/timers/timer_settime/Makefile | 16 +- testcases/lib/Makefile | 31 + testcases/lib/cmdlib.sh | 151 + testcases/lib/net_cmdlib.sh | 40 + testcases/misc/Makefile | 38 +- testcases/misc/crash/Makefile | 64 +- testcases/misc/crash/crash02.c | 23 +- testcases/misc/f00f/Makefile | 66 +- testcases/misc/math/Makefile | 38 +- testcases/misc/math/abs/Makefile | 19 +- testcases/misc/math/atof/Makefile | 19 +- testcases/misc/math/float/Makefile | 52 +- testcases/misc/math/float/bessel/Makefile | 50 +- testcases/misc/math/float/exp_log/Makefile | 51 +- testcases/misc/math/float/exp_log/genexp.c | 2 +- testcases/misc/math/float/iperb/Makefile | 48 +- testcases/misc/math/float/power/Makefile | 48 +- testcases/misc/math/float/thread_code.c | 2 +- testcases/misc/math/float/trigo/Makefile | 48 +- testcases/misc/math/fptests/Makefile | 15 +- testcases/misc/math/nextafter/Makefile | 19 +- testcases/misc/tcore_patch_test_suites/Makefile | 51 +- testcases/network/Makefile | 59 +- .../network/can/filter-tests/run_ltp-can_tests.sh | 2 +- testcases/network/dhcpd/Makefile | 37 +- testcases/network/generate.sh | 56 +- testcases/network/iproute/Makefile | 37 +- testcases/network/iptables/Makefile | 35 +- testcases/network/ipv6/Makefile | 23 - testcases/network/ipv6/echo6/Makefile | 15 - testcases/network/ipv6/echo6/createfile.c | 38 - testcases/network/ipv6/echo6/echo601 | 154 - testcases/network/ipv6/echo6/echoes6.c | 291 - testcases/network/ipv6/finger6/Makefile | 7 - testcases/network/ipv6/finger6/finger601 | 235 - testcases/network/ipv6/perf_lan6/Makefile | 15 - testcases/network/ipv6/perf_lan6/perf_lan6 | 166 - testcases/network/ipv6/perf_lan6/pingpong6.c | 294 - testcases/network/ipv6/ping6/Makefile | 7 - testcases/network/ipv6/ping6/ping601 | 90 - testcases/network/ipv6/sendfile6/Makefile | 18 - testcases/network/ipv6/sendfile6/SF_Server6 | 6 - testcases/network/ipv6/sendfile6/sendfile601 | 142 - testcases/network/ipv6/sendfile6/testsf_c6.c | 112 - testcases/network/ipv6/sendfile6/testsf_s6.c | 185 - testcases/network/ipv6/tcpdump6/Makefile | 7 - testcases/network/ipv6/tcpdump6/tcpdump601 | 98 - testcases/network/lib6/Makefile | 24 +- testcases/network/lib6/runcc.c | 2 +- testcases/network/multicast/Makefile | 37 +- testcases/network/multicast/mc_cmds/Makefile | 38 +- testcases/network/multicast/mc_cmds/mc_cmds | 2 +- testcases/network/multicast/mc_commo/Makefile | 46 +- testcases/network/multicast/mc_commo/mc_commo | 9 +- testcases/network/multicast/mc_member/Makefile | 47 +- testcases/network/multicast/mc_member/mc_member | 2 +- testcases/network/multicast/mc_opts/Makefile | 46 +- testcases/network/multicast/mc_opts/mc_opts | 10 +- testcases/network/nfs/Makefile | 36 +- testcases/network/nfs/fsx-linux/Makefile | 44 +- testcases/network/nfs/nfs01/Makefile | 44 +- testcases/network/nfs/nfs02/Makefile | 42 +- testcases/network/nfs/nfs03/Makefile | 38 +- testcases/network/nfs/nfs04/Makefile | 42 +- testcases/network/nfs/nfs_fsstress/Makefile | 48 +- testcases/network/nfs/nfslock01/Makefile | 55 +- testcases/network/nfs/nfslock01/nfs_flock.c | 2 - testcases/network/nfs/nfslock01/nfs_flock.h | 3 + testcases/network/nfs/nfslock01/nfs_flock_dgen.c | 116 +- testcases/network/nfs/nfslock01/nfs_flock_frk.c | 4 +- testcases/network/nfs/nfslock01/nfs_flock_func.c | 8 +- testcases/network/nfs/nfsstat01/Makefile | 38 +- testcases/network/nfs/nfsstress/Makefile | 45 +- testcases/network/nfsv4/Makefile | 30 +- testcases/network/nfsv4/acl/Makefile | 54 +- testcases/network/nfsv4/acl/random_gen.pyc | Bin 11694 -> 0 bytes testcases/network/nfsv4/locks/Makefile | 45 +- testcases/network/rpc/Makefile | 46 +- testcases/network/rpc/basic_tests/Makefile | 36 +- testcases/network/rpc/basic_tests/rpc01/Makefile | 46 +- testcases/network/rpc/basic_tests/rpc01/rpc01 | 3 +- testcases/network/rpc/basic_tests/rpc01/rpc1.c | 30 +- .../network/rpc/basic_tests/rpc01/rpc_server.c | 49 +- testcases/network/rpc/basic_tests/rpcinfo/Makefile | 38 +- .../network/rpc/basic_tests/rpcinfo/rpcinfo01 | 4 +- testcases/network/rpc/basic_tests/rup/Makefile | 38 +- testcases/network/rpc/basic_tests/rusers/Makefile | 38 +- testcases/network/sctp/Makefile | 68 +- testcases/network/sctp/func_tests/Makefile | 221 +- testcases/network/sctp/lib/Makefile | 73 +- testcases/network/sctp/testlib/Makefile | 85 +- testcases/network/sctp/testlib/sctputil.c | 4 +- testcases/network/sockets/Makefile | 68 +- testcases/network/stress/Makefile | 36 +- testcases/network/stress/broken_ip/Makefile | 45 +- testcases/network/stress/dns/Makefile | 42 +- testcases/network/stress/ftp/Makefile | 44 +- testcases/network/stress/http/Makefile | 42 +- testcases/network/stress/icmp/Makefile | 36 +- .../network/stress/icmp/multi-diffip/Makefile | 48 +- .../network/stress/icmp/multi-diffnic/Makefile | 48 +- testcases/network/stress/icmp/uni-basic/Makefile | 48 +- testcases/network/stress/interface/Makefile | 49 +- testcases/network/stress/multicast/Makefile | 36 +- .../stress/multicast/grp-operation/Makefile | 42 +- .../network/stress/multicast/packet-flood/Makefile | 42 +- .../network/stress/multicast/query-flood/Makefile | 44 +- testcases/network/stress/ns-tools/Makefile | 100 +- testcases/network/stress/ns-tools/check_envval | 9 + testcases/network/stress/route/Makefile | 42 +- testcases/network/stress/ssh/Makefile | 40 +- testcases/network/stress/tcp/Makefile | 36 +- testcases/network/stress/tcp/multi-diffip/Makefile | 56 +- .../network/stress/tcp/multi-diffnic/Makefile | 56 +- .../network/stress/tcp/multi-diffport/Makefile | 56 +- .../network/stress/tcp/multi-sameport/Makefile | 56 +- testcases/network/stress/tcp/uni-basic/Makefile | 56 +- testcases/network/stress/tcp/uni-dsackoff/Makefile | 56 +- .../network/stress/tcp/uni-pktlossdup/Makefile | 56 +- testcases/network/stress/tcp/uni-sackoff/Makefile | 56 +- .../network/stress/tcp/uni-smallsend/Makefile | 56 +- testcases/network/stress/tcp/uni-tso/Makefile | 56 +- testcases/network/stress/tcp/uni-winscale/Makefile | 56 +- testcases/network/stress/udp/Makefile | 36 +- testcases/network/stress/udp/multi-diffip/Makefile | 48 +- .../network/stress/udp/multi-diffnic/Makefile | 48 +- .../network/stress/udp/multi-diffport/Makefile | 48 +- testcases/network/stress/udp/uni-basic/Makefile | 48 +- testcases/network/tcp_cmds/Makefile | 44 +- testcases/network/tcp_cmds/Makefile.inc | 30 + testcases/network/tcp_cmds/arp/Makefile | 38 +- testcases/network/tcp_cmds/arp/arp01 | 116 +- testcases/network/tcp_cmds/echo/Makefile | 53 +- testcases/network/tcp_cmds/echo/createfile.c | 47 +- testcases/network/tcp_cmds/echo/echo01 | 163 +- testcases/network/tcp_cmds/echo/echoes.c | 725 +- testcases/network/tcp_cmds/finger/Makefile | 38 +- testcases/network/tcp_cmds/finger/finger01 | 470 +- testcases/network/tcp_cmds/ftp/Makefile | 47 +- testcases/network/tcp_cmds/ftp/ftp01 | 189 +- testcases/network/tcp_cmds/ftp/ftp02 | 59 +- testcases/network/tcp_cmds/ftp/ftp02_s1 | 13 +- testcases/network/tcp_cmds/ftp/ftp03 | 182 +- testcases/network/tcp_cmds/ftp/ftp04 | 126 +- testcases/network/tcp_cmds/ftp/ftp05 | 137 +- testcases/network/tcp_cmds/ftp/ftp_set_passwd | 2 +- testcases/network/tcp_cmds/host/Makefile | 38 +- testcases/network/tcp_cmds/host/host01 | 92 +- testcases/network/tcp_cmds/include/netdefs.h | 73 + testcases/network/tcp_cmds/netstat/Makefile | 38 +- testcases/network/tcp_cmds/netstat/netstat01 | 74 +- testcases/network/tcp_cmds/perf_lan/Makefile | 59 +- testcases/network/tcp_cmds/perf_lan/perf_lan | 131 +- testcases/network/tcp_cmds/perf_lan/pingpong.c | 795 +-- testcases/network/tcp_cmds/perf_lan/pingpong6.c | 298 + testcases/network/tcp_cmds/ping/Makefile | 38 +- testcases/network/tcp_cmds/ping/ping01 | 77 +- testcases/network/tcp_cmds/rcp/Makefile | 40 +- testcases/network/tcp_cmds/rcp/rcp01 | 166 +- testcases/network/tcp_cmds/rdist/Makefile | 40 +- testcases/network/tcp_cmds/rdist/rdist01 | 258 +- testcases/network/tcp_cmds/rlogin/Makefile | 38 +- testcases/network/tcp_cmds/rsh/Makefile | 38 +- testcases/network/tcp_cmds/rsh/rsh01 | 108 +- testcases/network/tcp_cmds/rwho/Makefile | 38 +- testcases/network/tcp_cmds/rwho/rwho01 | 200 +- testcases/network/tcp_cmds/sendfile/Makefile | 57 +- testcases/network/tcp_cmds/sendfile/sendfile01 | 140 +- testcases/network/tcp_cmds/sendfile/testsf_c.c | 243 +- testcases/network/tcp_cmds/sendfile/testsf_s.c | 359 +- testcases/network/tcp_cmds/ssh/Makefile | 44 +- testcases/network/tcp_cmds/ssh/ssh01 | 72 +- testcases/network/tcp_cmds/ssh/ssh02 | 82 +- testcases/network/tcp_cmds/ssh/ssh03 | 71 +- testcases/network/tcp_cmds/ssh/ssh03_s1 | 1 - testcases/network/tcp_cmds/tcpdump/Makefile | 38 +- testcases/network/tcp_cmds/tcpdump/tcpdump01 | 113 +- testcases/network/tcp_cmds/telnet/Makefile | 37 +- testcases/network/traceroute/Makefile | 35 +- testcases/network/xinetd/Makefile | 37 +- testcases/realtime/Makefile | 120 +- testcases/realtime/configure | 6887 +++++++++++++++++++ testcases/realtime/configure.in | 26 + testcases/realtime/func/Makefile | 57 +- testcases/realtime/func/async_handler/Makefile | 48 +- testcases/realtime/func/gtod_latency/Makefile | 44 +- testcases/realtime/func/hrtimer-prio/Makefile | 47 +- testcases/realtime/func/matrix_mult/Makefile | 47 +- testcases/realtime/func/measurement/Makefile | 43 +- testcases/realtime/func/periodic_cpu_load/Makefile | 44 +- testcases/realtime/func/pi-tests/Makefile | 55 +- testcases/realtime/func/pi-tests/sbrk_mutex.c | 11 +- testcases/realtime/func/pi-tests/testpi-1.c | 10 +- testcases/realtime/func/pi-tests/testpi-2.c | 10 +- testcases/realtime/func/pi-tests/testpi-4.c | 10 +- testcases/realtime/func/pi_perf/Makefile | 48 +- testcases/realtime/func/prio-preempt/Makefile | 48 +- testcases/realtime/func/prio-wake/Makefile | 48 +- .../realtime/func/pthread_kill_latency/Makefile | 48 +- testcases/realtime/func/rt-migrate/Makefile | 48 +- testcases/realtime/func/rt-migrate/rt-migrate.c | 59 +- testcases/realtime/func/sched_football/Makefile | 43 +- testcases/realtime/func/sched_jitter/Makefile | 43 +- testcases/realtime/func/sched_latency/Makefile | 48 +- testcases/realtime/func/thread_clock/Makefile | 43 +- testcases/realtime/include/librttest.h | 1 + testcases/realtime/include/realtime_config.h.in | 61 + testcases/realtime/lib/Makefile | 49 +- testcases/realtime/lib/librttest.c | 7 +- testcases/realtime/lib/libstats.c | 2 +- testcases/realtime/m4/GNUmakefile | 37 + testcases/realtime/m4/Makefile.am | 1 + testcases/realtime/m4/check.m4 | 35 + testcases/realtime/perf/Makefile | 41 +- testcases/realtime/perf/latency/Makefile | 43 +- testcases/realtime/scripts/check_pi.sh | 23 - testcases/realtime/scripts/check_robust.sh | 23 - testcases/realtime/stress/Makefile | 41 +- testcases/realtime/stress/pi-tests/Makefile | 43 +- testscripts/default_runtest_set.awk | 44 + testscripts/ltp-missing-install-files.py | 116 + tools/Makefile | 53 +- tools/apicmds/Makefile | 56 +- tools/genhtml.pl | 10 +- tools/genload/Makefile | 45 +- tools/genload/genload.c | 983 +++ tools/make-file.sh | 12 +- utils/Makefile | 13 +- utils/benchmark/Makefile | 16 +- utils/benchmark/ebizzy-0.3/Makefile | 44 +- 1203 files changed, 59495 insertions(+), 20949 deletions(-) rewrite Makefile (93%) delete mode 100644 README.ltp-devel create mode 100644 README.ltp-devel.in create mode 100644 README.mk-devel create mode 100644 TODO delete mode 100644 config.mk.in create mode 100644 doc/Makefile rewrite doc/man1/Makefile (97%) rewrite doc/man3/Makefile (98%) rewrite include/Makefile (99%) create mode 100644 include/mk/automake.mk create mode 100644 include/mk/config.mk.default create mode 100644 include/mk/config.mk.in create mode 100644 include/mk/env_post.mk create mode 100644 include/mk/env_pre.mk create mode 100644 include/mk/functions.mk create mode 100644 include/mk/generic_leaf_target.inc create mode 100644 include/mk/generic_leaf_target.mk create mode 100644 include/mk/generic_trunk_target.inc create mode 100644 include/mk/generic_trunk_target.mk create mode 100644 include/mk/lib.mk create mode 100644 include/mk/man.mk create mode 100644 include/mk/testcases.mk rewrite lib/Makefile (93%) delete mode 100644 lib/ltp.pc create mode 100644 lib/ltp.pc.in delete mode 100644 ltp-devel.spec create mode 100644 ltp-devel.spec.in rewrite m4/GNUmakefile (97%) delete mode 100644 m4/ac_prog_ar.m4 create mode 100644 m4/ltp-cap.m4 create mode 100644 m4/ltp-numa.m4 create mode 100644 m4/ltp-ptrace.m4 create mode 100644 m4/ltp-quota.m4 create mode 100644 m4/ltp-swaponoff.m4 rewrite m4/ltp-unshare.m4 (100%) create mode 100644 m4/ltp-version.m4 rewrite pan/Makefile (68%) create mode 100644 runtest/Makefile create mode 100644 runtest/fs_ext4 create mode 100644 runtest/ipv6_expect rewrite runtest/ipv6_noexpect (87%) rewrite runtest/ltp-aiodio.part4 (91%) rewrite runtest/rpc (80%) create mode 100644 runtest/tcp_cmds_expect rewrite runtest/tcp_cmds_noexpect (63%) rewrite testcases/Makefile (99%) rewrite testcases/commands/Makefile (99%) rewrite testcases/commands/ade/Makefile (98%) rewrite testcases/commands/ade/ar/Makefile (97%) rewrite testcases/commands/ade/file/Makefile (94%) rewrite testcases/commands/ade/ld/Makefile (97%) rewrite testcases/commands/ade/ldd/Makefile (97%) rewrite testcases/commands/ade/nm/Makefile (97%) rewrite testcases/commands/ade/objdump/Makefile (98%) rewrite testcases/commands/ade/size/Makefile (97%) rewrite testcases/commands/at/Makefile (98%) rewrite testcases/commands/cpio/Makefile (97%) rewrite testcases/commands/cron/Makefile (99%) rewrite testcases/commands/eject/Makefile (98%) rewrite testcases/commands/fileutils/Makefile (96%) rewrite testcases/commands/fileutils/cp/Makefile (94%) rewrite testcases/commands/fileutils/ln/Makefile (94%) rewrite testcases/commands/fileutils/mkdir/Makefile (95%) rewrite testcases/commands/fileutils/mv/Makefile (94%) rewrite testcases/commands/gzip/Makefile (97%) rewrite testcases/commands/logrotate/Makefile (97%) rewrite testcases/commands/mail/Makefile (97%) rewrite testcases/commands/su/Makefile (99%) rewrite testcases/commands/tar/Makefile (97%) rewrite testcases/commands/tpm-tools/Makefile (96%) rewrite testcases/commands/tpm-tools/tpm/Makefile (98%) rewrite testcases/commands/tpm-tools/tpm/tpm_changeauth/Makefile (98%) rewrite testcases/commands/tpm-tools/tpm/tpm_clear/Makefile (97%) rewrite testcases/commands/tpm-tools/tpm/tpm_getpubek/Makefile (97%) rewrite testcases/commands/tpm-tools/tpm/tpm_restrictpubek/Makefile (98%) rewrite testcases/commands/tpm-tools/tpm/tpm_selftest/Makefile (95%) rewrite testcases/commands/tpm-tools/tpm/tpm_takeownership/Makefile (97%) rewrite testcases/commands/tpm-tools/tpm/tpm_version/Makefile (95%) rewrite testcases/commands/tpm-tools/tpmtoken/Makefile (97%) rewrite testcases/commands/tpm-tools/tpmtoken/tpmtoken_import/Makefile (99%) rewrite testcases/commands/tpm-tools/tpmtoken/tpmtoken_init/Makefile (98%) rewrite testcases/commands/tpm-tools/tpmtoken/tpmtoken_objects/Makefile (97%) rewrite testcases/commands/tpm-tools/tpmtoken/tpmtoken_protect/Makefile (98%) rewrite testcases/commands/tpm-tools/tpmtoken/tpmtoken_setpasswd/Makefile (99%) rewrite testcases/commands/unzip/Makefile (91%) rewrite testcases/kernel/Makefile (97%) rewrite testcases/kernel/connectors/Makefile (99%) rewrite testcases/kernel/connectors/pec/Makefile (99%) rewrite testcases/kernel/containers/Makefile (99%) create mode 100644 testcases/kernel/containers/Makefile.inc delete mode 100644 testcases/kernel/containers/check_for_unshare.c delete mode 100644 testcases/kernel/containers/libclone/libnetns.c delete mode 100644 testcases/kernel/containers/mqns/check_mqns_enabled.c create mode 100644 testcases/kernel/containers/netns/common.c delete mode 100644 testcases/kernel/containers/pidns/check_pidns_enabled.c rewrite testcases/kernel/controllers/Makefile (99%) create mode 100644 testcases/kernel/controllers/Makefile.inc rewrite testcases/kernel/controllers/cgroup/Makefile (98%) rewrite testcases/kernel/controllers/cgroup_fj/Makefile (98%) rewrite testcases/kernel/controllers/cpuacct/Makefile (98%) rewrite testcases/kernel/controllers/cpuctl/Makefile (98%) rewrite testcases/kernel/controllers/cpuctl_fj/Makefile (98%) rewrite testcases/kernel/controllers/cpuset/Makefile (99%) create mode 100644 testcases/kernel/controllers/cpuset/Makefile.inc rewrite testcases/kernel/controllers/cpuset/cpuset_base_ops_test/Makefile (97%) rewrite testcases/kernel/controllers/cpuset/cpuset_exclusive_test/Makefile (97%) create mode 100755 testcases/kernel/controllers/cpuset/cpuset_funcs.sh rewrite testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/Makefile (97%) rewrite testcases/kernel/controllers/cpuset/cpuset_hotplug_test/Makefile (99%) rewrite testcases/kernel/controllers/cpuset/cpuset_inherit_test/Makefile (97%) rewrite testcases/kernel/controllers/cpuset/cpuset_lib/Makefile (98%) rewrite testcases/kernel/controllers/cpuset/cpuset_load_balance_test/Makefile (99%) rewrite testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/Makefile (99%) rewrite testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/Makefile (99%) rewrite testcases/kernel/controllers/cpuset/cpuset_memory_test/Makefile (99%) rewrite testcases/kernel/controllers/cpuset/cpuset_syscall_test/Makefile (99%) rewrite testcases/kernel/controllers/freezer/Makefile (98%) delete mode 100755 testcases/kernel/controllers/freezer/run.sh create mode 100755 testcases/kernel/controllers/freezer/run_freezer.sh rewrite testcases/kernel/controllers/io-throttle/Makefile (98%) rewrite testcases/kernel/controllers/libcontrollers/Makefile (97%) rewrite testcases/kernel/controllers/memcg/Makefile (98%) rewrite testcases/kernel/controllers/memcg/functional/Makefile (98%) rewrite testcases/kernel/controllers/memcg/regression/Makefile (98%) rewrite testcases/kernel/controllers/memcg/stress/Makefile (98%) rewrite testcases/kernel/controllers/memctl/Makefile (98%) rewrite testcases/kernel/fs/Makefile (98%) rewrite testcases/kernel/fs/acls/Makefile (76%) rewrite testcases/kernel/fs/doio/Makefile (99%) create mode 100644 testcases/kernel/fs/ext4-new-features/Makefile create mode 100644 testcases/kernel/fs/ext4-new-features/README create mode 100755 testcases/kernel/fs/ext4-new-features/configure create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/Makefile create mode 100755 testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/Makefile create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config0 create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config1 create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config2 create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config3 create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config4 create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config5 create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config6 create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config7 create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-inode-version/Makefile create mode 100755 testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_get_inode_version.sh create mode 100755 testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_inode_version_test.sh create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_test_inode_version.c create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/Makefile create mode 100755 testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/Makefile create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_file_time.c create mode 100755 testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-online-defrag/Makefile create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c create mode 100755 testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/Makefile create mode 100755 testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/Makefile create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_long_dirs.c create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_short_dirs.c create mode 100755 testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh create mode 100644 testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/Makefile create mode 100755 testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh create mode 100755 testcases/kernel/fs/ext4-new-features/ext4_funcs.sh create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/AUTHORS create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/COPYING create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/INSTALL create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/LICENSE create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/Makefile.am create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/Makefile.in create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/README create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/cirlist.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/cirlist.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/config.h.in create mode 100755 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/configure create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/configure.in create mode 100755 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/depcomp create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/examples/profile_everything create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fc.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_thread.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_thread.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/filelist.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/filelist.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fileops.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fileops.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/list.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/list.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/main.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/metaops.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/metaops.h create mode 100755 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/mkinstalldirs create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/parser.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/parser.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/public-description create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rand.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rand.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/registration-description create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rwlock.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rwlock.h create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/stamp-h.in create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/util.c create mode 100644 testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/util.h create mode 100755 testcases/kernel/fs/ext4-new-features/run_ext4_test.sh rewrite testcases/kernel/fs/fs-bench/Makefile (98%) create mode 100644 testcases/kernel/fs/fs-bench/random-access-del-create.c rewrite testcases/kernel/fs/fs_bind/Makefile (99%) rewrite testcases/kernel/fs/fs_bind/bin/Makefile (99%) rewrite testcases/kernel/fs/fs_di/Makefile (98%) rewrite testcases/kernel/fs/fs_inod/Makefile (98%) rewrite testcases/kernel/fs/fs_perms/Makefile (98%) rewrite testcases/kernel/fs/fsstress/Makefile (97%) rewrite testcases/kernel/fs/fsx-linux/Makefile (97%) rewrite testcases/kernel/fs/ftest/Makefile (98%) rewrite testcases/kernel/fs/inode/Makefile (98%) rewrite testcases/kernel/fs/lftest/Makefile (98%) rewrite testcases/kernel/fs/linktest/Makefile (98%) delete mode 100755 testcases/kernel/fs/linktest/linktest.pl create mode 100755 testcases/kernel/fs/linktest/linktest.sh rewrite testcases/kernel/fs/openfile/Makefile (98%) rewrite testcases/kernel/fs/quota_remount/Makefile (99%) rewrite testcases/kernel/include/Makefile (98%) rewrite testcases/kernel/io/Makefile (98%) rewrite testcases/kernel/io/aio/Makefile (99%) rewrite testcases/kernel/io/aio/aio02/Makefile (98%) create mode 100644 testcases/kernel/io/aio/aio02/aio_tio.c delete mode 100644 testcases/kernel/io/aio/aio02/cases/aio_tio.c create mode 100644 testcases/kernel/io/aio/aio02/common.h rewrite testcases/kernel/io/direct_io/Makefile (99%) rewrite testcases/kernel/io/ltp-aiodio/Makefile (99%) rewrite testcases/kernel/io/stress_cd/Makefile (97%) rewrite testcases/kernel/io/stress_floppy/Makefile (97%) rewrite testcases/kernel/io/stress_floppy/generate.sh (93%) rewrite testcases/kernel/io/writetest/Makefile (98%) rewrite testcases/kernel/ipc/Makefile (98%) rewrite testcases/kernel/ipc/ipc_stress/Makefile (98%) rewrite testcases/kernel/ipc/semaphore/Makefile (98%) rewrite testcases/kernel/mem/Makefile (98%) create mode 100644 testcases/kernel/mem/Makefile.inc create mode 100644 testcases/kernel/mem/hugetlb/Makefile.inc rewrite testcases/kernel/mem/hugetlb/hugemmap/Makefile (98%) rewrite testcases/kernel/mem/hugetlb/hugeshmat/Makefile (98%) rewrite testcases/kernel/mem/hugetlb/hugeshmctl/Makefile (98%) rewrite testcases/kernel/mem/hugetlb/hugeshmdt/Makefile (98%) rewrite testcases/kernel/mem/hugetlb/hugeshmget/Makefile (99%) rewrite testcases/kernel/mem/mtest01/Makefile (98%) rewrite testcases/kernel/mem/mtest05/Makefile (98%) rewrite testcases/kernel/mem/mtest06/Makefile (98%) rewrite testcases/kernel/mem/mtest07/Makefile (98%) rewrite testcases/kernel/mem/page/Makefile (98%) rewrite testcases/kernel/mem/shmt/Makefile (98%) rewrite testcases/kernel/module/Makefile (98%) rewrite testcases/kernel/module/delete_module/delete_module03.c (60%) rewrite testcases/kernel/performance_counters/Makefile (98%) rewrite testcases/kernel/pty/Makefile (98%) rewrite testcases/kernel/sched/Makefile (98%) rewrite testcases/kernel/sched/clisrv/Makefile (99%) rewrite testcases/kernel/sched/hyperthreading/Makefile (98%) delete mode 100644 testcases/kernel/sched/hyperthreading/ht_affinity/HTaffinity.c delete mode 100644 testcases/kernel/sched/hyperthreading/ht_affinity/HTutils.c rewrite testcases/kernel/sched/hyperthreading/ht_affinity/Makefile (99%) create mode 100644 testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c create mode 100644 testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c rename testcases/kernel/sched/hyperthreading/ht_affinity/{HTutils.h => ht_utils.h} (100%) delete mode 100644 testcases/kernel/sched/hyperthreading/ht_enabled/HTenabled.c delete mode 100644 testcases/kernel/sched/hyperthreading/ht_enabled/HTutils.c rewrite testcases/kernel/sched/hyperthreading/ht_enabled/Makefile (98%) create mode 100644 testcases/kernel/sched/hyperthreading/ht_enabled/ht_enabled.c create mode 100644 testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c rename testcases/kernel/sched/hyperthreading/ht_enabled/{HTutils.h => ht_utils.h} (100%) delete mode 100644 testcases/kernel/sched/hyperthreading/ht_interrupt/HTinterrupt.c delete mode 100644 testcases/kernel/sched/hyperthreading/ht_interrupt/HTutils.c rewrite testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile (98%) create mode 100644 testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c create mode 100644 testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c rename testcases/kernel/sched/hyperthreading/ht_interrupt/{HTutils.h => ht_utils.h} (100%) rewrite testcases/kernel/sched/process_stress/Makefile (98%) rewrite testcases/kernel/sched/pthreads/Makefile (98%) rewrite testcases/kernel/sched/sched_stress/Makefile (95%) rewrite testcases/kernel/sched/tool/Makefile (98%) rewrite testcases/kernel/security/Makefile (98%) delete mode 100644 testcases/kernel/security/filecaps/check_xattr.c delete mode 100644 testcases/kernel/security/filecaps/makenumcapsh.c rewrite testcases/kernel/security/integrity/Makefile (99%) rewrite testcases/kernel/security/integrity/ima/Makefile (98%) rewrite testcases/kernel/security/integrity/ima/policy/Makefile (97%) rewrite testcases/kernel/security/integrity/ima/src/Makefile (98%) rewrite testcases/kernel/security/integrity/ima/tests/Makefile (97%) rewrite testcases/kernel/security/mmc_security/Makefile (98%) delete mode 100755 testcases/kernel/security/p9auth/checkp9auth.sh rewrite testcases/kernel/security/selinux-testsuite/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/policy/Makefile (93%) rewrite testcases/kernel/security/selinux-testsuite/refpolicy/Makefile (92%) rewrite testcases/kernel/security/selinux-testsuite/tests/Makefile (96%) create mode 100644 testcases/kernel/security/selinux-testsuite/tests/Makefile.inc rewrite testcases/kernel/security/selinux-testsuite/tests/bounds/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/capable_file/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/capable_net/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/capable_sys/Makefile (99%) rewrite testcases/kernel/security/selinux-testsuite/tests/domain_trans/Makefile (100%) rewrite testcases/kernel/security/selinux-testsuite/tests/dyntrace/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/dyntrans/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/entrypoint/Makefile (100%) rewrite testcases/kernel/security/selinux-testsuite/tests/execshare/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/exectrace/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/Makefile (100%) rewrite testcases/kernel/security/selinux-testsuite/tests/fdreceive/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/file/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/inherit/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/ioctl/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/link/Makefile (100%) rewrite testcases/kernel/security/selinux-testsuite/tests/mkdir/Makefile (100%) rewrite testcases/kernel/security/selinux-testsuite/tests/msg/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/open/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/ptrace/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/readlink/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/relabel/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/rename/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/rxdir/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/sem/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/setattr/Makefile (97%) rewrite testcases/kernel/security/selinux-testsuite/tests/setnice/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/shm/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/sigkill/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/stat/Makefile (96%) rewrite testcases/kernel/security/selinux-testsuite/tests/sysctl/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/task_create/Makefile (99%) rewrite testcases/kernel/security/selinux-testsuite/tests/task_getpgid/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/task_getscheduler/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/task_getsid/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/task_setnice/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/task_setpgid/Makefile (99%) rewrite testcases/kernel/security/selinux-testsuite/tests/task_setscheduler/Makefile (98%) rewrite testcases/kernel/security/selinux-testsuite/tests/wait/Makefile (99%) rewrite testcases/kernel/security/smack/Makefile (69%) create mode 100755 testcases/kernel/security/smack/smack_common.sh rewrite testcases/kernel/security/smack/smack_set_onlycap.sh (61%) rewrite testcases/kernel/security/tomoyo/Makefile (96%) rewrite testcases/kernel/syscalls/Makefile (98%) create mode 100644 testcases/kernel/syscalls/geteuid/compat_16.h create mode 100644 testcases/kernel/syscalls/getuid/compat_16.h create mode 100644 testcases/kernel/syscalls/ipc/Makefile.inc delete mode 100644 testcases/kernel/syscalls/lchown/create_link.mode.sh delete mode 100644 testcases/kernel/syscalls/mount/setuid_test.mode.sh delete mode 100755 testcases/kernel/syscalls/move_pages/move_pages03.mode.sh delete mode 100755 testcases/kernel/syscalls/move_pages/move_pages11.mode.sh rewrite testcases/kernel/syscalls/nftw/Makefile (63%) create mode 100755 testcases/kernel/syscalls/ptrace/make_syscall_list.sh create mode 100644 testcases/kernel/syscalls/ptrace/ptrace05.c create mode 100644 testcases/kernel/syscalls/ptrace/simple_tracer.c create mode 100644 testcases/kernel/syscalls/ptrace/syscalls.h rewrite testcases/kernel/syscalls/quotactl/quotactl01.c (75%) rewrite testcases/kernel/syscalls/set_thread_area/set_thread_area01.c (92%) rewrite testcases/kernel/syscalls/set_thread_area/set_thread_area02.c (89%) delete mode 100644 testcases/kernel/syscalls/sigreturn/Makefile delete mode 100644 testcases/kernel/syscalls/sigreturn/sigreturn01.c rewrite testcases/kernel/syscalls/switch/Makefile (72%) create mode 100644 testcases/kernel/syscalls/utils/compat_uid.h delete mode 100644 testcases/kernel/syscalls/utimensat/check_for_utimensat_support.c rewrite testcases/kernel/timers/Makefile (98%) create mode 100644 testcases/lib/Makefile create mode 100644 testcases/lib/cmdlib.sh create mode 100644 testcases/lib/net_cmdlib.sh rewrite testcases/misc/Makefile (98%) rewrite testcases/misc/crash/Makefile (98%) rewrite testcases/misc/f00f/Makefile (98%) rewrite testcases/misc/math/Makefile (98%) rewrite testcases/misc/math/float/Makefile (98%) rewrite testcases/misc/math/float/bessel/Makefile (99%) rewrite testcases/misc/math/float/exp_log/Makefile (99%) rewrite testcases/misc/math/float/iperb/Makefile (98%) rewrite testcases/misc/math/float/power/Makefile (99%) rewrite testcases/misc/math/float/trigo/Makefile (98%) rewrite testcases/misc/tcore_patch_test_suites/Makefile (98%) rewrite testcases/network/Makefile (98%) rewrite testcases/network/dhcpd/Makefile (97%) rewrite testcases/network/iproute/Makefile (96%) rewrite testcases/network/iptables/Makefile (97%) delete mode 100644 testcases/network/ipv6/Makefile delete mode 100644 testcases/network/ipv6/echo6/Makefile delete mode 100644 testcases/network/ipv6/echo6/createfile.c delete mode 100755 testcases/network/ipv6/echo6/echo601 delete mode 100644 testcases/network/ipv6/echo6/echoes6.c delete mode 100644 testcases/network/ipv6/finger6/Makefile delete mode 100755 testcases/network/ipv6/finger6/finger601 delete mode 100644 testcases/network/ipv6/perf_lan6/Makefile delete mode 100755 testcases/network/ipv6/perf_lan6/perf_lan6 delete mode 100644 testcases/network/ipv6/perf_lan6/pingpong6.c delete mode 100644 testcases/network/ipv6/ping6/Makefile delete mode 100755 testcases/network/ipv6/ping6/ping601 delete mode 100644 testcases/network/ipv6/sendfile6/Makefile delete mode 100755 testcases/network/ipv6/sendfile6/SF_Server6 delete mode 100755 testcases/network/ipv6/sendfile6/sendfile601 delete mode 100644 testcases/network/ipv6/sendfile6/testsf_c6.c delete mode 100644 testcases/network/ipv6/sendfile6/testsf_s6.c delete mode 100644 testcases/network/ipv6/tcpdump6/Makefile delete mode 100755 testcases/network/ipv6/tcpdump6/tcpdump601 rewrite testcases/network/multicast/Makefile (98%) rewrite testcases/network/multicast/mc_cmds/Makefile (94%) rewrite testcases/network/multicast/mc_commo/Makefile (97%) rewrite testcases/network/multicast/mc_member/Makefile (98%) rewrite testcases/network/multicast/mc_opts/Makefile (97%) rewrite testcases/network/nfs/Makefile (98%) rewrite testcases/network/nfs/fsx-linux/Makefile (96%) rewrite testcases/network/nfs/nfs01/Makefile (97%) rewrite testcases/network/nfs/nfs02/Makefile (97%) rewrite testcases/network/nfs/nfs03/Makefile (97%) rewrite testcases/network/nfs/nfs04/Makefile (98%) rewrite testcases/network/nfs/nfs_fsstress/Makefile (97%) rewrite testcases/network/nfs/nfslock01/Makefile (98%) rewrite testcases/network/nfs/nfslock01/nfs_flock_dgen.c (86%) rewrite testcases/network/nfs/nfsstat01/Makefile (97%) rewrite testcases/network/nfs/nfsstress/Makefile (98%) rewrite testcases/network/nfsv4/Makefile (99%) rewrite testcases/network/nfsv4/acl/Makefile (98%) delete mode 100644 testcases/network/nfsv4/acl/random_gen.pyc rewrite testcases/network/nfsv4/locks/Makefile (98%) rewrite testcases/network/rpc/Makefile (99%) rewrite testcases/network/rpc/basic_tests/Makefile (98%) rewrite testcases/network/rpc/basic_tests/rpc01/Makefile (97%) rewrite testcases/network/rpc/basic_tests/rpcinfo/Makefile (94%) rewrite testcases/network/rpc/basic_tests/rup/Makefile (94%) rewrite testcases/network/rpc/basic_tests/rusers/Makefile (94%) rewrite testcases/network/sctp/Makefile (98%) rewrite testcases/network/sctp/func_tests/Makefile (72%) rewrite testcases/network/sctp/lib/Makefile (98%) rewrite testcases/network/sctp/testlib/Makefile (98%) rewrite testcases/network/sockets/Makefile (98%) rewrite testcases/network/stress/Makefile (98%) rewrite testcases/network/stress/broken_ip/Makefile (99%) rewrite testcases/network/stress/dns/Makefile (98%) rewrite testcases/network/stress/ftp/Makefile (99%) rewrite testcases/network/stress/http/Makefile (98%) rewrite testcases/network/stress/icmp/Makefile (98%) rewrite testcases/network/stress/icmp/multi-diffip/Makefile (99%) rewrite testcases/network/stress/icmp/multi-diffnic/Makefile (99%) rewrite testcases/network/stress/icmp/uni-basic/Makefile (99%) rewrite testcases/network/stress/interface/Makefile (99%) rewrite testcases/network/stress/multicast/Makefile (98%) rewrite testcases/network/stress/multicast/grp-operation/Makefile (99%) rewrite testcases/network/stress/multicast/packet-flood/Makefile (98%) rewrite testcases/network/stress/multicast/query-flood/Makefile (99%) rewrite testcases/network/stress/ns-tools/Makefile (99%) rewrite testcases/network/stress/route/Makefile (99%) rewrite testcases/network/stress/ssh/Makefile (98%) rewrite testcases/network/stress/tcp/Makefile (98%) rewrite testcases/network/stress/tcp/multi-diffip/Makefile (99%) rewrite testcases/network/stress/tcp/multi-diffnic/Makefile (99%) rewrite testcases/network/stress/tcp/multi-diffport/Makefile (99%) rewrite testcases/network/stress/tcp/multi-sameport/Makefile (99%) rewrite testcases/network/stress/tcp/uni-basic/Makefile (99%) rewrite testcases/network/stress/tcp/uni-dsackoff/Makefile (99%) rewrite testcases/network/stress/tcp/uni-pktlossdup/Makefile (99%) rewrite testcases/network/stress/tcp/uni-sackoff/Makefile (99%) rewrite testcases/network/stress/tcp/uni-smallsend/Makefile (99%) rewrite testcases/network/stress/tcp/uni-tso/Makefile (99%) rewrite testcases/network/stress/tcp/uni-winscale/Makefile (99%) rewrite testcases/network/stress/udp/Makefile (98%) rewrite testcases/network/stress/udp/multi-diffip/Makefile (99%) rewrite testcases/network/stress/udp/multi-diffnic/Makefile (99%) rewrite testcases/network/stress/udp/multi-diffport/Makefile (99%) rewrite testcases/network/stress/udp/uni-basic/Makefile (99%) rewrite testcases/network/tcp_cmds/Makefile (98%) create mode 100644 testcases/network/tcp_cmds/Makefile.inc rewrite testcases/network/tcp_cmds/arp/Makefile (94%) rewrite testcases/network/tcp_cmds/echo/Makefile (96%) rewrite testcases/network/tcp_cmds/echo/echoes.c (75%) rewrite testcases/network/tcp_cmds/finger/Makefile (94%) rewrite testcases/network/tcp_cmds/finger/finger01 (64%) rewrite testcases/network/tcp_cmds/ftp/Makefile (99%) rewrite testcases/network/tcp_cmds/host/Makefile (94%) create mode 100644 testcases/network/tcp_cmds/include/netdefs.h rewrite testcases/network/tcp_cmds/netstat/Makefile (94%) rewrite testcases/network/tcp_cmds/perf_lan/Makefile (97%) rewrite testcases/network/tcp_cmds/perf_lan/pingpong.c (71%) create mode 100644 testcases/network/tcp_cmds/perf_lan/pingpong6.c rewrite testcases/network/tcp_cmds/ping/Makefile (94%) rewrite testcases/network/tcp_cmds/rcp/Makefile (97%) rewrite testcases/network/tcp_cmds/rdist/Makefile (97%) rewrite testcases/network/tcp_cmds/rlogin/Makefile (94%) rewrite testcases/network/tcp_cmds/rsh/Makefile (94%) rewrite testcases/network/tcp_cmds/rwho/Makefile (94%) rewrite testcases/network/tcp_cmds/sendfile/Makefile (98%) rewrite testcases/network/tcp_cmds/sendfile/testsf_c.c (87%) rewrite testcases/network/tcp_cmds/sendfile/testsf_s.c (87%) rewrite testcases/network/tcp_cmds/ssh/Makefile (99%) rewrite testcases/network/tcp_cmds/tcpdump/Makefile (94%) rewrite testcases/network/tcp_cmds/telnet/Makefile (96%) rewrite testcases/network/traceroute/Makefile (97%) rewrite testcases/network/xinetd/Makefile (97%) rewrite testcases/realtime/Makefile (98%) create mode 100755 testcases/realtime/configure create mode 100644 testcases/realtime/configure.in rewrite testcases/realtime/func/Makefile (99%) rewrite testcases/realtime/func/async_handler/Makefile (98%) rewrite testcases/realtime/func/gtod_latency/Makefile (98%) rewrite testcases/realtime/func/hrtimer-prio/Makefile (98%) rewrite testcases/realtime/func/matrix_mult/Makefile (98%) rewrite testcases/realtime/func/measurement/Makefile (98%) rewrite testcases/realtime/func/periodic_cpu_load/Makefile (98%) rewrite testcases/realtime/func/pi-tests/Makefile (98%) rewrite testcases/realtime/func/pi_perf/Makefile (98%) rewrite testcases/realtime/func/prio-preempt/Makefile (98%) rewrite testcases/realtime/func/prio-wake/Makefile (98%) rewrite testcases/realtime/func/pthread_kill_latency/Makefile (98%) rewrite testcases/realtime/func/rt-migrate/Makefile (98%) rewrite testcases/realtime/func/sched_football/Makefile (98%) rewrite testcases/realtime/func/sched_jitter/Makefile (98%) rewrite testcases/realtime/func/sched_latency/Makefile (98%) rewrite testcases/realtime/func/thread_clock/Makefile (98%) create mode 100644 testcases/realtime/include/realtime_config.h.in rewrite testcases/realtime/lib/Makefile (95%) create mode 100644 testcases/realtime/m4/GNUmakefile create mode 100644 testcases/realtime/m4/Makefile.am create mode 100644 testcases/realtime/m4/check.m4 rewrite testcases/realtime/perf/Makefile (98%) rewrite testcases/realtime/perf/latency/Makefile (98%) delete mode 100755 testcases/realtime/scripts/check_pi.sh delete mode 100755 testcases/realtime/scripts/check_robust.sh rewrite testcases/realtime/stress/Makefile (98%) rewrite testcases/realtime/stress/pi-tests/Makefile (98%) create mode 100755 testscripts/default_runtest_set.awk create mode 100755 testscripts/ltp-missing-install-files.py rewrite tools/Makefile (98%) rewrite tools/apicmds/Makefile (99%) rewrite tools/genload/Makefile (97%) create mode 100644 tools/genload/genload.c rewrite utils/benchmark/ebizzy-0.3/Makefile (99%) diff --git a/ChangeLog b/ChangeLog index 21accf13..2d343801 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,1095 @@ +LTP-20091031 + +1) Log Message: +Fix issues in cpu consolidation verification functions: Arguments passed for cpu consolidation was not used appropriatly. Provided TINFO messages to indicate dependency test failures. Signed-off-by: poornima nayak . + +Modified File(s): +ltp/testcases/kernel/power_management/pm_include.sh + +2) Log Message: +Developed new functions and fixed issues causing ilb test failure: CPU Consolidation verification function is fixed to handle variations in CPU utilization. Threshold is selected based on test conducted on 2.6.31 on dual core, quad core & hyper threaded system. Developed new function to generate hyper threaded siblings list and get job count for hyper threaded system and multisocket system. Modified kernbench workload execution time for 5 min, hence test execution time will be reduced further. Developed new functions to stop workload. Signed-off-by: poornima nayak . + +Modified File(s): +ltp/testcases/kernel/power_management/lib/sched_mc.py + +3) Log Message: +Modified ilb test to run with ebizzy as default workload. Signed-off-by: poornima nayak . + +Modified File(s): +ltp/testcases/kernel/power_management/ilb_test.py + +4) Log Message: +Enhanced & Modified cpu_consolidation testcase: We can pass additional argument performance to use the same testcase for Performance test. Fixed issues in cpu consolidation test. Signed-off-by: poornima nayak . + +Modified File(s): +ltp/testcases/kernel/power_management/cpu_consolidation.py + +5) Log Message: +Modified master script to pass appropriate arguments for cpu consolidation test cases. Signed-off-by: poornima nayak . + +Modified File(s): +ltp/testcases/kernel/power_management/runpwtests.sh + +6) Log Message: +utimes: fix failure of utimes01: In /testcases/kernel/syscalls/utimes, case02 expects "EACCES" error. According to utimes's manual: EACCES times is NULL, the caller’s effective user ID does not match the owner of the file, the caller does not have write access to the file, and the caller is not privileged (Linux: does not have either the CAP_DAC_OVERRIDE or the CAP_FOWNER capability). However, now case02's times is not NULL so that it can only get "EPERM". So, change case02's times to NULL to reach its expect. This patch fixes the problem. Signed-off-by: Liu Bo . + +Modified Files: +ltp/testcases/kernel/syscalls/utimes/utimes01.c + +7) Log Message: +network: fix rpc use rsh instead of ssh: rpcinfo01 testcase use ssh to run command on remote machine, which will prompt for authentication and password. I think it is a typo because all network tests use rsh. Signed-off-by: Hushan Jia . + +Modified Files: +ltp/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01 + +8) Log Message: +Fix false success for exp test: if I get it right there is error in ltp-full-20090831/testcases/misc/math/float/exp_log/genexp.c (see genexp_resfile.patch). Resulting file exp_out.ref is wrong, but it is not catch by test - nan_compare.patch make correct nan comparison. Signed-off-by: Pavel Kiryukhin . + +Modified File(s): +ltp/testcases/misc/math/float/thread_code.c +ltp/testcases/misc/math/float/exp_log/genexp.c + +9) Log Message: +IMA tcb policy: Dependency section update. Signed-off-by: Mimi Zohar . + +Modified File(s): +ltp/testcases/kernel/security/integrity/ima/README + +10) Log Message: +Remove `verbose mode' from runltp*: +1. This option really doesn't buy us much in runltp*, and we've almost already run out of options anyhow... +2. Correct some ugly indentation. +Signed-off-by: Garrett Cooper . + +Modified File(s): +ltp/runltp +ltp/runltplite.sh + +11) Log Message: +realtime: Remove printing of cpu affinity masks in pi-tests: Some tests under realtime/func/pi-tests in LTP display junk values for cpu affinity masks: +Start ./testpi-2 +protocol in mutexattr is 1 +Thread 14574 started running with priority 10 on CPU 1110536304 +Thread 14574 at start pthread pol 2 pri 10 - Got global lock +Thread 14575 started running with prio 20 on CPU 1084272752 +Thread 14576 started running with prio 30 on CPU 1118929008 +Thread 14577 started running with prio 40 on CPU 1127321712 +Noise Thread 14578 started running with prio 40 on CPU 1099915376 + +testpi-1 and testpi-4 also report similar wrong values. + +The cause of this problem is the incorrect way in which sched_getaffinity output is used in the tests. I think there is no need to call getaffinity() to know the cpu mask, because we test the return value of setaffinity() before that. The following patch removes all calls to sched_affinity() and removes printing cpu affinity masks. +Signed-off-by: Sripathi Kodi , +Acked-by: Gowrishankar , + +Modified File(s): +ltp/testcases/realtime/func/pi-tests/testpi-1.c +ltp/testcases/realtime/func/pi-tests/testpi-2.c +ltp/testcases/realtime/func/pi-tests/testpi-4.c + +12) Log Message: +fix memcg_function_test's bug: testcase_25() uses a wrong "$?" value , Now use "ret" to record the real "$?" value for test. Signed-off-by: Liu Bo . + +Modified File(s): +ltp/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh + +13) Log Message: +fix possible tst_xxx buffer overrun: Following patch fixes tst_** functions that would segfault for printing messages longer than 2048 chars. Now such message is truncated. Signed-off-by: . + +Modified File(s): +ltp/lib/tst_res.c + +14) Log Message: +Just another printf cleanup: attached patch fixes some more printf formating issues as well as some coding style errors. Signed-off-by: . + +Modified Files: +ltp/testcases/kernel/fs/proc/proc01.c +ltp/testcases/kernel/fs/stream/stream03.c +ltp/testcases/kernel/mem/mtest06/mmap1.c +ltp/testcases/kernel/mem/shmt/shmt05.c +ltp/testcases/kernel/mem/shmt/shmt09.c +ltp/testcases/kernel/mem/vmtests/data_space.c +ltp/testcases/kernel/mem/vmtests/stack_space.c +ltp/testcases/kernel/sched/nptl/nptl01.c +ltp/testcases/kernel/syscalls/close/close08.c +ltp/testcases/kernel/syscalls/dup/dup01.c +ltp/testcases/kernel/syscalls/dup/dup02.c +ltp/testcases/kernel/syscalls/dup/dup03.c +ltp/testcases/kernel/syscalls/dup/dup04.c +ltp/testcases/kernel/syscalls/dup/dup05.c + +15) Log Message: +Remove this test and itś reference anywhere as requested by Cyril Hrubis . Signed-off-by: Subrata Modak . + +Modified Files: +ltp/runtest/syscalls +Removed Files: +ltp/testcases/kernel/syscalls/sigreturn/Makefile +ltp/testcases/kernel/syscalls/sigreturn/sigreturn01.c + +16) Message: +Just before doing a CVS diff I noticed that these binary files made it back into the repository: +testcases/ballista/ballista/blexer +testcases/ballista/ballista/bparser +testcases/ballista/ballista/mut.out +This change removes them again: Signed-off-by: Garrett Cooper . + +Removed Files: +ltp/testcases/ballista/ballista/blexer +ltp/testcases/ballista/ballista/bparser +ltp/testcases/ballista/ballista/mut.out + +17) Log Message: +Byte compiled python files should not be in the repo. + +Removed Files: +ltp/testcases/network/nfsv4/acl/random_gen.pyc + +18) Log Message: +make strptrace() inline to avoid unused warnings + +Modified Files: +ltp/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h + +19) Log Message: +tweak how we notify unsupported arches so the code is always compiled + +Modified Files: +ltp/testcases/kernel/syscalls/ptrace/ptrace04.c + +20) Log Message: +add some simple trace code to help with debugging + +Modified Files: +ltp/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h +Added Files: +ltp/testcases/kernel/syscalls/ptrace/make_syscall_list.sh +ltp/testcases/kernel/syscalls/ptrace/simple_tracer.c syscalls.h + +21) Log Message: +1. Please see README.mk-devel for a full description of the changes from a Make perspective. +2. Several files were changed to accomodate correct installation practices, most notably ones in testcases/network/{ipv6,tcp_cmds}, testcases/kernel/sched/hyperthreading/ht_enabled/..., and some items in tools/..., and also to avoid collisions as far as installed testcases (scripts, compiled C apps) were concerned. +3. Several apps weren't autoconf safe and some autoconf tests and conditional statements have been placed in sourcecode and in Makefiles to either + a) prevent the tests from being built / installed or + b) turn the tests into dummy apps which print out TCONF messages due to lack-of-build support. +Signed-off-by: Garrett Cooper + +Added Files: +ltp/README.ltp-devel.in +ltp/README.mk-devel +ltp/README.mk-user +ltp/TODO +ltp/ltp-devel.spec.in +ltp/doc/Makefile +ltp/include/mk/automake.mk +ltp/include/mk/config.mk.in +ltp/include/mk/env_post.mk +ltp/include/mk/env_pre.mk +ltp/include/mk/functions.mk +ltp/include/mk/generic_leaf_target.inc +ltp/include/mk/generic_leaf_target.mk +ltp/include/mk/generic_trunk_target.inc +ltp/include/mk/generic_trunk_target.mk +ltp/include/mk/lib.mk +ltp/include/mk/man.mk +ltp/include/mk/testcases.mk +ltp/lib/ltp.pc.in +ltp/m4/ltp-cap.m4 +ltp/m4/ltp-numa.m4 +ltp/m4/ltp-ptrace.m4 +ltp/m4/ltp-quota.m4 +ltp/runtest/Makefile +ltp/runtest/ipv6_expect +ltp/runtest/tcp_cmds_expect +ltp/testcases/kernel/containers/Makefile.inc +ltp/testcases/kernel/containers/netns/common.c +ltp/testcases/kernel/controllers/Makefile.inc +ltp/testcases/kernel/controllers/cpuset/Makefile.inc +ltp/testcases/kernel/controllers/cpuset/cpuset_funcs.sh +ltp/testcases/kernel/controllers/freezer/run_freezer.sh +ltp/testcases/kernel/fs/fs-bench/random-access-del-create.c +ltp/testcases/kernel/io/aio/aio02/aio_tio.c +ltp/testcases/kernel/io/aio/aio02/common.h +ltp/testcases/kernel/mem/Makefile.inc +ltp/testcases/kernel/mem/hugetlb/Makefile.inc +ltp/testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c +ltp/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c +ltp/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h +ltp/testcases/kernel/sched/hyperthreading/ht_enabled/ht_enabled.c +ltp/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c +ltp/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h +ltp/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c +ltp/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c +ltp/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h +ltp/testcases/kernel/security/selinux-testsuite/tests/Makefile.inc +ltp/testcases/kernel/security/smack/smack_common.sh +ltp/testcases/kernel/syscalls/ipc/Makefile.inc +ltp/testcases/lib/Makefile +ltp/testcases/lib/cmdlib.sh +ltp/testcases/lib/net_cmdlib.sh +ltp/testcases/network/tcp_cmds/Makefile.inc +ltp/testcases/network/tcp_cmds/include/netdefs.h +ltp/testcases/network/tcp_cmds/perf_lan/pingpong6.c +ltp/testscripts/default_runtest_set.awk +ltp/testscripts/ltp-missing-install-files.py +ltp/tools/genload/genload.c + +Removed Files: +ltp/README.ltp-devel +ltp/config.mk.in +ltp/ltp-devel.spec +ltp/testcases/kernel/containers/check_for_unshare.c +ltp/testcases/kernel/containers/libclone/libnetns.c +ltp/testcases/kernel/containers/mqns/check_mqns_enabled.c +ltp/testcases/kernel/containers/pidns/check_pidns_enabled.c +ltp/testcases/kernel/controllers/freezer/run.sh +ltp/testcases/kernel/sched/hyperthreading/ht_affinity/HTaffinity.c +ltp/testcases/kernel/sched/hyperthreading/ht_affinity/HTutils.c +ltp/testcases/kernel/sched/hyperthreading/ht_affinity/HTutils.h +ltp/testcases/kernel/sched/hyperthreading/ht_enabled/HTenabled.c +ltp/testcases/kernel/sched/hyperthreading/ht_enabled/HTutils.c +ltp/testcases/kernel/sched/hyperthreading/ht_enabled/HTutils.h +ltp/testcases/kernel/sched/hyperthreading/ht_interrupt/HTinterrupt.c +ltp/testcases/kernel/sched/hyperthreading/ht_interrupt/HTutils.c +ltp/testcases/kernel/sched/hyperthreading/ht_interrupt/HTutils.h +ltp/testcases/kernel/security/filecaps/check_xattr.c +ltp/testcases/kernel/security/filecaps/makenumcapsh.c +ltp/testcases/kernel/security/p9auth/checkp9auth.sh +ltp/testcases/kernel/syscalls/lchown/create_link.mode.sh +ltp/testcases/kernel/syscalls/mount/setuid_test.mode.sh +ltp/testcases/kernel/syscalls/move_pages/move_pages03.mode.sh +ltp/testcases/kernel/syscalls/move_pages/move_pages11.mode.sh +ltp/testcases/kernel/syscalls/utimensat/check_for_utimensat_support.c +ltp/testcases/network/ipv6/Makefile +ltp/testcases/network/ipv6/echo6/Makefile +ltp/testcases/network/ipv6/echo6/createfile.c +ltp/testcases/network/ipv6/echo6/echo601 +ltp/testcases/network/ipv6/echo6/echoes6.c +ltp/testcases/network/ipv6/finger6/Makefile +ltp/testcases/network/ipv6/finger6/finger601 +ltp/testcases/network/ipv6/perf_lan6/Makefile +ltp/testcases/network/ipv6/perf_lan6/perf_lan6 +ltp/testcases/network/ipv6/perf_lan6/pingpong6.c +ltp/testcases/network/ipv6/ping6/Makefile +ltp/testcases/network/ipv6/ping6/ping601 +ltp/testcases/network/ipv6/sendfile6/Makefile +ltp/testcases/network/ipv6/sendfile6/SF_Server6 +ltp/testcases/network/ipv6/sendfile6/sendfile601 +ltp/testcases/network/ipv6/sendfile6/testsf_c6.c +ltp/testcases/network/ipv6/sendfile6/testsf_s6.c +ltp/testcases/network/ipv6/tcpdump6/Makefile +ltp/testcases/network/ipv6/tcpdump6/tcpdump601 + +Modified Files: +890 of them + +22) Log Message: +This proposed change makes linktest.pl into linktest.sh, to avoid missing coverage with symlinks and hardlinks due to a lacking perl dependency on the target host. This change has been outstanding for some time in our private copy of LTP and needed to get checked into CVS. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/runtest/fs +ltp/runtest/stress.part1 +ltp/testcases/kernel/fs/linktest/Makefile + +Added Files: +ltp/testcases/kernel/fs/linktest/linktest.sh + +Removed Files: +ltp/testcases/kernel/fs/linktest/linktest.pl + +23) Log Message: +Dependency for all was wrong. + +Modified File(s): +ltp/testcases/kernel/mem/hugetlb/Makefile.inc + +24) Log Message: +The following patch adds a signal() syscall to the ppoll01 testcase. The testcase has a signal handler in it but this signal handler is not registered with the kernel through the signal() syscall. Without the patch the testcase fails when it sends a SIGINT to itself as part of one of the case of the test run. Signed-off-by: Chandru S . + +Modified Files: +ltp/testcases/kernel/syscalls/ppoll/ppoll01.c + +25) Log Message: +File descriptors not cleaned up: This patch for openfile contains the following changes: +- test output to use tst_resm functions, +- sets ups and cleans up tmp dir properly, +- closes all opened file descriptors before thread exit(fixes nfs issues on removing tmp dir), +Signed-off-by: Henry Yei . This test opens multiple file descriptors to the same file. Perhaps the author meant to open file handles for separate files? + +Modified Files: +ltp/testcases/kernel/fs/openfile/openfile.c + + +26) Log Message: +Complete the test cases for getuid16: Some of testcases for *16 and *64 system calls have not been completed yet though my makefile trick were introduced by Suburata. *16 may not be so important but I'd like to complete them anyway. The first one is for getuid16. To apply getuid16.patch use -p0 option. Put compat_uid.h at testcases/kernel/syscalls/utils/compat_uid.h. Put compat_16.h. at testcases/kernel/syscalls/getuid/compat_16.h. Signed-off-by: Masatake YAMATO , + +Modified Files: +ltp/testcases/kernel/syscalls/getuid/Makefile +ltp/testcases/kernel/syscalls/getuid/getuid01.c +ltp/testcases/kernel/syscalls/getuid/getuid02.c +ltp/testcases/kernel/syscalls/getuid/getuid03.c +Added Files: +ltp/testcases/kernel/syscalls/getuid/compat_16.h +ltp/testcases/kernel/syscalls/utils/compat_uid.h + +27) Log Message: +use default size for blks if parsing df output fails to return numeric argument: This patch for rwtest.sh sets a default size for the number of blocks within the filesystem the test is executing on if parsing "df output" somehow results in a non-numeric value(unexpected df output). Also removes trailing whitespace. Garrett, I've attached the patch with your suggested changes. As for making default_sz 1000000, this was to keep to the original functionality, but fix cases where df output was not expected. If you see the original code, if sz > max, than it is capped at max=1000000 as well. Whether ~ 1GB is a good maximum, I'm not sure. Signed-off-by: Henry Yei . + +Modified Files: +ltp/testcases/kernel/fs/doio/rwtest.sh + +28) Log Message: +Move `creating ... directory' to block where: We shouldn't say that we're creating the directory unless we are actually creating the directory. This only leads to potentialconfusion with LTP newbies. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/runltp + +29) Log Message: +While trying to figure out why entries don't get entered in the exec log, I found the following issue with a malloc call. I also fixed a typo and a whacky indentation item as well. Signed-off-by: Garrett Cooper . + +Modified File(s): +ltp/pan/ltp-pan.c + +30) Log Message: +Check in `creating directory' cosmetic item for runltplite.sh as well, just to be consistent. Signed-off-by: Garrett Cooper . + +Modified File(s): +ltp/runltplite.sh + +31) Log Message: +Remove an accidental circular dependency. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/include/mk/automake.mk + +32) Log Message: +autoconf 2.61 / m4 1.4.7 don't define the macro, AC_PROG_AR. This needs to be defined in configure.ac, so those versions will continue to function properly. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/configure.ac + +33) Log Message: +Add copyright tort. Abbreviate. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/m4/ltp-unshare.m4 + +34) Log Message: +AR is defined in configure.ac. Not needed in m4 anymore. Signed-off-by: Garrett Cooper . + +Removed Files: +ltp/m4/ac_prog_ar.m4 + +35) Log Message: +1. Fix taskstats.m4 so it no longer punts out warnings. +2. Add ltp-swaponoff.m4 to properly detect when we're running an older kernel and need linux/swap.h (issue found by compiler team at Cisco). +3. Apply fixes according to 2. to testcases/kernel/syscalls/swap*/*.c. +4. Apply Cyril Hrubis's libcpu_set fix to the .in files and cpuset_lib Makefile and .c file. +5. Block off functionality in getdelays.c with proper preprocessor defines, as per issues after encountered after ltp-taskstats.m4 was fixed. +Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/m4/ltp-taskstats.m4 +ltp/testcases/kernel/syscalls/swapon/swapon01.c +ltp/testcases/kernel/syscalls/swapon/swapon02.c +ltp/testcases/kernel/syscalls/swapon/swapon03.c +ltp/testcases/kernel/controllers/cgroup/getdelays.c +ltp/testcases/kernel/controllers/cpuset/cpuset_lib/Makefile +ltp/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c +ltp/testcases/kernel/syscalls/swapoff/swapoff01.c +ltp/testcases/kernel/syscalls/swapoff/swapoff02.c +ltp/testcases/kernel/include/powerpc.in +ltp/testcases/kernel/include/powerpc64.in +ltp/testcases/kernel/include/s390.in +ltp/configure.ac + +Added Files: +ltp/m4/ltp-swaponoff.m4 + +36) Log Message: +config.mk.in: we're no longer installing directly to the destination directory until install is called, so let's not pick up anything CPPFLAGS-wise from that directory. pingpong6.c: get rid of compile warnings, even though the app will eventually go away. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/network/tcp_cmds/perf_lan/pingpong6.c +ltp/include/mk/config.mk.in + +37) Log Message: +generic_*target.inc: Revive BUILD_DEPS support so dependencies are built prior to building MAKE_TARGETS, for simplicity of design for the end-user. testcases.mk: Apply proper dependency logic, so submakes no longer require building libltp.a beforehand, or linux_syscall_numbers.h, as they are dependencies of all operations that include testcases.mk. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/include/mk/generic_leaf_target.inc +ltp/include/mk/generic_trunk_target.inc +ltp/include/mk/testcases.mk + +38) Log Message: +Rename BUILD_DEPS to MAKE_DEPS to be more consistent with MAKE_TARGETS. Bleh... I've dealt with our build system here at Cisco far too much (BUILD_DEPS is the variable name...). Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/include/mk/generic_leaf_target.inc +ltp/include/mk/generic_trunk_target.inc +ltp/include/mk/testcases.mk + + +39) Log Message: +1. Make linux_syscall_numbers.h dependent on the .in files so that it can be regenerated if and when the files are touched. +2. Add the ppoll(2) syscall number to all architectures, as per each arch specific unistd.h. +Signed-off-by: Nicolas Joly , + +Modified Files: +ltp/testcases/kernel/include/Makefile +ltp/testcases/kernel/include/ia64.in +ltp/testcases/kernel/include/powerpc.in +ltp/testcases/kernel/include/powerpc64.in +ltp/testcases/kernel/include/s390.in +ltp/testcases/kernel/include/sh.in +ltp/testcases/kernel/include/sparc.in +ltp/testcases/kernel/include/sparc64.in +ltp/testcases/kernel/include/x86_64.in + +40) Log Message: +Change use of signal to sigaction for more reliability, fix time issue: Here are three patches the help with the issue where these tests miss a signal and hang. The original patches were created before the latest check-ins by jpalecek@web.de , but I believe they still help. I've regenerated the patches against CVS source and tested on a multi-core machine running MVL6 (x86 2.6.28). The clock_nanosleep01 patch changes signal to the more reliable sigaction(). mq_timedsend01 patch changes from signal() to sigaction() and corrects the time-specs used by the test. Timespec's passed to mq_timedsend are abs time, not relative time. The patch adds the current time to convert relative time to abs time but only if the change won't invalidate the test objective. For example, if the test would have passed -1 for tv_sec to cause an invalid time error, adding the current time would prevent the expected error. mq_timedrecieve01.patch changes from signal() to sigaction() and corrects the time-specs used by the test. Timespec's passed to mq_timedreceive are abs time, not relative time. The patch adds the current time to convert relative time to abs time but only if the change won't invalidate the test objective. For example, if the test would have passed -1 for tv_sec to cause an invalid time error, adding the current time would prevent the expected error. The timeout for SIGINT test is extended to allow time for the signal to arrive. +Original patches provided by Randy Vinson , +Signed-off by: Henry Yei , + +Modified Files: +ltp/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c +ltp/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c +ltp/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c + +41) Log Message: +modify fs scenario to use working directory specified by runltp: This patch modifies the fs scenario to remove hard coded paths with /tmp as well as make sure that tests that take directory arguments use the temporary directory specified by runltp. I've chosen to pass in the temporary directory rather than change the tests themselves for certain tests take a path as an argument. Signed-off by: Henry Yei . + +Modified Files: +ltp/runtest/fs + +42) Log Message: +Modify tests to honor tmp directory passed into runltp, convert to LTP format: This is a set of patches for tests in the fs runtest file which make use of tst_tmpdir functions or alternatively, the base tmpdir set by the user. Some of the tests have been converted to LTP test format as well. Tests that are changed: fs_di, fs_perms, lftest, linker01, quota_remount_test01, writetest. Signed-off by: Henry Yei . + +Modified Files: +ltp/testcases/kernel/fs/fs_di/fs_di +ltp/testcases/kernel/fs/fs_perms/fs_perms.c +ltp/testcases/kernel/fs/fs_perms/fs_perms_simpletest.sh +ltp/testcases/kernel/fs/quota_remount/quota_remount_test01.sh +ltp/testcases/kernel/fs/racer/fs_racer.sh +ltp/testcases/kernel/io/writetest/writetest.c + +43) Log Message: +-laio shouldn't be added to LDLIBS by default. That is just plain wrong. + +Modified Files: +ltp/m4/ltp-eventfd.m4 + +44) Log Message: +1. Honor TMPDIR, as per Henry Yei's note, because linktest.sh doesn't currently do that. +2. Add error checking for cd(1) failure. +3. Suffix the temporary directory with $$ to allow multiple copies to execute on the directory at any given time. +4. Add trap(1)'s to delete the temporary files / directories generated in the script. +gcooper@orangebox /scratch/ltp-dev2/ltp $ testcases/kernel/fs/linktest/linktest.sh 200 1000 +linker01 1 TPASS : Symbolic Link Errors: 0 +linker01 2 TPASS : Hard Link Errors: 0 +Signed-off-by: Garrett Cooper + +Modified Files: +ltp/testcases/kernel/fs/linktest/linktest.sh + +45) Log Message: +1. Fix incrementing call to use POSIX compliant version of incrementing. +2. Add function `is_root' to help test writer determine whether or not the user is root with one uniform command. +Signed-off-by: Garrett Cooper + +Modified Files: +ltp/testcases/lib/cmdlib.sh + +46) Log Message: +The trap signal handler wasn't being disabled on entry thus causing it to be called twice, the first time when tst_cleanup was called; the second when cleanup exited. This fixes that. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/lib/cmdlib.sh + +47) Log Message: +This change (which I'm committing to cvs right now) changes the default to the loopback address: +gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/network/tcp_cmds/ping $ ./ping01 +ping01 0 TINFO : ping with 8 16 32 64 128 256 512 1024 2048 4064 ICMP packets +ping01 0 TINFO : calling ping with packet size = 8 +ping01 0 TINFO : calling ping with packet size = 16 +ping01 0 TINFO : calling ping with packet size = 32 +ping01 0 TINFO : calling ping with packet size = 64 +ping01 0 TINFO : calling ping with packet size = 128 +ping01 0 TINFO : calling ping with packet size = 256 +ping01 0 TINFO : calling ping with packet size = 512 +ping01 0 TINFO : calling ping with packet size = 1024 +ping01 0 TINFO : calling ping with packet size = 2048 +ping01 0 TINFO : calling ping with packet size = 4064 +ping01 0 TINFO : Cleaning up. +ping01 1 TPASS : Test successful +gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/network/tcp_cmds/ping $ +The default can still be changed by specifying the RHOST environment variable. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/network/tcp_cmds/ping/ping01 + +48) Log Message: +The attached patch fixes my issues, but I can't easily verify whether or not it fixes the positive behavior of the testcase itself under all conditions: +<<>> +tag=ima01 stime=1255926150 cmdline=" ima_measurements.sh" contacts="" analysis=exit +<<>> +setup 1 TBROK : Failed to mkdir /sys/kernel/security +setup 1 TBROK : Cannot mount securityfs +setup 0 TINFO : CLEAN: removing /tmp/ltp-VdWwjzuH1v/ima +<<>> +initiation_status="ok" duration=0 termination_type=exited termination_id=1 corefile=no cutime=0 cstime=0 +<<>> +<<>> +tag=ima02 stime=1255926150 cmdline=" ima_policy.sh" contacts="" analysis=exit +<<>> +setup 1 TBROK : Failed to mkdir /sys/kernel/security +setup 1 TBROK : Cannot mount securityfs +setup 0 TINFO : CLEAN: removing /tmp/ltp-VdWwjzuH1v/ima +<<>> +initiation_status="ok" duration=0 termination_type=exited termination_id=1 corefile=no cutime=0 cstime=2 +<<>> +<<>> +tag=ima03 stime=1255926150 cmdline=" ima_tpm.sh" contacts="" analysis=exit +<<>> +setup 1 TBROK : Failed to mkdir /sys/kernel/security +setup 1 TBROK : Cannot mount securityfs +setup 0 TINFO : CLEAN: removing /tmp/ltp-VdWwjzuH1v/ima +<<>> +initiation_status="ok" duration=0 termination_type=exited termination_id=1 corefile=no cutime=1 cstime=1 +<<>> +<<>> +tag=ima04 stime=1255926150 cmdline=" ima_violations.sh" contacts="" analysis=exit +<<>> +setup 1 TBROK : Failed to mkdir /sys/kernel/security +setup 1 TBROK : Cannot mount securityfs +setup 0 TINFO : CLEAN: removing /tmp/ltp-VdWwjzuH1v/ima +incrementing stop +<<>> +initiation_status="ok" duration=0 termination_type=exited termination_id=1 corefile=no cutime=0 cstime=1 +<<>> +Either way, it's a positive move forward so I'm checking this into cvs now. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh +ltp/testcases/kernel/security/integrity/ima/tests/ima_policy.sh +ltp/testcases/kernel/security/integrity/ima/tests/ima_setup.sh +ltp/testcases/kernel/security/integrity/ima/tests/ima_tpm.sh +ltp/testcases/kernel/security/integrity/ima/tests/ima_violations.sh + + +49) Log Message: +1. Add check for locale command with exists command in cmdlib.sh +2. Predefine any and all unbound variables so the set -u call in cmdlib.sh will allow the script to continue on to a failure point of some kind (or succeed if all is defined). +Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/network/stress/ns-tools/check_envval + +50) Log Message: +This is the patch of testcases for the ext4 new features test. It contains multi-block alloc/delayed alloc test, inode version test, journal checksumming test, nanosec timestamps test, online defrag test, persist prealloc test, subdirectory limit test and uninit groups test of ext4. In this test suite, there is two FAIL in the subdirectory limit test. It is because we cann't create more than 32000 subdirectory when block size is small, such as 1024, and the name of every subdirectory is very long, such as every name is 255 bytes. I think it is the bug of the ext4. +Note: Your MUST run configure in the directory testcases/kernel/fs/ext4-new-features to config the tool of ffsb, and specify a partition to be used for test before compiling the tool. The data on the specified partition would be DESTROYED. +Signed-off-by: Miao Xie , +Minor-Segmentation-fault-in-ffsb-fixed-by: Subrata Modak , + +Modified Files: +ltp/README +ltp/testcases/kernel/fs/Makefile + +Added Files: +ltp/runtest/fs_ext4 +ltp/testcases/kernel/fs/ext4-new-features/Makefile +ltp/testcases/kernel/fs/ext4-new-features/README +ltp/testcases/kernel/fs/ext4-new-features/configure +ltp/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh +ltp/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh +ltp/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/Makefile +ltp/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh +ltp/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/Makefile +ltp/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config0 +ltp/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config1 +ltp/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config2 +ltp/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config3 +ltp/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config4 +ltp/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config5 +ltp/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config6 +ltp/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config7 +ltp/testcases/kernel/fs/ext4-new-features/ext4-inode-version/Makefile +ltp/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_get_inode_version.sh +ltp/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_inode_version_test.sh +ltp/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_test_inode_version.c +ltp/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/Makefile +ltp/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh +ltp/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/Makefile +ltp/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_file_time.c +ltp/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh +ltp/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/Makefile +ltp/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c +ltp/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh +ltp/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/Makefile +ltp/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh +ltp/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/Makefile +ltp/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_long_dirs.c +ltp/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_short_dirs.c +ltp/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh +ltp/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/Makefile +ltp/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/AUTHORS +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/COPYING +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/INSTALL +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/LICENSE +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/Makefile.am +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/Makefile.in +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/README +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/aclocal.m4 +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/cirlist.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/cirlist.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/config.guess +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/config.h.in +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/config.sub +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/configure +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/configure.in +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/depcomp +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fc.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_thread.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_thread.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/filelist.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/filelist.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fileops.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fileops.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/install-sh +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/list.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/list.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/main.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/metaops.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/metaops.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/missing +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/mkinstalldirs +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/parser.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/parser.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/public-description +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rand.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rand.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/registration-description +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rwlock.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rwlock.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/stamp-h.in +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/util.c +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/util.h +ltp/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/examples/profile_everything + +51) Log Message: +Fix several out-of-build tree issues with CVS HEAD found while building on-site with Cisco. Some issues were related to changes I made, and some were related to Masatake's getuid changes as well. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/kernel/syscalls/setgroups/Makefile +ltp/testcases/kernel/syscalls/getuid/Makefile +ltp/testcases/kernel/syscalls/getegid/Makefile +ltp/testcases/kernel/syscalls/utils/compat_16.mk +ltp/testcases/kernel/syscalls/utils/newer_64.mk +ltp/include/mk/env_post.mk +ltp/include/mk/testcases.mk +ltp/testcases/kernel/syscalls/getgid/Makefile + +52) Log Message: +- Add additional quota check for RHEL 4.8 as reported by SimonX on #ltp +- Fix m4 file so that items are properly comma delimited, and thus the contents aren't incorrectly concatenated. +Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/m4/ltp-quota.m4 +ltp/testcases/kernel/syscalls/quotactl/quotactl01.c + +53) Log Message: +Fix indentation and a compile error noted by SimonXu on #ltp. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/kernel/syscalls/set_thread_area/set_thread_area.h +ltp/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c +ltp/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c + +54) Log Message: +Fix two broken Makefiles reported by Gowri at IBM. Signed-off-by: Gowri , Reviewed-by: Garrett Cooper , + +Modified Files: +ltp/testcases/realtime/perf/Makefile +ltp/testcases/realtime/stress/Makefile + +55) Log Message: +Check in Makefile, which partially fixes issue with realtime component build breakage. Originally reported by Gowri () at IBM. Signed-off-by: Gowrishankar , Tested-by: Gowrishankar , Acked-by: Sripathi Kodi , + +Modified Files: +ltp/testcases/realtime/Makefile + +56) Log Message: +The format string quantifier is incorrect, and thus the compiler prints out a warning. This changes the format quantifier to %ld to remove the compiler warning. Signed-off-by: Gowrishankar , Tested-by: Gowrishankar , Acked-by: Sripathi Kodi , + +Modified Files: +ltp/testcases/realtime/lib/libstats.c + +57) Log Message: +Fix a typo and a warning related to unchecked results from asprintf, punted by from the compiler. Signed-off-by: Garrett Cooper . + +ltp/testcases/realtime/lib/librttest.c + +58) Log Message: +Add a default config.mk file to ease use for non-autoconf users. Signed-off-by: Garrett Cooper . + +Added Files: +ltp/include/mk/config.mk.default + +59) Log Message: +On second thought, the compiler-related variables should be uncommented. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/include/mk/config.mk.default + +60) Log Message: +1. Get rid of useless documentation (the directions are already in INSTALL). +2. Tell people to read INSTALL instead. +Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/Makefile +Removed Files: +ltp/README.mk-user + +61) Log Message: +Some fixes to make swap* stricter with including sys/swap.h, and defining MAX_SWAPFILES, that were hanging out in my dev branch that weren't checked in. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/kernel/syscalls/swapon/swapon01.c +ltp/testcases/kernel/syscalls/swapon/swapon02.c +ltp/testcases/kernel/syscalls/swapon/swapon03.c +ltp/testcases/kernel/syscalls/swapoff/swapoff01.c +ltp/testcases/kernel/syscalls/swapoff/swapoff02.c + +62) Log Message: +Update the documentation for building and installing LTP as per the Makefile infrastructure changes. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/INSTALL +ltp/README.mk-devel +ltp/README.ltp-devel.in + +63) Log Message: +testcases.mk: Add a freebie compile for the apicmds, if needed so tests can be run before install. config.mk.in: Remove $(DESTDIR)/$(libdir) from the LDFLAGS, because we're no longer installing libraries in all. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/include/mk/testcases.mk +ltp/include/mk/config.mk.in + +64) Log Message: +1. Get rid of psuedo-autoconf scripts in testcases/realtime/scripts. +2. Integrate testcases/realtime with autoconf. +3. Fix compilation, according to report made by Gowri at IBM. +Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/realtime/func/rt-migrate/rt-migrate.c +ltp/testcases/realtime/lib/Makefile +ltp/testcases/realtime/func/pi-tests/Makefile +ltp/testcases/realtime/func/pi-tests/sbrk_mutex.c +ltp/testcases/realtime/scripts/check_pi.sh +ltp/testcases/realtime/scripts/check_robust.sh +ltp/testcases/realtime/Makefile +ltp/testcases/realtime/config.mk +ltp/include/mk/automake.mk +ltp/testcases/realtime/include/librttest.h +ltp/testcases/realtime/m4/GNUmakefile +ltp/testcases/realtime/m4/Makefile.am +ltp/testcases/realtime/m4/check.m4 +Added Files: +ltp/testcases/realtime/configure.in + +65) Log Message: +Get rid of redundant XOPEN2K #define (_GNU_SOURCE covers this). Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/realtime/func/rt-migrate/rt-migrate.c + +66) Log Message: +Make sure the end-user knows that they need to run make autotools from $(top_srcdir), to avoid potential confusion. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/INSTALL + +67) Log Message: +I thought I removed the recursive LDLIBS definition sneak in. Oh well... Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/realtime/lib/Makefile + +68) Log Message: +Accidentally nuking your .c files when running clean isn't a good thing. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/realtime/func/pi-tests/Makefile + +69) Log Message: +lcov: improve derive-func-data option +- rewrite graph file handling +- make derive data look at all lines belonging to a function to find out whether it has been hit or not +- introduce --debug option to better debug problems with graph files +Peter Oberparleiter . + +Modified File(s): +ltp/utils/analysis/lcov/bin/geninfo lcov + +70) Log Message: +Fix temporary file creation in mmapstress tests: these are two little fixes of the mmapstress test: + - the mkstemp() function returns -1 on error; the tests treat 0 as error instead, + - mkstemp() returns a file descriptor; no need to open the file once more later, +Signed-off-by: Jiri Palecek . + +Modified Files: +ltp/testcases/kernel/mem/mmapstress/mmapstress02.c +ltp/testcases/kernel/mem/mmapstress/mmapstress05.c + +71) Log Message: +Change errno reporting mechanism to TERRNO/TTERRNO in msgctl tests: The TERRNO/TTERRNO flags offer more information than the manual errno output used previously in the tests. This patch changes the tst_resm(XXX, ..., errno) and similar statements to tst_resm(XXX|TERRNO, ...). Signed-off-by: Jiri Palecek . + +Modified Files: +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c +ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c + +72) Log Message: +Fix some bashisms: this is another patch fixing bashisms in LTP tests (the fixes are more or less the same as in the previous patches, except for a few exceptions). Note that the patch is not complete, in the sense that there may remain further bashisms in the source even after applying the patch (like use of arrays, which is visible even from this patch). Signed-off-by: Jiri Palecek . + +Modified Files: +ltp/testcases/kernel/controllers/cgroup_fj/cgroup_fj_utility.sh +ltp/testcases/kernel/controllers/cgroup_fj/run_cgroup_test_fj.sh +ltp/testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh +ltp/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +ltp/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +ltp/testcases/kernel/fs/acls/acl_test01 +ltp/testcases/kernel/fs/fs-bench/modaltr.sh +ltp/testcases/kernel/fs/fs_di/fs_di +ltp/testcases/kernel/fs/mongo/test.sh +ltp/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug02.sh +ltp/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug03.sh +ltp/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug04.sh +ltp/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug06.sar.sh +ltp/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug06.top.sh +ltp/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug07.sh +ltp/testcases/network/can/filter-tests/run_ltp-can_tests.sh +ltp/testcases/network/tcp_cmds/netstat/netstat01 + +73) Log Message: +Printf-style format string warnings (TEST_RETURN related): this patch fixes some printf-format string warnings, concerning the TEST_RETURN variable. TEST_RETURN is declared as "long", so it is advisable to use "%ld" in printf format string to avoid undefined behaviour. Note that this patch is not complete - it fixes the warnings in files near the beginning of the alphabet only. Signed-off-by: Jiri Palecek . + +Modified Files: +ltp/testcases/kernel/fs/fs-bench/modaltr.sh +ltp/testcases/kernel/fs/mongo/test.sh +ltp/testcases/kernel/syscalls/fadvise/posix_fadvise01.c +ltp/testcases/kernel/syscalls/fadvise/posix_fadvise02.c +ltp/testcases/kernel/syscalls/fadvise/posix_fadvise03.c +ltp/testcases/kernel/syscalls/fadvise/posix_fadvise04.c +ltp/testcases/kernel/syscalls/fchmod/fchmod01.c +ltp/testcases/kernel/syscalls/fchmod/fchmod06.c +ltp/testcases/kernel/syscalls/fchown/fchown01.c +ltp/testcases/kernel/syscalls/fchown/fchown04.c +ltp/testcases/kernel/syscalls/fcntl/fcntl02.c +ltp/testcases/kernel/syscalls/fcntl/fcntl03.c +ltp/testcases/kernel/syscalls/fcntl/fcntl04.c +ltp/testcases/kernel/syscalls/fcntl/fcntl05.c +ltp/testcases/kernel/syscalls/fcntl/fcntl08.c +ltp/testcases/kernel/syscalls/fcntl/fcntl09.c +ltp/testcases/kernel/syscalls/fcntl/fcntl10.c +ltp/testcases/kernel/syscalls/fcntl/fcntl22.c +ltp/testcases/kernel/syscalls/fcntl/fcntl23.c +ltp/testcases/kernel/syscalls/fcntl/fcntl24.c +ltp/testcases/kernel/syscalls/fcntl/fcntl25.c +ltp/testcases/kernel/syscalls/fcntl/fcntl26.c +ltp/testcases/kernel/syscalls/fdatasync/fdatasync02.c +ltp/testcases/kernel/syscalls/fork/fork01.c +ltp/testcases/kernel/syscalls/fpathconf/fpathconf01.c +ltp/testcases/kernel/syscalls/fstatfs/fstatfs01.c +ltp/testcases/kernel/syscalls/fsync/fsync01.c +ltp/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c +ltp/testcases/kernel/syscalls/getdomainname/getdomainname01.c +ltp/testcases/kernel/syscalls/getegid/getegid01.c +ltp/testcases/kernel/syscalls/getegid/getegid02.c +ltp/testcases/kernel/syscalls/geteuid/geteuid01.c +ltp/testcases/kernel/syscalls/getgid/getgid01.c +ltp/testcases/kernel/syscalls/getgid/getgid03.c +ltp/testcases/kernel/syscalls/gethostname/gethostname01.c +ltp/testcases/kernel/syscalls/getpgrp/getpgrp01.c +ltp/testcases/kernel/syscalls/getpid/getpid01.c +ltp/testcases/kernel/syscalls/getppid/getppid01.c +ltp/testcases/kernel/syscalls/getpriority/getpriority01.c +ltp/testcases/kernel/syscalls/getpriority/getpriority02.c +ltp/testcases/kernel/syscalls/getrusage/getrusage01.c +ltp/testcases/kernel/syscalls/getrusage/getrusage02.c +ltp/testcases/kernel/syscalls/getsockname/getsockname01.c +ltp/testcases/kernel/syscalls/getsockopt/getsockopt01.c +ltp/testcases/kernel/syscalls/gettid/gettid01.c +ltp/testcases/kernel/syscalls/getuid/getuid01.c +ltp/testcases/kernel/syscalls/getuid/getuid02.c +ltp/testcases/kernel/syscalls/getuid/getuid03.c +ltp/testcases/kernel/syscalls/io_cancel/io_cancel01.c +ltp/testcases/kernel/syscalls/io_destroy/io_destroy01.c +ltp/testcases/kernel/syscalls/io_getevents/io_getevents01.c +ltp/testcases/kernel/syscalls/io_setup/io_setup01.c +ltp/testcases/kernel/syscalls/io_submit/io_submit01.c +ltp/testcases/kernel/syscalls/ioperm/ioperm02.c +ltp/testcases/kernel/syscalls/iopl/iopl01.c +ltp/testcases/kernel/syscalls/iopl/iopl02.c +ltp/testcases/kernel/syscalls/lchown/lchown02.c +ltp/testcases/kernel/syscalls/link/link02.c +ltp/testcases/kernel/syscalls/link/link03.c +ltp/testcases/kernel/syscalls/link/link04.c +ltp/testcases/kernel/syscalls/link/link05.c +ltp/testcases/kernel/syscalls/link/link06.c +ltp/testcases/kernel/syscalls/link/link07.c +ltp/testcases/kernel/syscalls/listen/listen01.c +ltp/testcases/kernel/syscalls/llseek/llseek02.c +ltp/testcases/kernel/syscalls/lseek/lseek02.c +ltp/testcases/kernel/syscalls/lseek/lseek03.c +ltp/testcases/kernel/syscalls/lseek/lseek04.c +ltp/testcases/kernel/syscalls/lseek/lseek05.c +ltp/testcases/kernel/syscalls/lseek/lseek06.c +ltp/testcases/kernel/syscalls/lseek/lseek08.c +ltp/testcases/kernel/syscalls/lseek/lseek09.c +ltp/testcases/kernel/syscalls/lseek/lseek10.c +ltp/testcases/kernel/syscalls/lstat/lstat01.c +ltp/testcases/kernel/syscalls/lstat/lstat02.c +ltp/testcases/kernel/syscalls/madvise/madvise01.c +ltp/testcases/kernel/syscalls/madvise/madvise02.c +ltp/testcases/kernel/syscalls/madvise/madvise03.c +ltp/testcases/kernel/syscalls/mlock/mlock01.c +ltp/testcases/kernel/syscalls/mlock/mlock02.c +ltp/testcases/kernel/syscalls/times/times01.c +ltp/testcases/kernel/syscalls/wait/wait02.c +ltp/testcases/network/tcp_cmds/netstat/netstat01 +ltp/testcases/kernel/fs/fs-bench/modaltr.sh +ltp/testcases/kernel/fs/mongo/test.sh +ltp/testcases/network/tcp_cmds/netstat/netstat01 + +74) Log Message: +mem/hugetlb: fix failure of hugemmap03: 1) In mmap's manual, The starting address for the new mapping is specified in addr. So, if mmap's argument "addr" is reachable, the mmap will creates a new mapping in the virtual address space of the call-ing process. The test hugemmap03 will test that a normal page cannot be mapped into a high memory region. This infers that "addr" should be higher for 64-bit mode. 2) The test use "-I2" option, and this not only causes TFAIL's loop, but also causes TPASS's loop. For TFAIL, loop is deserved, nor for TPASS. This patch fixed these problems. Signed-off-by: Liu Bo . + +Modified Files: +ltp/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c + +75) Log Message: +Some fixes of shell scripts of tests: this patch fixes some minor bugs in the code of LTP shell scripts: + - quote arguments of test(1) in some places concerning redhat detection, + - don't execute the result of type(1), it makes no sense - even more when the output of it should be redirected, +Signed-off-by: Jiri Palecek . + +Modified Files: +ltp/testcases/commands/ade/file/file_test.sh +ltp/testcases/commands/cron/cron_allow01 +ltp/testcases/commands/cron/cron_deny01 +ltp/testcases/commands/cron/cron_pos_tests.sh +ltp/testcases/commands/mail/mail_tests.sh +ltp/testcases/commands/su/su01 +ltp/testcases/network/tcp_cmds/rdist/rdist01 + +76) Log Message: +Complete the test cases for geteuid16: Another small patch to complete the test cases for *16. Put compat_16.h to testcases/kernel/syscalls/geteuid. Signed-off-by: Masatake YAMATO . + +Modified Files: +ltp/testcases/kernel/syscalls/geteuid/Makefile +ltp/testcases/kernel/syscalls/geteuid/geteuid01.c +Added Files: +ltp/testcases/kernel/syscalls/geteuid/compat_16.h + +77) Log Message: +Fix failures messages on multi socket hyper threaded system. Signed-off-by: poornima nayak . + +Modified Files: +ltp/testcases/kernel/power_management/runpwtests.sh + +78) Log Message: +Patch to remove hard coded cpu governers. Signed-off-by: poornima nayak . + +Modified Files: +ltp/testcases/kernel/power_management/pwkm_load_unload.sh + +79) Log Message: +Garret added a new testcase for ptrace() syscall: The following calls ptrace(PTRACE_TRACEME, 0) for all signals and validates that all signals apart from SIGKILL are properly intercepted and WIFSTOPPED remains true, and SIGKILL is properly treated as WIFSIGNALED() && WTERMSIG() returns SIGKILL.I looked at it again this weekend, and my criterion for kill (..., 0) was incorrect. The newer version passes, and tests correct criterion, as per the manpage: +1. This test app helped unroot another issue with our custom Linux platform here at Cisco, +2. This test application does function properly on a Gentoo Linux based x86_64 / 2.6.30 kernel however, so it's an issue with our OS platform, +I will add this application to testcases/kernel/syscalls/ptrace, if someone else sees the value in it. I agree that additional error checking could be added for the calls to kill(2)... I just whipped this up in 45 mins after finding this strange behavior on our platform. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/runtest/syscalls +Added Files: +ltp/testcases/kernel/syscalls/ptrace/ptrace05.c + +80) Log Message: +lcov: remove unnecessary warning + +Modified Files: +ltp/utils/analysis/lcov/bin/geninfo + +81) Log Message: +lcov: fix problem with matching filename +- used correct source for filenames +- converted match_filenames to portable version, + +Modified Files: +ltp/utils/analysis/lcov/bin/geninfo + +82) Log Message: +lcov: remove further unneeded warning + use correct source for list of filenames + +Modified Files: +ltp/utils/analysis/lcov/bin/geninfo + +83) Log Message: +lcov: update README to mention required -lgcov switch during linking + +Modified File(s): +ltp/utils/analysis/lcov/README + +84) Log Message: +lcov: further clarification in the README + +Modified Files: +ltp/utils/analysis/lcov/README + +85) Log Message: +Fix a bashism that was pointed out in other files by Jiri Palecek. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/lib/cmdlib.sh + +86) Log Message: +Avoid a possible issue with the test statement for SHELL_DEBUG if the user set it to something nasty like -x. Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/lib/cmdlib.sh + +87) Log Message: +Stupid Garrett. I need to increment the value... Signed-off-by: Garrett Cooper . + +Modified Files: +ltp/testcases/lib/mdlib.sh + LTP-20090930 1) Log Message: diff --git a/INSTALL b/INSTALL index 83f15663..7b95703b 100644 --- a/INSTALL +++ b/INSTALL @@ -1,43 +1,118 @@ -$Id: INSTALL,v 1.25 2009/08/28 05:33:40 subrata_modak Exp $ +$Id: INSTALL,v 1.27 2009/10/25 10:44:14 yaberauneya Exp $ -About configuration +Requirements ------------------- -If you want to use auto configuration, be sure autoconf-2.61 & automake-1.10 are installed. +In order to compile and use pan, you must have bison/yacc and flex installed. -(Latest automake sources can be downloaded from: -ftp://ftp.gnu.org/gnu/automake/automake-1.10.2.tar.gz, +bison can be obtained here: +- http://ftp.gnu.org/gnu/bison/bison-2.4.1.tar.gz -Latest autoconf sources can be downloaded from: -ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz, -ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2, +Berkeley yacc can be obtained here: +- ftp://invisible-island.net/byacc/byacc.tar.gz -Autoconf also requires certain higher version(s) of m4, which can be found from: -http://ftp.gnu.org/gnu/m4/, -http://ftp.gnu.org/gnu/m4/m4-1.4.12.tar.bz2). +flex can be obtained here: +- http://downloads.sourceforge.net/project/flex/flex/flex-2.5.33/flex-2.5.33.tar.bz2 -Then run: - $ make autotools - $ ./configure - $ make all - $ make install +If you want to use auto configuration, be sure autoconf-2.61+ & automake-1.10+ +are installed. -If you get a build error, please report it to ltp-list@lists.sf.net with -following information, +automake-1.10.2's sources can be downloaded from: +- ftp://ftp.gnu.org/gnu/automake/automake-1.10.2.tar.bz2 +- ftp://ftp.gnu.org/gnu/automake/automake-1.10.2.tar.gz + +autoconf-2.61's sources can be downloaded from: +- ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2 +- ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz + +autoconf-2.61 also requires m4-1.4.7+ be installed. Its sources can be +downloaded from: +- http://ftp.gnu.org/gnu/m4/m4-1.4.7.tar.bz2 +- http://ftp.gnu.org/gnu/m4/m4-1.4.7.tar.gz + +Configuring +------------------- +Using autoconf: + $ make autotools # This must be run from "$TOP_SRCDIR!" + $ test -d "$TOP_BUILDDIR" || mkdir -p "$TOP_BUILDDIR" + $ cd "$TOP_BUILDDIR" && "$TOP_SRCDIR/configure" \ + # [configure args go here, e.g. CC=$CC, LDFLAGS=$LDFLAGS, etc] + +Not using autoconf: + + $ test -d "$TOP_BUILDDIR" || mkdir -p "$TOP_BUILDDIR" + $ cp "$TOP_SRCDIR/include/config.h.default" \ + "$TOP_BUILDDIR/include/config.h" + $ cp "$TOP_SRCDIR/include/mk/config.mk.default" \ + "$TOP_BUILDDIR/include/mk/config.mk" + + # Fire up your favorite editor and set each value appropriately in + # include/mk/config.mk. Uncomment all values commented out, such as + # NUMA_LIBS, etc, but only if you're sure that the libraries exist and + # can be linked on your system. + +- $TOP_SRCDIR and $TOP_BUILDDIR are the same for in-build-tree scenarios. +- $TOP_SRCDIR and $TOP_BUILDDIR differ for out-of-build-tree scenarios. + +See the In-build-tree and Out-of-build-tree sections below for more details on +what to do next... - 1. the error output of build tools(make, gcc, etc...) - 2. the output of ./configure - 3. include/config.h - 4. config.mk - 5. config.log +Compiling LTP +------------------- + +In-build-tree +------------------- +In-build-tree support is when you build binaries (applications, binary objects) +in the same directory where the source files reside. + $ make all + $ make \ + "DESTDIR=$SYSROOT" \ + SKIP_IDCHECK=[0|1] \ + install -If you want to use default configuration, autoconf is not needed. Just run: - $ touch include/config.h.default - $ make config.h - $ make all +- Specifying DESTDIR is optional, but required when installing to a non-host + sysroot, as opposed to the host system's sysroot. +- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd} + on the target system's sysroot. + +If you get a build error, please report it to ltp-list@lists.sf.net with +following information, -If make all is failed even if you use the auto configuration, please, report it to -ltp developers with config.log, generated by running the configure script. + 1. The error output before the failure. + 2. If you used configure: + i. include/config.h + ii. include/mk/config.mk + iii. config.log + +Out-of-build-tree +------------------- +Out-of-build-tree support is when you build binaries (applications, binary +objects, generated files) outside of the directory where the source files +reside. This is typically used when cross-compiling for multiple targets. + +NOTE: This is by and large correctly implemented, but there are several corner +case, where this isn't implemented properly. Please see TODO for a list of items +which need fixing in the LTP tree. + + $ mkdir "$OUT_OF_BUILD_TREE_DIR" + $ make \ + -C "$OUT_OF_BUILD_TREE_DIR" \ + -f "$TOP_SRCDIR/Makefile" \ + "top_srcdir=$TOP_SRCDIR" \ + "top_builddir=$OUT_OF_BUILD_TREE_DIR" + $ make \ + -C "$OUT_OF_BUILD_TREE_DIR" \ + -f "$TOP_SRCDIR/Makefile" \ + "top_srcdir=$TOP_SRCDIR" \ + "top_builddir=$OUT_OF_BUILD_TREE_DIR" \ + "DESTDIR=$SYSROOT" \ + SKIP_IDCHECK=[0|1] + install + +- Specifying DESTDIR is optional, but required when installing to a non-host + sysroot, as opposed to the host system's sysroot. +- Specify SKIP_IDCHECK=1 if and when you don't want to modify /etc/{group,passwd} + on the target system's sysroot. Quick Start ----------- @@ -71,20 +146,19 @@ contributions are welcome. unprivileged users, as some tests are run as a different user than root. Hence /root is not a good choice on several distributions. -3. Run "make" to build everything. - *NOTE: Some of the Makefiles (example: pan/Makefile) require the lex (or - flex) package to be installed. +3. Build and install everything, as described above. Note the minimum software + requirements above before doing so. -4. You can run all of the tests sequentially by using the example test - script runalltests.sh. The script is there just to get you started. +4. You can run all of the tests sequentially using the example test script + runalltests.sh. The script is provided to get you started. See ltp-pan(1) for more information on the test driver we have provided. It is simple, but it can do a lot of stuff. NOTE: The diskio and network tests will NOT be run by the runalltests.sh - script. We chose to separate these tests because of their required setup - overhead. + script. They are separate from the other tests because of the additional + required setup overhead. -5. The disk i/o tests can be run by executing the diskio.sh script. In order +5. The disk I/O tests can be run by executing the diskio.sh script. In order for these tests to successfully operate a writable high-density 3.5" floppy must be in the disk drive and a CD-ROM with more than 100Mb of data must be in the CD-ROM drive. The corresponding tests will fail if either disk is @@ -147,55 +221,34 @@ contributions are welcome. Cross compiling --------------- -To cross compile, override one or more of CC, AR, CROSS_CFLAGS, -LOADLIBES, LDFLAGS, & LIB_DIR and be sure to always build from the top level. - -To override them from the make commandline, do something like this: -$ CROSS_COMPILER=/opt/cegl-1.4/hardhat/devkit/ppc/405/bin/powerpc-linux- -$ make \ - CROSS_CFLAGS="-mcpu=403 -D__PPC405__" \ - LDFLAGS=-static \ - LOADLIBES="-lpthread -lc -lresolv -lnss_dns -lnss_files -lm -lc" +To cross compile, you must specify the correct variables: -Alternately, to override them by editing this file, uncomment the -following lines: - CROSS_COMPILER=/opt/ppc64/powerpc64-linux/bin/powerpc64-linux- - CROSS_CFLAGS= -mpowerpc64 - LDFLAGS=-static - LOADLIBES=-lpthread -lc -lresolv -lnss_dns -lnss_files -lm -lc - LIB_DIR=/lib64 - export LOADLIBES LIB_DIR +1. When running configure (CC, CXX, CXXFLAGS, LDLIBS, etc). +2. Manually edit include/mk/config.mk, as described in Configuration. -Or, you can save all your settings into the local 'config.mk' file. -The defaults will not be usable in that case; you will need to -override things explicitly. +Note: Do not specify variables on the command-line. Use config.mk instead. -uClinux Users: make sure you add -DUCLINUX to your CFLAGS - -Note: If you override a variable from the commandline all -assignments to it in the Makefiles will be ignored. To set it both -in the commandline and in the Makefiles use a dummy variable like in -CFLAGS. +uClinux Users +-------------- +Specify UCLINUX=1 when calling make; -DUCLINUX=1 use is deprecated and highly +discouraged. Variables in Makefile ---------------------- -The conventions enforced are the standard ones. LTP isnt redefining any -of the flags from their normal meaning. here's a quick summary: +The conventions enforced are standard ones. Here's a quick summary: -CFLAGS - used when compiling/linking C code (no CPPFLAGS!) +CFLAGS - used when compiling/linking C code, e.g. -D_GNU_SOURCE (no CPPFLAGS!) CXXFLAGS - used when compiling/linking C++ code (no CPPFLAGS!) -CPPFLAGS - used when preprocessor is run (so C/C++ compiling an $(CPP) - checks) - -LDFLAGS - linker flags (no libraries) used when linking +CPPFLAGS - used when preprocessor is run (so C/C++ compiling with $(CPP) + functions, e.g. -I$SYSROOT/usr/include -I$SYSROOT/include -I$SYSROOT -LDLIBS - libraries listed after objects during link +LDFLAGS - linker flags, e.g. "-L$SYSROOT/usr/lib" "-L$SYSROOT/lib". DO NOT + PUT LIBRARIES IN THIS LIST (see LDLIBS for that). -Above list is ideal: Many codes in LTP violates above list especially -about CPPFLAGS. e.g. -I and -D are passed to CFLAGS. +LDLIBS - libraries listed after objects during link, e.g. -lc, -lpthread, + -lltp. -Currently the violation isn't critical. However, it should be fixed. -Patches are welcome. +See README.mk-devel for a more terse description of what's available. diff --git a/Makefile b/Makefile dissimilarity index 93% index e86872e3..b215b799 100644 --- a/Makefile +++ b/Makefile @@ -1,160 +1,200 @@ -# See toplevel INSTALL for build info - -ifdef CROSS_COMPILE -CROSS_COMPILER = $(CROSS_COMPILE) -endif -ifdef CROSS_COMPILER -CC=$(CROSS_COMPILER)gcc -AR=$(CROSS_COMPILER)ar -RANLIB=$(CROSS_COMPILER)ranlib -else -# RANLIB isn't a standard Make variable, which means that when it's exported -# to leaf callers as an empty value, builds fail. -# testcases/network/lib6/Makefile is a prime example. -RANLIB?=ranlib -endif - -HAS_NUMA=$(shell sh tools/scripts/numa_test.sh) - -export CFLAGS += -Wall $(CROSS_CFLAGS) -export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA - -# SKIP_IDCHECK != 1, defaults to previous behavior, which is to execute -# IDcheck.sh at the end of `make install'. -SKIP_IDCHECK ?= 0 - --include config.mk - -VPATH += include m4 -all: config.h config.mk libltp.a - @$(MAKE) -C pan $@ - @$(MAKE) -C testcases $@ - @$(MAKE) -C tools $@ - @$(MAKE) -C utils $@ - @echo - @echo "***********************************************" - @echo "** You now need to do a make install as root **" - @echo "***********************************************" - -install: all - @$(MAKE) -C testcases install - @$(MAKE) -C tools install - @$(MAKE) -C lib install - @$(MAKE) -C include install - @$(MAKE) -C pan install - @$(MAKE) -C m4 install - @$(MAKE) -C doc/man1 install - @$(MAKE) -C doc/man3 install - @$(MAKE) -C utils install -ifneq ($(strip $(SKIP_IDCHECK)),1) - @./IDcheck.sh -endif - -libltp.a: config.h - @$(MAKE) -C lib $@ - -uclinux: uclinux_libltp.a - #@$(MAKE) -C pan all - @$(MAKE) -C testcases uclinux - @$(MAKE) -C tools all - @echo - @echo "*******************************************************" - @echo "** You now need to do a make uclinux_install as root **" - @echo "*******************************************************" - -uclinux_install: uclinux - @$(MAKE) -C testcases uclinux_install - @$(MAKE) -C tools install -ifneq ($(strip $(SKIP_IDCHECK)),1) - @./IDcheck.sh -endif - -uclinux_libltp.a: - @$(MAKE) -C lib UCLINUX=1 libltp.a - -menuconfig: - @./ltpmenu - -clean: ac-clean - @$(MAKE) -C lib $@ - @$(MAKE) -C pan $@ - @$(MAKE) -C tools $@ - @$(MAKE) -C testcases $@ - @$(MAKE) -C utils $@ - -distclean: clean ac-distclean - @$(MAKE) -C include $@ - -maintainer-clean: distclean ac-maintainer-clean - @$(MAKE) -C include $@ - -package: - rpmbuild -ba ltp-devel.spec - - -# -# Autotools related -# -.PHONY: autotools -autotools: aclocal autoconf autoheader automake - -.PHONY: aclocal -aclocal: aclocal.m4 -aclocal.m4: $(wildcard m4/*.m4) - aclocal -I m4 - -.PHONY: autoconf -autoconf: configure -configure: configure.ac aclocal.m4 - autoconf - -.PHONY: autoheader -autoheader: config.h.in -config.h.in: configure.ac $(wildcard m4/*.m4) - autoheader - touch include/$@ -config.h: config.h.default - cp include/config.h.default include/config.h -config.mk: - touch $@ - -.PHONY: automake -AUTOMAKE_FILES = config.guess config.sub install-sh missing -automake: aclocal $(AUTOMAKE_FILES) -$(AUTOMAKE_FILES): m4/Makefile.in -m4/Makefile.in: m4/Makefile.am - automake -c -a - -.PHONY: ac-clean ac-distclean ac-maintainer-clean -ac-clean: - rm -rf autom4te.cache - rm -f config.log config.status -ac-distclean: ac-clean -ac-maintainer-clean: ac-distclean - rm -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in - -# -# Help -# -.PHONY: help -help: - @echo - @echo 'About configuration' - @echo '-------------------' - @echo 'If you want to use auto configuration, ' - @echo 'be sure autoconf and automake are installed. Then run: ' - @echo ' $$ make autotools ' - @echo ' $$ ./configure ' - @echo ' $$ make all ' - @echo - @echo 'If you want to use default configuration, ' - @echo 'autoconf is not needed. Just run: ' - @echo ' $$ touch include/config.h.default ' - @echo ' $$ make config.h ' - @echo ' $$ make all ' - @echo - @echo 'If make all is failed even if you use the ' - @echo 'auto configuration, please, report it to ' - @echo 'ltp developers with config.log, generated ' - @echo 'by running the configure script. ' - @echo +# +# Top-level Makefile for LTP. See INSTALL for more info. +# +# 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. +# +# Garrett Cooper, July 2009 +# + +# Force IDcheck.sh to fix any issues found with $(DESTDIR)/etc/group and +# $(DESTDIR)/etc/passwd automatically when after running the top-level +# install target. +CREATE_ENTRIES ?= 0 + +top_srcdir ?= $(CURDIR) + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/automake.mk + +# This variable is automatically changed from help to all once someone has +# run configure, or the equivalent steps manually, as described in +# README.mk-user. +ifeq ($(wildcard $(top_builddir)/include/config.h),) +.DEFAULT_GOAL := help +else +.DEFAULT_GOAL := all +endif + +.SUFFIXES: +.SUFFIXES: .am .default .h .in .m4 .mk + +vpath %.am $(top_srcdir)/m4 +vpath %.default $(top_srcdir)/include +vpath %.h $(top_srcdir)/include:$(top_builddir)/include +vpath %.in $(top_srcdir)/include +vpath %.m4 $(top_srcdir)/m4 +vpath %.mk $(top_srcdir)/mk:$(top_srcdir)/mk/include + +# Skip running IDcheck.sh at the end of install? +SKIP_IDCHECK ?= 0 + +# User wants uclinux binaries? +UCLINUX ?= 0 + +# User wants uclinux binaries. Do this for backwards compatibility, but +# print out a warning. +ifneq ($(filter uclinux%,$(MAKECMDGOALS)),) +$(warning uclinux* targets will be deprecated in the future.) +$(warning Please specify UCLINUX=1 on the command line to achieve the same) +$(warning functionality.) +UCLINUX := 1 +endif + +export UCLINUX + +# CLEAN_TARGETS: Targets which exist solely in clean. +# COMMON_TARGETS: Targets which exist in all, clean, and install. +# INSTALL_TARGETS: Targets which exist in clean and install (contains +# COMMON_TARGETS). +# BOOTSTRAP_TARGETS: Directories required to bootstrap out-of-build-tree +# support. + +# We're not using uclinux based targets (default). +ifneq ($(UCLINUX),1) +COMMON_TARGETS := pan utils +INSTALL_TARGETS := doc +endif + +COMMON_TARGETS += testcases tools +INSTALL_TARGETS += $(COMMON_TARGETS) runtest +CLEAN_TARGETS += $(COMMON_TARGETS) lib include runtest +BOOTSTRAP_TARGETS := $(sort $(COMMON_TARGETS) $(CLEAN_TARGETS)\ + $(INSTALL_TARGETS)) + +CLEAN_TARGETS := $(addsuffix -clean,$(CLEAN_TARGETS)) +INSTALL_TARGETS := $(addsuffix -install,$(INSTALL_TARGETS)) +MAKE_TARGETS := $(addsuffix -all,$(filter-out lib,$(COMMON_TARGETS))) + +# There's no reason why we should run `all' twice. Otherwise we're just wasting +# 3+ mins of useful CPU cycles on a modern machine, and even more time on an +# overtaxed one, or one where -j => 1 was specified. +all: $(addsuffix -all,$(COMMON_TARGETS)) + +$(MAKE_TARGETS): lib-install + +.PHONY: include-all include-install +include-install: include/config.h include/mk/config.mk include-all + +INSTALL_DIR := $(DESTDIR)/$(prefix) + +# build tree bootstrap targets and $(INSTALL_DIR) target. +$(addprefix $(abs_top_builddir)/,$(BOOTSTRAP_TARGETS)) $(INSTALL_DIR): + mkdir -m 00755 -p "$@" + +## Pattern based subtarget rules. +lib-all: include-install + +lib-install: lib-all + +.SECONDEXPANSION: +$(MAKE_TARGETS) include-all lib-all: %-all: $(abs_top_builddir)/$$* + $(MAKE) -C $* -f "$(abs_top_srcdir)/$*/Makefile" all + +# Let's not conflict with ac-clean, maintainer-clean, etc, so. +.SECONDEXPANSION: +$(filter-out include-clean,$(CLEAN_TARGETS)):: %-clean: $(abs_top_builddir)/$$* + -$(MAKE) -C $* -f "$(abs_top_srcdir)/$*/Makefile" clean + +# Just like everything depends on include-all / -install, we need to get rid +# of include last to ensure that things won't be monkey screwed up. Only do +# this if we're invoking clean or a subclean directly though. +ifneq ($(filter clean,$(MAKECMDGOALS)),) +INCLUDE_CLEAN_RDEP_SUBJECT := $(CLEAN_TARGETS) +else +ifneq ($(filter %clean,$(MAKECMDGOALS)),) +INCLUDE_CLEAN_RDEP_SUBJECT := $(MAKECMDGOALS) +endif +endif + +# Remove potential for circular dependencies. +INCLUDE_CLEAN_RDEPS := $(filter-out include-clean,\ + $(INCLUDE_CLEAN_RDEP_SUBJECT)) + +include-clean:: $(INCLUDE_CLEAN_RDEPS) $(abs_top_builddir)/include + -$(MAKE) -C include -f "$(abs_top_srcdir)/include/Makefile" clean + +# include-install is separate to avoid creating a circular dependency below in +# the install target. +.SECONDEXPANSION: +$(INSTALL_TARGETS) include-install lib-install: %-install: $(abs_top_builddir)/$$* + $(MAKE) -C $* -f "$(abs_top_srcdir)/$*/Makefile" install + +# Just in case configure hasn't been run yet, let's not overambitiously remove +# the $(INSTALL_DIR). +clean:: $(CLEAN_TARGETS) + $(RM) -f Version + $(if $(DESTDIR)$(prefix),-$(RM) -Rf "$(INSTALL_DIR)") + +SRCDIR_INSTALL_SCRIPTS := IDcheck.sh runltp runltplite.sh ver_linux +SRCDIR_INSTALL_READONLY := Version +SRCDIR_INSTALL_TARGETS := $(SRCDIR_INSTALL_SCRIPTS) $(SRCDIR_INSTALL_READONLY) + +# Save space. We only need the first line in ChangeLog for runltp*. +Version: $(top_srcdir)/ChangeLog + head -n 1 "$^" > "$@" + +$(INSTALL_DIR)/Version: Version + install -m 00644 "$(top_builddir)/$(@F)" "$@" + +$(addprefix $(DESTDIR)/$(bindir)/,$(BINDIR_INSTALL_SCRIPTS)) \ +$(addprefix $(INSTALL_DIR)/,$(SRCDIR_INSTALL_SCRIPTS)): %: + install -m 00755 "$(top_srcdir)/$(@F)" "$@" + +INSTALL_TARGETS += $(addprefix $(INSTALL_DIR)/,\ + $(SRCDIR_INSTALL_TARGETS)) + +$(INSTALL_TARGETS): $(INSTALL_DIR) + +## Install +install: $(INSTALL_TARGETS) +ifeq ($(SKIP_IDCHECK),0) + @CREATE_ENTRIES=$(CREATE_ENTRIES) \ + DESTDIR="$(DESTDIR)" \ + "$(top_srcdir)/IDcheck.sh" +else + @echo "*******************************************************" + @echo "** Will not run IDcheck.sh (SKIP_IDCHECK set to 1). **" + @echo "*******************************************************" +endif + +## Misc targets. + +## Help +.PHONY: help +help: + @echo "Please read the Configuration section in $(top_srcdir)/INSTALL" + @exit 1 + +## Menuconfig +menuconfig: + @$(SHELL) "$(top_srcdir)/ltpmenu" + +## Package +package: + @$(RPMBUILD) -ba ltp-devel.spec + +## End misc targets. diff --git a/README b/README index cec6e36d..e98827c5 100644 --- a/README +++ b/README @@ -405,3 +405,21 @@ end 1) Add as many framework as they get added/modifed in the kernel --------------------------------- +--------------------------------- +Enabling Kernel Configuration to test ext4 new features +--------------------------------- +CONFIG_EXT4_FS=y +CONFIG_EXT4DEV_COMPAT=y +CONFIG_EXT4_FS_XATTR=y +CONFIG_EXT4_FS_POSIX_ACL=y +CONFIG_EXT4_FS_SECURITY=y + +Beside that, the following packages are necessary. + e2fsprogs + e2fsprogs-devel + e2fsprogs-libs +And the version of packages must be 1.41.4 or above. + +For more information to build/install/run these tests, look through: +ltp/testcases/kernel/fs/ext4-new-features/README +--------------------------------- diff --git a/README.ltp-devel b/README.ltp-devel deleted file mode 100644 index aa51d440..00000000 --- a/README.ltp-devel +++ /dev/null @@ -1,48 +0,0 @@ -This is a README to describe the ltp-devel.patch functional changes. - -"make install" is to build and install: - - /scratch/ltp-install2/bin/ltp-bump - /scratch/ltp-install2/bin/ltp-pan - /scratch/ltp-install2/bin/ltp-scanner - /scratch/ltp-install2/lib/libltp.a - ${prefix}/share/pkgconfig/ltp.pc - /scratch/ltp-install2/include/ - ${datarootdir}/man - -"make package" is to rpm package what was installed above: - - /usr/src/redhat/RPMS/i386/ltp-devel-1.0-0.0.i386.rpm - -For someone wanting to write a standalone test that uses "libltp.a", then -their Makefile would compile their test program like this: - - test: test.c - cc test.c `pkg-config --cflags --libs ltp` - -To read manual pages, then the developer would type: -(Most Important man pages) - - man usctest - man ltp-pan - man tst_res - man tst_sig - man tst_set_error - man tst_tmpdir - man parse_opts - -(Others) - man ltp-bump - man doio - man iogen - man forker - man pattern - man random_range_seed - man string_to_tokens - man get_attrib - man parse_open_flags - man parse_ranges - man random_range - man rmobj - man str_to_bytes - man write_log diff --git a/README.ltp-devel.in b/README.ltp-devel.in new file mode 100644 index 00000000..55389972 --- /dev/null +++ b/README.ltp-devel.in @@ -0,0 +1,48 @@ +This is a README to describe the ltp-devel.patch functional changes. + +"make install" is to build and install: + + @prefix@/bin/ltp-bump + @prefix@/bin/ltp-pan + @prefix@/bin/ltp-scanner + @prefix@/lib/libltp.a + @datarootdir@/pkgconfig/ltp.pc + @prefix@/include/ + @mandir@ + +"make package" is to rpm package what was installed above: + + /usr/src/redhat/RPMS/i386/ltp-devel-1.0-0.0.i386.rpm + +For someone wanting to write a standalone test that uses "libltp.a", then +the Makefile to compile their test program would look like this: + + test: test.c + $(COMPILE.o) $(OUTPUT_OPTION) $^ `pkg-config --cflags --libs ltp` + +To read manual pages, then the developer would type: +(Most Important man pages) + + man usctest + man ltp-pan + man tst_res + man tst_sig + man tst_set_error + man tst_tmpdir + man parse_opts + +(Others) + man ltp-bump + man doio + man iogen + man forker + man pattern + man random_range_seed + man string_to_tokens + man get_attrib + man parse_open_flags + man parse_ranges + man random_range + man rmobj + man str_to_bytes + man write_log diff --git a/README.mk-devel b/README.mk-devel new file mode 100644 index 00000000..7e09a399 --- /dev/null +++ b/README.mk-devel @@ -0,0 +1,173 @@ +============================== +Introduction +============================== + +The following document briefly describes the steps and methodologies used for +the new and improved Makefile system. + +============================== +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 very 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 (easy 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 (easy of use). + +These items needed to be fixed to reduce maintenance nightmares for the +development community contributing to LTP, as well as the individuals +maintaining the project. + +============================== +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 + +============================== +Make Rules and Make Variables +============================== + +When using make rules, avoid writing adhoc 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. + +$(CXX) : The system C++ compiler. + +$(CPP) : The system C preprocessor. + +$(CFLAGS) : C compiler flags. + +$(CPPFLAGS) : Preprocessor flags, e.g. -I arguments. + +$(CXXFLAGS) : C++ compiler flags, e.g. -I arguments. + +$(DEBUG_CFLAGS) : Debug flags to pass to $(CC), -g, etc. + +$(DEBUG_CXXFLAGS) : Debug flags to pass to $(CXX). + +$(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). + +$(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. + +$(OPT_CXXFLAGS) : Optimization flags to pass to the C++ compiler. + +$(RANLIB) : What to run after archiving a library. + +$(WCFLAGS) : Warning flags to pass to $(CC), e.g. -Werror, + -Wall, etc. + +$(WCXXFLAGS) : Same as $(WCFLAGS), but for $(CXX). + +============================== +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: + +- implicit rules: http://www.gnu.org/software/make/manual/make.html#Implicit-Rules +- variables and expansion: http://www.gnu.org/software/make/manual/make.html#Using-Variables +- origin use: http://www.gnu.org/software/make/manual/make.html#Origin-Function +- vpath use: http://www.gnu.org/software/make/manual/make.html#Directory-Search + +============================== +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/TODO b/TODO new file mode 100644 index 00000000..243ecd35 --- /dev/null +++ b/TODO @@ -0,0 +1,266 @@ +The following items need fixing with the new Makefile infrastructure: + +testcases/Makefile: +1. mce-test doesn't fit cleanly in the build, yet. +2. pounder21 is just broken (wasn't traversed before). +3. Not sure why realtime should still be disabled for build; the aggregated + list was the original list of disabled items for UCLINUX != 1. + +testcases/ballista: +1. a) Not integrated with the Make infrastructure (and thus the output isn't + guaranteed to function with cross-compilation based envs). + b) Is a mess (there's a lot of shoddy Make and perl code that I'm cleaning + up right now). + c) Uses cshell for some weird arse reason, instead of using Bourne shell + compat scripts. + +testcases/commands/ade/Makefile: +1. .../objdump's Makefile needs fixing. Basically some of the obj files used + as stimuli are .o files, which a) is a bad idea, and b) are intermediary's + for some apps. Either the tests or the Makefiles need to be fixed, and + this is a call that needs to be made by someone else including myself. + +testcases/commands/unzip/Makefile: + +1. This test requires a test zip file in order to function and it isn't + generated at build time anymore: + +<<>> +tag=unzip01 stime=1255544779 +cmdline="unzip_tests.sh $LTPROOT/testcases/commands/unzip/tst_unzip_file.zip" +contacts="" +analysis=exit +<<>> +stat: cannot stat `/tests/ltp/testcases/commands/unzip/tst_unzip_file.zip': No such file or directory +/tests/ltp/testcases/bin/31631.H31633 /tests/ltp/testcases/bin +/tests/ltp/testcases/bin +unzip01 0 TINFO : CLEAN: removing "31631.H31633" +<<>> +initiation_status="ok" +duration=1 termination_type=exited termination_id=1 corefile=no +cutime=2 cstime=1 +<<>> + +testcases/kernel/containers/container_test.sh: + +1. The check_for_unshare, check_mqns_enabled, check_pidns_enabled, and + check_netns_enabled commands applications were removed because (at first + glance) they appeared to only be used for conditional building when users + compiled LTP with the old makefile infrastructure. After inspecting the + runtime logs though, it appears to be used at runtime too. Maybe the logic + that was removed should be added to the testcases that require it as a + common file? + +<<>> +tag=Containers stime=1255508072 +cmdline="container_test.sh" +contacts="" +analysis=exit +<<>> +/tests/ltp/testcases/bin/container_test.sh: line 13: check_for_unshare: command not found +Running utsns tests. +unshare tests + +/tests/ltp/testcases/bin/container_test.sh: line 49: check_pidns_enabled: command not found +Process id namespaces not enabled in kernel. Not running pidns tests. +/tests/ltp/testcases/bin/container_test.sh: line 57: check_mqns_enabled: command not found +Posix message queues or ipc namespaces not enabled in kernel. +Not running mqns tests. +/tests/ltp/testcases/bin/container_test.sh: line 66: check_netns_enabled: command not found +Network namespaces not enabled in kernel. Not running netns tests. + +testcases/kernel/controllers/memcg/functional/Makefile: +1. For whatever reason this Makefile's are calling up relative CPPFLAGS + (the old ../../../../include value) for -I$(include), despite the fact that + the Makefile infra been updated. This should be investigated and fixed, but + for now it's just an observation; not a blocking point. + +testcases/kernel/fs/dmapi/Makefile: +1. This test requires JFS support, which most systems don't have. So a set of + proper autoconf tests need to be added for this as well. + +testcases/kernel/fs/doio/rwtest.sh: +1. rwtest.sh isn't determining where to pick up the files from appropriately + (bad relative path logic somewhere... not sure where). + +testcases/kernel/sched/nptl/Makefile: +1. There's a $(shell ) call in the Makefile that needs to be replaced. + +testcases/kernel/syscalls/utils/*.mk: +1. There are unused variables and unneeded logic that needs to be evaluated + and potentially removed. + +testcases/misc/crash/crash02.c: +#if defined(__ia64__) + SYS_clone2, +#else + /* + * No SYS_fork(vfork) on IA-64. Instead, it uses, + * clone(child_stack=0, flags=CLONE_VM|CLONE_VFORK|SIGCHLD) + * clone2() + */ + + /* + * NOTE (garrcoop): + * Could not find reference to SYS_fork(vfork) on mips32 + * with the Montavista / Octeon toolchain. Need to develop an + * autoconf check for this item. + */ +#if defined(__NR_vfork) && __NR_vfork + SYS_vfork, +#endif +#if defined(__NR_fork) && __NR_fork + SYS_fork, +#endif +#endif /* __ia64__ */ +#if defined(__NR_clone) && __NR_clone + SYS_clone, +#endif + +testcases/network/multicast/...: +1. These tests need to be fixed because they use make / install logic in the + tests: + +<<>> +tag=mc_opts stime=1255502705 +cmdline="export TCsrc=$LTPROOT/testcases/network/multicast/mc_opts; mc_opts" +contacts="" +analysis=exit +<<>> +gethostbyname*: Host name lookup failure +install: cannot stat `/tests/ltp/opts': No such file or directory +install: cannot stat `/tests/ltp/opts_e': No such file or directory +mc_opts: doing /tests/ltp/testcases/bin/mc_opts. +Running mc_opts opts_e on +/tests/ltp/testcases/bin/mc_opts: line 86: /tests/ltp/bin/mc_opts13780/opts: No such file or directory +mc_opts: doing /tests/ltp/testcases/bin/mc_opts. +mc_opts: doing /tests/ltp/testcases/bin/mc_opts +Test Failed: opts failed +<<>> +initiation_status="ok" +duration=1 termination_type=exited termination_id=1 corefile=no +cutime=1 cstime=6 +<<>> + +testcases/network/rpc/rpc-tirpc-full-test-suite: +1. This needs to be integrated into the build with a Makefile, as it's not + getting copied over with the install. + +testcases/network/tcp_cmds/perf_lan/Makefile: +1. There are duplicate sourcefiles because I don't feel confident as far as + the changes were concerned on the sourcefiles and I was running into + compile issues with the IPv6 code. + +testcases/network/stress/udp/...: +1. Many of the scripts are installing themselves using the old-status quo + method of hardlinking into $(abs_top_srcdir)/testcases/bin, which means + that all of the scripts are being linked to the file + $(abs_top_srcdir)/testcases/bin . + +tools/Makefile: +1. netpipe* needs fixing and reorg, because it's referencing /home/mpich, etc. + +utils/benchmark/Makefile: +1. kernbench needs to be fixed because its makefile doesn't have support + out-of-build-tree building. + +Other items of issue are listed below (from testscripts/ltp-missing-install-files.py): + +io-output.log: Tag | App +io-output.log: runfstests.sh runfstests.sh +ipv6-output.log: Tag | App +ipv6-output.log: finger601 finger601 +ipv6-output.log: ping601 ping601 +ipv6-output.log: rlogin01 rlogin01 +ipv6-output.log: tcpdump601 tcpdump601 +ipv6-output.log: telnet01 telnet01 +ipv6_expect-output.log: Tag | App +ipv6_expect-output.log: rlogin01 rlogin01 +ipv6_noexpect-output.log: Tag | App +ipv6_noexpect-output.log: /scratch/ltp-install5/testcases/bin/echo01 /scratch/ltp-install5/testcases/bin/createfile +modules-output.log: Tag | App +modules-output.log: delete_module01 delete_module01 +modules-output.log: delete_module02 delete_module02 +modules-output.log: delete_module03 delete_module03 +multicast-output.log: Tag | App +multicast-output.log: /scratch/ltp-install5/testcases/bin/mc_opts /scratch/ltp-install5/bin/mc_opts9521/opts +selinux-output.log: Tag | App +selinux-output.log: selinux_capable_file.sh selinux_capable_file.sh +selinux-output.log: selinux_capable_net.sh selinux_capable_net.sh +selinux-output.log: selinux_capable_sys.sh selinux_capable_sys.sh +selinux-output.log: selinux_domain_trans.sh selinux_domain_trans.sh +selinux-output.log: selinux_entrypoint.sh selinux_entrypoint.sh +selinux-output.log: selinux_execshare.sh selinux_execshare.sh +selinux-output.log: selinux_exectrace.sh selinux_exectrace.sh +selinux-output.log: selinux_execute_no_trans.sh selinux_execute_no_trans.sh +selinux-output.log: selinux_fdreceive.sh selinux_fdreceive.sh +selinux-output.log: selinux_file.sh selinux_file.sh +selinux-output.log: selinux_inherit.sh selinux_inherit.sh +selinux-output.log: selinux_ioctl.sh selinux_ioctl.sh +selinux-output.log: selinux_link.sh selinux_link.sh +selinux-output.log: selinux_mkdir.sh selinux_mkdir.sh +selinux-output.log: selinux_msg.sh selinux_msg.sh +selinux-output.log: selinux_open.sh selinux_open.sh +selinux-output.log: selinux_ptrace.sh selinux_ptrace.sh +selinux-output.log: selinux_readlink.sh selinux_readlink.sh +selinux-output.log: selinux_relabel.sh selinux_relabel.sh +selinux-output.log: selinux_rename.sh selinux_rename.sh +selinux-output.log: selinux_rxdir.sh selinux_rxdir.sh +selinux-output.log: selinux_sem.sh selinux_sem.sh +selinux-output.log: selinux_setattr.sh selinux_setattr.sh +selinux-output.log: selinux_setnice.sh selinux_setnice.sh +selinux-output.log: selinux_shm.sh selinux_shm.sh +selinux-output.log: selinux_sigkill.sh selinux_sigkill.sh +selinux-output.log: selinux_stat.sh selinux_stat.sh +selinux-output.log: selinux_sysctl.sh selinux_sysctl.sh +selinux-output.log: selinux_task_create.sh selinux_task_create.sh +selinux-output.log: selinux_task_getpgid.sh selinux_task_getpgid.sh +selinux-output.log: selinux_task_getscheduler.sh selinux_task_getscheduler.sh +selinux-output.log: selinux_task_getsid.sh selinux_task_getsid.sh +selinux-output.log: selinux_task_setnice.sh selinux_task_setnice.sh +selinux-output.log: selinux_task_setpgid.sh selinux_task_setpgid.sh +selinux-output.log: selinux_task_setscheduler.sh selinux_task_setscheduler.sh +selinux-output.log: selinux_wait.sh selinux_wait.sh +selinux-output.log: selinux_dyntrace.sh selinux_dyntrace.sh +selinux-output.log: selinux_dyntrans.sh selinux_dyntrans.sh +selinux-output.log: selinux_bounds.sh selinux_bounds.sh +stress.part3-output.log: Tag | App +stress.part3-output.log: /scratch/ltp-install5/testcases/bin/mc_opts /scratch/ltp-install5/bin/mc_opts4243/opts +tcp_cmds-output.log: Tag | App +tcp_cmds-output.log: /scratch/ltp-install5/testcases/bin/echo01 /scratch/ltp-install5/testcases/bin/createfile +tcp_cmds-output.log: rlogin01 rlogin01 +tcp_cmds-output.log: telnet01 telnet01 +tcp_cmds_expect-output.log: Tag | App +tcp_cmds_expect-output.log: rlogin01 rlogin01 +tcp_cmds_expect-output.log: telnet01 telnet01 +tcp_cmds_noexpect-output.log: Tag | App +tcp_cmds_noexpect-output.log: /scratch/ltp-install5/testcases/bin/echo01 /scratch/ltp-install5/testcases/bin/createfile + +testcases/kernel/security/selinux: + Is disabled on purpose (doesn't fit within build and probably won't until + autoconf tests are created to detect SELinux). + +Other missing items in an out-of-build-tree configuration: + +/tests/ltp/output/power_management_tests-output.log:/tests/ltp/testcases/bin/runpwtests.sh: line 57: check_kv_arch: comman +d not found +/tests/ltp/output/power_management_tests-output.log:/tests/ltp/testcases/bin/runpwtests.sh: line 172: get_sched_values: co +mmand not found +/tests/ltp/output/power_management_tests-output.log:/tests/ltp/testcases/bin/runpwtests.sh: line 191: check_kv_arch: comma +nd not found +/tests/ltp/output/power_management_tests_exclusive-output.log:/tests/ltp/testcases/bin/runpwtests.sh: line 57: check_kv_ar +ch: command not found +/tests/ltp/output/power_management_tests_exclusive-output.log:/tests/ltp/testcases/bin/runpwtests.sh: line 172: get_sched_ +values: command not found +/tests/ltp/output/power_management_tests_exclusive-output.log:/tests/ltp/testcases/bin/runpwtests.sh: line 191: check_kv_a +rch: command not found +/tests/ltp/output/tcp_cmds_noexpect-output.log:sendfile01 1 TFAIL : Test broken: gethost: command not found + +/tests/ltp/output/io_floppy-output.log:sh: stress_floppy: command not found +/tests/ltp/output/ipv6-output.log:sh: echo601: command not found +/tests/ltp/output/ipv6-output.log:ftp01 1 TFAIL : Test broken: ftp: command not found +/tests/ltp/output/ipv6-output.log:sh: perf_lan6: command not found +/tests/ltp/output/ipv6-output.log:rcp01 1 TFAIL : Test broken: rcp: command not found +/tests/ltp/output/ipv6-output.log:rsh01 1 TFAIL : Test broken: rsh: command not found +/tests/ltp/output/ipv6-output.log:rwho01 1 TFAIL : Test broken: rsh: command not found +/tests/ltp/output/ipv6-output.log:sh: sendfile601: command not found diff --git a/config.mk.in b/config.mk.in deleted file mode 100644 index 64e38470..00000000 --- a/config.mk.in +++ /dev/null @@ -1,13 +0,0 @@ -CC = @CC@ -AR = @AR@ -RANLIB = @RANLIB@ - -CPPFLAGS = @CPPFLAGS@ -CFLAGS = @CFLAGS@ -LDFLAGS = @LDFLAGS@ - -AIO_LIBS = @AIO_LIBS@ -SELINUX_LIBS = @SELINUX_LIBS@ -CRYPTO_LIB = @CRYPTO_LIB@ - -LTP_CHECK_CGROUPSTATS_HEADER = @LTP_CHECK_CGROUPSTATS_HEADER@ diff --git a/configure b/configure index c155bed0..10494d28 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for ltp cvs. +# Generated by GNU Autoconf 2.63 for ltp 20091031. # # Report bugs to . # @@ -596,10 +596,11 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='ltp' PACKAGE_TARNAME='ltp' -PACKAGE_VERSION='cvs' -PACKAGE_STRING='ltp cvs' +PACKAGE_VERSION='20091031' +PACKAGE_STRING='ltp 20091031' PACKAGE_BUGREPORT='ltp-results@lists.sourceforge.net' +ac_default_prefix=/opt/ltp ac_header_list= # Factoring default headers for most tests. ac_includes_default="\ @@ -637,17 +638,24 @@ ac_includes_default="\ # include #endif" +enable_option_checking=no ac_func_list= ac_subst_vars='LTLIBOBJS LIBOBJS -LTP_CHECK_CGROUPSTATS_HEADER -CRYPTO_LIB -SELINUX_LIBS +NUMA_LIBS AIO_LIBS +SELINUX_LIBS +CRYPTO_LIBS +subdirs EGREP GREP CPP +YFLAGS +YACC RANLIB +LEXLIB +LEX_OUTPUT_ROOT +LEX AR am__fastdepCC_FALSE am__fastdepCC_TRUE @@ -673,6 +681,8 @@ build_os build_vendor build_cpu build +CROSS_COMPILATION_FALSE +CROSS_COMPILATION_TRUE am__untar am__tar AMTAR @@ -732,7 +742,8 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +CAP_LIBS' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -746,8 +757,12 @@ CFLAGS LDFLAGS LIBS CPPFLAGS +YACC +YFLAGS CPP' - +ac_subdirs_all=' \ + testcases/kernel/syscalls/pcllib/ \ +' # Initialize some variables set by options. ac_init_help= @@ -1299,7 +1314,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ltp cvs to adapt to many kinds of systems. +\`configure' configures ltp 20091031 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1369,7 +1384,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ltp cvs:";; + short | recursive ) echo "Configuration of ltp 20091031:";; esac cat <<\_ACEOF @@ -1388,6 +1403,11 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory + YACC The `Yet Another C Compiler' implementation to use. Defaults to + the first program found out of: `bison -y', `byacc', `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -1456,7 +1476,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ltp configure cvs +ltp configure 20091031 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1470,7 +1490,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ltp $as_me cvs, which was +It was created by ltp $as_me 20091031, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1747,10 +1767,18 @@ $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi +ac_header_list="$ac_header_list dmapi.h" ac_header_list="$ac_header_list ifaddrs.h" -ac_header_list="$ac_header_list sys/capability.h" -ac_header_list="$ac_header_list sys/inotify.h" +ac_header_list="$ac_header_list libaio.h" +ac_header_list="$ac_header_list mm.h" +ac_header_list="$ac_header_list linux/genetlink.h" +ac_header_list="$ac_header_list linux/module.h" +ac_header_list="$ac_header_list linux/netlink.h" +ac_header_list="$ac_header_list sys/acl.h" ac_header_list="$ac_header_list sys/epoll.h" +ac_header_list="$ac_header_list sys/inotify.h" +ac_header_list="$ac_header_list sys/jfsdmapi.h" +ac_header_list="$ac_header_list sys/prctl.h" ac_header_list="$ac_header_list linux/types.h" ac_func_list="$ac_func_list unshare" # Check that the precious variables saved in the cache have kept the same @@ -1844,10 +1872,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.10' - ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do +for ac_dir in . "$srcdir"/.; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" @@ -1863,8 +1889,8 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in . \"$srcdir\"/." >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in . \"$srcdir\"/." >&2;} { (exit 1); exit 1; }; } fi @@ -1877,6 +1903,8 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +am__api_version='1.10' + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -2192,7 +2220,7 @@ fi # Define the identity of the package. PACKAGE='ltp' - VERSION='cvs' + VERSION='20091031' cat >>confdefs.h <<_ACEOF @@ -2336,7 +2364,16 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers include/config.h" -ac_config_files="$ac_config_files config.mk m4/Makefile" +ac_config_files="$ac_config_files include/mk/config.mk lib/ltp.pc ltp-devel.spec m4/Makefile README.ltp-devel" + + + if test x$cross_compiling = xyes; then + CROSS_COMPILATION_TRUE= + CROSS_COMPILATION_FALSE='#' +else + CROSS_COMPILATION_TRUE='#' + CROSS_COMPILATION_FALSE= +fi # Make sure we can run config.sub. @@ -2422,6 +2459,7 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3525,6 +3563,9 @@ else fi +# <= autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it. Not sure about +# 2.62. + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -3617,6 +3658,220 @@ else AR="$ac_cv_prog_AR" fi + +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LEX+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LEX="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + { $as_echo "$as_me:$LINENO: result: $LEX" >&5 +$as_echo "$LEX" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + +if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%% +a { ECHO; } +b { REJECT; } +c { yymore (); } +d { yyless (1); } +e { yyless (input () != 0); } +f { unput (yytext[0]); } +. { BEGIN INITIAL; } +%% +#ifdef YYTEXT_POINTER +extern char *yytext; +#endif +int +main (void) +{ + return ! yylex () + ! yywrap (); +} +_ACEOF +{ (ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$LEX conftest.l") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ $as_echo "$as_me:$LINENO: checking lex output file root" >&5 +$as_echo_n "checking lex output file root... " >&6; } +if test "${ac_cv_prog_lex_root+set}" = set; then + $as_echo_n "(cached) " >&6 +else + +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + { { $as_echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +$as_echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +$as_echo "$ac_cv_prog_lex_root" >&6; } +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +if test -z "${LEXLIB+set}"; then + { $as_echo "$as_me:$LINENO: checking lex library" >&5 +$as_echo_n "checking lex library... " >&6; } +if test "${ac_cv_lib_lex+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + ac_save_LIBS=$LIBS + ac_cv_lib_lex='none needed' + for ac_lib in '' -lfl -ll; do + LIBS="$ac_lib $ac_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_lex=$ac_lib +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + test "$ac_cv_lib_lex" != 'none needed' && break + done + LIBS=$ac_save_LIBS + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5 +$as_echo "$ac_cv_lib_lex" >&6; } + test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex +fi + + +{ $as_echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +$as_echo_n "checking whether yytext is a pointer... " >&6; } +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +ac_save_LIBS=$LIBS +LIBS="$LEXLIB $ac_save_LIBS" +cat >conftest.$ac_ext <<_ACEOF +#define YYTEXT_POINTER 1 +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_prog_lex_yytext_pointer=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +cat >>confdefs.h <<\_ACEOF +#define YYTEXT_POINTER 1 +_ACEOF + +fi +rm -f conftest.l $LEX_OUTPUT_ROOT.c + +fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -3709,6 +3964,50 @@ else RANLIB="$ac_cv_prog_RANLIB" fi +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_YACC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_YACC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { $as_echo "$as_me:$LINENO: result: $YACC" >&5 +$as_echo "$YACC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + + ac_ext=c @@ -4511,7 +4810,49 @@ done -for ac_header in libaio.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# open_hpi_testsuite does NOT fit cleanly in the build. BLAH. +#AC_CONFIG_SUBDIRS([ \ +# testcases/open_hpi_testsuite/ \ +# testcases/kernel/syscalls/pcllib/ \ +#]) + + + +subdirs="$subdirs testcases/kernel/syscalls/pcllib/" + + + + +for ac_header in sys/capability.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -4657,44 +4998,42 @@ as_val=`eval 'as_val=${'$as_ac_Header'} #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - { $as_echo "$as_me:$LINENO: checking for io_setup in -laio" >&5 -$as_echo_n "checking for io_setup in -laio... " >&6; } -if test "${ac_cv_lib_aio_io_setup+set}" = set; then + +for ac_header in attr/xattr.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else - ac_check_lib_save_LIBS=$LIBS -LIBS="-laio $LIBS" + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char io_setup (); -int -main () -{ -return io_setup (); - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -4703,45 +5042,139 @@ $as_echo "$ac_try_echo") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err }; then - ac_cv_lib_aio_io_setup=yes + ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_aio_io_setup=no + ac_header_preproc=no fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------------------ ## +## Report this to ltp-results@lists.sourceforge.net ## +## ------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_aio_io_setup" >&5 -$as_echo "$ac_cv_lib_aio_io_setup" >&6; } -if test "x$ac_cv_lib_aio_io_setup" = x""yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } - LIBS="$LIBS -laio" - AIO_LIBS="-laio" - { $as_echo "$as_me:$LINENO: checking io_set_eventfd is defined in aio library or aio header" >&5 -$as_echo_n "checking io_set_eventfd is defined in aio library or aio header... " >&6; } - cat >conftest.$ac_ext <<_ACEOF +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + LTP_CAPABILITY_SUPPORT=yes + { $as_echo "$as_me:$LINENO: checking for cap_free in -lcap" >&5 +$as_echo_n "checking for cap_free in -lcap... " >&6; } +if test "${ac_cv_lib_cap_cap_free+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcap $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - #include +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cap_free (); int main () { -io_set_eventfd(NULL, 0); return 0; - +return cap_free (); ; return 0; } @@ -4767,64 +5200,36 @@ $as_echo "$ac_try_echo") >&5 test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_IO_SET_EVENTFD 1 -_ACEOF - - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + ac_cv_lib_cap_cap_free=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_lib_cap_cap_free=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -else - AIO_LIBS="" -fi - +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cap_cap_free" >&5 +$as_echo "$ac_cv_lib_cap_cap_free" >&6; } +if test "x$ac_cv_lib_cap_cap_free" = x""yes; then -done - - - - -for ac_func in modify_ldt -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for cap_from_text in -lcap" >&5 +$as_echo_n "checking for cap_from_text in -lcap... " >&6; } +if test "${ac_cv_lib_cap_cap_from_text+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcap $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -4832,18 +5237,11 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +char cap_from_text (); int main () { -return $ac_func (); +return cap_from_text (); ; return 0; } @@ -4869,68 +5267,61 @@ $as_echo "$ac_try_echo") >&5 test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then - eval "$as_ac_var=yes" + ac_cv_lib_cap_cap_from_text=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_lib_cap_cap_from_text=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cap_cap_from_text" >&5 +$as_echo "$ac_cv_lib_cap_cap_from_text" >&6; } +if test "x$ac_cv_lib_cap_cap_from_text" = x""yes; then -for ac_header in asm/ldt.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for cap_set_proc in -lcap" >&5 +$as_echo_n "checking for cap_set_proc in -lcap... " >&6; } +if test "${ac_cv_lib_cap_cap_set_proc+set}" = set; then $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcap $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cap_set_proc (); +int +main () +{ +return cap_set_proc (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -4939,134 +5330,128 @@ $as_echo "$ac_try_echo") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_cap_cap_set_proc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_lib_cap_cap_set_proc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cap_cap_set_proc" >&5 +$as_echo "$ac_cv_lib_cap_cap_set_proc" >&6; } +if test "x$ac_cv_lib_cap_cap_set_proc" = x""yes; then -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } + { $as_echo "$as_me:$LINENO: checking for cap_compare in -lcap" >&5 +$as_echo_n "checking for cap_compare in -lcap... " >&6; } +if test "${ac_cv_lib_cap_cap_compare+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcap $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cap_compare (); +int +main () +{ +return cap_compare (); + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext }; then - ac_header_preproc=yes + ac_cv_lib_cap_cap_compare=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no + ac_cv_lib_cap_cap_compare=no fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cap_cap_compare" >&5 +$as_echo "$ac_cv_lib_cap_cap_compare" >&6; } +if test "x$ac_cv_lib_cap_cap_compare" = x""yes; then + + CAP_LIBS="-lcap" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to ltp-results@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - LTP_SYSCALL_MODIFY_LDT_HEADER=yes + + fi -done -if test x"$LTP_SYSCALL_MODIFY_LDT_HEADER" = xyes; then - { $as_echo "$as_me:$LINENO: checking for struct user_desc" >&5 -$as_echo_n "checking for struct user_desc... " >&6; } -if test "${ac_cv_type_struct_user_desc+set}" = set; then +fi + + { $as_echo "$as_me:$LINENO: checking whether CAP_BSET_DROP is declared" >&5 +$as_echo_n "checking whether CAP_BSET_DROP is declared... " >&6; } +if test "${ac_cv_have_decl_CAP_BSET_DROP+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_struct_user_desc=no -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -if (sizeof (struct user_desc)) - return 0; +#ifndef CAP_BSET_DROP + (void) CAP_BSET_DROP; +#endif + ; return 0; } @@ -5089,20 +5474,53 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then + ac_cv_have_decl_CAP_BSET_DROP=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_CAP_BSET_DROP=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_CAP_BSET_DROP" >&5 +$as_echo "$ac_cv_have_decl_CAP_BSET_DROP" >&6; } +if test "x$ac_cv_have_decl_CAP_BSET_DROP" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_BSET_DROP 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_BSET_DROP 0 +_ACEOF + + +fi +{ $as_echo "$as_me:$LINENO: checking whether CAP_BSET_READ is declared" >&5 +$as_echo_n "checking whether CAP_BSET_READ is declared... " >&6; } +if test "${ac_cv_have_decl_CAP_BSET_READ+set}" = set; then + $as_echo_n "(cached) " >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -if (sizeof ((struct user_desc))) - return 0; +#ifndef CAP_BSET_READ + (void) CAP_BSET_READ; +#endif + ; return 0; } @@ -5125,54 +5543,53 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_struct_user_desc=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_have_decl_CAP_BSET_READ=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_have_decl_CAP_BSET_READ=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_user_desc" >&5 -$as_echo "$ac_cv_type_struct_user_desc" >&6; } -if test "x$ac_cv_type_struct_user_desc" = x""yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_CAP_BSET_READ" >&5 +$as_echo "$ac_cv_have_decl_CAP_BSET_READ" >&6; } +if test "x$ac_cv_have_decl_CAP_BSET_READ" = x""yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_USER_DESC 1 +#define HAVE_DECL_CAP_BSET_READ 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_BSET_READ 0 _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking for struct modify_ldt_ldt_s" >&5 -$as_echo_n "checking for struct modify_ldt_ldt_s... " >&6; } -if test "${ac_cv_type_struct_modify_ldt_ldt_s+set}" = set; then +{ $as_echo "$as_me:$LINENO: checking whether PR_CAPBSET_READ is declared" >&5 +$as_echo_n "checking whether PR_CAPBSET_READ is declared... " >&6; } +if test "${ac_cv_have_decl_PR_CAPBSET_READ+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_struct_modify_ldt_ldt_s=no -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -if (sizeof (struct modify_ldt_ldt_s)) - return 0; +#ifndef PR_CAPBSET_READ + (void) PR_CAPBSET_READ; +#endif + ; return 0; } @@ -5195,20 +5612,53 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then + ac_cv_have_decl_PR_CAPBSET_READ=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_PR_CAPBSET_READ=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_PR_CAPBSET_READ" >&5 +$as_echo "$ac_cv_have_decl_PR_CAPBSET_READ" >&6; } +if test "x$ac_cv_have_decl_PR_CAPBSET_READ" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PR_CAPBSET_READ 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PR_CAPBSET_READ 0 +_ACEOF + + +fi +{ $as_echo "$as_me:$LINENO: checking whether cap_compare is declared" >&5 +$as_echo_n "checking whether cap_compare is declared... " >&6; } +if test "${ac_cv_have_decl_cap_compare+set}" = set; then + $as_echo_n "(cached) " >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -if (sizeof ((struct modify_ldt_ldt_s))) - return 0; +#ifndef cap_compare + (void) cap_compare; +#endif + ; return 0; } @@ -5231,45 +5681,35 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_struct_modify_ldt_ldt_s=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_have_decl_cap_compare=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_have_decl_cap_compare=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_modify_ldt_ldt_s" >&5 -$as_echo "$ac_cv_type_struct_modify_ldt_ldt_s" >&6; } -if test "x$ac_cv_type_struct_modify_ldt_ldt_s" = x""yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_cap_compare" >&5 +$as_echo "$ac_cv_have_decl_cap_compare" >&6; } +if test "x$ac_cv_have_decl_cap_compare" = x""yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_MODIFY_LDT_LDT_S 1 +#define HAVE_DECL_CAP_COMPARE 1 _ACEOF -fi - -fi - +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_COMPARE 0 +_ACEOF -for ac_func in signalfd -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +fi +{ $as_echo "$as_me:$LINENO: checking whether cap_free is declared" >&5 +$as_echo_n "checking whether cap_free is declared... " >&6; } +if test "${ac_cv_have_decl_cap_free+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5278,54 +5718,29 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func +#include -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif int main () { -return $ac_func (); +#ifndef cap_free + (void) cap_free; +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5334,62 +5749,57 @@ $as_echo "$ac_try_echo") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_cap_free=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_have_decl_cap_free=no fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_cap_free" >&5 +$as_echo "$ac_cv_have_decl_cap_free" >&6; } +if test "x$ac_cv_have_decl_cap_free" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_FREE 1 +_ACEOF + + +else cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_DECL_CAP_FREE 0 _ACEOF - LTP_SYSCALL_SIGNALFD_FUNCTION=yes -fi -done -for ac_header in sys/signalfd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether cap_from_text is declared" >&5 +$as_echo_n "checking whether cap_from_text is declared... " >&6; } +if test "${ac_cv_have_decl_cap_from_text+set}" = set; then + $as_echo_n "(cached) " >&6 else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#include + + +int +main () +{ +#ifndef cap_from_text + (void) cap_from_text; +#endif + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -5409,126 +5819,104 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_have_decl_cap_from_text=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_have_decl_cap_from_text=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_cap_from_text" >&5 +$as_echo "$ac_cv_have_decl_cap_from_text" >&6; } +if test "x$ac_cv_have_decl_cap_from_text" = x""yes; then -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_FROM_TEXT 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_FROM_TEXT 0 +_ACEOF + + +fi +{ $as_echo "$as_me:$LINENO: checking whether cap_get_proc is declared" >&5 +$as_echo_n "checking whether cap_get_proc is declared... " >&6; } +if test "${ac_cv_have_decl_cap_get_proc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +#include + + +int +main () +{ +#ifndef cap_get_proc + (void) cap_get_proc; +#endif + + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_cap_get_proc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no + ac_cv_have_decl_cap_get_proc=no fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to ltp-results@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_cap_get_proc" >&5 +$as_echo "$ac_cv_have_decl_cap_get_proc" >&6; } +if test "x$ac_cv_have_decl_cap_get_proc" = x""yes; then -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_GET_PROC 1 _ACEOF -fi - -done - - - - - - +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_GET_PROC 0 +_ACEOF -for ac_header in linux/signalfd.h signalfd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +fi +{ $as_echo "$as_me:$LINENO: checking whether cap_set_file is declared" >&5 +$as_echo_n "checking whether cap_set_file is declared... " >&6; } +if test "${ac_cv_have_decl_cap_set_file+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5537,12 +5925,19 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef HAVE_LINUX_TYPES_H -#include -#endif +#include -#include <$ac_header> +int +main () +{ +#ifndef cap_set_file + (void) cap_set_file; +#endif + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -5562,36 +5957,35 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" + ac_cv_have_decl_cap_set_file=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" + ac_cv_have_decl_cap_set_file=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_cap_set_file" >&5 +$as_echo "$ac_cv_have_decl_cap_set_file" >&6; } +if test "x$ac_cv_have_decl_cap_set_file" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_SET_FILE 1 _ACEOF - LTP_SYSCALL_SIGNALFD_HEADER=yes -fi -done +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_SET_FILE 0 +_ACEOF -if test x"$LTP_SYSCALL_SIGNALFD_HEADER" = xyes; then - { $as_echo "$as_me:$LINENO: checking for struct signalfd_siginfo.ssi_signo" >&5 -$as_echo_n "checking for struct signalfd_siginfo.ssi_signo... " >&6; } -if test "${ac_cv_member_struct_signalfd_siginfo_ssi_signo+set}" = set; then + +fi +{ $as_echo "$as_me:$LINENO: checking whether cap_set_flag is declared" >&5 +$as_echo_n "checking whether cap_set_flag is declared... " >&6; } +if test "${ac_cv_have_decl_cap_set_flag+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5600,23 +5994,16 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined HAVE_SYS_SIGNALFD_H -#include -#elif defined HAVE_LINUX_SIGNALFD_H -#ifdef HAVE_LINUX_TYPES_H -#include -#endif -#include -#elif defined HAVE_SIGNALFD_H -#include -#endif +#include + int main () { -static struct signalfd_siginfo ac_aggr; -if (ac_aggr.ssi_signo) -return 0; +#ifndef cap_set_flag + (void) cap_set_flag; +#endif + ; return 0; } @@ -5639,34 +6026,53 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_signalfd_siginfo_ssi_signo=yes + ac_cv_have_decl_cap_set_flag=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF + ac_cv_have_decl_cap_set_flag=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_cap_set_flag" >&5 +$as_echo "$ac_cv_have_decl_cap_set_flag" >&6; } +if test "x$ac_cv_have_decl_cap_set_flag" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_SET_FLAG 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_SET_FLAG 0 +_ACEOF + + +fi +{ $as_echo "$as_me:$LINENO: checking whether cap_set_proc is declared" >&5 +$as_echo_n "checking whether cap_set_proc is declared... " >&6; } +if test "${ac_cv_have_decl_cap_set_proc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined HAVE_SYS_SIGNALFD_H -#include -#elif defined HAVE_LINUX_SIGNALFD_H -#ifdef HAVE_LINUX_TYPES_H -#include -#endif -#include -#elif defined HAVE_SIGNALFD_H -#include -#endif +#include + int main () { -static struct signalfd_siginfo ac_aggr; -if (sizeof ac_aggr.ssi_signo) -return 0; +#ifndef cap_set_proc + (void) cap_set_proc; +#endif + ; return 0; } @@ -5689,32 +6095,35 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_signalfd_siginfo_ssi_signo=yes + ac_cv_have_decl_cap_set_proc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_member_struct_signalfd_siginfo_ssi_signo=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_have_decl_cap_set_proc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_signalfd_siginfo_ssi_signo" >&5 -$as_echo "$ac_cv_member_struct_signalfd_siginfo_ssi_signo" >&6; } -if test "x$ac_cv_member_struct_signalfd_siginfo_ssi_signo" = x""yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_cap_set_proc" >&5 +$as_echo "$ac_cv_have_decl_cap_set_proc" >&6; } +if test "x$ac_cv_have_decl_cap_set_proc" = x""yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SIGNALFD_SIGINFO_SSI_SIGNO 1 +#define HAVE_DECL_CAP_SET_PROC 1 _ACEOF -LTP_SYSCALL_SIGNALFD_FIELD_PREFIX=given + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_SET_PROC 0 +_ACEOF + + fi -{ $as_echo "$as_me:$LINENO: checking for struct signalfd_siginfo.signo" >&5 -$as_echo_n "checking for struct signalfd_siginfo.signo... " >&6; } -if test "${ac_cv_member_struct_signalfd_siginfo_signo+set}" = set; then +{ $as_echo "$as_me:$LINENO: checking whether cap_to_text is declared" >&5 +$as_echo_n "checking whether cap_to_text is declared... " >&6; } +if test "${ac_cv_have_decl_cap_to_text+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5723,73 +6132,16 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined HAVE_SYS_SIGNALFD_H -#include -#elif defined HAVE_LINUX_SIGNALFD_H -#ifdef HAVE_LINUX_TYPES_H -#include -#endif -#include -#elif defined HAVE_SIGNALFD_H -#include -#endif +#include + int main () { -static struct signalfd_siginfo ac_aggr; -if (ac_aggr.signo) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_signalfd_siginfo_signo=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined HAVE_SYS_SIGNALFD_H -#include -#elif defined HAVE_LINUX_SIGNALFD_H -#ifdef HAVE_LINUX_TYPES_H -#include -#endif -#include -#elif defined HAVE_SIGNALFD_H -#include +#ifndef cap_to_text + (void) cap_to_text; #endif -int -main () -{ -static struct signalfd_siginfo ac_aggr; -if (sizeof ac_aggr.signo) -return 0; ; return 0; } @@ -5812,148 +6164,42 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_signalfd_siginfo_signo=yes + ac_cv_have_decl_cap_to_text=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_member_struct_signalfd_siginfo_signo=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_have_decl_cap_to_text=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_signalfd_siginfo_signo" >&5 -$as_echo "$ac_cv_member_struct_signalfd_siginfo_signo" >&6; } -if test "x$ac_cv_member_struct_signalfd_siginfo_signo" = x""yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_cap_to_text" >&5 +$as_echo "$ac_cv_have_decl_cap_to_text" >&6; } +if test "x$ac_cv_have_decl_cap_to_text" = x""yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SIGNALFD_SIGINFO_SIGNO 1 +#define HAVE_DECL_CAP_TO_TEXT 1 _ACEOF -LTP_SYSCALL_SIGNALFD_FIELD_PREFIX=given -fi - - -fi - - - -for ac_func in $ac_func_list -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CAP_TO_TEXT 0 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF fi -done - - - - - - - +done -for ac_header in selinux/selinux.h +for ac_header in openssl/sha.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -6098,45 +6344,52 @@ as_val=`eval 'as_val=${'$as_ac_Header'} cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF + CRYPTO_LIBS=-lcrypto +else + CRYPTO_LIBS= +fi - { $as_echo "$as_me:$LINENO: checking for is_selinux_enabled in -lselinux" >&5 -$as_echo_n "checking for is_selinux_enabled in -lselinux... " >&6; } -if test "${ac_cv_lib_selinux_is_selinux_enabled+set}" = set; then +done + + + + + +for ac_header in linux/ptrace.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lselinux $LIBS" + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char is_selinux_enabled (); -int -main () -{ -return is_selinux_enabled (); - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -6145,70 +6398,272 @@ $as_echo "$ac_try_echo") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err }; then - ac_cv_lib_selinux_is_selinux_enabled=yes + ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_selinux_is_selinux_enabled=no + ac_header_preproc=no fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------------------ ## +## Report this to ltp-results@lists.sourceforge.net ## +## ------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5 -$as_echo "$ac_cv_lib_selinux_is_selinux_enabled" >&6; } -if test "x$ac_cv_lib_selinux_is_selinux_enabled" = x""yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } - cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBSELINUX_DEVEL 1 +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - SELINUX_LIBS="-lselinux" + + LINUX_PTRACE_HEADER=yes + { $as_echo "$as_me:$LINENO: checking whether PTRACE_GETSIGINFO is declared" >&5 +$as_echo_n "checking whether PTRACE_GETSIGINFO is declared... " >&6; } +if test "${ac_cv_have_decl_PTRACE_GETSIGINFO+set}" = set; then + $as_echo_n "(cached) " >&6 else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include - SELINUX_LIBS="" -fi +int +main () +{ +#ifndef PTRACE_GETSIGINFO + (void) PTRACE_GETSIGINFO; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_PTRACE_GETSIGINFO=yes else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - SELINUX_LIBS="" + ac_cv_have_decl_PTRACE_GETSIGINFO=no fi -done +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_PTRACE_GETSIGINFO" >&5 +$as_echo "$ac_cv_have_decl_PTRACE_GETSIGINFO" >&6; } +if test "x$ac_cv_have_decl_PTRACE_GETSIGINFO" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PTRACE_GETSIGINFO 1 +_ACEOF +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PTRACE_GETSIGINFO 0 +_ACEOF -for ac_header in openssl/sha.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + +fi +{ $as_echo "$as_me:$LINENO: checking whether PTRACE_O_TRACEVFORKDONE is declared" >&5 +$as_echo_n "checking whether PTRACE_O_TRACEVFORKDONE is declared... " >&6; } +if test "${ac_cv_have_decl_PTRACE_O_TRACEVFORKDONE+set}" = set; then $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + + +int +main () +{ +#ifndef PTRACE_O_TRACEVFORKDONE + (void) PTRACE_O_TRACEVFORKDONE; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_PTRACE_O_TRACEVFORKDONE=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_PTRACE_O_TRACEVFORKDONE=no fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_PTRACE_O_TRACEVFORKDONE" >&5 +$as_echo "$ac_cv_have_decl_PTRACE_O_TRACEVFORKDONE" >&6; } +if test "x$ac_cv_have_decl_PTRACE_O_TRACEVFORKDONE" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PTRACE_O_TRACEVFORKDONE 1 +_ACEOF + + else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PTRACE_O_TRACEVFORKDONE 0 +_ACEOF + + +fi +{ $as_echo "$as_me:$LINENO: checking whether PTRACE_SETOPTIONS is declared" >&5 +$as_echo_n "checking whether PTRACE_SETOPTIONS is declared... " >&6; } +if test "${ac_cv_have_decl_PTRACE_SETOPTIONS+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#include + + +int +main () +{ +#ifndef PTRACE_SETOPTIONS + (void) PTRACE_SETOPTIONS; +#endif + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -6228,137 +6683,2373 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_have_decl_PTRACE_SETOPTIONS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_have_decl_PTRACE_SETOPTIONS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_PTRACE_SETOPTIONS" >&5 +$as_echo "$ac_cv_have_decl_PTRACE_SETOPTIONS" >&6; } +if test "x$ac_cv_have_decl_PTRACE_SETOPTIONS" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PTRACE_SETOPTIONS 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PTRACE_SETOPTIONS 0 +_ACEOF + + +fi + + +fi + +done + + + + + +for ac_header in selinux/selinux.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------------------ ## +## Report this to ltp-results@lists.sourceforge.net ## +## ------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: checking for is_selinux_enabled in -lselinux" >&5 +$as_echo_n "checking for is_selinux_enabled in -lselinux... " >&6; } +if test "${ac_cv_lib_selinux_is_selinux_enabled+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lselinux $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char is_selinux_enabled (); +int +main () +{ +return is_selinux_enabled (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_selinux_is_selinux_enabled=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_selinux_is_selinux_enabled=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5 +$as_echo "$ac_cv_lib_selinux_is_selinux_enabled" >&6; } +if test "x$ac_cv_lib_selinux_is_selinux_enabled" = x""yes; then + + cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBSELINUX_DEVEL 1 +_ACEOF + SELINUX_LIBS="-lselinux" +else + + SELINUX_LIBS="" +fi + +else + + SELINUX_LIBS="" +fi + +done + + + + + +for ac_header in libaio.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------------------ ## +## Report this to ltp-results@lists.sourceforge.net ## +## ------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: checking for io_setup in -laio" >&5 +$as_echo_n "checking for io_setup in -laio... " >&6; } +if test "${ac_cv_lib_aio_io_setup+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-laio $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char io_setup (); +int +main () +{ +return io_setup (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_aio_io_setup=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_aio_io_setup=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_aio_io_setup" >&5 +$as_echo "$ac_cv_lib_aio_io_setup" >&6; } +if test "x$ac_cv_lib_aio_io_setup" = x""yes; then + + AIO_LIBS="-laio" + { $as_echo "$as_me:$LINENO: checking io_set_eventfd is defined in aio library or aio header" >&5 +$as_echo_n "checking io_set_eventfd is defined in aio library or aio header... " >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +io_set_eventfd(NULL, 0); return 0; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_IO_SET_EVENTFD 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +else + AIO_LIBS="" +fi + +fi + +done + + + + +for ac_func in modify_ldt +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_header in asm/ldt.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------------------ ## +## Report this to ltp-results@lists.sourceforge.net ## +## ------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + LTP_SYSCALL_MODIFY_LDT_HEADER=yes +fi + +done + +if test x"$LTP_SYSCALL_MODIFY_LDT_HEADER" = xyes; then + { $as_echo "$as_me:$LINENO: checking for struct user_desc" >&5 +$as_echo_n "checking for struct user_desc... " >&6; } +if test "${ac_cv_type_struct_user_desc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_struct_user_desc=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + + +int +main () +{ +if (sizeof (struct user_desc)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + + +int +main () +{ +if (sizeof ((struct user_desc))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_user_desc=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_user_desc" >&5 +$as_echo "$ac_cv_type_struct_user_desc" >&6; } +if test "x$ac_cv_type_struct_user_desc" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_USER_DESC 1 +_ACEOF + + +fi +{ $as_echo "$as_me:$LINENO: checking for struct modify_ldt_ldt_s" >&5 +$as_echo_n "checking for struct modify_ldt_ldt_s... " >&6; } +if test "${ac_cv_type_struct_modify_ldt_ldt_s+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_struct_modify_ldt_ldt_s=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + + +int +main () +{ +if (sizeof (struct modify_ldt_ldt_s)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + + +int +main () +{ +if (sizeof ((struct modify_ldt_ldt_s))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_modify_ldt_ldt_s=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_modify_ldt_ldt_s" >&5 +$as_echo "$ac_cv_type_struct_modify_ldt_ldt_s" >&6; } +if test "x$ac_cv_type_struct_modify_ldt_ldt_s" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_MODIFY_LDT_LDT_S 1 +_ACEOF + + +fi + +fi + +for ac_header in numa.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------------------ ## +## Report this to ltp-results@lists.sourceforge.net ## +## ------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + + LTP_SYSCALL_NUMA_HEADER=yes + +for ac_func in numa_alloc_onnode +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + numa_move_pages +fi +done + + +for ac_header in numaif.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------------------ ## +## Report this to ltp-results@lists.sourceforge.net ## +## ------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + LTP_SYSCALL_NUMAIF_HEADER=yes +fi + +done + + + { $as_echo "$as_me:$LINENO: checking for numa_available in -lnuma" >&5 +$as_echo_n "checking for numa_available in -lnuma... " >&6; } +if test "${ac_cv_lib_numa_numa_available+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnuma $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char numa_available (); +int +main () +{ +return numa_available (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_numa_numa_available=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_numa_numa_available=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_numa_numa_available" >&5 +$as_echo "$ac_cv_lib_numa_numa_available" >&6; } +if test "x$ac_cv_lib_numa_numa_available" = x""yes; then + + NUMA_LIBS="-lnuma" + +fi + + + +fi + +done + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +#include +#include +int +main () +{ + +int main(void) { + return quotactl(Q_GETINFO, (const char *)NULL, geteuid(), (caddr_t)NULL); +} + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + has_rhel46_quotactl="yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +#include +#include +int +main () +{ + +int main(void) { + return quotactl(Q_GETINFO, (const char *)NULL, geteuid(), (caddr_t)NULL); +} + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + has_rhel48_quotactl="yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +int +main () +{ + +int main(void) { + return quotactl(Q_GETINFO, (const char *)NULL, geteuid(), (caddr_t)NULL); +} + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + has_new_minimal_quotactl="yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: WARNING: Couldn't find functional copy of quotactl" >&5 +$as_echo "$as_me: WARNING: Couldn't find functional copy of quotactl" >&2;} +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test "x$has_rhel46_quotactl" = "xyes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAS_RHEL46_QUOTACTL 1 +_ACEOF + +elif test "x$has_rhel48_quotactl" = "xyes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAS_RHEL48_QUOTACTL 1 +_ACEOF + +elif test "x$has_new_minimal_quotactl" = "xyes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAS_NEW_MINIMAL_QUOTACTL 1 +_ACEOF + +fi + + + + +for ac_func in signalfd +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + LTP_SYSCALL_SIGNALFD_FUNCTION=yes +fi +done + + +for ac_header in sys/signalfd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------------------ ## +## Report this to ltp-results@lists.sourceforge.net ## +## ------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + +for ac_header in linux/signalfd.h signalfd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_LINUX_TYPES_H +#include +#endif + + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + LTP_SYSCALL_SIGNALFD_HEADER=yes +fi + +done + + +if test x"$LTP_SYSCALL_SIGNALFD_HEADER" = xyes; then + { $as_echo "$as_me:$LINENO: checking for struct signalfd_siginfo.ssi_signo" >&5 +$as_echo_n "checking for struct signalfd_siginfo.ssi_signo... " >&6; } +if test "${ac_cv_member_struct_signalfd_siginfo_ssi_signo+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined HAVE_SYS_SIGNALFD_H +#include +#elif defined HAVE_LINUX_SIGNALFD_H +#ifdef HAVE_LINUX_TYPES_H +#include +#endif +#include +#elif defined HAVE_SIGNALFD_H +#include +#endif + +int +main () +{ +static struct signalfd_siginfo ac_aggr; +if (ac_aggr.ssi_signo) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_signalfd_siginfo_ssi_signo=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined HAVE_SYS_SIGNALFD_H +#include +#elif defined HAVE_LINUX_SIGNALFD_H +#ifdef HAVE_LINUX_TYPES_H +#include +#endif +#include +#elif defined HAVE_SIGNALFD_H +#include +#endif + +int +main () +{ +static struct signalfd_siginfo ac_aggr; +if (sizeof ac_aggr.ssi_signo) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_signalfd_siginfo_ssi_signo=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_signalfd_siginfo_ssi_signo=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_signalfd_siginfo_ssi_signo" >&5 +$as_echo "$ac_cv_member_struct_signalfd_siginfo_ssi_signo" >&6; } +if test "x$ac_cv_member_struct_signalfd_siginfo_ssi_signo" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SIGNALFD_SIGINFO_SSI_SIGNO 1 +_ACEOF + +LTP_SYSCALL_SIGNALFD_FIELD_PREFIX=given +fi +{ $as_echo "$as_me:$LINENO: checking for struct signalfd_siginfo.signo" >&5 +$as_echo_n "checking for struct signalfd_siginfo.signo... " >&6; } +if test "${ac_cv_member_struct_signalfd_siginfo_signo+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined HAVE_SYS_SIGNALFD_H +#include +#elif defined HAVE_LINUX_SIGNALFD_H +#ifdef HAVE_LINUX_TYPES_H +#include +#endif +#include +#elif defined HAVE_SIGNALFD_H +#include +#endif + +int +main () +{ +static struct signalfd_siginfo ac_aggr; +if (ac_aggr.signo) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_signalfd_siginfo_signo=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined HAVE_SYS_SIGNALFD_H +#include +#elif defined HAVE_LINUX_SIGNALFD_H +#ifdef HAVE_LINUX_TYPES_H +#include +#endif +#include +#elif defined HAVE_SIGNALFD_H +#include +#endif + +int +main () +{ +static struct signalfd_siginfo ac_aggr; +if (sizeof ac_aggr.signo) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_signalfd_siginfo_signo=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_signalfd_siginfo_signo=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_signalfd_siginfo_signo" >&5 +$as_echo "$ac_cv_member_struct_signalfd_siginfo_signo" >&6; } +if test "x$ac_cv_member_struct_signalfd_siginfo_signo" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SIGNALFD_SIGINFO_SIGNO 1 +_ACEOF + +LTP_SYSCALL_SIGNALFD_FIELD_PREFIX=given +fi + + +fi + + + + +for ac_func in $ac_func_list +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> +int +main () +{ +return $ac_func (); + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext }; then - ac_header_preproc=yes + eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to ltp-results@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} +ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} +as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - CRYPTO_LIB=-lcrypto -else - CRYPTO_LIB= -fi +fi done -{ $as_echo "$as_me:$LINENO: checking for struct taskstats.freepages_count" >&5 -$as_echo_n "checking for struct taskstats.freepages_count... " >&6; } -if test "${ac_cv_member_struct_taskstats_freepages_count+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF + + + + + + + +{ $as_echo "$as_me:$LINENO: checking for swapon / swapoff implementation" >&5 +$as_echo_n "checking for swapon / swapoff implementation... " >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include - - +#include + #include int main () { -static struct taskstats ac_aggr; -if (ac_aggr.freepages_count) -return 0; +swapon("/foo", 0); swapoff("/foo"); return 0; ; return 0; } @@ -6381,7 +9072,7 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_taskstats_freepages_count=yes + swaponoff_impl="2.6" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -6392,16 +9083,13 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include - - +#include + #include + #include int main () { -static struct taskstats ac_aggr; -if (sizeof ac_aggr.freepages_count) -return 0; +swapon("/foo", 0); swapoff("/foo"); return 0; ; return 0; } @@ -6424,32 +9112,50 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_taskstats_freepages_count=yes + swaponoff_impl="2.4" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_member_struct_taskstats_freepages_count=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_taskstats_freepages_count" >&5 -$as_echo "$ac_cv_member_struct_taskstats_freepages_count" >&6; } -if test "x$ac_cv_member_struct_taskstats_freepages_count" = x""yes; then +if test "x$swaponoff_impl" = "x2.4" ; then + { $as_echo "$as_me:$LINENO: result: 2.6" >&5 +$as_echo "2.6" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_TASKSTATS_FREEPAGES_COUNT 1 +cat >>confdefs.h <<\_ACEOF +#define HAVE_OLD_SWAPONOFF /**/ _ACEOF +elif test "x$swaponoff_impl" = "x2.6" ; then + { $as_echo "$as_me:$LINENO: result: 2.6" >&5 +$as_echo "2.6" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NEW_SWAPONOFF /**/ +_ACEOF +else + { $as_echo "$as_me:$LINENO: result: unknown" >&5 +$as_echo "unknown" >&6; } + { $as_echo "$as_me:$LINENO: WARNING: Couldn't determine swapon / swapoff implementation" >&5 +$as_echo "$as_me: WARNING: Couldn't determine swapon / swapoff implementation" >&2;} fi -{ $as_echo "$as_me:$LINENO: checking for struct taskstats.nvcsw" >&5 -$as_echo_n "checking for struct taskstats.nvcsw... " >&6; } -if test "${ac_cv_member_struct_taskstats_nvcsw+set}" = set; then + + + +for ac_header in linux/taskstats.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6458,7 +9164,62 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + #include + + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: checking for struct taskstats.freepages_count" >&5 +$as_echo_n "checking for struct taskstats.freepages_count... " >&6; } +if test "${ac_cv_member_struct_taskstats_freepages_count+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include @@ -6466,7 +9227,7 @@ int main () { static struct taskstats ac_aggr; -if (ac_aggr.nvcsw) +if (ac_aggr.freepages_count) return 0; ; return 0; @@ -6490,7 +9251,7 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_taskstats_nvcsw=yes + ac_cv_member_struct_taskstats_freepages_count=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -6501,7 +9262,6 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include #include @@ -6509,7 +9269,7 @@ int main () { static struct taskstats ac_aggr; -if (sizeof ac_aggr.nvcsw) +if (sizeof ac_aggr.freepages_count) return 0; ; return 0; @@ -6533,12 +9293,12 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_taskstats_nvcsw=yes + ac_cv_member_struct_taskstats_freepages_count=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_member_struct_taskstats_nvcsw=no + ac_cv_member_struct_taskstats_freepages_count=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -6546,19 +9306,19 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_taskstats_nvcsw" >&5 -$as_echo "$ac_cv_member_struct_taskstats_nvcsw" >&6; } -if test "x$ac_cv_member_struct_taskstats_nvcsw" = x""yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_taskstats_freepages_count" >&5 +$as_echo "$ac_cv_member_struct_taskstats_freepages_count" >&6; } +if test "x$ac_cv_member_struct_taskstats_freepages_count" = x""yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_TASKSTATS_NVCSW 1 +#define HAVE_STRUCT_TASKSTATS_FREEPAGES_COUNT 1 _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking for struct taskstats.read_bytes" >&5 -$as_echo_n "checking for struct taskstats.read_bytes... " >&6; } -if test "${ac_cv_member_struct_taskstats_read_bytes+set}" = set; then +{ $as_echo "$as_me:$LINENO: checking for struct taskstats.nvcsw" >&5 +$as_echo_n "checking for struct taskstats.nvcsw... " >&6; } +if test "${ac_cv_member_struct_taskstats_nvcsw+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6567,7 +9327,6 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include #include @@ -6575,7 +9334,7 @@ int main () { static struct taskstats ac_aggr; -if (ac_aggr.read_bytes) +if (ac_aggr.nvcsw) return 0; ; return 0; @@ -6599,7 +9358,7 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_taskstats_read_bytes=yes + ac_cv_member_struct_taskstats_nvcsw=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -6610,7 +9369,6 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include #include @@ -6618,7 +9376,7 @@ int main () { static struct taskstats ac_aggr; -if (sizeof ac_aggr.read_bytes) +if (sizeof ac_aggr.nvcsw) return 0; ; return 0; @@ -6642,12 +9400,12 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_taskstats_read_bytes=yes + ac_cv_member_struct_taskstats_nvcsw=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_member_struct_taskstats_read_bytes=no + ac_cv_member_struct_taskstats_nvcsw=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -6655,45 +9413,39 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_taskstats_read_bytes" >&5 -$as_echo "$ac_cv_member_struct_taskstats_read_bytes" >&6; } -if test "x$ac_cv_member_struct_taskstats_read_bytes" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_TASKSTATS_READ_BYTES 1 -_ACEOF - - -fi - - - - -for ac_header in linux/cgroupstats.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_taskstats_nvcsw" >&5 +$as_echo "$ac_cv_member_struct_taskstats_nvcsw" >&6; } +if test "x$ac_cv_member_struct_taskstats_nvcsw" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TASKSTATS_NVCSW 1 +_ACEOF + + fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct taskstats.read_bytes" >&5 +$as_echo_n "checking for struct taskstats.read_bytes... " >&6; } +if test "${ac_cv_member_struct_taskstats_read_bytes+set}" = set; then + $as_echo_n "(cached) " >&6 else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#include + + +int +main () +{ +static struct taskstats ac_aggr; +if (ac_aggr.read_bytes) +return 0; + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -6713,112 +9465,75 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_member_struct_taskstats_read_bytes=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +#include + + +int +main () +{ +static struct taskstats ac_aggr; +if (sizeof ac_aggr.read_bytes) +return 0; + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_taskstats_read_bytes=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no + ac_cv_member_struct_taskstats_read_bytes=no fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to ltp-results@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_taskstats_read_bytes" >&5 +$as_echo "$ac_cv_member_struct_taskstats_read_bytes" >&6; } +if test "x$ac_cv_member_struct_taskstats_read_bytes" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TASKSTATS_READ_BYTES 1 _ACEOF - LTP_CHECK_CGROUPSTATS_HEADER=yes + + fi -done +fi +done @@ -6919,6 +9634,13 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +if test -z "${CROSS_COMPILATION_TRUE}" && test -z "${CROSS_COMPILATION_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"CROSS_COMPILATION\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"CROSS_COMPILATION\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -7255,7 +9977,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ltp $as_me cvs, which was +This file was extended by ltp $as_me 20091031, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7318,7 +10040,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -ltp config.status cvs +ltp config.status 20091031 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -7442,8 +10164,11 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; - "config.mk") CONFIG_FILES="$CONFIG_FILES config.mk" ;; + "include/mk/config.mk") CONFIG_FILES="$CONFIG_FILES include/mk/config.mk" ;; + "lib/ltp.pc") CONFIG_FILES="$CONFIG_FILES lib/ltp.pc" ;; + "ltp-devel.spec") CONFIG_FILES="$CONFIG_FILES ltp-devel.spec" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; + "README.ltp-devel") CONFIG_FILES="$CONFIG_FILES README.ltp-devel" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 @@ -8268,6 +10993,193 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi + +# +# CONFIG_SUBDIRS section. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file, --srcdir, and --disable-option-checking arguments + # so they do not pile up. + ac_sub_configure_args= + ac_prev= + eval "set x $ac_configure_args" + shift + for ac_arg + do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ + | --c=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + --disable-option-checking) + ;; + *) + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_arg="--prefix=$prefix" + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" + + # Pass --silent + if test "$silent" = yes; then + ac_sub_configure_args="--silent $ac_sub_configure_args" + fi + + # Always prepend --disable-option-checking to silence warnings, since + # different subdirs can have different --enable and --with options. + ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d "$srcdir/$ac_dir" || continue + + ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" + $as_echo "$as_me:$LINENO: $ac_msg" >&5 + $as_echo "$ac_msg" >&6 + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + cd "$ac_dir" + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f "$ac_srcdir/configure.gnu"; then + ac_sub_configure=$ac_srcdir/configure.gnu + elif test -f "$ac_srcdir/configure"; then + ac_sub_configure=$ac_srcdir/configure + elif test -f "$ac_srcdir/configure.in"; then + # This should be Cygnus configure. + ac_sub_configure=$ac_aux_dir/configure + else + { $as_echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 +$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative name. + ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; + esac + + { $as_echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + # The eval makes quoting arguments work. + eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ + --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || + { { $as_echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 +$as_echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} + { (exit 1); exit 1; }; } + fi + + cd "$ac_popdir" + done +fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} diff --git a/configure.ac b/configure.ac index 96420844..8a3dbb80 100644 --- a/configure.ac +++ b/configure.ac @@ -1,28 +1,67 @@ AC_PREREQ([2.61]) -AC_INIT([ltp], [cvs], [ltp-results@lists.sourceforge.net]) -AM_INIT_AUTOMAKE([1.10]) +AC_INIT([ltp], [LTP_VERSION], [ltp-results@lists.sourceforge.net]) +AC_CONFIG_AUX_DIR([.]) +AM_INIT_AUTOMAKE AC_CONFIG_HEADERS([include/config.h]) -AC_CONFIG_FILES([config.mk m4/Makefile]) +AC_CONFIG_FILES([ \ + include/mk/config.mk \ + lib/ltp.pc \ + ltp-devel.spec \ + m4/Makefile \ + README.ltp-devel \ +]) + +AM_CONDITIONAL(CROSS_COMPILATION, test x$cross_compiling = xyes) AC_CANONICAL_HOST + AC_PROG_CC +# <= autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it. Not sure about +# 2.62. +AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)]) AC_PROG_AR +AC_PROG_LEX AC_PROG_RANLIB +AC_PROG_YACC + +AC_PREFIX_DEFAULT(/opt/ltp) AC_CHECK_HEADERS_ONCE([ \ -ifaddrs.h \ -sys/capability.h \ -sys/inotify.h \ -sys/epoll.h \ + dmapi.h \ + ifaddrs.h \ + libaio.h \ + mm.h \ + linux/genetlink.h \ + linux/module.h \ + linux/netlink.h \ + sys/acl.h \ + sys/epoll.h \ + sys/inotify.h \ + sys/jfsdmapi.h \ + sys/prctl.h \ ]) +# open_hpi_testsuite does NOT fit cleanly in the build. BLAH. +#AC_CONFIG_SUBDIRS([ \ +# testcases/open_hpi_testsuite/ \ +# testcases/kernel/syscalls/pcllib/ \ +#]) + +AC_CONFIG_SUBDIRS([ \ + testcases/kernel/syscalls/pcllib/ \ +]) + +LTP_CHECK_CAPABILITY_SUPPORT +LTP_CHECK_CRYPTO +LTP_CHECK_LINUX_PTRACE +LTP_CHECK_SELINUX LTP_CHECK_SYSCALL_EVENTFD LTP_CHECK_SYSCALL_MODIFY_LDT +LTP_CHECK_SYSCALL_NUMA +LTP_CHECK_SYSCALL_QUOTACTL LTP_CHECK_SYSCALL_SIGNALFD LTP_CHECK_SYSCALL_UNSHARE -LTP_CHECK_SELINUX -LTP_CHECK_CRYPTO +LTP_CHECK_SYSCALL_SWAPONOFF LTP_CHECK_TASKSTATS -LTP_CHECK_CGROUPSTATS AC_OUTPUT diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 00000000..b5f5b4c0 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,29 @@ +# +# Doc 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= .. + +include $(top_srcdir)/include/mk/env_pre.mk + +RECURSIVE_TARGETS := install + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/doc/man1/Makefile b/doc/man1/Makefile dissimilarity index 97% index 87f4e59f..faa189ea 100644 --- a/doc/man1/Makefile +++ b/doc/man1/Makefile @@ -1,12 +1,27 @@ - - -PREFIX=/usr -MANPAGES=ltp-bump.1 doio.1 iogen.1 ltp-pan.1 - -all: - -install: $(MANPAGES) - @set -e; for i in $(MANPAGES); do \ - install -D -m 644 $$i $(DESTDIR)/$(PREFIX)/share/man/man1/$$i; \ - done - +# +# man1 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. +# +# Garrett Cooper, July 2009 +# + +MANPREFIX := 1 + +top_srcdir ?= ../.. + +include $(top_srcdir)/include/mk/man.mk diff --git a/doc/man3/Makefile b/doc/man3/Makefile dissimilarity index 98% index bcd2a26d..46d67296 100644 --- a/doc/man3/Makefile +++ b/doc/man3/Makefile @@ -1,15 +1,27 @@ - - -PREFIX=/usr -MANPAGES=forker.3 get_attrib.3 parse_open_flags.3 parse_opts.3 \ - parse_ranges.3 pattern.3 random_range.3 random_range_seed.3 \ - rmobj.3 string_to_tokens.3 str_to_bytes.3 tst_res.3 \ - tst_set_error.3 tst_sig.3 tst_tmpdir.3 usctest.3 write_log.3 - -all: - -install: $(MANPAGES) - @set -e; for i in $(MANPAGES); do \ - install -D -m 644 $$i $(DESTDIR)/$(PREFIX)/share/man/man3/$$i; \ - done - +# +# man3 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. +# +# Garrett Cooper, July 2009 +# + +MANPREFIX := 3 + +top_srcdir ?= ../.. + +include $(top_srcdir)/include/mk/man.mk diff --git a/include/Makefile b/include/Makefile dissimilarity index 99% index b5944aaa..ba34d1fe 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,27 +1,47 @@ - - -PREFIX=/opt/ltp -HEADERS=compiler.h dataascii.h databin.h file_lock.h forker.h open_flags.h \ - pattern.h random_range.h rmobj.h search_path.h string_to_tokens.h \ - str_to_bytes.h test.h tlibio.h usctest.h write_log.h \ - linux_syscall_numbers.h libtestsuite.h config.h - -.PHONY: all install -all: - -install: $(HEADERS) - @set -e; for i in $(HEADERS); do \ - install -D -m 644 $$i $(DESTDIR)/$(PREFIX)/include/ltp/$$i; \ - done - -.PHONY: clean distclean maintainer-clean -clean: ac-clean -distclean: clean ac-distclean -maintainer-clean: distclean ac-maintainer-clean - -.PHONY: ac-clean ac-distclean ac-maintainerclean -ac-clean: -ac-distclean: - rm -f config.h -ac-maintainer-clean: - rm -f config.h.in +# +# include 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= .. + +include $(top_srcdir)/include/mk/env_pre.mk + +clean:: ac-clean + +INSTALL_DIR := $(includedir) + +INSTALL_MODE := 00644 + +INSTALL_TARGETS := *.h + +MAKE_TARGETS := + +.PHONY: ac-clean ac-distclean ac-maintainer-clean distclean maintainer-clean +distclean:: clean ac-distclean +maintainer-clean:: distclean ac-maintainer-clean +ac-clean ac-distclean:: + $(RM) -f config.h +ac-maintainer-clean:: + $(RM) -f config.h.in + +$(eval $(call generate_vpath_rule,h)) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/include/config.h.in b/include/config.h.in index 3f89d1c3..5b2ef45b 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -1,8 +1,82 @@ /* include/config.h.in. Generated from configure.ac by autoheader. */ +/* Define to 1 if you have the new implementation of quotactl that only + requires sys/types.h and sys/quota.h */ +#undef HAS_NEW_MINIMAL_QUOTACTL + +/* Define to 1 if you have the RHEL ~4.6 version of quotactl, e.g. require + linux/quota.h instead of sys/quota.h */ +#undef HAS_RHEL46_QUOTACTL + +/* Define to 1 if you have the RHEL 4.8+ version of quotactl, e.g. require + sys/quota.h instead of sys/quota.h */ +#undef HAS_RHEL48_QUOTACTL + /* Define to 1 if you have the header file. */ #undef HAVE_ASM_LDT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_ATTR_XATTR_H + +/* Define to 1 if you have the declaration of `CAP_BSET_DROP', and to 0 if you + don't. */ +#undef HAVE_DECL_CAP_BSET_DROP + +/* Define to 1 if you have the declaration of `CAP_BSET_READ', and to 0 if you + don't. */ +#undef HAVE_DECL_CAP_BSET_READ + +/* Define to 1 if you have the declaration of `cap_compare', and to 0 if you + don't. */ +#undef HAVE_DECL_CAP_COMPARE + +/* Define to 1 if you have the declaration of `cap_free', and to 0 if you + don't. */ +#undef HAVE_DECL_CAP_FREE + +/* Define to 1 if you have the declaration of `cap_from_text', and to 0 if you + don't. */ +#undef HAVE_DECL_CAP_FROM_TEXT + +/* Define to 1 if you have the declaration of `cap_get_proc', and to 0 if you + don't. */ +#undef HAVE_DECL_CAP_GET_PROC + +/* Define to 1 if you have the declaration of `cap_set_file', and to 0 if you + don't. */ +#undef HAVE_DECL_CAP_SET_FILE + +/* Define to 1 if you have the declaration of `cap_set_flag', and to 0 if you + don't. */ +#undef HAVE_DECL_CAP_SET_FLAG + +/* Define to 1 if you have the declaration of `cap_set_proc', and to 0 if you + don't. */ +#undef HAVE_DECL_CAP_SET_PROC + +/* Define to 1 if you have the declaration of `cap_to_text', and to 0 if you + don't. */ +#undef HAVE_DECL_CAP_TO_TEXT + +/* Define to 1 if you have the declaration of `PR_CAPBSET_READ', and to 0 if + you don't. */ +#undef HAVE_DECL_PR_CAPBSET_READ + +/* Define to 1 if you have the declaration of `PTRACE_GETSIGINFO', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_GETSIGINFO + +/* Define to 1 if you have the declaration of `PTRACE_O_TRACEVFORKDONE', and + to 0 if you don't. */ +#undef HAVE_DECL_PTRACE_O_TRACEVFORKDONE + +/* Define to 1 if you have the declaration of `PTRACE_SETOPTIONS', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_SETOPTIONS + +/* Define to 1 if you have the header file. */ +#undef HAVE_DMAPI_H + /* Define to 1 if you have the header file. */ #undef HAVE_IFADDRS_H @@ -18,21 +92,51 @@ /* Define to 1 if you have both SELinux libraries and headers. */ #undef HAVE_LIBSELINUX_DEVEL -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_CGROUPSTATS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_GENETLINK_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_MODULE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_NETLINK_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_PTRACE_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_SIGNALFD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_TASKSTATS_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MM_H + /* Define to 1 if you have the `modify_ldt' function. */ #undef HAVE_MODIFY_LDT +/* 2.6 version of swapon/swapoff */ +#undef HAVE_NEW_SWAPONOFF + +/* Define to 1 if you have the header file. */ +#undef HAVE_NUMAIF_H + +/* Define to 1 if you have the `numa_alloc_onnode' function. */ +#undef HAVE_NUMA_ALLOC_ONNODE + +/* Define to 1 if you have the header file. */ +#undef HAVE_NUMA_H + +/* 2.4 version of swapon/swapoff */ +#undef HAVE_OLD_SWAPONOFF + /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_SHA_H @@ -78,6 +182,9 @@ /* Define to 1 if the system has the type `struct user_desc'. */ #undef HAVE_STRUCT_USER_DESC +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_ACL_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CAPABILITY_H @@ -87,6 +194,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_INOTIFY_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_JFSDMAPI_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PRCTL_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SIGNALFD_H @@ -125,3 +238,7 @@ /* Version number of package */ #undef VERSION + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER diff --git a/include/mk/automake.mk b/include/mk/automake.mk new file mode 100644 index 00000000..d84b77fd --- /dev/null +++ b/include/mk/automake.mk @@ -0,0 +1,117 @@ +# +# Autotools include 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. +# +# Garrett Cooper, July 2009 +# + +# Override these variables to use non-system available tools. +ACLOCAL ?= aclocal +AUTOCONF ?= autoconf +AUTOHEADER ?= autoheader +AUTOMAKE ?= automake + +AUTOCONFED_SUBDIRS = \ + testcases/kernel/syscalls/pcllib \ + testcases/realtime + +testcases/realtime/configure: + $(MAKE) -C $(@D) autotools + +.PHONY: autotools +autotools: aclocal autoconf autoheader automake $(addsuffix /configure,$(AUTOCONFED_SUBDIRS)) + +.PHONY: aclocal +aclocal: aclocal.m4 + +aclocal.m4: $(wildcard m4/*.m4) m4/ltp-version.m4 + $(ACLOCAL) -I m4 + +.PHONY: autoconf +autoconf: configure + +configure: configure.ac aclocal.m4 + $(AUTOCONF) + +.PHONY: autoheader +autoheader: include/config.h.in + +include: + mkdir -p "$@" + +include/config.h.in: configure.ac $(wildcard m4/*.m4) m4/ltp-version.m4 + $(AUTOHEADER) + touch $@ + +include/config.h: $(abs_srcdir)/include/config.h.default | include + cp $^ $@ + +m4/ltp-version.m4: ChangeLog + sed -n '1{s:LTP-:AC_DEFUN([LTP_VERSION],[:;s:$$:]):;p;q}' $< > $@ + +.PHONY: automake +AUTOMAKE_FILES := config.guess config.sub install-sh missing stamp-h1 +automake: aclocal $(AUTOMAKE_FILES) +$(AUTOMAKE_FILES): m4/Makefile.in +m4/Makefile.in: m4/Makefile.am + $(AUTOMAKE) -c -a + +.PHONY: ac-clean ac-distclean ac-maintainer-clean +ac-clean:: + $(RM) -rf autom4te.cache + $(RM) -f aclocal.m4 config.log config.status + $(RM) -f include/config.h include/config.h.in include/stamp-h1 + $(RM) -f m4/Makefile m4/ltp-version.m4 + -for d in $(AUTOCONFED_SUBDIRS); do \ + $(MAKE) -C "$(top_srcdir)/$$d" $@; \ + done + +ac-distclean:: ac-clean +ac-maintainer-clean:: ac-distclean + -for d in $(AUTOCONFED_SUBDIRS); do \ + $(MAKE) -C "$(top_srcdir)/$$d" $@; \ + done + $(RM) -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in + +AUTOCONFED_SUBDIRS = \ + testcases/kernel/syscalls/pcllib \ + testcases/realtime + +# Don't include config.h, or make will (rightfully) whine about overriding +# rules. +AUTOGENERATED_FILES = \ + include/mk/config.mk \ + lib/ltp.pc \ + m4/Makefile \ + ltp-devel.spec \ + README.ltp-devel + +distclean:: %: clean ac-distclean + -for d in $(AUTOCONFED_SUBDIRS); do \ + $(MAKE) -C "$(top_srcdir)/$$d" $@; \ + done + $(RM) -f $(AUTOGENERATED_FILES) + +maintainer-clean:: distclean ac-maintainer-clean + +$(AUTOGENERATED_FILES): $(top_builddir)/config.status + $(SHELL) $^ + +$(top_builddir)/config.status: + $(MAKE) -C $(top_srcdir) help; \ + exit 1 diff --git a/include/mk/config.mk.default b/include/mk/config.mk.default new file mode 100644 index 00000000..793f3544 --- /dev/null +++ b/include/mk/config.mk.default @@ -0,0 +1,69 @@ +# +# config.mk.in. +# +# 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. +# +# Garrett Cooper, July 2009 +# + +# See this page for more info about LEX*: +# http://www.gnu.org/software/hello/manual/autoconf/Particular-Programs.html + +# Application specifying variables. You should never have to change these. +AR := ar +CC := gcc +LEX := flex +RANLIB := ranlib +YACC := bison -y + +#AIO_LIBS := -laio +#CAP_LIBS := -lcap +#CRYPTO_LIBS := -lcrypto +LEXLIB := -lfl +#NUMA_LIBS := -lnuma +#SELINUX_LIBS := -lselinux + +prefix := /opt/ltp + +datarootdir := ${prefix}/share +includedir := ${prefix}/include +exec_prefix := ${prefix} +libdir := ${exec_prefix}/lib +mandir := ${datarootdir}/man + +RPMBUILD ?= rpmbuild + +CPPFLAGS := +CFLAGS := -g -O2 +LDLIBS := +LDFLAGS := + +DEBUG_CFLAGS ?= -g +DEBUG_CXXFLAGS ?= $(DEBUG_CFLAGS) + +# Please see README.mk-devel about -fstrict-aliasing. +OPT_CFLAGS ?= -O2 -fno-strict-aliasing -pipe +OPT_CXXFLAGS ?= $(OPT_CFLAGS) + +WCFLAGS ?= -Wall +WCXXFLAGS ?= $(WCFLAGS) + +LDFLAGS += $(WLDFLAGS) +CFLAGS += $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS) +CXXFLAGS += $(DEBUG_CXXFLAGS) $(OPT_CXXFLAGS) $(WCXXFLAGS) + +export datarootdir includedir libdir mandir prefix diff --git a/include/mk/config.mk.in b/include/mk/config.mk.in new file mode 100644 index 00000000..61a676ce --- /dev/null +++ b/include/mk/config.mk.in @@ -0,0 +1,69 @@ +# +# config.mk.in. +# +# 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. +# +# Garrett Cooper, July 2009 +# + +# See this page for more info about LEX*: +# http://www.gnu.org/software/hello/manual/autoconf/Particular-Programs.html + +# Application specifying variables. You should never have to change these. +AR := @AR@ +CC := @CC@ +LEX := @LEX@ +RANLIB := @RANLIB@ +YACC := @YACC@ + +AIO_LIBS := @AIO_LIBS@ +CAP_LIBS := @CAP_LIBS@ +CRYPTO_LIBS := @CRYPTO_LIBS@ +LEXLIB := @LEXLIB@ +NUMA_LIBS := @NUMA_LIBS@ +SELINUX_LIBS := @SELINUX_LIBS@ + +prefix := @prefix@ + +datarootdir := @datarootdir@ +includedir := @includedir@ +exec_prefix := @exec_prefix@ +libdir := @libdir@ +mandir := @mandir@ + +RPMBUILD ?= rpmbuild + +CPPFLAGS := @CPPFLAGS@ +CFLAGS := @CFLAGS@ +LDLIBS := @LIBS@ +LDFLAGS := @LDFLAGS@ + +DEBUG_CFLAGS ?= -g +DEBUG_CXXFLAGS ?= $(DEBUG_CFLAGS) + +# Please see README.mk-devel about -fstrict-aliasing. +OPT_CFLAGS ?= -O2 -fno-strict-aliasing -pipe +OPT_CXXFLAGS ?= $(OPT_CFLAGS) + +WCFLAGS ?= -Wall +WCXXFLAGS ?= $(WCFLAGS) + +LDFLAGS += $(WLDFLAGS) +CFLAGS += $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS) +CXXFLAGS += $(DEBUG_CXXFLAGS) $(OPT_CXXFLAGS) $(WCXXFLAGS) + +export datarootdir includedir libdir mandir prefix diff --git a/include/mk/env_post.mk b/include/mk/env_post.mk new file mode 100644 index 00000000..2120f9f1 --- /dev/null +++ b/include/mk/env_post.mk @@ -0,0 +1,78 @@ +# +# Environment post-setup 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. +# +# Garrett Cooper, July 2009 +# + +ENV_PRE_LOADED ?= $(error You must load env_pre.mk before including this file) + +include $(top_srcdir)/include/mk/functions.mk + +ifndef ENV_POST_LOADED +ENV_PRE_LOADED = 1 + +# Default source search path. Modify as necessary, but I would call that +# poor software design if you need more than one search directory, and +# would suggest creating a general purpose static library to that end. +$(eval $(call generate_vpath_rule,c)) + +# For config.h, et all. +CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include + +LDFLAGS += -L$(top_builddir)/lib + +MAKE_TARGETS ?= $(filter-out $(FILTER_OUT_MAKE_TARGETS),$(notdir $(patsubst %.c,%,$(wildcard $(abs_srcdir)/*.c)))) + +CLEAN_TARGETS += $(MAKE_TARGETS) *.o *.pyc + +# Majority of the files end up in testcases/bin... +INSTALL_DIR ?= testcases/bin + +ifneq ($(filter-out install,$(MAKECMDGOALS)),$(MAKECMDGOALS)) + +ifeq ($(strip $(INSTALL_DIR)),) +INSTALL_DIR := $(error You must define INSTALL_DIR before including this file) +endif + +ifneq ($(strip $(prefix)),) +# Value specified by INSTALL_DIR isn't an absolute path, so let's tack on $(prefix). +ifneq ($(patsubst /%,,$(INSTALL_DIR)),) +INSTALL_DIR := $(prefix)/$(INSTALL_DIR) +endif + +# Glob any possible expressions, but make sure to zap the $(abs_srcdir) +# reference at the start of the filename instead of using $(notdir), so that +# way we don't accidentally nuke the relative path from $(abs_srcdir) that +# may have been set in the Makefile. +INSTALL_TARGETS := $(wildcard $(addprefix $(abs_srcdir)/,$(INSTALL_TARGETS))) +INSTALL_TARGETS := $(patsubst $(abs_srcdir)/%,%,$(INSTALL_TARGETS)) + +# The large majority of the files that we install are going to be apps and +# scripts, so let's chmod them like that. +INSTALL_MODE ?= 00775 + +$(foreach im_dir,$(sort $(dir $(INSTALL_TARGETS) $(MAKE_TARGETS))),$(eval $(call generate_install_rule_dir_dep,$(INSTALL_DIR),$(im_dir)))) +$(foreach install_target,$(INSTALL_TARGETS),$(eval $(call generate_install_rule,$(install_target),$(abs_srcdir),$(INSTALL_DIR)))) +$(foreach make_target,$(MAKE_TARGETS),$(eval $(call generate_install_rule,$(make_target),$(abs_builddir),$(INSTALL_DIR)))) +else +$(error You must define $$(prefix) before executing install) +endif +endif + +endif diff --git a/include/mk/env_pre.mk b/include/mk/env_pre.mk new file mode 100644 index 00000000..fa7f9b92 --- /dev/null +++ b/include/mk/env_pre.mk @@ -0,0 +1,69 @@ +# +# Make pre-include environment 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. +# +# Garrett Cooper, September 2009 +# +# This Makefile must be included first. NO IF'S, AND'S, OR BUT'S. +# +# This sets the stage for all operations required within Makefiles. +# + +ifndef ENV_PRE_LOADED +ENV_PRE_LOADED = 1 + +# Get the absolute path for the source directory. +top_srcdir ?= $(error You must define top_srcdir before including this file) + +# Where's the root source directory? +abs_top_srcdir := $(abspath $(top_srcdir)) + +# +# Where's the root object directory? +# +# Just in case it's not specified, set it to the top srcdir (because the user +# must not have wanted out of build tree support)... +# +top_builddir ?= $(top_srcdir) + +# We need the absolute path... +abs_top_builddir := $(abspath $(top_builddir)) + +# Where's the root object directory? +builddir := . + +abs_builddir := $(CURDIR) + +# Where's the source located at? Squish all of the / away by using abspath... +abs_srcdir := $(abspath $(abs_top_srcdir)/$(subst $(abs_top_builddir),,$(abs_builddir))) + +srcdir := $(or $(subst $(abs_top_srcdir)/,,$(abs_srcdir)),.) + +ifneq ($(abs_builddir),$(abs_srcdir)) +export OUT_OF_BUILD_TREE := 1 +endif + +# We can piece together where we're located in the source and object trees with +# just these two vars and $(CURDIR). +export abs_top_srcdir abs_top_builddir + +-include $(top_builddir)/include/mk/config.mk + +.DEFAULT_GOAL := all + +endif diff --git a/include/mk/functions.mk b/include/mk/functions.mk new file mode 100644 index 00000000..8b7d4464 --- /dev/null +++ b/include/mk/functions.mk @@ -0,0 +1,83 @@ +# +# A Makefile with a collection of reusable functions. +# +# 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. +# +# Garrett Cooper, July 2009 +# + +# +# Generate the directory install dependency separate from generate_install_rule +# to avoid noise from Make about redefining existing targets, for good reason. +# +# 1 -> The base install directory, based off $(prefix), or another +# $(prefix)-like variable. Automatically gets $(DESTDIR) tacked on it. +# 2 -> The install target. This can be relative to $(srcdir), but will most +# likely be `empty'. +# +define generate_install_rule_dir_dep + +$$(abspath $(DESTDIR)/$(1)/$(2)): + mkdir -p "$$@" + +endef + +# +# Generate an install rule which also creates the install directory if needed +# to avoid unnecessary bourne shell based for-loops and install errors, as well +# as adhoc install rules. +# +# 1 -> Target basename. +# 2 -> Source directory. +# 3 -> Destination directory. +# +define generate_install_rule + +# This doesn't do Jack currently, as per the $(MAKECMDGOALS) check in +# env_post.mk. I can revisit this `enhancement' later. +#CLEAN_TARGETS += $$(INSTALL_FILE) +INSTALL_FILES += $$(abspath $(DESTDIR)/$(3)/$(1)) + +$$(abspath $(DESTDIR)/$(3)/$(1)): $$(abspath $$(dir $(DESTDIR)/$(3)/$(1))) +ifdef INSTALL_PRE + @echo "Executing preinstall command." + $$(INSTALL_PRE) +endif + install -m $$(INSTALL_MODE) "$(2)/$(1)" "$$@" +ifdef INSTALL_POST + @echo "Executing preinstall command." + $$(INSTALL_POST) +endif +endef + +# +# Create a vpath rule for a given extension. +# +# 1 -> file extension +# 2 -> search directory. Defaults to $(abs_srcdir) if not specified. +# +define generate_vpath_rule +vpath %.$(1) $$(if $(2),$(2),$(abs_srcdir)) +endef + +# +# Set SUBDIRS to the subdirectories where Makefiles were found. +# +define get_make_dirs +SUBDIRS ?= $$(subst $(abs_srcdir)/,,$$(patsubst %/Makefile,%,$$(wildcard $(abs_srcdir)/*/Makefile))) +SUBDIRS := $$(filter-out $$(FILTER_OUT_DIRS),$$(SUBDIRS)) +endef diff --git a/include/mk/generic_leaf_target.inc b/include/mk/generic_leaf_target.inc new file mode 100644 index 00000000..e7309811 --- /dev/null +++ b/include/mk/generic_leaf_target.inc @@ -0,0 +1,102 @@ +# +# Generic leaf rules include 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. +# +# Garrett Cooper, July 2009 +# + +# +# generic_leaf_target +# +# Generate a set of basic targets (all, clean, install) for a leaf directory +# (no subdirectories). +# +# $(MAKE_DEPS) : What should we execute beforehand as a +# dependency of $(MAKE_TARGETS)? +# +# $(INSTALL_FILES) -> install +# +# Helpful variables are: +# +# $(MAKE_TARGETS) : What to execute as direct dependencies of +# all. +# 1. Defaults to the basename of the targets +# produced by the %.c -> % implicit pattern +# rules, e.g. the MAKE_TARGET in a directory +# like the following: +# +# $$ ls /bar +# foo.c +# +# Would be `foo'. Similarly, the following +# dir structure: +# +# $$ ls /bar +# foo.c zanzibar.c +# +# Would be `foo zanzibar'. +# +# 2. If you define MAKE_TARGETS as an empty +# string, this will override the defaults. +# I did this to avoid providing too much +# rope to hang one's self in the event of +# unwanted behavior. +# +# $(CLEAN_TARGETS) : What targets should be cleaned (must be +# real files). This will automatically append +# adds the .o suffix to all files referenced +# by $(MAKE_TARGETS)) to CLEAN_TARGETS, if +# MAKE_TARGETS wasn't defined (see +# $(MAKE_TARGETS)). +# $(INSTALL_MODE) : What mode should we using when calling +# install(1)? +# +# Also, if you wish to change the installation directory, from the set default +# (testcases/bin) you must do something like either one of the following items: +# +# Method A: +# +# INSTALL_DIR := /path/to/installdir/from/$(DESTDIR)/$(prefix) +# +# e.g. if I wanted to install my binaries in testcases/bin, I would do: +# +# INSTALL_DIR := testcases/bin +# +# in my calling Makefile. +# +# Or Method B: +# +# INSTALL_DIR := /path/to/installdir/from/$(DESTDIR) +# +# e.g. if I wanted to install my binaries in $(libdir) (which may not exist +# outside of $(prefix) right now, but could in the future), I could do the +# following: +# +# INSTALL_DIR := $(libdir) +# + +.PHONY: all clean install + +all: $(MAKE_DEPS) | $(MAKE_TARGETS) + +clean:: + -$(RM) -f $(CLEAN_TARGETS) + +install: $(INSTALL_FILES) | $(INSTALL_DEPS) + +# vim: syntax=make diff --git a/include/mk/generic_leaf_target.mk b/include/mk/generic_leaf_target.mk new file mode 100644 index 00000000..cb6db5e9 --- /dev/null +++ b/include/mk/generic_leaf_target.mk @@ -0,0 +1,24 @@ +# +# Generic leaf include 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. +# +# Garrett Cooper, July 2009 +# + +include $(top_srcdir)/include/mk/env_post.mk +include $(top_srcdir)/include/mk/generic_leaf_target.inc diff --git a/include/mk/generic_trunk_target.inc b/include/mk/generic_trunk_target.inc new file mode 100644 index 00000000..2f09a632 --- /dev/null +++ b/include/mk/generic_trunk_target.inc @@ -0,0 +1,94 @@ +# +# Generic trunk rules include 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. +# +# Garrett Cooper, July 2009 +# + +# +# generic_trunk_target +# +# Generate a set of recursive targets to apply over a trunk directory (has +# directories) -- optionally with a set of trunk-based files. +# +# All variables in this canned define are essentially the same as +# generic_leaf_target, with the exception that the install flow for local +# targets is: +# +# $(INSTALL_FILES) -> trunk-install -> install (recursive) +# +# All recursive targets are traverse SUBDIRS as defined by the user, or if +# undefined, defaults to any subdirectories where Makefile's are contained +# within. +# +# generic_trunk_target specific variables are: +# +# RECURSIVE_TARGETS : a list of targets to apply over an entire +# directory tree. This defaults to +# `all install'. +# +# See generic_leaf_target, generic_target_env_setup, and get_make_dirs for +# more details and design notes. +# + +include $(top_srcdir)/include/mk/functions.mk + +RECURSIVE_TARGETS ?= all install + +$(eval $(get_make_dirs)) + +.PHONY: $(RECURSIVE_TARGETS) $(addprefix trunk-,$(RECURSIVE_TARGETS)) + +$(SUBDIRS): %: + mkdir -m 00755 -p "$@" + +trunk-all: $(MAKE_DEPS) | $(MAKE_TARGETS) + +trunk-clean:: | $(SUBDIRS) + $(if $(strip $(CLEAN_TARGETS)),$(RM) -f $(CLEAN_TARGETS)) + +trunk-install: $(INSTALL_FILES) + +# Avoid creating duplicate .PHONY references to all, clean, and install. IIRC, +# I've seen some indeterministic behavior when one does this in the past with +# GNU Make... +.PHONY: $(filter-out $(RECURSIVE_TARGETS),all clean install) +all: trunk-all + +clean:: trunk-clean + set -e; for dir in $(SUBDIRS); do \ + $(MAKE) -C "$$dir" -f "$(abs_srcdir)/$$dir/Makefile" $@; \ + done +ifneq ($(abs_builddir),$(abs_srcdir)) + $(RM) -Rf $(SUBDIRS) +endif + +install: trunk-install + +# Print out CURDIR to check for a recursion issue. +ifeq ($(strip $(SUBDIRS)),) + $(warning CURDIR is: $(CURDIR)) + $(error SUBDIRS empty -- did you want generic_leaf_target instead?) +else +$(RECURSIVE_TARGETS): %: | $(SUBDIRS) + @set -e; for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir -f "$(abs_srcdir)/$$dir/Makefile" $@; \ + done +endif + +# vim: syntax=make diff --git a/include/mk/generic_trunk_target.mk b/include/mk/generic_trunk_target.mk new file mode 100644 index 00000000..f480ef6a --- /dev/null +++ b/include/mk/generic_trunk_target.mk @@ -0,0 +1,24 @@ +# +# Generic trunk include 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. +# +# Garrett Cooper, July 2009 +# + +include $(top_srcdir)/include/mk/env_post.mk +include $(top_srcdir)/include/mk/generic_trunk_target.inc diff --git a/include/mk/lib.mk b/include/mk/lib.mk new file mode 100644 index 00000000..48597240 --- /dev/null +++ b/include/mk/lib.mk @@ -0,0 +1,55 @@ +# +# library include 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. +# +# Garrett Cooper, July 2009 +# + +# Makefile to include for libraries. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_DIR := $(libdir) + +# An extension of generic_leaf_target, strictly for libraries. +.PHONY: install_headers + +ifndef LIB +$(error You must define LIB when including this Makefile) +endif + +install_headers: $(addprefix $(DESTDIR)/$(includedir)/,$(notdir $(HEADER_FILES))) + +INSTALL_MODE ?= 00664 + +MAKE_TARGETS := $(LIB) + +LIBSRCS ?= $(wildcard $(abs_srcdir)/*.c) +LIBSRCS := $(subst $(abs_srcdir)/,,$(wildcard $(abspath $(LIBSRCS)))) + +LIBOBJS := $(LIBSRCS:.c=.o) + +$(LIB): $(notdir $(LIBOBJS)) + if [ -z "$(strip $^)" ] ; then \ + echo "Cowardly refusing to create empty archive"; \ + exit 1; \ + fi + $(if $(AR),$(AR),ar) -rc "$@" $^ + $(if $(RANLIB),$(RANLIB),ranlib) "$@" + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/include/mk/man.mk b/include/mk/man.mk new file mode 100644 index 00000000..88abc6d8 --- /dev/null +++ b/include/mk/man.mk @@ -0,0 +1,35 @@ +# +# Manpage include 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. +# +# Garrett Cooper, July 2009 +# + +ifeq ($(strip $(MANPREFIX)),) +$(error $$(MANPREFIX) not defined) +endif + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_DIR := $(mandir)/man$(MANPREFIX) + +INSTALL_TARGETS ?= *.$(MANPREFIX) + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/include/mk/testcases.mk b/include/mk/testcases.mk new file mode 100644 index 00000000..b3cebc38 --- /dev/null +++ b/include/mk/testcases.mk @@ -0,0 +1,58 @@ +# +# testcases include 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. +# +# Garrett Cooper, July 2009 +# + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/functions.mk + +APICMDS_DIR := $(abs_top_builddir)/tools/apicmds + +TKI_DIR := testcases/kernel/include + +LSN_H := $(abs_top_builddir)/$(TKI_DIR)/linux_syscall_numbers.h + +LIBLTP_DIR := $(abs_top_builddir)/lib + +LIBLTP := $(LIBLTP_DIR)/libltp.a + +$(APICMDS_DIR)/tst_kvercmp: $(APICMDS_DIR) + $(MAKE) -C "$^" -f "$(abs_top_srcdir)/tools/apicmds/Makefile" all + +$(LIBLTP): $(LIBLTP_DIR) + $(MAKE) -C "$^" -f "$(abs_top_srcdir)/lib/Makefile" all + +$(LSN_H): $(abs_top_builddir)/$(TKI_DIR) + $(MAKE) -C "$^" -f "$(abs_top_srcdir)/$(TKI_DIR)/Makefile" all + +MAKE_DEPS := $(LIBLTP) $(LSN_H) + +# For linux_syscall_numbers.h +CPPFLAGS += -I$(abs_top_builddir)/$(TKI_DIR) + +INSTALL_DIR := testcases/bin + +LDLIBS += -lltp + +# Should be using this. Not enough time to implement this before commit. BLEH. +#$(foreach dep_dir,$(LIBLTP_DIR) $(abs_top_builddir)/$(TKI_DIR),$(eval $(call generate_install_rule_dir_dep,$(dep_dir)))) + +$(LIBLTP_DIR) $(abs_top_builddir)/$(TKI_DIR): %: + mkdir -p "$@" diff --git a/lib/Makefile b/lib/Makefile dissimilarity index 93% index 7e3b81a4..10d8d6a7 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,28 +1,41 @@ - -PREFIX=/opt/ltp - -CFLAGS+= -Wall -CPPFLAGS+= -I../include -ifeq ($(shell uname -s),HP-UX) -CFLAGS+=-Ae -D_LARGEFILE64_SOURCE +DA1.1 -endif -ifeq ($(UCLINUX),1) -CFLAGS+= -D_USC_LIB_ -D__UCLIBC__ -DUCLINUX -endif -LDFLAGS+= -TARGET=libltp.a -SRCS=$(wildcard *.c) -OBJS=$(patsubst %.c,%.o,$(SRCS)) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(AR) -cr $@ $^ - -clean: - rm -f $(TARGET) *.o - -install: $(TARGET) - install -D -m 644 $(TARGET) $(DESTDIR)/$(PREFIX)/lib$(LIBSUFFIX)/$(TARGET) - install -D -m 644 ltp.pc $(DESTDIR)/$(PREFIX)/share/pkgconfig/ltp.pc - +# +# lib 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= .. + +include $(top_srcdir)/include/mk/env_pre.mk + +ifeq ($(UCLINUX),1) +CFLAGS += -D_USC_LIB_ -D__UCLIBC__ -DUCLINUX +endif + +LIB := libltp.a + +pc_file := $(DESTDIR)/$(datarootdir)/pkgconfig/ltp.pc + +INSTALL_TARGETS := $(pc_file) + +$(pc_file): + test -d "$(@D)" || mkdir -p "$(@D)" + install -m $(INSTALL_MODE) "$(builddir)/$(@F)" "$@" + +include $(top_srcdir)/include/mk/lib.mk diff --git a/lib/ltp.pc b/lib/ltp.pc deleted file mode 100644 index 61359454..00000000 --- a/lib/ltp.pc +++ /dev/null @@ -1,11 +0,0 @@ -prefix=/opt/ltp -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: LTP -Description: Linux Test Project -Version: 1.0 -Libs: -L${libdir} -lltp -Cflags: -I${includedir} -Libs.private: -L${libdir} -lltp diff --git a/lib/ltp.pc.in b/lib/ltp.pc.in new file mode 100644 index 00000000..96201292 --- /dev/null +++ b/lib/ltp.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ + +Name: LTP +Description: Linux Test Project +Version: @VERSION@ +Libs: -L${libdir} -lltp +Cflags: -I${includedir} diff --git a/lib/tst_res.c b/lib/tst_res.c index 742ab3a1..ded3cd65 100644 --- a/lib/tst_res.c +++ b/lib/tst_res.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. - * Copyring (c) 2009 Cyril Hrubis chrubis@suse.cz + * Copyright (c) 2009 Cyril Hrubis chrubis@suse.cz * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -32,7 +32,7 @@ */ -/* $Id: tst_res.c,v 1.12 2009/08/28 11:05:36 vapier Exp $ */ +/* $Id: tst_res.c,v 1.13 2009/10/13 13:59:29 subrata_modak Exp $ */ /********************************************************** * @@ -131,20 +131,18 @@ * EXPAND_VAR_ARGS - Expand the variable portion (arg_fmt) of a result * message into the specified string. */ -#define EXPAND_VAR_ARGS(arg_fmt, str) { \ - va_list ap; /* varargs mechanism */ \ - \ - if (arg_fmt != NULL) { \ - if ( Expand_varargs == TRUE ) { \ - va_start(ap, arg_fmt); \ - vsprintf(str, arg_fmt, ap); \ - va_end(ap); \ - } else { \ - strcpy(str, arg_fmt); \ - } \ - } else { \ - str[0] = '\0'; \ - } \ +#define EXPAND_VAR_ARGS(buf, arg_fmt, buf_len) { \ + va_list ap; \ + \ + if (arg_fmt != NULL) { \ + if (Expand_varargs) { \ + va_start(ap, arg_fmt); \ + vsnprintf(buf, buf_len, arg_fmt, ap); \ + va_end(ap); \ + } else \ + strncpy(buf, arg_fmt, buf_len); \ + } else \ + buf[0] = '\0'; \ } /* @@ -300,7 +298,7 @@ void tst_res(int ttype, char *fname, char *arg_fmt, ...) Tst_count, Tst_range); fflush(stdout); #endif - EXPAND_VAR_ARGS(arg_fmt, tmesg); + EXPAND_VAR_ARGS(tmesg, arg_fmt, USERMESG); /* * Save the test result type by ORing ttype into the current exit @@ -625,7 +623,7 @@ void tst_brk(int ttype, char *fname, void (*func)(void), char *arg_fmt, ...) fflush(stdout); #endif - EXPAND_VAR_ARGS(arg_fmt, tmesg); + EXPAND_VAR_ARGS(tmesg, arg_fmt, USERMESG); /* * Only FAIL, BROK, CONF, and RETR are supported by tst_brk(). @@ -686,7 +684,7 @@ void tst_brkloop(int ttype, char *fname, void (*func)(void), char *arg_fmt, ...) fflush(stdout); #endif - EXPAND_VAR_ARGS(arg_fmt, tmesg); + EXPAND_VAR_ARGS(tmesg, arg_fmt, USERMESG); if (Tst_lpstart < 0 || Tst_lptotal < 0) { tst_print(TCID, 0, 1, TWARN, @@ -748,7 +746,7 @@ void tst_resm(int ttype, char *arg_fmt, ...) fflush(stdout); #endif - EXPAND_VAR_ARGS(arg_fmt, tmesg); + EXPAND_VAR_ARGS(tmesg, arg_fmt, USERMESG); tst_res(ttype, NULL, "%s", tmesg); } @@ -766,7 +764,7 @@ void tst_brkm(int ttype, void (*func)(void), char *arg_fmt, ...) fflush(stdout); #endif - EXPAND_VAR_ARGS(arg_fmt, tmesg); + EXPAND_VAR_ARGS(tmesg, arg_fmt, USERMESG); tst_brk(ttype, NULL, func, "%s", tmesg); } @@ -784,7 +782,7 @@ void tst_brkloopm(int ttype, void (*func)(void), char *arg_fmt, ...) fflush(stdout); #endif - EXPAND_VAR_ARGS(arg_fmt, tmesg); + EXPAND_VAR_ARGS(tmesg, arg_fmt, USERMESG); tst_brkloop(ttype, NULL, func, "%s", tmesg); } diff --git a/ltp-devel.spec b/ltp-devel.spec deleted file mode 100644 index e82cceba..00000000 --- a/ltp-devel.spec +++ /dev/null @@ -1,68 +0,0 @@ -# -# RPM Package Manager (RPM) spec file for ltp-devel -# -Summary: Linux Test Project (LTP) Software Development Kit (SDK) -Name: ltp-devel -Version: 2.0 -Release: 0.0 -Prefix: /opt/ltp -License: GPL -Group: Development/Libraries -URL: http://www.linuxtestproject.org -Vendor: IBM Corp -Packager: Subrata Modak -AutoReqProv: 0 -Provides: LTP -#ExclusiveArch: i386 -ExclusiveOS: linux -%description -This is a development package of the Linux Test Project (LTP). -It is intended to be used to build testcases using the provided API. -%files -/opt/ltp/lib/libltp.a -/usr/share/pkgconfig/ltp.pc -/opt/ltp/bin/ltp-pan -/opt/ltp/bin/ltp-scanner -/opt/ltp/bin/ltp-bump -/opt/ltp/include/linux_syscall_numbers.h -/opt/ltp/include/libtestsuite.h -/opt/ltp/include/usctest.h -/opt/ltp/include/string_to_tokens.h -/opt/ltp/include/str_to_bytes.h -/opt/ltp/include/databin.h -/opt/ltp/include/open_flags.h -/opt/ltp/include/write_log.h -/opt/ltp/include/dataascii.h -/opt/ltp/include/forker.h -/opt/ltp/include/compiler.h -/opt/ltp/include/test.h -/opt/ltp/include/tlibio.h -/opt/ltp/include/pattern.h -/opt/ltp/include/file_lock.h -/opt/ltp/include/random_range.h -/opt/ltp/include/search_path.h -/opt/ltp/include/rmobj.h -/usr/share/man/man3/tst_tmpdir.3 -/usr/share/man/man3/random_range_seed.3 -/usr/share/man/man3/pattern.3 -/usr/share/man/man3/parse_ranges.3 -/usr/share/man/man3/usctest.3 -/usr/share/man/man3/random_range.3 -/usr/share/man/man3/forker.3 -/usr/share/man/man3/rmobj.3 -/usr/share/man/man3/parse_open_flags.3 -/usr/share/man/man3/tst_res.3 -/usr/share/man/man3/write_log.3 -/usr/share/man/man3/str_to_bytes.3 -/usr/share/man/man3/tst_set_error.3 -/usr/share/man/man3/parse_opts.3 -/usr/share/man/man3/string_to_tokens.3 -/usr/share/man/man3/tst_sig.3 -/usr/share/man/man3/get_attrib.3 -/usr/share/man/man1/ltp-pan.1 -/usr/share/man/man1/doio.1 -/usr/share/man/man1/iogen.1 -/usr/share/man/man1/ltp-bump.1 -# Post-install stuff would go here. -#EOF - diff --git a/ltp-devel.spec.in b/ltp-devel.spec.in new file mode 100644 index 00000000..83d0942b --- /dev/null +++ b/ltp-devel.spec.in @@ -0,0 +1,68 @@ +# +# RPM Package Manager (RPM) spec file for ltp-devel +# +Summary: Linux Test Project (LTP) Software Development Kit (SDK) +Name: ltp-devel +Version: 2.0 +Release: 0.0 +Prefix: @prefix@ +License: GPL +Group: Development/Libraries +URL: http://www.linuxtestproject.org +Vendor: IBM Corp +Packager: Subrata Modak +AutoReqProv: 0 +Provides: LTP +#ExclusiveArch: i386 +ExclusiveOS: linux +%description +This is a development package of the Linux Test Project (LTP). +It is intended to be used to build testcases using the provided API. +%files +@prefix@/lib/libltp.a +@datarootdir@/pkgconfig/ltp.pc +@prefix@/bin/ltp-pan +@prefix@/bin/ltp-scanner +@prefix@/bin/ltp-bump +@prefix@/include/linux_syscall_numbers.h +@prefix@/include/libtestsuite.h +@prefix@/include/usctest.h +@prefix@/include/string_to_tokens.h +@prefix@/include/str_to_bytes.h +@prefix@/include/databin.h +@prefix@/include/open_flags.h +@prefix@/include/write_log.h +@prefix@/include/dataascii.h +@prefix@/include/forker.h +@prefix@/include/compiler.h +@prefix@/include/test.h +@prefix@/include/tlibio.h +@prefix@/include/pattern.h +@prefix@/include/file_lock.h +@prefix@/include/random_range.h +@prefix@/include/search_path.h +@prefix@/include/rmobj.h +@mandir@/man3/tst_tmpdir.3 +@mandir@/man3/random_range_seed.3 +@mandir@/man3/pattern.3 +@mandir@/man3/parse_ranges.3 +@mandir@/man3/usctest.3 +@mandir@/man3/random_range.3 +@mandir@/man3/forker.3 +@mandir@/man3/rmobj.3 +@mandir@/man3/parse_open_flags.3 +@mandir@/man3/tst_res.3 +@mandir@/man3/write_log.3 +@mandir@/man3/str_to_bytes.3 +@mandir@/man3/tst_set_error.3 +@mandir@/man3/parse_opts.3 +@mandir@/man3/string_to_tokens.3 +@mandir@/man3/tst_sig.3 +@mandir@/man3/get_attrib.3 +@mandir@/man1/ltp-pan.1 +@mandir@/man1/doio.1 +@mandir@/man1/iogen.1 +@mandir@/man1/ltp-bump.1 +# Post-install stuff would go here. +#EOF + diff --git a/m4/GNUmakefile b/m4/GNUmakefile dissimilarity index 97% index a1641d49..79c8ae27 100644 --- a/m4/GNUmakefile +++ b/m4/GNUmakefile @@ -1,12 +1,37 @@ - - -PREFIX=/opt/ltp -M4MACROS=$(notdir $(wildcard *.m4)) - -all: - -install: $(M4MACROS) - for i in $(M4MACROS); do \ - install -D -m 644 $$i $(DESTDIR)/$(PREFIX)/share/aclocal/$$i; \ - done - +# +# m4 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= .. + +include $(top_srcdir)/include/mk/env_pre.mk + +M4MACROS := $(notdir $(wildcard *.m4)) + +INSTALL_DIR := $(datarootdir)/aclocal + +INSTALL_MODE := 00644 + +INSTALL_TARGETS := $(M4_MACROS) + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/m4/ac_prog_ar.m4 b/m4/ac_prog_ar.m4 deleted file mode 100644 index 86e00868..00000000 --- a/m4/ac_prog_ar.m4 +++ /dev/null @@ -1,7 +0,0 @@ -dnl based on AC_PROG_RANLIB from autoconf -m4_ifndef([AC_PROG_AR],[dnl -AN_MAKEVAR([AR], [AC_PROG_AR]) -AN_PROGRAM([ar], [AC_PROG_AR]) -AC_DEFUN([AC_PROG_AR], -[AC_CHECK_TOOL(AR, ar, :)]) -]) diff --git a/m4/ltp-cap.m4 b/m4/ltp-cap.m4 new file mode 100644 index 00000000..5f8d969b --- /dev/null +++ b/m4/ltp-cap.m4 @@ -0,0 +1,43 @@ +dnl +dnl Copyright (c) Cisco Systems Inc., 2009 +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl Author: Garrett Cooper +dnl + +dnl +dnl LTP_CHECK_CAPABILITY_SUPPORT +dnl ---------------------------- +dnl +AC_DEFUN([LTP_CHECK_CAPABILITY_SUPPORT],[ +AC_CHECK_HEADERS(sys/capability.h,[ + AC_CHECK_HEADERS(attr/xattr.h) + LTP_CAPABILITY_SUPPORT=yes + AC_CHECK_LIB(cap,cap_free,[ + AC_CHECK_LIB(cap,cap_from_text,[ + AC_CHECK_LIB(cap,cap_set_proc,[ + AC_CHECK_LIB(cap,cap_compare,[ + CAP_LIBS="-lcap" + ]) + ]) + ]) + ]) + AC_CHECK_DECLS([CAP_BSET_DROP, CAP_BSET_READ, PR_CAPBSET_READ, cap_compare, cap_free, cap_from_text, cap_get_proc, cap_set_file, cap_set_flag, cap_set_proc, cap_to_text],[],[],[dnl +#include +]) dnl AC_CHECK_DECLS +])] +AC_SUBST(CAP_LIBS) +) diff --git a/m4/ltp-crypto.m4 b/m4/ltp-crypto.m4 index ad2795b4..3dfc5126 100644 --- a/m4/ltp-crypto.m4 +++ b/m4/ltp-crypto.m4 @@ -4,6 +4,6 @@ dnl ---------------------------- dnl AC_DEFUN([LTP_CHECK_CRYPTO], [dnl -AC_CHECK_HEADERS(openssl/sha.h,[CRYPTO_LIB=-lcrypto],[CRYPTO_LIB=]) -AC_SUBST(CRYPTO_LIB) +AC_CHECK_HEADERS(openssl/sha.h,[CRYPTO_LIBS=-lcrypto],[CRYPTO_LIBS=]) +AC_SUBST(CRYPTO_LIBS) ]) diff --git a/m4/ltp-eventfd.m4 b/m4/ltp-eventfd.m4 index 615801e5..f4b8db56 100644 --- a/m4/ltp-eventfd.m4 +++ b/m4/ltp-eventfd.m4 @@ -28,7 +28,6 @@ AH_TEMPLATE(HAVE_IO_SET_EVENTFD, [Define to 1 if you have the `io_set_eventfd' function.]) AC_CHECK_HEADERS(libaio.h,[ AC_CHECK_LIB(aio,io_setup,[ - LIBS="$LIBS -laio" AIO_LIBS="-laio" AC_MSG_CHECKING([io_set_eventfd is defined in aio library or aio header]) AC_TRY_LINK([#include diff --git a/m4/ltp-numa.m4 b/m4/ltp-numa.m4 new file mode 100644 index 00000000..9a9947c6 --- /dev/null +++ b/m4/ltp-numa.m4 @@ -0,0 +1,38 @@ +dnl +dnl Copyright (c) Cisco Systems Inc., 2009 +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl Author: Garrett Cooper +dnl + +dnl +dnl LTP_CHECK_SYSCALL_NUMA +dnl ---------------------------- +dnl +AC_DEFUN([LTP_CHECK_SYSCALL_NUMA], +[dnl +AC_CHECK_HEADERS(numa.h,[ + LTP_SYSCALL_NUMA_HEADER=yes + AC_CHECK_FUNCS(numa_alloc_onnode,numa_move_pages) + AC_CHECK_HEADERS(numaif.h,[LTP_SYSCALL_NUMAIF_HEADER=yes], [], [], [ +#include +]) +] + AC_CHECK_LIB(numa,numa_available,[ + NUMA_LIBS="-lnuma" + ]) +AC_SUBST(NUMA_LIBS) +)]) diff --git a/m4/ltp-ptrace.m4 b/m4/ltp-ptrace.m4 new file mode 100644 index 00000000..3c7441c1 --- /dev/null +++ b/m4/ltp-ptrace.m4 @@ -0,0 +1,38 @@ +dnl +dnl Copyright (c) Jiri Palecek 2009 +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl + + +AC_DEFUN([LTP_CHECK_LINUX_PTRACE], +_LTP_CHECK_LINUX_PTRACE +)dnl + +dnl _LTP_CHECK_LINUX_PTRACE +dnl ---------------------------------------- +dnl +dnl Check for ptrace support +dnl in commit 016ae219 in July 2008 +dnl + +AC_DEFUN([_LTP_CHECK_LINUX_PTRACE],[ +AC_CHECK_HEADERS(linux/ptrace.h,[ + LINUX_PTRACE_HEADER=yes + AC_CHECK_DECLS([PTRACE_GETSIGINFO, PTRACE_O_TRACEVFORKDONE, PTRACE_SETOPTIONS],[],[],[dnl +#include +]) dnl AC_CHECK_DECLS +]) dnl AC_CHECK_HEADERS +]) dnl _LTP_CHECK_TASKSTATS_FREEPAGES diff --git a/m4/ltp-quota.m4 b/m4/ltp-quota.m4 new file mode 100644 index 00000000..d0c38b0f --- /dev/null +++ b/m4/ltp-quota.m4 @@ -0,0 +1,53 @@ +dnl +dnl Copyright (c) Cisco Systems, Inc, 2008 +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl + +dnl +dnl LTP_CHECK_SYSCALL_QUOTACTL +dnl ---------------------------- +dnl +AC_DEFUN([LTP_CHECK_SYSCALL_QUOTACTL],[AC_TRY_COMPILE([ +#include +#include +#include +#include +#include ],[ +int main(void) { + return quotactl(Q_GETINFO, (const char *)NULL, geteuid(), (caddr_t)NULL); +}],[has_rhel46_quotactl="yes"],[AC_TRY_COMPILE([ +#include +#include +#include +#include +#include ],[ +int main(void) { + return quotactl(Q_GETINFO, (const char *)NULL, geteuid(), (caddr_t)NULL); +}],[has_rhel48_quotactl="yes"],[AC_TRY_COMPILE([ +#include +#include +#include ],[ +int main(void) { + return quotactl(Q_GETINFO, (const char *)NULL, geteuid(), (caddr_t)NULL); +}],[has_new_minimal_quotactl="yes"],[AC_MSG_WARN([Couldn't find functional copy of quotactl])])])]) +if test "x$has_rhel46_quotactl" = "xyes"; then + AC_DEFINE(HAS_RHEL46_QUOTACTL,1,[Define to 1 if you have the RHEL ~4.6 version of quotactl, e.g. require linux/quota.h instead of sys/quota.h]) +elif test "x$has_rhel48_quotactl" = "xyes"; then + AC_DEFINE(HAS_RHEL48_QUOTACTL,1,[Define to 1 if you have the RHEL 4.8+ version of quotactl, e.g. require sys/quota.h instead of sys/quota.h]) +elif test "x$has_new_minimal_quotactl" = "xyes"; then + AC_DEFINE(HAS_NEW_MINIMAL_QUOTACTL,1,[Define to 1 if you have the new implementation of quotactl that only requires sys/types.h and sys/quota.h]) +fi +]) diff --git a/m4/ltp-swaponoff.m4 b/m4/ltp-swaponoff.m4 new file mode 100644 index 00000000..8133db4f --- /dev/null +++ b/m4/ltp-swaponoff.m4 @@ -0,0 +1,48 @@ +dnl +dnl Copyright (c) Cisco Systems Inc., 2009 +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl Author: Garrett Cooper +dnl + +dnl +dnl LTP_CHECK_CAPABILITY_SUPPORT +dnl ---------------------------- +dnl +AC_DEFUN([LTP_CHECK_SYSCALL_SWAPONOFF],[ +AC_MSG_CHECKING([for swapon / swapoff implementation]) +AC_TRY_COMPILE([#include + #include ], + [swapon("/foo", 0); swapoff("/foo"); return 0;], + [swaponoff_impl="2.6"], + [AC_TRY_COMPILE([#include + #include + #include ], + [swapon("/foo", 0); swapoff("/foo"); return 0;], + [swaponoff_impl="2.4"], + )] +) +if test "x$swaponoff_impl" = "x2.4" ; then + AC_MSG_RESULT(2.6) + AC_DEFINE([HAVE_OLD_SWAPONOFF],[],[2.4 version of swapon/swapoff]) +elif test "x$swaponoff_impl" = "x2.6" ; then + AC_MSG_RESULT(2.6) + AC_DEFINE([HAVE_NEW_SWAPONOFF],[],[2.6 version of swapon/swapoff]) +else + AC_MSG_RESULT(unknown) + AC_MSG_WARN(Couldn't determine swapon / swapoff implementation) +fi +]) diff --git a/m4/ltp-taskstats.m4 b/m4/ltp-taskstats.m4 index 63e10a2b..00bf911c 100644 --- a/m4/ltp-taskstats.m4 +++ b/m4/ltp-taskstats.m4 @@ -16,7 +16,6 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl - AC_DEFUN([LTP_CHECK_TASKSTATS], _LTP_CHECK_TASKSTATS_FREEPAGES )dnl @@ -28,11 +27,13 @@ dnl Check for taskstat.freepages_* members, introduced to the kernel dnl in commit 016ae219 in July 2008 dnl -AC_DEFUN([_LTP_CHECK_TASKSTATS_FREEPAGES], -[dnl -AC_CHECK_MEMBERS([struct taskstats.freepages_count, struct taskstats.nvcsw, struct taskstats.read_bytes],[],[],[dnl -#include +AC_DEFUN([_LTP_CHECK_TASKSTATS_FREEPAGES],[ +AC_CHECK_HEADERS([linux/taskstats.h],[ + AC_CHECK_MEMBERS([struct taskstats.freepages_count, struct taskstats.nvcsw, struct taskstats.read_bytes], + [],[],[dnl #include -]) -]dnl -)dnl +]) dnl AC_CHECK_MEMBERS +],[],[ +#include +]) dnl AC_CHECK_HEADERS_ONCE +]) dnl _LTP_CHECK_TASKSTATS_FREEPAGES diff --git a/m4/ltp-unshare.m4 b/m4/ltp-unshare.m4 dissimilarity index 100% index 697af627..60f4c54c 100644 --- a/m4/ltp-unshare.m4 +++ b/m4/ltp-unshare.m4 @@ -1,2 +1,25 @@ -AC_DEFUN([LTP_CHECK_SYSCALL_UNSHARE], -[AC_CHECK_FUNCS_ONCE([unshare])]) +dnl +dnl Copyright (c) Cisco Systems Inc., 2009 +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl Author: Garrett Cooper +dnl + +dnl +dnl LTP_CHECK_SYSCALL_UNSHARE +dnl ---------------------------- +dnl +AC_DEFUN([LTP_CHECK_SYSCALL_UNSHARE],[AC_CHECK_FUNCS_ONCE(unshare)]) diff --git a/m4/ltp-version.m4 b/m4/ltp-version.m4 new file mode 100644 index 00000000..408491ad --- /dev/null +++ b/m4/ltp-version.m4 @@ -0,0 +1 @@ +AC_DEFUN([LTP_VERSION],[20091031]) diff --git a/pan/Makefile b/pan/Makefile dissimilarity index 68% index 234f9d42..d973d587 100644 --- a/pan/Makefile +++ b/pan/Makefile @@ -1,24 +1,49 @@ - -LOADLIBES += -lm -LFLAGS += -l -w -CFLAGS += -w -PREFIX = /opt/ltp - -all: ltp-pan ltp-bump ltp-scanner - -ltp-pan: ltp-pan.o zoolib.o splitstr.o - - -ltp-bump: ltp-bump.o zoolib.o - - -ltp-scanner: scan.o ltp-scanner.o reporter.o tag_report.o symbol.o splitstr.o debug.o - - -install: ltp-pan ltp-bump ltp-scanner - install -D ltp-scanner $(DESTDIR)/$(PREFIX)/bin/ltp-scanner - install -D ltp-pan $(DESTDIR)/$(PREFIX)/bin/ltp-pan - install -D ltp-bump $(DESTDIR)/$(PREFIX)/bin/ltp-bump - -clean: - rm -f *.o ltp-pan ltp-bump ltp-scanner +# +# pan Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= .. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/functions.mk + +CPPFLAGS += -I$(abs_srcdir) + +LDLIBS += -lm $(LEXLIB) + +LFLAGS += -l + +INSTALL_DIR := bin + +MAKE_TARGETS := ltp-bump ltp-pan ltp-scanner + +ltp-bump: ltp-bump.o zoolib.o + +ltp-pan: ltp-pan.o zoolib.o splitstr.o + +ltp-scanner: scan.o ltp-scanner.o reporter.o tag_report.o symbol.o splitstr.o debug.o + +# flex does some whacky junk when it generates files on the fly, so let's make +# sure gcc doesn't get lost... +$(eval $(call generate_vpath_rule,c,$(abs_srcdir):$(abs_builddir))) +$(eval $(call generate_vpath_rule,l)) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c index a8753709..86cd1542 100644 --- a/pan/ltp-pan.c +++ b/pan/ltp-pan.c @@ -49,7 +49,7 @@ * - added option to create a command file with all failed tests. * */ -/* $Id: ltp-pan.c,v 1.3 2009/06/09 16:14:40 subrata_modak Exp $ */ +/* $Id: ltp-pan.c,v 1.4 2009/10/15 18:45:55 yaberauneya Exp $ */ #include #include @@ -337,6 +337,11 @@ main(int argc, char **argv) /* a place to store the pgrps we're watching */ running = (struct tag_pgrp *)malloc((keep_active + 1) * sizeof(struct tag_pgrp)); + if (running == NULL) { + fprintf(stderr, "pan(%s): Failed to allocate memory: %s\n", panname, + strerror(errno)); + exit(2); + } memset(running, 0, keep_active * sizeof(struct tag_pgrp)); running[keep_active].pgrp = -1; /* end sentinel */ @@ -397,7 +402,7 @@ main(int argc, char **argv) if (outputfilename) { if (!freopen(outputfilename, "a+", stdout)) { fprintf(stderr, - "pan(%s): Error %s (%d) openning output file '%s'\n", + "pan(%s): Error %s (%d) opening output file '%s'\n", panname, strerror(errno), errno, outputfilename); exit(1); } @@ -743,7 +748,7 @@ check_pids(struct tag_pgrp *running, int *num_active, int keep_active, w); } - fflush(logfile); + fflush(logfile); } if ((failcmdfile != NULL) && (w !=0)) { diff --git a/runltp b/runltp index 88ec237c..c8ea1fb8 100755 --- a/runltp +++ b/runltp @@ -80,14 +80,14 @@ setup() export TMPBASE="/tmp" export PATH="${PATH}:${LTPROOT}/testcases/bin" - [ -d $LTPROOT/testcases/bin ] || + [ -d "$LTPROOT/testcases/bin" ] || { echo "FATAL: Test suite not installed correctly" echo "INFO: as root user type 'make ; make install'" exit 1 } - [ -e $LTPROOT/pan/ltp-pan ] || + [ -e "$LTPROOT/bin/ltp-pan" ] || { echo "FATAL: Test suite driver 'ltp-pan' not found" echo "INFO: as root user type 'make ; make install'" @@ -97,7 +97,7 @@ setup() version_of_ltp() { - head -n 1 $LTPROOT/ChangeLog + cat "$LTPROOT/Version" exit 0 } @@ -156,7 +156,6 @@ usage() -t 24h = 24 hours -t 2d = 2 days -T REPETITION Execute the testsuite for REPETITION no. of times - -v Print more verbose output to screen. -w CMDFILEADDR Uses wget to get the user's list of testcases. -x INSTANCES Run multiple instances of this testsuite. -b DEVICE Some tests require an unmounted block device @@ -182,18 +181,17 @@ main() local RUN_NETEST=0 local RUN_REPEATED=0 local QUIET_MODE="" - local VERBOSE_MODE="" local NETPIPE=0 local GENLOAD=0 local MEMSIZE=0 local DURATION="" local CMDFILEADDR="" local FAILCMDFILE="" - local INJECT_KERNEL_FAULT="" - local INJECT_KERNEL_FAULT_PERCENTAGE="" - local INJECT_FAULT_LOOPS_PER_TEST="" - local VALGRIND_CHECK="" - local VALGRIND_CHECK_TYPE="" + local INJECT_KERNEL_FAULT="" + local INJECT_KERNEL_FAULT_PERCENTAGE="" + local INJECT_FAULT_LOOPS_PER_TEST="" + local VALGRIND_CHECK="" + local VALGRIND_CHECK_TYPE="" local LOGFILE_NAME="" local LOGFILE="" local OUTPUTFILE_NAME="" @@ -205,9 +203,9 @@ main() local TAG_RESTRICT_STRING="" local PAN_COMMAND="" local DEFAULT_FILE_NAME_GENERATION_TIME=`date +"%Y_%b_%d-%Hh_%Mm_%Ss"` - version_date=`head -n 1 $LTPROOT/ChangeLog` + version_date=$(cat "$LTPROOT/Version") - while getopts a:c:C:d:D:f:F:ehi:g:l:m:M:Nno:pqr:s:S:t:T:vw:x:b:B: arg + while getopts a:c:C:d:D:f:F:ehi:g:l:m:M:Nno:pqr:s:S:t:T:w:x:b:B: arg do case $arg in a) EMAIL_TO=$OPTARG ALT_EMAIL_OUT=1;; @@ -398,8 +396,6 @@ main() T) # In case you want the testcases to runsequentially RUN_REPEATED times RUN_REPEATED=$OPTARG;; - v) VERBOSE_MODE=1;; - w) CMDFILEADDR=$OPTARG;; x) # number of ltp's to run @@ -460,9 +456,9 @@ main() # If we need, create the output directory [ "$ALT_DIR_OUT" -eq 1 ] && \ { - echo "INFO: creating $LTPROOT/output directory" [ ! -d $LTPROOT/output ] && \ { + echo "INFO: creating $LTPROOT/output directory" mkdir -p $LTPROOT/output || \ { echo "ERROR: failed to create $LTPROOT/output" @@ -753,13 +749,11 @@ main() fi [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test start time: $(date)" ; } - PAN_COMMAND="${LTPROOT}/pan/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \ + PAN_COMMAND="${LTPROOT}/bin/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \ -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE" - if [ ! -z "$VERBOSE_MODE" ] ; then - echo "COMMAND: $PAN_COMMAND" - if [ ! -z "$TAG_RESTRICT_STRING" ] ; then - echo "INFO: Restricted to $TAG_RESTRICT_STRING" - fi + echo "COMMAND: $PAN_COMMAND" + if [ ! -z "$TAG_RESTRICT_STRING" ] ; then + echo "INFO: Restricted to $TAG_RESTRICT_STRING" fi #$PAN_COMMAND #Duplicated code here, because otherwise if we fail, only "PAN_COMMAND" gets output @@ -829,7 +823,7 @@ main() # Some tests need to run inside the "bin" directory. cd "${LTPROOT}/testcases/bin" - ${LTPROOT}/pan/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE + "${LTPROOT}/bin/ltp-pan" $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE if [ $? -eq 0 ]; then echo "INFO: ltp-pan reported all tests PASS" diff --git a/runltplite.sh b/runltplite.sh index 5c2e03d8..559ef92f 100755 --- a/runltplite.sh +++ b/runltplite.sh @@ -57,7 +57,7 @@ setup() exit 1 } - [ -e $LTPROOT/pan/ltp-pan ] || + [ -e $LTPROOT/bin/ltp-pan ] || { echo "FATAL: Test suite driver 'ltp-pan' not found" echo "INFO: as root user type 'make ; make install'" @@ -85,7 +85,6 @@ usage() -p Human readable format logfiles. -q Print less verbose output to screen. -r LTPROOT Fully qualified path where testsuite is installed. - -v Print more verbose output to screen. example: ./${0##*/} -i 1024 -m 128 -p -q -l /tmp/resultlog.$$ -d ${PWD} @@ -114,7 +113,7 @@ main() local TAG_RESTRICT_STRING="" local PAN_COMMAND="" - while getopts c:d:hi:l:m:No:pqr:v arg + while getopts c:d:hi:l:m:No:pqr: arg do case $arg in c) NUM_PROCS=$(($OPTARG)) @@ -138,9 +137,9 @@ main() l) - echo "INFO: creating $LTPROOT/results directory" [ ! -d $LTPROOT/results ] && \ { + echo "INFO: creating $LTPROOT/results directory" mkdir -p $LTPROOT/results || \ { echo "ERROR: failed to create $LTPROOT/results" @@ -171,8 +170,6 @@ main() r) LTPROOT=$OPTARG;; - v) VERBOSE_MODE=1;; - \?) usage;; esac done @@ -284,7 +281,7 @@ main() } [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test start time: $(date)" ; } - PAN_COMMAND="${LTPROOT}/pan/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \ + PAN_COMMAND="${LTPROOT}/bin/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \ -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE" if [ ! -z "$VERBOSE_MODE" ] ; then echo "COMMAND: $PAN_COMMAND" @@ -295,7 +292,7 @@ main() #$PAN_COMMAND #Duplicated code here, because otherwise if we fail, only "PAN_COMMAND" gets output # Some tests need to run inside the "bin" directory. cd "${LTPROOT}/testcases/bin" - ${LTPROOT}/pan/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \ + ${LTPROOT}/bin/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \ -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE if [ $? -eq 0 ]; then diff --git a/runtest/Makefile b/runtest/Makefile new file mode 100644 index 00000000..0907ef6b --- /dev/null +++ b/runtest/Makefile @@ -0,0 +1,39 @@ +# +# runtest 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= .. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_DIR := runtest + +# We don't want to copy over directories like CVS, STAX, etc, or the Makefile +# itself. +UNWANTED_FILES := Makefile CVS STAX + +INSTALL_MODE := 00644 + +INSTALL_TARGETS := $(filter-out $(UNWANTED_FILES),$(notdir $(patsubst $(abs_srcdir)/%,%,$(wildcard $(abs_srcdir)/*)))) + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/runtest/fs b/runtest/fs index fce6a710..76b700c9 100644 --- a/runtest/fs +++ b/runtest/fs @@ -1,46 +1,46 @@ #DESCRIPTION:Filesystem stress tests -gf01 growfiles -W gf01 -b -e 1 -u -i 0 -L 20 -w -C 1 -l -I r -T 10 glseek20 glseek20.2 -gf02 growfiles -W gf02 -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ -gf03 growfiles -W gf03 -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_ -gf04 growfiles -W gf04 -b -e 1 -g 4090 -i 500 -t 39000 -u -f gf06_ -gf05 growfiles -W gf05 -b -e 1 -g 5000 -i 500 -t 49900 -T10 -c9 -I p -u -f gf07_ -gf06 growfiles -W gf06 -b -e 1 -u -r 1-5000 -R 0--1 -i 0 -L 30 -C 1 g_rand10 g_rand10.2 -gf07 growfiles -W gf07 -b -e 1 -u -r 1-5000 -R 0--2 -i 0 -L 30 -C 1 -I p g_rand13 g_rand13.2 -gf08 growfiles -W gf08 -b -e 1 -u -r 1-5000 -R 0--2 -i 0 -L 30 -C 1 g_rand11 g_rand11.2 -gf09 growfiles -W gf09 -b -e 1 -u -r 1-5000 -R 0--1 -i 0 -L 30 -C 1 -I p g_rand12 g_rand12.2 -gf10 growfiles -W gf10 -b -e 1 -u -r 1-5000 -i 0 -L 30 -C 1 -I l g_lio14 g_lio14.2 -gf11 growfiles -W gf11 -b -e 1 -u -r 1-5000 -i 0 -L 30 -C 1 -I L g_lio15 g_lio15.2 -gf12 mkfifo gffifo17; growfiles -b -W gf12 -e 1 -u -i 0 -L 30 gffifo17 -gf13 mkfifo gffifo18; growfiles -b -W gf13 -e 1 -u -i 0 -L 30 -I r -r 1-4096 gffifo18 -gf14 growfiles -W gf14 -b -e 1 -u -i 0 -L 20 -w -l -C 1 -T 10 glseek19 glseek19.2 -gf15 growfiles -W gf15 -b -e 1 -u -r 1-49600 -I r -u -i 0 -L 120 Lgfile1 -gf16 growfiles -W gf16 -b -e 1 -i 0 -L 120 -u -g 4090 -T 100 -t 408990 -l -C 10 -c 1000 -S 10 -f Lgf02_ -gf17 growfiles -W gf17 -b -e 1 -i 0 -L 120 -u -g 5000 -T 100 -t 499990 -l -C 10 -c 1000 -S 10 -f Lgf03_ -gf18 growfiles -W gf18 -b -e 1 -i 0 -L 120 -w -u -r 10-5000 -I r -l -S 2 -f Lgf04_ -gf19 growfiles -W gf19 -b -e 1 -g 5000 -i 500 -t 49900 -T10 -c9 -I p -o O_RDWR,O_CREAT,O_TRUNC -u -f gf08i_ -gf20 growfiles -W gf20 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 1-256000:512 -R 512-256000 -T 4 gfbigio-$$ -gf21 growfiles -W gf21 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 -T 10 -t 20480 gf-bld-$$ -gf22 growfiles -W gf22 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 -T 10 -t 20480 gf-bldf-$$ -gf23 growfiles -W gf23 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 512-64000:1024 -R 1-384000 -T 4 gf-inf-$$ -gf24 growfiles -W gf24 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 gf-jbld-$$ -gf25 growfiles -W gf25 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 1024000-2048000:2048 -R 4095-2048000 -T 1 gf-large-gs-$$ -gf26 growfiles -W gf26 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 128-32768:128 -R 512-64000 -T 4 gfsmallio-$$ -gf27 growfiles -W gf27 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u gfsparse-1-$$ -gf28 growfiles -W gf28 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$ -gf29 growfiles -W gf29 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$ -gf30 growfiles -W gf30 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/tmp/rwtest01%f +gf01 growfiles -W gf01 -b -e 1 -u -i 0 -L 20 -w -C 1 -l -I r -T 10 glseek20 glseek20.2 -d $TMPDIR +gf02 growfiles -W gf02 -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ -d $TMPDIR +gf03 growfiles -W gf03 -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_ -d $TMPDIR +gf04 growfiles -W gf04 -b -e 1 -g 4090 -i 500 -t 39000 -u -f gf06_ -d $TMPDIR +gf05 growfiles -W gf05 -b -e 1 -g 5000 -i 500 -t 49900 -T10 -c9 -I p -u -f gf07_ -d $TMPDIR +gf06 growfiles -W gf06 -b -e 1 -u -r 1-5000 -R 0--1 -i 0 -L 30 -C 1 g_rand10 g_rand10.2 -d $TMPDIR +gf07 growfiles -W gf07 -b -e 1 -u -r 1-5000 -R 0--2 -i 0 -L 30 -C 1 -I p g_rand13 g_rand13.2 -d $TMPDIR +gf08 growfiles -W gf08 -b -e 1 -u -r 1-5000 -R 0--2 -i 0 -L 30 -C 1 g_rand11 g_rand11.2 -d $TMPDIR +gf09 growfiles -W gf09 -b -e 1 -u -r 1-5000 -R 0--1 -i 0 -L 30 -C 1 -I p g_rand12 g_rand12.2 -d $TMPDIR +gf10 growfiles -W gf10 -b -e 1 -u -r 1-5000 -i 0 -L 30 -C 1 -I l g_lio14 g_lio14.2 -d $TMPDIR +gf11 growfiles -W gf11 -b -e 1 -u -r 1-5000 -i 0 -L 30 -C 1 -I L g_lio15 g_lio15.2 -d $TMPDIR +gf12 mkfifo $TMPDIR/gffifo17; growfiles -b -W gf12 -e 1 -u -i 0 -L 30 gffifo17 -d $TMPDIR +gf13 mkfifo $TMPDIR/gffifo18; growfiles -b -W gf13 -e 1 -u -i 0 -L 30 -I r -r 1-4096 gffifo18 -d $TMPDIR +gf14 growfiles -W gf14 -b -e 1 -u -i 0 -L 20 -w -l -C 1 -T 10 glseek19 glseek19.2 -d $TMPDIR +gf15 growfiles -W gf15 -b -e 1 -u -r 1-49600 -I r -u -i 0 -L 120 Lgfile1 -d $TMPDIR +gf16 growfiles -W gf16 -b -e 1 -i 0 -L 120 -u -g 4090 -T 100 -t 408990 -l -C 10 -c 1000 -S 10 -f Lgf02_ -d $TMPDIR +gf17 growfiles -W gf17 -b -e 1 -i 0 -L 120 -u -g 5000 -T 100 -t 499990 -l -C 10 -c 1000 -S 10 -f Lgf03_ -d $TMPDIR +gf18 growfiles -W gf18 -b -e 1 -i 0 -L 120 -w -u -r 10-5000 -I r -l -S 2 -f Lgf04_ -d $TMPDIR +gf19 growfiles -W gf19 -b -e 1 -g 5000 -i 500 -t 49900 -T10 -c9 -I p -o O_RDWR,O_CREAT,O_TRUNC -u -f gf08i_ -d $TMPDIR +gf20 growfiles -W gf20 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 1-256000:512 -R 512-256000 -T 4 gfbigio-$$ -d $TMPDIR +gf21 growfiles -W gf21 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 -T 10 -t 20480 gf-bld-$$ -d $TMPDIR +gf22 growfiles -W gf22 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 -T 10 -t 20480 gf-bldf-$$ -d $TMPDIR +gf23 growfiles -W gf23 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 512-64000:1024 -R 1-384000 -T 4 gf-inf-$$ -d $TMPDIR +gf24 growfiles -W gf24 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 gf-jbld-$$ -d $TMPDIR +gf25 growfiles -W gf25 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 1024000-2048000:2048 -R 4095-2048000 -T 1 gf-large-gs-$$ -d $TMPDIR +gf26 growfiles -W gf26 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 128-32768:128 -R 512-64000 -T 4 gfsmallio-$$ -d $TMPDIR +gf27 growfiles -W gf27 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u gfsparse-1-$$ -d $TMPDIR +gf28 growfiles -W gf28 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$ -d $TMPDIR +gf29 growfiles -W gf29 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$ -d $TMPDIR +gf30 growfiles -W gf30 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$ -d $TMPDIR +rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:$TMPDIR/rw-sync-$$ +rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:$TMPDIR/rw-buffered-$$ +rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:$TMPDIR/mm-buff-$$ +rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:$TMPDIR/mm-sync-$$ +rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:$TMPDIR/rwtest01%f #must be run as root #iogen01 iogen -i 120s -s read,write 500b:doio.f1.$$ 1000b:doio.f2.$$ | doio -akv -n 2 -iogen01 export LTPROOT; rwtest -N iogen01 -i 120s -s read,write -Da -Dv -n 2 500b:doio.f1.$$ 1000b:doio.f2.$$ +iogen01 export LTPROOT; rwtest.sh -N iogen01 -i 120s -s read,write -Da -Dv -n 2 500b:doio.f1.$$ 1000b:doio.f2.$$ fs_inod01 fs_inod $TMP 10 10 10 -linker01 linktest.pl 1000 1000 +linker01 linktest.sh 1000 1000 openfile01 openfile -f10 -t10 inode01 inode01 inode02 inode02 @@ -62,7 +62,7 @@ lftest01 lftest 100 writetest01 writetest #Also run the fs_di (Data Integrity tests) -fs_di fs_di -d /tmp/ +fs_di fs_di -d $TMPDIR #Also run the fs_perms (File System Permission Tests) fs_perms fs_perms_simpletest.sh diff --git a/runtest/fs_ext4 b/runtest/fs_ext4 new file mode 100644 index 00000000..c65ebabd --- /dev/null +++ b/runtest/fs_ext4 @@ -0,0 +1 @@ +ext4_new_feature_test run_ext4_test.sh diff --git a/runtest/io b/runtest/io index e48542d3..75274c4e 100644 --- a/runtest/io +++ b/runtest/io @@ -1,3 +1,3 @@ #AIO01 & AIO02 tests to be run aio01 aio01 -aio02 (cd $LTPROOT/testcases/kernel/io/aio/aio02/; ./runfstests.sh cases/aio_tio) +aio02 runfstests.sh aio_tio diff --git a/runtest/ipv6_expect b/runtest/ipv6_expect new file mode 100644 index 00000000..522082e4 --- /dev/null +++ b/runtest/ipv6_expect @@ -0,0 +1,2 @@ +#DESCRIPTION:IPV6 related tests which require expect +rlogin6 rlogin01 -6 diff --git a/runtest/ipv6_noexpect b/runtest/ipv6_noexpect dissimilarity index 87% index c0703d7b..14b80e8a 100644 --- a/runtest/ipv6_noexpect +++ b/runtest/ipv6_noexpect @@ -1,11 +1,11 @@ -#DESCRIPTION:IPV6 related tests that do not require expect -echo6 export TCbin=$LTPROOT/testcases/network/ipv6/echo6;echo601 -finger6 finger601 -ftp6 export TCbin=$LTPROOT/testcases/network/ipv6/ftp6; ftp01 -perf_lan6 export TCbin=$LTPROOT/testcases/network/ipv6/perf_lan6; perf_lan6 -ping6 ping601 -rcp6 export TCbin=$LTPROOT/testcases/network/ipv6/rcp6; rcp01 -rsh6 rsh01 -rwho6 rwho01 -sendfile6 export TCbin=$LTPROOT/testcases/network/ipv6/sendfile6; sendfile60 -tcpdump6 tcpdump601 +#DESCRIPTION:IPV6 related tests that do not require expect +echo6 echo01 -6 +finger6 finger01 +ftp6 ftp01 -6 +perf_lan6 perf_lan -6 +ping6 ping01 -6 +rcp6 rcp01 -6 +rsh6 rsh01 -6 +rwho6 rwho01 -6 +sendfile6 sendfile01 -6 +tcpdump6 tcpdump01 -6 diff --git a/runtest/ltp-aiodio.part4 b/runtest/ltp-aiodio.part4 dissimilarity index 91% index caa8a4ff..4b9dab4e 100644 --- a/runtest/ltp-aiodio.part4 +++ b/runtest/ltp-aiodio.part4 @@ -1,70 +1,68 @@ -# 3/2006 -# Malcles Jacky: this file is a copy from Ridgeway Marty's aio script -# goal: all aio tests using the same framework -#Running dio_sparse & dirty tests -DI000 testcases/kernel/io/ltp-aiodio/dirty -DS000 testcases/kernel/io/ltp-aiodio/dio_sparse -DI001 testcases/kernel/io/ltp-aiodio/dirty -DS001 testcases/kernel/io/ltp-aiodio/dio_sparse -DI002 testcases/kernel/io/ltp-aiodio/dirty -DS002 testcases/kernel/io/ltp-aiodio/dio_sparse -DI003 testcases/kernel/io/ltp-aiodio/dirty -DS003 testcases/kernel/io/ltp-aiodio/dio_sparse -DI004 testcases/kernel/io/ltp-aiodio/dirty -DS004 testcases/kernel/io/ltp-aiodio/dio_sparse -DI005 testcases/kernel/io/ltp-aiodio/dirty -DS005 testcases/kernel/io/ltp-aiodio/dio_sparse -DI006 testcases/kernel/io/ltp-aiodio/dirty -DS006 testcases/kernel/io/ltp-aiodio/dio_sparse -DI007 testcases/kernel/io/ltp-aiodio/dirty -DS007 testcases/kernel/io/ltp-aiodio/dio_sparse -DI008 testcases/kernel/io/ltp-aiodio/dirty -DS008 testcases/kernel/io/ltp-aiodio/dio_sparse -DI009 testcases/kernel/io/ltp-aiodio/dirty -DS009 testcases/kernel/io/ltp-aiodio/dio_sparse -#iteration on dio_sparse -DIO00 testcases/kernel/io/ltp-aiodio/dio_sparse -DIO01 testcases/kernel/io/ltp-aiodio/dio_sparse -DIO02 testcases/kernel/io/ltp-aiodio/dio_sparse -DIO03 testcases/kernel/io/ltp-aiodio/dio_sparse -DIO04 testcases/kernel/io/ltp-aiodio/dio_sparse -DIO05 testcases/kernel/io/ltp-aiodio/dio_sparse -DIO06 testcases/kernel/io/ltp-aiodio/dio_sparse -DIO07 testcases/kernel/io/ltp-aiodio/dio_sparse -DIO08 testcases/kernel/io/ltp-aiodio/dio_sparse -DIO09 testcases/kernel/io/ltp-aiodio/dio_sparse -#Running aiodio_append -AD000 testcases/kernel/io/ltp-aiodio/aiodio_append /test/aiodio/file2 -AD001 testcases/kernel/io/ltp-aiodio/aiodio_append /test/aiodio/file2 -AD002 testcases/kernel/io/ltp-aiodio/aiodio_append /test/aiodio/file2 -AD003 testcases/kernel/io/ltp-aiodio/aiodio_append /test/aiodio/file2 -AD004 testcases/kernel/io/ltp-aiodio/aiodio_append /test/aiodio/file2 -AD005 testcases/kernel/io/ltp-aiodio/aiodio_append /test/aiodio/file2 -AD006 testcases/kernel/io/ltp-aiodio/aiodio_append /test/aiodio/file2 -AD007 testcases/kernel/io/ltp-aiodio/aiodio_append /test/aiodio/file2 -AD008 testcases/kernel/io/ltp-aiodio/aiodio_append /test/aiodio/file2 -AD009 testcases/kernel/io/ltp-aiodio/aiodio_append /test/aiodio/file2 -#Running dio_append -ADI000 testcases/kernel/io/ltp-aiodio/dio_append -ADI001 testcases/kernel/io/ltp-aiodio/dio_append -ADI002 testcases/kernel/io/ltp-aiodio/dio_append -ADI003 testcases/kernel/io/ltp-aiodio/dio_append -ADI004 testcases/kernel/io/ltp-aiodio/dio_append -ADI005 testcases/kernel/io/ltp-aiodio/dio_append -ADI006 testcases/kernel/io/ltp-aiodio/dio_append -ADI007 testcases/kernel/io/ltp-aiodio/dio_append -ADI008 testcases/kernel/io/ltp-aiodio/dio_append -ADI009 testcases/kernel/io/ltp-aiodio/dio_append -#Running dio_truncate -DIT000 testcases/kernel/io/ltp-aiodio/dio_truncate -DIT001 testcases/kernel/io/ltp-aiodio/dio_truncate -DIT002 testcases/kernel/io/ltp-aiodio/dio_truncate -#Running read_checkzero -#testcases/kernel/io/ltp-aiodio/read_checkzero -#Running ltp-diorh -DOR000 testcases/kernel/io/ltp-aiodio/ltp-diorh /test/aiodio/file2 -DOR001 testcases/kernel/io/ltp-aiodio/ltp-diorh /test/aiodio/file3 -DOR002 testcases/kernel/io/ltp-aiodio/ltp-diorh /test/aiodio/file4 -DOR003 testcases/kernel/io/ltp-aiodio/ltp-diorh /test/aiodio/file5 - - +# 3/2006 +# Malcles Jacky: this file is a copy from Ridgeway Marty's aio script +# goal: all aio tests using the same framework +#Running dio_sparse & dirty tests +DI000 dirty +DS000 dio_sparse +DI001 dirty +DS001 dio_sparse +DI002 dirty +DS002 dio_sparse +DI003 dirty +DS003 dio_sparse +DI004 dirty +DS004 dio_sparse +DI005 dirty +DS005 dio_sparse +DI006 dirty +DS006 dio_sparse +DI007 dirty +DS007 dio_sparse +DI008 dirty +DS008 dio_sparse +DI009 dirty +DS009 dio_sparse +#iteration on dio_sparse +DIO00 dio_sparse +DIO01 dio_sparse +DIO02 dio_sparse +DIO03 dio_sparse +DIO04 dio_sparse +DIO05 dio_sparse +DIO06 dio_sparse +DIO07 dio_sparse +DIO08 dio_sparse +DIO09 dio_sparse +#Running aiodio_append +AD000 aiodio_append /test/aiodio/file2 +AD001 aiodio_append /test/aiodio/file2 +AD002 aiodio_append /test/aiodio/file2 +AD003 aiodio_append /test/aiodio/file2 +AD004 aiodio_append /test/aiodio/file2 +AD005 aiodio_append /test/aiodio/file2 +AD006 aiodio_append /test/aiodio/file2 +AD007 aiodio_append /test/aiodio/file2 +AD008 aiodio_append /test/aiodio/file2 +AD009 aiodio_append /test/aiodio/file2 +#Running dio_append +ADI000 dio_append +ADI001 dio_append +ADI002 dio_append +ADI003 dio_append +ADI004 dio_append +ADI005 dio_append +ADI006 dio_append +ADI007 dio_append +ADI008 dio_append +ADI009 dio_append +#Running dio_truncate +DIT000 dio_truncate +DIT001 dio_truncate +DIT002 dio_truncate +#Running read_checkzero +#gread_checkzero +#Running ltp-diorh +DOR000 ltp-diorh /test/aiodio/file2 +DOR001 ltp-diorh /test/aiodio/file3 +DOR002 ltp-diorh /test/aiodio/file4 +DOR003 ltp-diorh /test/aiodio/file5 diff --git a/runtest/ltplite b/runtest/ltplite index 48ad88c0..b6fb07f8 100644 --- a/runtest/ltplite +++ b/runtest/ltplite @@ -1078,10 +1078,10 @@ gf27 growfiles -W gf27 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u gfsparse-1-$$ #gf28 growfiles -W gf28 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$ #gf29 growfiles -W gf29 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$ gf30 growfiles -W gf30 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/tmp/rwtest01%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/tmp/rwtest01%f diff --git a/runtest/lvm.part1 b/runtest/lvm.part1 index b2e9c055..26e98eb8 100644 --- a/runtest/lvm.part1 +++ b/runtest/lvm.part1 @@ -30,11 +30,11 @@ gf127 growfiles -W gf127 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u /test/growfiles/msd gf128 growfiles -W gf128 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u /test/growfiles/msdos/gfsparse-2-$$ gf129 growfiles -W gf129 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u /test/growfiles/msdos/gfsparse-3-$$ gf130 growfiles -W gf130 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 /test/growfiles/msdos/gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/msdos/rwtest01%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/msdos/rwtest02%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/msdos/rwtest03%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/msdos/rwtest04%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/msdos/rwtest05%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/msdos/rwtest01%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/msdos/rwtest02%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/msdos/rwtest03%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/msdos/rwtest04%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/msdos/rwtest05%f # Check the Reiserfs filesystem gf202 growfiles -W gf202 -d /test/growfiles/reiser -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ gf203 growfiles -W gf203 -d /test/growfiles/reiser -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_ @@ -66,11 +66,11 @@ gf227 growfiles -W gf227 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u /test/growfiles/rei gf228 growfiles -W gf228 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u /test/growfiles/reiser/gfsparse-2-$$ gf229 growfiles -W gf229 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u /test/growfiles/reiser/gfsparse-3-$$ gf230 growfiles -W gf230 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 /test/growfiles/reiser/gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/reiser/rwtest06%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/reiser/rwtest07%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/reiser/rwtest08%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/reiser/rwtest09%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/reiser/rwtest10%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/reiser/rwtest06%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/reiser/rwtest07%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/reiser/rwtest08%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/reiser/rwtest09%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/reiser/rwtest10%f # Check the EXT2 filesystem gf302 growfiles -W gf302 -d /test/growfiles/ext2 -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ gf303 growfiles -W gf303 -d /test/growfiles/ext2 -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_ @@ -102,11 +102,11 @@ gf327 growfiles -W gf327 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u /test/growfiles/ext gf328 growfiles -W gf328 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u /test/growfiles/ext2/gfsparse-2-$$ gf329 growfiles -W gf329 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u /test/growfiles/ext2/gfsparse-3-$$ gf330 growfiles -W gf330 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 /test/growfiles/ext2/gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/ext2/rwtest11%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/ext2/rwtest12%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/ext2/rwtest13%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/ext2/rwtest14%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/ext2/rwtest15%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/ext2/rwtest11%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/ext2/rwtest12%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/ext2/rwtest13%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/ext2/rwtest14%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/ext2/rwtest15%f # Check an NFS filesystem gf402 growfiles -W gf402 -d /test/growfiles/nfs -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ gf403 growfiles -W gf403 -d /test/growfiles/nfs -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_ @@ -138,11 +138,11 @@ gf427 growfiles -W gf427 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u /test/growfiles/nfs gf428 growfiles -W gf428 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u /test/growfiles/nfs/gfsparse-2-$$ gf429 growfiles -W gf429 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u /test/growfiles/nfs/gfsparse-3-$$ gf430 growfiles -W gf430 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 /test/growfiles/nfs/gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/nfs/rwtest16%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/nfs/rwtest17%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/nfs/rwtest18%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/nfs/rwtest19%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/nfs/rwtest20%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/nfs/rwtest16%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/nfs/rwtest17%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/nfs/rwtest18%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/nfs/rwtest19%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/nfs/rwtest20%f # Check a Ram Disk filesystem gf502 growfiles -W gf502 -d /test/growfiles/ramdisk -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ gf503 growfiles -W gf503 -d /test/growfiles/ramdisk -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_ @@ -174,11 +174,11 @@ gf527 growfiles -W gf527 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u /test/growfiles/ram gf528 growfiles -W gf528 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u /test/growfiles/ramdisk/gfsparse-2-$$ gf529 growfiles -W gf529 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u /test/growfiles/ramdisk/gfsparse-3-$$ gf530 growfiles -W gf530 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 /test/growfiles/ramdisk/gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/ramdisk/rwtest21%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/ramdisk/rwtest22%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/ramdisk/rwtest23%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/ramdisk/rwtest24%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/ramdisk/rwtest25%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/ramdisk/rwtest21%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/ramdisk/rwtest22%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/ramdisk/rwtest23%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/ramdisk/rwtest24%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/ramdisk/rwtest25%f # Check the MINIX filesystem gf602 growfiles -W gf602 -d /test/growfiles/minix -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ gf603 growfiles -W gf603 -d /test/growfiles/minix -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_ @@ -210,8 +210,8 @@ gf627 growfiles -W gf627 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u /test/growfiles/min gf628 growfiles -W gf628 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u /test/growfiles/minix/gfsparse-2-$$ gf629 growfiles -W gf629 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u /test/growfiles/minix/gfsparse-3-$$ gf630 growfiles -W gf630 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 /test/growfiles/minix/gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/minix/rwtest26%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/minix/rwtest27%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/minix/rwtest28%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/minix/rwtest29%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/minix/rwtest30%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/minix/rwtest26%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/minix/rwtest27%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/minix/rwtest28%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/minix/rwtest29%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/minix/rwtest30%f diff --git a/runtest/lvm.part2 b/runtest/lvm.part2 index f0dbf327..d2c3ea3d 100644 --- a/runtest/lvm.part2 +++ b/runtest/lvm.part2 @@ -29,11 +29,11 @@ gf727 growfiles -W gf727 -d /test/growfiles/ext3 -b -D 0 -w -g 8b -C 1 -b -i 100 gf728 growfiles -W gf728 -d /test/growfiles/ext3 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$ gf729 growfiles -W gf729 -d /test/growfiles/ext3 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$ gf730 growfiles -W gf730 -d /test/growfiles/ext3 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/ext3/rwtest11%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/ext3/rwtest12%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/ext3/rwtest13%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/ext3/rwtest14%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/ext3/rwtest15%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/ext3/rwtest11%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/ext3/rwtest12%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/ext3/rwtest13%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/ext3/rwtest14%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/ext3/rwtest15%f # Check the JFS filesystem gf802 growfiles -W gf802 -d /test/growfiles/jfs -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ gf803 growfiles -W gf803 -d /test/growfiles/jfs -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_ @@ -65,8 +65,8 @@ gf827 growfiles -W gf827 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u /test/growfiles/jfs gf828 growfiles -W gf828 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u /test/growfiles/jfs/gfsparse-2-$$ gf829 growfiles -W gf829 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u /test/growfiles/jfs/gfsparse-3-$$ gf830 growfiles -W gf830 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 /test/growfiles/jfs/gf-sync-$$ -rwtest11 export LTPROOT; rwtest -N rwtest11 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/jfs/rwtest11%f -rwtest12 export LTPROOT; rwtest -N rwtest12 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/jfs/rwtest12%f -rwtest13 export LTPROOT; rwtest -N rwtest13 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/jfs/rwtest13%f -rwtest14 export LTPROOT; rwtest -N rwtest14 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/jfs/rwtest14%f -rwtest15 export LTPROOT; rwtest -N rwtest15 -c -q -i 50 -T 64b 500b:/test/growfiles/jfs/rwtest15%f +rwtest11 export LTPROOT; rwtest.sh -N rwtest11 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/jfs/rwtest11%f +rwtest12 export LTPROOT; rwtest.sh -N rwtest12 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/jfs/rwtest12%f +rwtest13 export LTPROOT; rwtest.sh -N rwtest13 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/jfs/rwtest13%f +rwtest14 export LTPROOT; rwtest.sh -N rwtest14 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/jfs/rwtest14%f +rwtest15 export LTPROOT; rwtest.sh -N rwtest15 -c -q -i 50 -T 64b 500b:/test/growfiles/jfs/rwtest15%f diff --git a/runtest/nfs b/runtest/nfs index 5922070b..4f5d8768 100644 --- a/runtest/nfs +++ b/runtest/nfs @@ -2,16 +2,16 @@ # # PLEASE READ THE README FILE IN /nfs BEFORE RUNNING THESE. # -nfs01 export VERSION SOCKET_TYPE; export TCbin=$LTPROOT/testcases/network/nfs/nfs01; nfs01 -nfs02 export VERSION SOCKET_TYPE; export TCbin=$LTPROOT/testcases/network/nfs/nfs02; nfs02 -nfs03 export VERSION SOCKET_TYPE; export TCbin=$LTPROOT/testcases/network/nfs/nfs03; nfs03 -nfs04 export VERSION SOCKET_TYPE; export TCbin=$LTPROOT/testcases/network/nfs/nfs04; nfs04 -nfslock01 export VERSION; export TCbin=$LTPROOT/testcases/network/nfs/nfslock01; nfslock01 +nfs01 export VERSION SOCKET_TYPE; export TCbin=$LTPROOT/testcases/bin nfs01 +nfs02 export VERSION SOCKET_TYPE; export TCbin=$LTPROOT/testcases/bin nfs02 +nfs03 export VERSION SOCKET_TYPE; export TCbin=$LTPROOT/testcases/bin nfs03 +nfs04 export VERSION SOCKET_TYPE; export TCbin=$LTPROOT/testcases/bin nfs04 +nfslock01 export VERSION; nfslock01 # This will run 1 thread on 20 directories with 50 files in each. -nfsstress export VERSION SOCKET_TYPE; export TCbin=$LTPROOT/testcases/network/nfs/nfsstress; nfsstress 20 50 1 +nfsstress export VERSION SOCKET_TYPE; nfsstress 20 50 1 -nfsstat01 export VERSION; export TCbin=$LTPROOT/testcases/network/nfs/nfsstat01; nfsstat01 +nfsstat01 export VERSION; export TCbin=$LTPROOT/testcases/bin; nfsstat01 nfsx-linux export VERSION SOCKET_TYPE; export TCbin=$LTPROOT/testcases/bin; fsx.sh diff --git a/runtest/numa b/runtest/numa index 2a8a2a5a..cd2bb4b0 100644 --- a/runtest/numa +++ b/runtest/numa @@ -1,7 +1,7 @@ Numa-testcases numa01.sh move_pages01 move_pages.sh 01 move_pages02 move_pages.sh 02 -move_pages03 move_pages.sh 03 +move_pages03 cd $LTPROOT/bin && chown root move_pages03 && chmod 04755 && move_pages.sh 03 move_pages04 move_pages.sh 04 move_pages05 move_pages.sh 05 move_pages06 move_pages.sh 06 @@ -9,6 +9,4 @@ move_pages07 move_pages.sh 07 move_pages08 move_pages.sh 08 move_pages09 move_pages.sh 09 move_pages10 move_pages.sh 10 -move_pages11 move_pages.sh 11 - - +move_pages11 cd $LTPROOT/bin && chown root move_pages11 && chmod 04755 && move_pages.sh 11 diff --git a/runtest/rpc b/runtest/rpc dissimilarity index 80% index e813d850..c9e5f0dc 100644 --- a/runtest/rpc +++ b/runtest/rpc @@ -1,9 +1,9 @@ -#DESCRIPTION:Remote Procedure Call -# -# PLEASE READ THE README FILE IN /rpc BEFORE RUNNING THESE. -# -run_rpc_tests.sh export TCbin=$LTPROOT/testcases/network/rpc/rpc-tirpc-full-test-suite; run_rpc_tests.sh -rpc01 export TCbin=$LTPROOT/testcases/network/rpc/basic_tests/rpc01; rpc01 -rpcinfo export TCbin=$LTPROOT/testcases/network/rpc/basic_tests/rpcinfo01; rpcinfo01 -rup export TCbin=$LTPROOT/testcases/network/rpc/basic_tests/rup; rup01 -rusers export TCbin=$LTPROOT/testcases/network/rpc/basic_tests/rusers; rusers01 +#DESCRIPTION:Remote Procedure Call +# +# PLEASE READ THE README FILE IN /rpc BEFORE RUNNING THESE. +# +run_rpc_tests.sh run_rpc_tests.sh +rpc01 rpc01 +rpcinfo rpcinfo01 +rup rup01 +rusers rusers01 diff --git a/runtest/scsi_debug.part1 b/runtest/scsi_debug.part1 index 1ca8d5f6..b0f6cb7d 100644 --- a/runtest/scsi_debug.part1 +++ b/runtest/scsi_debug.part1 @@ -31,11 +31,11 @@ gf227 growfiles -W gf227 -d /test/growfiles/reiser -b -D 0 -w -g 8b -C 1 -b -i 1 gf228 growfiles -W gf228 -d /test/growfiles/reiser -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$ gf229 growfiles -W gf229 -d /test/growfiles/reiser -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$ gf230 growfiles -W gf230 -d /test/growfiles/reiser -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/reiser/rwtest06%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/reiser/rwtest07%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/reiser/rwtest08%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/reiser/rwtest09%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/reiser/rwtest10%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/reiser/rwtest06%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/reiser/rwtest07%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/reiser/rwtest08%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/reiser/rwtest09%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/reiser/rwtest10%f # Check the EXT2 filesystem gf301 growfiles -W gf301 -d /test/growfiles/ext2 -b -e 1 -u -i 0 -L 20 -w -C 1 -l -I r -T 10 glseek20 glseek20.2 gf302 growfiles -W gf302 -d /test/growfiles/ext2 -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ @@ -67,11 +67,11 @@ gf327 growfiles -W gf327 -d /test/growfiles/ext2 -b -D 0 -w -g 8b -C 1 -b -i 100 gf328 growfiles -W gf328 -d /test/growfiles/ext2 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$ gf329 growfiles -W gf329 -d /test/growfiles/ext2 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$ gf330 growfiles -W gf330 -d /test/growfiles/ext2 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/ext2/rwtest11%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/ext2/rwtest12%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/ext2/rwtest13%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/ext2/rwtest14%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/ext2/rwtest15%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/ext2/rwtest11%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/ext2/rwtest12%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/ext2/rwtest13%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/ext2/rwtest14%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/ext2/rwtest15%f # Check the EXT3 filesystem gf701 growfiles -W gf701 -d /test/growfiles/ext3 -b -e 1 -u -i 0 -L 20 -w -C 1 -l -I r -T 10 glseek20 glseek20.2gf702 growfiles -W gf702 -d /test/growfiles/ext3 -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ gf703 growfiles -W gf703 -d /test/growfiles/ext3 -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_ @@ -102,11 +102,11 @@ gf727 growfiles -W gf727 -d /test/growfiles/ext3 -b -D 0 -w -g 8b -C 1 -b -i 100 gf728 growfiles -W gf728 -d /test/growfiles/ext3 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$ gf729 growfiles -W gf729 -d /test/growfiles/ext3 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$ gf730 growfiles -W gf730 -d /test/growfiles/ext3 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/ext3/rwtest11%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/ext3/rwtest12%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/ext3/rwtest13%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/ext3/rwtest14%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/ext3/rwtest15%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/ext3/rwtest11%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/ext3/rwtest12%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/ext3/rwtest13%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/ext3/rwtest14%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/ext3/rwtest15%f # Check the MSDOS filesystem gf101 growfiles -W gf101 -d /test/growfiles/msdos -b -e 1 -u -i 0 -L 20 -w -C 1 -l -I r -T 10 glseek20 glseek20.2 gf102 growfiles -W gf102 -d /test/growfiles/msdos -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ @@ -138,11 +138,11 @@ gf127 growfiles -W gf127 -d /test/growfiles/msdos -b -D 0 -w -g 8b -C 1 -b -i 10 gf128 growfiles -W gf128 -d /test/growfiles/msdos -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$ gf129 growfiles -W gf129 -d /test/growfiles/msdos -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$ gf130 growfiles -W gf130 -d /test/growfiles/msdos -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/msdos/rwtest01%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/msdos/rwtest02%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/msdos/rwtest03%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/msdos/rwtest04%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/msdos/rwtest05%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/msdos/rwtest01%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/msdos/rwtest02%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/msdos/rwtest03%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/msdos/rwtest04%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/msdos/rwtest05%f # Check the Reiserfs filesystem gf201 growfiles -W gf201 -d /test/growfiles/reiser -b -e 1 -u -i 0 -L 20 -w -C 1 -l -I r -T 10 glseek20 glseek20.2 gf202 growfiles -W gf202 -d /test/growfiles/reiser -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_ @@ -174,9 +174,9 @@ gf227 growfiles -W gf227 -d /test/growfiles/reiser -b -D 0 -w -g 8b -C 1 -b -i 1 gf228 growfiles -W gf228 -d /test/growfiles/reiser -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$ gf229 growfiles -W gf229 -d /test/growfiles/reiser -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$ gf230 growfiles -W gf230 -d /test/growfiles/reiser -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/reiser/rwtest06%f -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/reiser/rwtest07%f -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/reiser/rwtest08%f -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/reiser/rwtest09%f -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/reiser/rwtest10%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ 500b:/test/growfiles/reiser/rwtest06%f +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ 500b:/test/growfiles/reiser/rwtest07%f +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/reiser/rwtest08%f +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/reiser/rwtest09%f +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/reiser/rwtest10%f diff --git a/runtest/stress.part1 b/runtest/stress.part1 index 705d9d7d..65d8008b 100644 --- a/runtest/stress.part1 +++ b/runtest/stress.part1 @@ -145,18 +145,18 @@ gf27 growfiles -W gf27 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u gfsparse-1-$$ gf28 growfiles -W gf28 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$ gf29 growfiles -W gf29 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$ gf30 growfiles -W gf30 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$ -rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ -rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ -rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ -rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ -rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/tmp/rwtest01%f +rwtest01 export LTPROOT; rwtest.sh -N rwtest01 -c -q -i 60s -f sync 10%25000:rw-sync-$$ +rwtest02 export LTPROOT; rwtest.sh -N rwtest02 -c -q -i 60s -f buffered 10%25000:rw-buffered-$$ +rwtest03 export LTPROOT; rwtest.sh -N rwtest03 -c -q -i 60s -n 2 -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ +rwtest04 export LTPROOT; rwtest.sh -N rwtest04 -c -q -i 60s -n 2 -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ +rwtest05 export LTPROOT; rwtest.sh -N rwtest05 -c -q -i 50 -T 64b 500b:/tmp/rwtest01%f #must be run as root #iogen01 iogen -i 120s -s read,write 500b:doio.f1.$$ 1000b:doio.f2.$$ | doio -akv -n 2 -iogen01 export LTPROOT; rwtest -N iogen01 -i 120s -s read,write -Da -Dv -n 2 500b:doio.f1.$$ 1000b:doio.f2.$$ +iogen01 export LTPROOT; rwtest.sh -N iogen01 -i 120s -s read,write -Da -Dv -n 2 500b:doio.f1.$$ 1000b:doio.f2.$$ fs_inod01 fs_inod $TMP 10 10 1 -linker01 linktest.pl +linker01 linktest.sh openfile01 openfile -f10 -t10 inode01 inode01 inode02 inode02 diff --git a/runtest/stress.part3 b/runtest/stress.part3 index dc7fa9f7..1c3d312a 100644 --- a/runtest/stress.part3 +++ b/runtest/stress.part3 @@ -883,5 +883,5 @@ mc_cmds mc_cmds mc_opts export TCsrc=$LTPROOT/testcases/network/multicast/mc_opts; mc_opts rpc01 export TCbin=$LTPROOT/testcases/network/rpc/basic_tests/rpc01; rpc01 run_rpc_tests.sh export TCbin=$LTPROOT/testcases/network/rpc/rpc-tirpc-full-test-suite; run_rpc_tests.sh -perf_lan export TCbin=$LTPROOT/testcases/network/tcp_cmds/perf_lan; perf_lan +perf_lan perf_lan diff --git a/runtest/syscalls b/runtest/syscalls index 0f147947..fbe86419 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -571,7 +571,7 @@ mount1234 test_mount move_pages01 move_pages.sh 01 move_pages02 move_pages.sh 02 -move_pages03 move_pages.sh 03 +move_pages03 cd $LTPROOT/bin && chown root move_pages03 && chmod 04755 && move_pages.sh 03 move_pages04 move_pages.sh 04 move_pages05 move_pages.sh 05 move_pages06 move_pages.sh 06 @@ -579,7 +579,7 @@ move_pages07 move_pages.sh 07 move_pages08 move_pages.sh 08 move_pages09 move_pages.sh 09 move_pages10 move_pages.sh 10 -move_pages11 move_pages.sh 11 +move_pages11 cd $LTPROOT/bin && chown root move_pages11 && chmod 04755 && move_pages.sh 11 mprotect01 mprotect01 mprotect02 mprotect02 @@ -731,7 +731,9 @@ ptrace01 ptrace01 ptrace02 ptrace02 ptrace03 ptrace03 ptrace04 ptrace04 -ptrace06 ptrace06 +ptrace05 ptrace05 +# Broken test; See: testcases/kernel/syscalls/ptrace/Makefile for more details. +#ptrace06 ptrace06 pwrite01 pwrite01 pwrite02 pwrite02 @@ -1049,7 +1051,6 @@ sigpending02 sigpending02 sigprocmask01 sigprocmask01 sigrelse01 sigrelse01 -sigreturn01 sigreturn01 sigsuspend01 sigsuspend01 diff --git a/runtest/tcp_cmds_expect b/runtest/tcp_cmds_expect new file mode 100644 index 00000000..760cdb81 --- /dev/null +++ b/runtest/tcp_cmds_expect @@ -0,0 +1,8 @@ +#DESCRIPTION:TCP/IP commands tests that require expect +# +# PLEASE READ THE README FILE IN /tcp_cmds BEFORE RUNNING THESE. +# +rlogin rlogin01 +telnet telnet01 +iptables iptables_tests.sh +dhcpd dhcpd_tests.sh diff --git a/runtest/tcp_cmds_noexpect b/runtest/tcp_cmds_noexpect dissimilarity index 63% index 1cb3a63a..8e47217a 100644 --- a/runtest/tcp_cmds_noexpect +++ b/runtest/tcp_cmds_noexpect @@ -1,18 +1,18 @@ -#DESCRIPTION:TCP/IP commands tests that do not require expect -# -# PLEASE READ THE README FILE IN /tcp_cmds BEFORE RUNNING THESE. -# -arp arp01 -echo export TCbin=$LTPROOT/testcases/network/tcp_cmds/echo; echo01 -finger finger01 -ftp export TCbin=$LTPROOT/testcases/network/tcp_cmds/ftp; ftp01 -host host01 -netstat netstat01 -perf_lan export TCbin=$LTPROOT/testcases/network/tcp_cmds/perf_lan; perf_lan -ping ping01 -rcp export TCbin=$LTPROOT/testcases/network/tcp_cmds/rcp; rcp01 -rdist export TCbin=$LTPROOT/testcases/network/tcp_cmds/rdist; rdist01 -rsh rsh01 -rwho rwho01 -sendfile export TCbin=$LTPROOT/testcases/network/tcp_cmds/sendfile; sendfile01 -tcpdump tcpdump01 +#DESCRIPTION:TCP/IP commands tests that do not require expect +# +# PLEASE READ THE README FILE IN /tcp_cmds BEFORE RUNNING THESE. +# +arp arp01 +echo echo01 +finger finger01 +ftp ftp01 +host host01 +netstat netstat01 +perf_lan perf_lan +ping ping01 +rcp rcp01 +rdist rdist01 +rsh rsh01 +rwho rwho01 +sendfile sendfile01 +tcpdump tcpdump01 diff --git a/testcases/Makefile b/testcases/Makefile dissimilarity index 99% index 07630705..ebf4b06d 100644 --- a/testcases/Makefile +++ b/testcases/Makefile @@ -1,21 +1,41 @@ - SUBDIRS = `ls */Makefile | sed "s/Makefile//g" | grep -v open | grep -v pounder | grep -v DOTS | grep -v kdump | grep -v realtime | grep -v audit-test | grep -v mce-test` -UCLINUX_SUBDIRS = kernel -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - mkdir -p bin - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -uclinux: - @set -e; for i in $(UCLINUX_SUBDIRS); do $(MAKE) -C $$i uclinux; done - -uclinux_install: - mkdir -p bin - @set -e; for i in $(UCLINUX_SUBDIRS); \ - do $(MAKE) -C $$i uclinux_install ; done - -clean: - rm -rf bin/ - @set -e; for i in $(SUBDIRS) ; do $(MAKE) -C $$i clean ; done - +# +# 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= .. + +include $(top_srcdir)/include/mk/env_pre.mk + +# XXX (garrcoop): +# 1. ballista is broken (working on it). +# 2. mce-test doesn't fit cleanly in the build, yet. +# 3. pounder21 is just broken. +FILTER_OUT_DIRS := ballista mce-test pounder21 + +# XXX (garrcoop): Not sure why realtime is still in this list; this was the +# original list of disabled items... +ifneq ($(UCLINUX),1) +FILTER_OUT_DIRS += audit-test DOTS kdump open% realtime +else +SUBDIRS := kernel +endif + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/ballista/ballista/Makefile b/testcases/ballista/ballista/Makefile index 870b761a..084c44d5 100644 --- a/testcases/ballista/ballista/Makefile +++ b/testcases/ballista/ballista/Makefile @@ -116,7 +116,7 @@ pause_harness : pause_harness.cpp ${OBJS} ${CC} -Itemplates ${CFLAGS} pause_harness.cpp ${OBJS} -o pause_harness # clean up everything that we build -clean : +clean: $(MAKE) -C templates clean $(RM) -f *.o *.out ballista blexer bparser callGen callGen_standAlone \ - genCodeCreator replacer testmarshal + genCodeCreator replacer testmarshal MakefileHost MakefileTarget diff --git a/testcases/commands/Makefile b/testcases/commands/Makefile dissimilarity index 99% index 4d39e6e3..277d03b0 100644 --- a/testcases/commands/Makefile +++ b/testcases/commands/Makefile @@ -1,12 +1,26 @@ -#SUBDIRS = `ls */Makefile | sed "s/Makefile//g" | grep -v at | grep -v unzip` -SUBDIRS = `ls */Makefile | sed "s/Makefile//g"` - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - +# +# commands test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/commands/ade/Makefile b/testcases/commands/ade/Makefile dissimilarity index 98% index 1161035d..cf7a487c 100644 --- a/testcases/commands/ade/Makefile +++ b/testcases/commands/ade/Makefile @@ -1,10 +1,30 @@ -SUBDIRS = ar objdump size ld ldd nm file - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# commands/ade test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +# XXX (garrcoop): objdump's Makefile needs fixing. +FILTER_OUT_DIRS := objdump + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/commands/ade/ar/Makefile b/testcases/commands/ade/ar/Makefile dissimilarity index 97% index 027adf2b..b6ab633c 100644 --- a/testcases/commands/ade/ar/Makefile +++ b/testcases/commands/ade/ar/Makefile @@ -1,20 +1,36 @@ -CFLAGS += -w -O -LDFLAGS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) file1.o - -install: - ln -f ar01 ../../../bin - ln -f file*.in ../../../bin - ln -f file1.o ../../../bin - -$(TARGETS): - $(CC) -o $@ $@.c $(CFLAGS) $(LDFLAGS) - -clean: - rm -f $(TARGETS) file1.o - - +# +# commands/ade/ar 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -fpic + +INSTALL_TARGETS := ar01 *.in + +MAKE_TARGETS := $(patsubst $(abs_srcdir)/%.c,%.obj,$(wildcard $(abs_srcdir)/*.c)) + +$(MAKE_TARGETS): %.obj: %.o + mv "$^" "$@" + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/ade/file/Makefile b/testcases/commands/ade/file/Makefile dissimilarity index 94% index c2054a19..1411b3e5 100644 --- a/testcases/commands/ade/file/Makefile +++ b/testcases/commands/ade/file/Makefile @@ -1,7 +1,31 @@ -all: - -install: - @ln -f file_test.sh ../../../bin/ - -clean: - +# +# commands/ade/file 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := file_test.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/ade/file/file_test.sh b/testcases/commands/ade/file/file_test.sh index 5fa287b3..14277748 100755 --- a/testcases/commands/ade/file/file_test.sh +++ b/testcases/commands/ade/file/file_test.sh @@ -472,7 +472,7 @@ export TCID=file09 export TST_COUNT=9 $LTPBIN/tst_resm TINFO "TEST #9: file command recognizes RPM files" -`type rpm &> /dev/null` +type rpm > /dev/null 2>&1 if [ $? = 0 ]; then bDIR=$(rpm --eval "%{_topdir}") bCMD=rpmbuild diff --git a/testcases/commands/ade/ld/Makefile b/testcases/commands/ade/ld/Makefile dissimilarity index 97% index 04c1f831..f59a1360 100644 --- a/testcases/commands/ade/ld/Makefile +++ b/testcases/commands/ade/ld/Makefile @@ -1,16 +1,36 @@ -CFLAGS += -O -Wall -fPIC -LOADLIBES += - -SRCS=$(wildcard *.c) -OBJECTS=$(patsubst %.c,%.o,$(SRCS)) - -all: $(OBJECTS) - -install: - ln -f ld01 ../../../bin - ln -f *.o ../../../bin - -clean: - rm -f main.o d1.o f1.o rd1.o rf1.o ldmain.o lola a.out - - +# +# commands/ade/ld 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -fPIC + +INSTALL_TARGETS := ld01 + +MAKE_TARGETS := $(patsubst $(abs_srcdir)/%.c,%.obj,$(wildcard $(abs_srcdir)/*.c)) + +$(MAKE_TARGETS): %.obj: %.o + mv $^ $@ + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/ade/ldd/Makefile b/testcases/commands/ade/ldd/Makefile dissimilarity index 97% index 6fa3d80b..eae06cd7 100644 --- a/testcases/commands/ade/ldd/Makefile +++ b/testcases/commands/ade/ldd/Makefile @@ -1,14 +1,36 @@ -CFLAGS += -c -O -fpic -LDFLAGS += - -SRCS:=$(wildcard *.c) -TARGETS:=$(patsubst %.c,%.o,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f ldd01 ../../../bin - ln -f *.o ../../../bin - -clean: - rm -f $(TARGETS) +# +# commands/ade/ldd 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -fpic + +INSTALL_TARGETS := ldd01 + +MAKE_TARGETS := $(patsubst $(abs_srcdir)/%.c,%.obj,$(wildcard $(abs_srcdir)/*.c)) + +$(MAKE_TARGETS): %.obj: %.o + mv $^ $@ + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/ade/nm/Makefile b/testcases/commands/ade/nm/Makefile dissimilarity index 97% index 4e07441c..de8e3b41 100644 --- a/testcases/commands/ade/nm/Makefile +++ b/testcases/commands/ade/nm/Makefile @@ -1,17 +1,34 @@ -CFLAGS += -O -Wall -LOADLIBES += - -SRCS=$(wildcard *.c) -OBJECTS=$(patsubst %.c,%.o,$(SRCS)) - -all: $(OBJECTS) - -install: - ln -f nm01 ../../../bin - ln -f nmfile*.c ../../../bin - ln -f *.o ../../../bin - -clean: - rm -f nmfile*.o - - +# +# commands/ade/nm 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := nm01 nmfile.c + +MAKE_TARGETS := $(patsubst $(abs_srcdir)/%.c,%.obj,$(wildcard $(abs_srcdir)/*.c)) + +$(MAKE_TARGETS): %.obj: %.o + mv $^ $@ + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/ade/objdump/Makefile b/testcases/commands/ade/objdump/Makefile dissimilarity index 98% index 80bde318..862438c4 100644 --- a/testcases/commands/ade/objdump/Makefile +++ b/testcases/commands/ade/objdump/Makefile @@ -1,22 +1,39 @@ -CFLAGS += -w -o -LDFLAGS += - -SRCS=$(wildcard *.c) -TESTS= test test_arch.o test_D - -all: $(TESTS) - -install: - ln -f objdump01 ../../../bin - ln -f test_arch.o ../../../bin - ln -f test ../../../bin - ln -f test_D ../../../bin - - -clean: - rm -f $(TESTS) - -$(TESTS): - $(CC) -O $(CFLAGS) $(cflags) test $(LDFLAGS) ./test.c - $(CC) -c $(CFLAGS) $(cflags) test_arch.o ./test.c - $(CC) $(CFLAGS) $(cflags) test_D $(LDFLAGS) ./test.c +# +# commands/ade/objdump 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +test: CPPFLAGS += -O + +test_arch.obj: test.o + mv $< "$@" + +test_D: test.o + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION) $@ + +INSTALL_TARGETS := objdump01 + +MAKE_TARGETS := test test_arch.obj test_D + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/ade/objdump/test.c b/testcases/commands/ade/objdump/test.c index b2a57ae2..357aeada 100644 --- a/testcases/commands/ade/objdump/test.c +++ b/testcases/commands/ade/objdump/test.c @@ -1,20 +1,15 @@ +#include -int main() +int main(void) { int i=0; - - for( i=0; i<10; i++) - { - + for(i=0; i<10; i++) { if ( i %2 ) - printf(" Hello \n "); - else printf("World \n"); - } printf(" the end \n"); @@ -22,5 +17,3 @@ int main() return 0; } - - diff --git a/testcases/commands/ade/size/Makefile b/testcases/commands/ade/size/Makefile dissimilarity index 97% index 75d84c25..ae2543c8 100644 --- a/testcases/commands/ade/size/Makefile +++ b/testcases/commands/ade/size/Makefile @@ -1,16 +1,29 @@ -CFLAGS += -w -O -LDFLAGS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f size01 ../../../bin - -clean: - rm -f $(TARGETS) - - - +# +# commands/ade/size 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := size01 + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/ade/size/test.c b/testcases/commands/ade/size/test.c index b2a57ae2..3be1dff9 100644 --- a/testcases/commands/ade/size/test.c +++ b/testcases/commands/ade/size/test.c @@ -1,20 +1,16 @@ +#include -int main() +int main(void) { int i=0; - for( i=0; i<10; i++) { - if ( i %2 ) - printf(" Hello \n "); - else printf("World \n"); - } printf(" the end \n"); @@ -22,5 +18,3 @@ int main() return 0; } - - diff --git a/testcases/commands/at/Makefile b/testcases/commands/at/Makefile dissimilarity index 98% index e799efdc..fd630927 100644 --- a/testcases/commands/at/Makefile +++ b/testcases/commands/at/Makefile @@ -1,6 +1,31 @@ -all: - -install: - ln -f at_deny01 ../../bin/ - ln -f at_allow01 ../../bin/ -clean: +# +# commands/at testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := at_allow01 at_deny01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/cpio/Makefile b/testcases/commands/cpio/Makefile dissimilarity index 97% index 974c73c3..32c111ce 100644 --- a/testcases/commands/cpio/Makefile +++ b/testcases/commands/cpio/Makefile @@ -1,6 +1,31 @@ -all: - -install: - @ln -f cpio_tests.sh ../../bin/cpio_tests.sh - -clean: +# +# commands/cpio 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := cpio_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/cron/Makefile b/testcases/commands/cron/Makefile dissimilarity index 99% index ee0ef698..1b49488e 100644 --- a/testcases/commands/cron/Makefile +++ b/testcases/commands/cron/Makefile @@ -1,20 +1,29 @@ -all: cron_dirs_check - -cron_dirs_check: - $(CC) $(CROSS_CFLAGS) $(LDFLAGS) -o cron_dirs_check cron_dirs_check.c - -install: - chmod 755 cron_tests.sh - @ln -f cron_tests.sh ../../bin/cron_tests.sh - @ln -f cron02 ../../bin/cron02 - @ln -f cron03 ../../bin/cron03 - @ln -f cron_illegal_cron_lines ../../bin/cron_illegal_cron_lines - @ln -f cron_pos_tests.sh ../../bin/cron_pos_tests.sh - @ln -f cron_neg_tests.sh ../../bin/cron_neg_tests.sh - @ln -f cron_allow01 ../../bin/cron_allow01 - @ln -f cron_deny01 ../../bin/cron_deny01 - @ln -f cron_dirs_checks01 ../../bin/cron_dirs_checks01 - @ln -f cron_dirs_check ../../bin/cron_dirs_check -clean: - rm -f cron_dirs_check - +# +# commands/cron testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := cron0[23] cron_illegal_cron_lines cron_allow01 cron_deny01 cron_dirs_checks01 *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/cron/cron02 b/testcases/commands/cron/cron02 index b2656e39..2bd6b488 100755 --- a/testcases/commands/cron/cron02 +++ b/testcases/commands/cron/cron02 @@ -54,10 +54,13 @@ do_setup(){ # restart cron daemon # Red Hat uses crond, SuSE/Other uses cron. - if [ -f /etc/init.d/crond ]; then + if [ -x /etc/init.d/crond ]; then /etc/init.d/crond restart - else + elif [ -x /etc/init.d/cron ]; then /etc/init.d/cron restart + else + echo "Could not determine cron init.d script." + exit 1 fi } diff --git a/testcases/commands/cron/cron_allow01 b/testcases/commands/cron/cron_allow01 index 404ca288..9a941ddf 100755 --- a/testcases/commands/cron/cron_allow01 +++ b/testcases/commands/cron/cron_allow01 @@ -29,7 +29,7 @@ iam=`whoami` tvar=${MACHTYPE%-*} tvar=${tvar#*-} -if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] +if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ] then CRON_ALLOW="/etc/cron.allow" else diff --git a/testcases/commands/cron/cron_deny01 b/testcases/commands/cron/cron_deny01 index 563f8578..89ca66c8 100755 --- a/testcases/commands/cron/cron_deny01 +++ b/testcases/commands/cron/cron_deny01 @@ -29,7 +29,7 @@ iam=`whoami` tvar=${MACHTYPE%-*} tvar=${tvar#*-} -if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] +if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ] then CRON_DENY="/etc/cron.deny" CRON_ALLOW="/etc/cron.allow" diff --git a/testcases/commands/cron/cron_pos_tests.sh b/testcases/commands/cron/cron_pos_tests.sh index 9b5c9f7d..acc08cb3 100755 --- a/testcases/commands/cron/cron_pos_tests.sh +++ b/testcases/commands/cron/cron_pos_tests.sh @@ -7,7 +7,7 @@ iam=`whoami` tvar=${MACHTYPE%-*} tvar=${tvar#*-} -if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] +if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ] then CRON_ALLOW="/etc/cron.allow" else diff --git a/testcases/commands/eject/Makefile b/testcases/commands/eject/Makefile dissimilarity index 98% index 1125c67f..d22173d0 100644 --- a/testcases/commands/eject/Makefile +++ b/testcases/commands/eject/Makefile @@ -1,14 +1,29 @@ -CFLAGS+= -I../../../include -Wall -LOADLIBES+= -L../../../lib - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../bin/$$i ; done - @ln -f eject-tests.sh ../../bin/eject_tests.sh - -clean: - rm -f $(TARGETS) +# +# commands/eject 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := eject-tests.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/fileutils/Makefile b/testcases/commands/fileutils/Makefile dissimilarity index 96% index dfd5bb2a..65616f74 100644 --- a/testcases/commands/fileutils/Makefile +++ b/testcases/commands/fileutils/Makefile @@ -1,9 +1,27 @@ -SUBDIRS = cp mv mkdir ln - -all: - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - +# +# commands/fileutils test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/commands/fileutils/cp/Makefile b/testcases/commands/fileutils/cp/Makefile dissimilarity index 94% index de7a2a53..caea044e 100644 --- a/testcases/commands/fileutils/cp/Makefile +++ b/testcases/commands/fileutils/cp/Makefile @@ -1,7 +1,31 @@ -all: - -install: - @ln -f cp_tests.sh ../../../bin/ - -clean: - +# +# commands/fileutils/cp 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := cp_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/fileutils/ln/Makefile b/testcases/commands/fileutils/ln/Makefile dissimilarity index 94% index 273f0e91..4637a9cc 100644 --- a/testcases/commands/fileutils/ln/Makefile +++ b/testcases/commands/fileutils/ln/Makefile @@ -1,7 +1,31 @@ -all: - -install: - @ln -f ln_tests.sh ../../../bin/ - -clean: - +# +# commands/fileutils/ln 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := ln_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/fileutils/mkdir/Makefile b/testcases/commands/fileutils/mkdir/Makefile dissimilarity index 95% index 1ce6d459..3738b7c6 100644 --- a/testcases/commands/fileutils/mkdir/Makefile +++ b/testcases/commands/fileutils/mkdir/Makefile @@ -1,7 +1,31 @@ -all: - -install: - @ln -f mkdir_tests.sh ../../../bin/ - -clean: - +# +# commands/fileutils/mkdir 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := mkdir_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/fileutils/mv/Makefile b/testcases/commands/fileutils/mv/Makefile dissimilarity index 94% index ee739f84..a01a3080 100644 --- a/testcases/commands/fileutils/mv/Makefile +++ b/testcases/commands/fileutils/mv/Makefile @@ -1,7 +1,31 @@ -all: - -install: - @ln -f mv_tests.sh ../../../bin/ - -clean: - +# +# commands/fileutils/mv 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := mv_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/gzip/Makefile b/testcases/commands/gzip/Makefile dissimilarity index 97% index 6ea49beb..5c1c256d 100644 --- a/testcases/commands/gzip/Makefile +++ b/testcases/commands/gzip/Makefile @@ -1,6 +1,31 @@ -all: - -install: - @ln -f gzip_tests.sh ../../bin/gzip_tests.sh - -clean: +# +# commands/gzip 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := gzip_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/logrotate/Makefile b/testcases/commands/logrotate/Makefile dissimilarity index 97% index b32c6bac..2bab1b31 100644 --- a/testcases/commands/logrotate/Makefile +++ b/testcases/commands/logrotate/Makefile @@ -1,6 +1,31 @@ -all: - -install: - @ln -f logrotate_tests.sh ../../bin/logrotate_tests.sh - -clean: +# +# commands/logrotate 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := logrotate_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/mail/Makefile b/testcases/commands/mail/Makefile dissimilarity index 97% index 70980996..4bc66174 100644 --- a/testcases/commands/mail/Makefile +++ b/testcases/commands/mail/Makefile @@ -1,6 +1,31 @@ -all: - -install: - @ln -f mail_tests.sh ../../bin/mail_tests.sh - -clean: +# +# commands/mail testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := mail_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/mail/mail_tests.sh b/testcases/commands/mail/mail_tests.sh index 45bac939..cee08d6e 100755 --- a/testcases/commands/mail/mail_tests.sh +++ b/testcases/commands/mail/mail_tests.sh @@ -60,7 +60,7 @@ export TCID=SETUP export TST_COUNT=1 MAIL_NOT_INSTALLED= -`type mail &> /dev/null` +type mail > /dev/null 2>&1 if [ $? != 0 ]; then MAIL_NOT_INSTALLED=1 fi diff --git a/testcases/commands/su/Makefile b/testcases/commands/su/Makefile dissimilarity index 99% index 75ee919b..dd220e60 100644 --- a/testcases/commands/su/Makefile +++ b/testcases/commands/su/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f su01 ../../bin - ln -f su01_s1 ../../bin - ln -f su_set_passwd ../../bin -clean: +# +# commands/su testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := su01 su01_s1 su_set_passwd + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/su/su01 b/testcases/commands/su/su01 index 91548c7e..1228c013 100755 --- a/testcases/commands/su/su01 +++ b/testcases/commands/su/su01 @@ -43,7 +43,7 @@ tvar=${tvar#*-} export tvar printf "Machine type is: $tvar\n\n" -if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] +if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ] # Need to also set group for TEST_USER2 then export TEST_USER1_GROUP="wheel" @@ -99,7 +99,7 @@ rm -f $TEST_ENV_FILE > /dev/null 2>&1 #create users home directory (SLES 8 does not do this, even when specified in adduser) # Only do this if not RH; RH creates the directory. - if [ $tvar != "redhat" -a $tvar != "redhat-linux" ] + if [ "$tvar" != "redhat" -a "$tvar" != "redhat-linux" ] then { USER_UID=`id -u $TEST_USER1` USER_GID=`id -g $TEST_USER1` @@ -135,7 +135,7 @@ rm -f $TEST_ENV_FILE > /dev/null 2>&1 #create users home diretory (SLES 8 does not do this, even when specified in adduser) # Only do this if not RH; RH creates the directory. - if [ $tvar != "redhat" -a $tvar != "redhat-linux" ] + if [ "$tvar" != "redhat" -a "$tvar" != "redhat-linux" ] then { USER_UID=`id -u $TEST_USER2` USER_GID=`id -g $TEST_USER2` diff --git a/testcases/commands/tar/Makefile b/testcases/commands/tar/Makefile dissimilarity index 97% index 6e718186..ac1fa4c8 100644 --- a/testcases/commands/tar/Makefile +++ b/testcases/commands/tar/Makefile @@ -1,6 +1,31 @@ -all: - -install: - @ln -f tar_tests.sh ../../bin/tar_tests.sh - -clean: +# +# commands/tar 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tar_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/Makefile b/testcases/commands/tpm-tools/Makefile dissimilarity index 96% index c6b4d702..191f2b85 100644 --- a/testcases/commands/tpm-tools/Makefile +++ b/testcases/commands/tpm-tools/Makefile @@ -1,9 +1,27 @@ -SUBDIRS = tpm tpmtoken - -all: - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - +# +# commands/tpm_tools 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/commands/tpm-tools/tpm/Makefile b/testcases/commands/tpm-tools/tpm/Makefile dissimilarity index 98% index 318c214e..3c087bac 100644 --- a/testcases/commands/tpm-tools/tpm/Makefile +++ b/testcases/commands/tpm-tools/tpm/Makefile @@ -1,15 +1,27 @@ -SUBDIRS = tpm_selftest \ - tpm_version \ - tpm_getpubek \ - tpm_takeownership \ - tpm_restrictpubek \ - tpm_changeauth \ - tpm_clear - -all: - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - +# +# commands/tpm-tools/tpm test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/commands/tpm-tools/tpm/tpm_changeauth/Makefile b/testcases/commands/tpm-tools/tpm/tpm_changeauth/Makefile dissimilarity index 98% index ab2fab2f..91177d84 100644 --- a/testcases/commands/tpm-tools/tpm/tpm_changeauth/Makefile +++ b/testcases/commands/tpm-tools/tpm/tpm_changeauth/Makefile @@ -1,10 +1,31 @@ -all: - -install: - @ln -f tpm_changeauth_tests.sh ../../../../bin/ - @ln -f tpm_changeauth_tests_exp01.sh ../../../../bin/ - @ln -f tpm_changeauth_tests_exp02.sh ../../../../bin/ - @ln -f tpm_changeauth_tests_exp03.sh ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpm/tpm_changeauth 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpm/tpm_clear/Makefile b/testcases/commands/tpm-tools/tpm/tpm_clear/Makefile dissimilarity index 97% index f15fa3da..eb93af78 100644 --- a/testcases/commands/tpm-tools/tpm/tpm_clear/Makefile +++ b/testcases/commands/tpm-tools/tpm/tpm_clear/Makefile @@ -1,8 +1,31 @@ -all: - -install: - @ln -f tpm_clear_tests.sh ../../../../bin/ - @ln -f tpm_clear_tests_exp01.sh ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpm/tpm_clear 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpm/tpm_getpubek/Makefile b/testcases/commands/tpm-tools/tpm/tpm_getpubek/Makefile dissimilarity index 97% index f636a25c..bd872043 100644 --- a/testcases/commands/tpm-tools/tpm/tpm_getpubek/Makefile +++ b/testcases/commands/tpm-tools/tpm/tpm_getpubek/Makefile @@ -1,8 +1,31 @@ -all: - -install: - @ln -f tpm_getpubek_tests.sh ../../../../bin/ - @ln -f tpm_getpubek_tests_exp01.sh ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpm/tpm_getpubek 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpm/tpm_restrictpubek/Makefile b/testcases/commands/tpm-tools/tpm/tpm_restrictpubek/Makefile dissimilarity index 98% index 0e5a4e33..183d6cb3 100644 --- a/testcases/commands/tpm-tools/tpm/tpm_restrictpubek/Makefile +++ b/testcases/commands/tpm-tools/tpm/tpm_restrictpubek/Makefile @@ -1,10 +1,31 @@ -all: - -install: - @ln -f tpm_restrictpubek_tests.sh ../../../../bin/ - @ln -f tpm_restrictpubek_tests_exp01.sh ../../../../bin/ - @ln -f tpm_restrictpubek_tests_exp02.sh ../../../../bin/ - @ln -f tpm_restrictpubek_tests_exp03.sh ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpm/tpm_restrictpubek 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpm/tpm_selftest/Makefile b/testcases/commands/tpm-tools/tpm/tpm_selftest/Makefile dissimilarity index 95% index 6a87546d..353a8229 100644 --- a/testcases/commands/tpm-tools/tpm/tpm_selftest/Makefile +++ b/testcases/commands/tpm-tools/tpm/tpm_selftest/Makefile @@ -1,7 +1,31 @@ -all: - -install: - @ln -f tpm_selftest_tests.sh ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpm/tpm_selftest 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpm/tpm_takeownership/Makefile b/testcases/commands/tpm-tools/tpm/tpm_takeownership/Makefile dissimilarity index 97% index d82166c4..bfbb4136 100644 --- a/testcases/commands/tpm-tools/tpm/tpm_takeownership/Makefile +++ b/testcases/commands/tpm-tools/tpm/tpm_takeownership/Makefile @@ -1,8 +1,31 @@ -all: - -install: - @ln -f tpm_takeownership_tests.sh ../../../../bin/ - @ln -f tpm_takeownership_tests_exp01.sh ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpm/tpm_takeownership 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpm/tpm_version/Makefile b/testcases/commands/tpm-tools/tpm/tpm_version/Makefile dissimilarity index 95% index a926a8cb..6c218525 100644 --- a/testcases/commands/tpm-tools/tpm/tpm_version/Makefile +++ b/testcases/commands/tpm-tools/tpm/tpm_version/Makefile @@ -1,7 +1,31 @@ -all: - -install: - @ln -f tpm_version_tests.sh ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpm/tpm_version 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpmtoken/Makefile b/testcases/commands/tpm-tools/tpmtoken/Makefile dissimilarity index 97% index 3e46f215..63565d96 100644 --- a/testcases/commands/tpm-tools/tpmtoken/Makefile +++ b/testcases/commands/tpm-tools/tpmtoken/Makefile @@ -1,13 +1,27 @@ -SUBDIRS = tpmtoken_init \ - tpmtoken_setpasswd \ - tpmtoken_import \ - tpmtoken_protect \ - tpmtoken_objects - -all: - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - +# +# commands/tpm-tools/tpmtoken test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/commands/tpm-tools/tpmtoken/tpmtoken_import/Makefile b/testcases/commands/tpm-tools/tpmtoken/tpmtoken_import/Makefile dissimilarity index 99% index e1de1be5..964ac8e2 100644 --- a/testcases/commands/tpm-tools/tpmtoken/tpmtoken_import/Makefile +++ b/testcases/commands/tpm-tools/tpmtoken/tpmtoken_import/Makefile @@ -1,16 +1,31 @@ -all: - -install: - @ln -f tpmtoken_import_tests.sh ../../../../bin/ - @ln -f tpmtoken_import_tests_exp01.sh ../../../../bin/ - @ln -f tpmtoken_import_tests_exp02.sh ../../../../bin/ - @ln -f tpmtoken_import_tests_exp03.sh ../../../../bin/ - @ln -f tpmtoken_import_tests_exp04.sh ../../../../bin/ - @ln -f tpmtoken_import_tests_exp05.sh ../../../../bin/ - @ln -f tpmtoken_import_tests_exp06.sh ../../../../bin/ - @ln -f tpmtoken_import_tests_exp07.sh ../../../../bin/ - @ln -f tpmtoken_import_tests_exp08.sh ../../../../bin/ - @ln -f tpmtoken_import_openssl.cnf ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpmtoken/tpmtoken_import 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpmtoken/tpmtoken_init/Makefile b/testcases/commands/tpm-tools/tpmtoken/tpmtoken_init/Makefile dissimilarity index 98% index 9a4c89e2..b57b9606 100644 --- a/testcases/commands/tpm-tools/tpmtoken/tpmtoken_init/Makefile +++ b/testcases/commands/tpm-tools/tpmtoken/tpmtoken_init/Makefile @@ -1,11 +1,31 @@ -all: - -install: - @ln -f tpmtoken_init_tests.sh ../../../../bin/ - @ln -f tpmtoken_init_tests_exp00.sh ../../../../bin/ - @ln -f tpmtoken_init_tests_exp01.sh ../../../../bin/ - @ln -f tpmtoken_init_tests_exp02.sh ../../../../bin/ - @ln -f tpmtoken_init_tests_exp03.sh ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpmtoken/tpmtoken_init 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpmtoken/tpmtoken_objects/Makefile b/testcases/commands/tpm-tools/tpmtoken/tpmtoken_objects/Makefile dissimilarity index 97% index 09ad25f4..53080c96 100644 --- a/testcases/commands/tpm-tools/tpmtoken/tpmtoken_objects/Makefile +++ b/testcases/commands/tpm-tools/tpmtoken/tpmtoken_objects/Makefile @@ -1,8 +1,31 @@ -all: - -install: - @ln -f tpmtoken_objects_tests.sh ../../../../bin/ - @ln -f tpmtoken_objects_tests_exp01.sh ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpmtoken/tpmtoken_objects 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpmtoken/tpmtoken_protect/Makefile b/testcases/commands/tpm-tools/tpmtoken/tpmtoken_protect/Makefile dissimilarity index 98% index 774ede83..112e8cf7 100644 --- a/testcases/commands/tpm-tools/tpmtoken/tpmtoken_protect/Makefile +++ b/testcases/commands/tpm-tools/tpmtoken/tpmtoken_protect/Makefile @@ -1,10 +1,31 @@ -all: - -install: - @ln -f tpmtoken_protect_tests.sh ../../../../bin/ - @ln -f tpmtoken_protect_tests_exp01.sh ../../../../bin/ - @ln -f tpmtoken_protect_tests_exp02.sh ../../../../bin/ - @ln -f tpmtoken_protect_data.txt ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpmtoken/tpmtoken_protect 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/tpm-tools/tpmtoken/tpmtoken_setpasswd/Makefile b/testcases/commands/tpm-tools/tpmtoken/tpmtoken_setpasswd/Makefile dissimilarity index 99% index 145fc235..e47ffa53 100644 --- a/testcases/commands/tpm-tools/tpmtoken/tpmtoken_setpasswd/Makefile +++ b/testcases/commands/tpm-tools/tpmtoken/tpmtoken_setpasswd/Makefile @@ -1,11 +1,31 @@ -all: - -install: - @ln -f tpmtoken_setpasswd_tests.sh ../../../../bin/ - @ln -f tpmtoken_setpasswd_tests_exp01.sh ../../../../bin/ - @ln -f tpmtoken_setpasswd_tests_exp02.sh ../../../../bin/ - @ln -f tpmtoken_setpasswd_tests_exp03.sh ../../../../bin/ - @ln -f tpmtoken_setpasswd_tests_exp04.sh ../../../../bin/ - -clean: - +# +# commands/tpm-tools/tpmtoken/tpmtoken_setpasswd 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/commands/unzip/Makefile b/testcases/commands/unzip/Makefile dissimilarity index 91% index 7c7aa603..271a7653 100644 --- a/testcases/commands/unzip/Makefile +++ b/testcases/commands/unzip/Makefile @@ -1,28 +1,49 @@ -# Only build and install if we have the zip and unzip commands -HAVE_ZIPTOOLS=$(shell which zip >/dev/null 2>&1\ - && which unzip >/dev/null 2>&1 && echo t) -ifeq ($(HAVE_ZIPTOOLS),t) -BINS := unzip_tests.sh -DEPS := tst_unzip_file.zip $(BINS) -else -BINS := -DEPS := -endif - -all: $(DEPS) - -tst_unzip_file.zip: tst_unzip.dir - zip -r tst_unzip_file.zip tst_unzip.dir && chmod 777 tst_unzip_file.zip - -# This target should be auto-removed by Make -.INTERMEDIATE: tst_unzip.dir -tst_unzip.dir: unzip_genfile.sh - ./unzip_genfile.sh tst_unzip.dir - -install: all - @set -e; for i in $(BINS); do \ - ln -f $$i ../../bin/$$i ; \ - done - -clean: - rm -rf tst_unzip.dir tst_unzip_file.zip +# +# commands/unzip 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +# Only build and install if we have the zip command. +HAVE_ZIPTOOLS := $(shell if which zip >/dev/null; then echo yes; else echo no; fi) + +DIR := tst_unzip.dir + +MAKE_TARGETS := + +ifeq ($(HAVE_ZIPTOOLS),yes) +INSTALL_TARGETS := unzip_tests.sh +$(INSTALL_TARGETS): $(ZIPFILE) +endif + +$(ZIPFILE): $(DIR) + $(ZIP) -r $@ $(DIR) && chmod 777 $@ + +CLEAN_TARGETS := $(DIR) + +# This target should be auto-removed by Make +.INTERMEDIATE: $(DIR) +$(DIR): unzip_genfile.sh + ./$^ $(DIR) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile dissimilarity index 97% index 40b704c1..07157398 100644 --- a/testcases/kernel/Makefile +++ b/testcases/kernel/Makefile @@ -1,23 +1,50 @@ -include ../../config.mk - -SUBDIRS = power_management numa containers connectors include fs io ipc mem pty sched security syscalls timers -UCLINUX_SUBDIRS = include syscalls - -ifeq ($(LTP_CHECK_CGROUPSTATS_HEADER),yes) - SUBDIRS+= controllers -endif - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -uclinux: - @set -e; for i in $(UCLINUX_SUBDIRS); do $(MAKE) -C $$i uclinux ; done - -uclinux_install: - @set -e; for i in $(UCLINUX_SUBDIRS); do $(MAKE) -C $$i uclinux_install ; done - -clean: - @set -e; for i in $(SUBDIRS) timers; do $(MAKE) -C $$i clean ; done +# +# kernel test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +ifneq ($(UCLINUX),1) +SUBDIRS := containers connectors controllers fs io ipc mem numa \ + performance_counters power_management pty sched security \ + syscalls timers +else +SUBDIRS := syscalls +endif + +trunk-all: $(includedir)/linux_syscall_numbers.h + +trunk-clean:: | linux-syscall-numbers-clean + +include: + mkdir -p "$@" + +linux-syscall-numbers-clean:: include + $(MAKE) -C $^ -f "$(abs_srcdir)/include/Makefile" clean + +$(includedir)/linux_syscall_numbers.h: include + set -e; for i in all install; do \ + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" $$i; \ + done + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/connectors/Makefile b/testcases/kernel/connectors/Makefile dissimilarity index 99% index 7e16b53a..7661c579 100644 --- a/testcases/kernel/connectors/Makefile +++ b/testcases/kernel/connectors/Makefile @@ -1,18 +1,29 @@ -SUBDIRS = pec - -all: - @set -e; \ - if ! test -f /proc/net/connector; then \ - echo "system does not support process event connector"; \ - else for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done; true; fi - -install: - @set -e; \ - ln -f connector_test.sh ../../bin/connector_test.sh; \ - chmod ugo+x connector_test.sh; \ - if ! test -f /proc/net/connector; then \ - echo "system does not support process event connector"; \ - else for i in $(SUBDIRS); do $(MAKE) -C $$i install; done; true; fi - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done +# +# testcases/kernel/connectors test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := connector_test.sh + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/connectors/pec/Makefile b/testcases/kernel/connectors/pec/Makefile dissimilarity index 99% index 8969a2f4..e9f64482 100644 --- a/testcases/kernel/connectors/pec/Makefile +++ b/testcases/kernel/connectors/pec/Makefile @@ -1,14 +1,29 @@ -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp - -SRCS:=$(wildcard *.c) -TARGETS:=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; chmod +x run_pec_test ; done ; - ln -f run_pec_test ../../../bin/ - chmod +x run_pec_test -clean: - rm -f $(TARGETS) +# +# kernel/connectors/pec 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := run_pec_test + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c index 20f269d2..86909369 100644 --- a/testcases/kernel/connectors/pec/pec_listener.c +++ b/testcases/kernel/connectors/pec/pec_listener.c @@ -20,15 +20,16 @@ /* */ /******************************************************************************/ +#include +#include +#include #include #include #include #include #include #include -#include -#include - +#include #include #ifndef NETLINK_CONNECTOR diff --git a/testcases/kernel/containers/Makefile b/testcases/kernel/containers/Makefile dissimilarity index 99% index 9e1a4ba7..5283bf68 100644 --- a/testcases/kernel/containers/Makefile +++ b/testcases/kernel/containers/Makefile @@ -1,37 +1,46 @@ -################################################################################ -## ## -## 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -## ## -################################################################################ - -SUBDIRS := libclone utsname sysvipc pidns netns mqns - -all: check_for_unshare - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done - -check_for_unshare: check_for_unshare.c - $(CC) $(CFLAGS) -rdynamic -o $@ $< ../../../lib/tst_kvercmp.c -I../../../include -ldl - -install: check_for_unshare - @set -e; ln -f check_for_unshare ../../bin/check_for_unshare; \ - ln -f container_test.sh ../../bin/container_test.sh; \ - for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done; \ - chmod ugo+x container_test.sh - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done - rm -f check_for_unshare +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +LIBDIR := libclone + +FILTER_OUT_DIRS := $(LIBDIR) + +LIB := $(LIBDIR)/libclone.a + +INSTALL_TARGETS := *.sh + +$(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. +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$(LIBDIR)/Makefile" all + +trunk-all: $(LIB) + +trunk-clean:: | lib-clean + +lib-clean:: $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$(LIBDIR)/Makefile" clean + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/containers/Makefile.inc b/testcases/kernel/containers/Makefile.inc new file mode 100644 index 00000000..ca810393 --- /dev/null +++ b/testcases/kernel/containers/Makefile.inc @@ -0,0 +1,45 @@ +# +# 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. +# +# Garrett 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_TARGETS): | $(LIBS) + +# vim: syntax=make diff --git a/testcases/kernel/containers/check_for_unshare.c b/testcases/kernel/containers/check_for_unshare.c deleted file mode 100644 index 06bdfd7d..00000000 --- a/testcases/kernel/containers/check_for_unshare.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -* Copyright (c) International Business Machines Corp., 2008 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -* the GNU General Public License for more details. -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -**************************************************************************/ -/* -* Description: -* This program verifies the kernel version to be no later than 2.6.16 -* And checks if the unshare() system call is defined using dlsym(), -* in the Dynamically Linked Libraries. -* -* Date : 26-11-2008 -* Author : Veerendra C -*/ - -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - void *handle; - void *ret; - char *error; - if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)) - return 1; - - handle = dlopen(NULL, RTLD_LAZY); - if (!handle) { - fprintf(stderr, "%s\n", dlerror()); - exit(1); - } - - dlerror(); /* Clear any existing error */ - ret = dlsym(handle, "unshare"); - if ((error = dlerror()) != NULL) { - fprintf(stderr, "Error: %s\n", error); - exit(1); - } - - dlclose(handle); - return 0; -} diff --git a/testcases/kernel/containers/libclone/Makefile b/testcases/kernel/containers/libclone/Makefile index a5373f3f..51608f44 100755 --- a/testcases/kernel/containers/libclone/Makefile +++ b/testcases/kernel/containers/libclone/Makefile @@ -18,28 +18,10 @@ ## ## ################################################################################ -SRCS := $(wildcard *.c) -OBJS := $(SRCS:%.c=%.o) +top_srcdir ?= ../../../.. -CFLAGS += -I../../../../include +include $(top_srcdir)/include/mk/env_pre.mk -HAS_UNSHARE ?= $(shell ../check_for_unshare && echo y) -ifeq ($(HAS_UNSHARE),y) -TARGET := libclone.a libnetns.a -else -TARGET := -endif +LIB := libclone.a -all: $(TARGET) - -libclone.a: $(OBJS) - $(AR) -cr $@ libclone.o - -libnetns.a: $(OBJS) - $(AR) -cr $@ libnetns.o -# $(AR) -cr $@ $^ - -clean: - rm -f $(TARGET) $(OBJS) - -install: +include $(top_srcdir)/include/mk/lib.mk diff --git a/testcases/kernel/containers/libclone/libnetns.c b/testcases/kernel/containers/libclone/libnetns.c deleted file mode 100644 index 821fec18..00000000 --- a/testcases/kernel/containers/libclone/libnetns.c +++ /dev/null @@ -1,170 +0,0 @@ -/* -* Copyright (c) International Business Machines Corp., 2008 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -* the GNU General Public License for more details. -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -***************************************************************************/ -/*========================================================================= -* This testcase creates the network namespace. -* It creates veth pair veth8 & veth9. Also assigns IP addresses to the childNS. -* Also it starts the sshd daemon @ port 7890 -* -* Scripts Used: parentns.sh childns.sh -* -* Author: Veerendra -=========================================================================*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "libclone.h" -#include "test.h" - - -int TST_TOTAL = 1; - -extern pid_t getpgid(pid_t pid); -extern pid_t getsid(pid_t pid); -static int child_fn(void *c1); - -int crtchild(char *s1 , char *s2) -{ - char *cmd[] = { "--", s1, s2, (char *)0 }; - execve("/bin/bash", cmd, __environ); - printf("The code would not reach here on success\n"); - perror("execve"); - return 1; -} - -int create_net_namespace(char *p1, char *c1) -{ - int pid, status = 0, ret; - char *ltproot, *par; - long int clone_flags = 0; - int stack_size = getpagesize() * 4; - void *childstack, *stack; - - if (tst_kvercmp(2, 6, 19) < 0) - return 1; - - stack = malloc(stack_size); - if (!stack) { - perror("failled to malloc memory for stack..."); - return -1; - } - childstack = stack + stack_size; - - clone_flags |= CLONE_NEWNS; -/* Enable other namespaces too optionally */ -#ifdef CLONE_NEWPID - clone_flags |= CLONE_NEWPID; -#endif - -#ifdef __ia64__ - pid = clone2(child_fn, childstack, getpagesize(), clone_flags | SIGCHLD, - (void *)c1, NULL, NULL, NULL); -#else - pid = clone(child_fn, childstack, clone_flags | SIGCHLD, (void *)c1); -#endif - - if (pid == -1) { - perror("Failled to do clone..."); - free(stack); - return -1; - } - -/* This code will be executed in parent */ - ltproot = getenv("LTPROOT"); - - if ( !ltproot) { - printf("LTPROOT env variable is not set\n"); - printf("Please set LTPROOT and re-run the test.. Thankyou\n"); - return -1; - } - - par = malloc(FILENAME_MAX); - - if (par == NULL) { - printf("FAIL: error while allocating memory"); - exit(1); - } - - /* We need to pass the child pid to the parentns.sh script */ - sprintf(par, "%s/testcases/kernel/containers/netns/parentns.sh %s %u", - ltproot, p1, pid); - - ret = system(par); - status = WEXITSTATUS(ret); - if ( ret == -1 || status != 0) { - printf("Error while running the script\n"); - fflush(stdout); - exit(1); - } - fflush(stdout); - - ret = waitpid(pid, &status, __WALL); - status = WEXITSTATUS(status); - if ( ret == -1 || status != 0) - printf("Error: waitpid() returns %d, status %d\n", ret, status); - - return status; -} - -/* The function to be executed in the child namespace */ -int child_fn(void *c1) -{ - char *ltproot, *child; - unsigned long flags = 0; - int ret; - -/* Flags to unshare different Namespaces */ - flags |= CLONE_NEWNS; - flags |= CLONE_NEWNET; - flags |= CLONE_NEWUTS; - flags |= CLONE_FS; - - ltproot = getenv("LTPROOT"); - - if (!ltproot) { - printf("LTPROOT env variable is not set\n"); - printf("Please set LTPROOT and re-run the test.. Thankyou\n"); - return -1; - } - - child = malloc(FILENAME_MAX); - if (child == NULL) { - printf("FAIL: error while allocating memory"); - exit(1); - } - - sprintf(child, "%s/testcases/kernel/containers/netns/childns.sh", - ltproot); - - /* Unshare the network namespace in the child */ - ret = unshare(flags); - if (ret < 0) { - perror("Failled to unshare for netns..."); - return 1; - } - return crtchild(child, c1); -} diff --git a/testcases/kernel/containers/mqns/Makefile b/testcases/kernel/containers/mqns/Makefile index d9aba3d7..aafb8923 100644 --- a/testcases/kernel/containers/mqns/Makefile +++ b/testcases/kernel/containers/mqns/Makefile @@ -19,24 +19,11 @@ ## ## ################################################################################ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -I../libclone -LDLIBS += -L../../../../lib -L../libclone ../libclone/libclone.a -lltp -lrt +top_srcdir ?= ../../../.. -SRCS := $(wildcard *.c) -TARGETS := $(SRCS:%.c=%) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc -HAS_UNSHARE ?= $(shell ../check_for_unshare && echo y) -ifneq ($(HAS_UNSHARE),y) -TARGETS := -endif +LDLIBS += -lclone -lpthread -lrt -all: $(TARGETS) - -clean: - rm -f $(TARGETS) *.o - -install: -ifeq ($(HAS_UNSHARE),y) - @set -e; for i in $(TARGETS) runmqnstest.sh check_mqns_enabled; do ln -f $$i ../../../bin/$$i ; chmod +x runmqnstest.sh ; done -endif +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/containers/mqns/check_mqns_enabled.c b/testcases/kernel/containers/mqns/check_mqns_enabled.c deleted file mode 100644 index 169e8c9e..00000000 --- a/testcases/kernel/containers/mqns/check_mqns_enabled.c +++ /dev/null @@ -1,55 +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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* Author: Serge Hallyn -***************************************************************************/ -#include -#include -#include -#include -#include "../libclone/libclone.h" -#include "test.h" -#include "mqns.h" - -int dummy(void *v) -{ - return 0; -} - -int main() -{ - int pid; - mqd_t mqd; - - if (tst_kvercmp(2,6,30) < 0) /* only in -mm so far actually */ - return 1; - - mq_unlink("/checkmqnsenabled"); - mqd = mq_open("/checkmqnsenabled", O_RDWR|O_CREAT|O_EXCL, 0777, NULL); - if (mqd == -1) { - perror("mq_open"); - return 3; - } - mq_close(mqd); - mq_unlink("/checkmqnsenabled"); - - pid = do_clone(CLONE_NEWIPC, dummy, NULL); - - if (pid == -1) - return 5; - - return 0; -} diff --git a/testcases/kernel/containers/netns/Makefile b/testcases/kernel/containers/netns/Makefile index f12fa2d5..dae64909 100644 --- a/testcases/kernel/containers/netns/Makefile +++ b/testcases/kernel/containers/netns/Makefile @@ -19,33 +19,16 @@ ## Author: Veerendra ## ################################################################################ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -I../libclone -LDLIBS += -L../../../../lib -L../libclone ../libclone/libnetns.a -lltp -SCRIPTS = initialize.sh parentns.sh childns.sh \ -parent.sh child.sh \ -parent_view.sh parent_share.sh child_propagate.sh \ -parent_1.sh parent_2.sh child_1.sh child_2.sh \ -delchild.sh rename_net.sh \ -paripv6.sh childipv6.sh \ -par_ftp.sh ch_ftp.sh container_ftp.pl \ -runnetnstest.sh nw_under_ns.sh +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(SRCS:%.c=%) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc -HAS_UNSHARE ?= $(shell ../check_for_unshare && echo y) -ifneq ($(HAS_UNSHARE),y) -TARGETS := -endif +INSTALL_TARGETS := *.sh -all: $(TARGETS) - @chmod +x $(SCRIPTS) +MAKE_TARGETS := create_container crtchild crtchild_delchild \ + par_chld_ftp par_chld_ipv6 sysfsview two_children_ns -install: -ifeq ($(HAS_UNSHARE),y) - @set -e; for i in $(TARGETS) $(SCRIPTS) runnetnstest.sh check_netns_enabled; do ln -f $$i ../../../bin/$$i ; chmod +x runnetnstest.sh ; done -endif +$(MAKE_TARGETS): %: common.o %.o -clean: - rm -f $(TARGETS) *.o +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/containers/netns/childns.sh b/testcases/kernel/containers/netns/childns.sh index 5a831ba9..3634d81f 100755 --- a/testcases/kernel/containers/netns/childns.sh +++ b/testcases/kernel/containers/netns/childns.sh @@ -32,59 +32,58 @@ # set -x # The test case ID, the test case count and the total number of test case -TCID=${TCID:-childns.sh} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL -. initialize.sh +export TCID=${TCID:-childns.sh} +. cmdlib.sh +exists awk grep ip ping sshd +. initialize.sh status=0 - if [ $# = 1 ] ; then - childscrpt=$1 - debug "INFO: The script to be executed in child NS is $childscrpt" - fi - - # Passing the PID of child - echo "child ready" > /tmp/FIFO1; - - # waiting for the device name from parent - vnet1=`cat /tmp/FIFO2`; - debug "INFO: network dev name received $vnet1"; - # Assigning the dev addresses - ifconfig $vnet1 $IP2/24 up > /dev/null 2>&1 - if [ $? -ne 0 ]; then - debug "Failed to make interface $vnet1 up in child....." - fi +if [ $# -eq 1 ] ; then + childscrpt=$1 + debug "INFO: The script to be executed in child NS is $childscrpt" +fi + +# Passing the PID of child +echo "child ready" > /tmp/FIFO1; + +# waiting for the device name from parent +vnet1=`cat /tmp/FIFO2`; +debug "INFO: network dev name received $vnet1"; +# Assigning the dev addresses +if ! ifconfig $vnet1 $IP2/24 up > /dev/null 2>&1 ; then + debug "Failed to make interface $vnet1 up in child....." +fi + +ifconfig lo up +sleep 2 + +#starting the sshd inside the child NS +if ! sshd -p $PORT; then + debug "INFO: started the sshd @ port no $PORT" + sshpid=`ps -ef | grep "sshd -p $PORT" | grep -v grep | awk '{ print $2 ; exit 0} ' ` +else + tst_resm TFAIL "Failed in starting ssh @ port $PORT" + cleanup $vnet1 + status=1 +fi + +if [ $status -eq 0 ] ; then - ifconfig lo up ; - sleep 2 - - #starting the sshd inside the child NS - /usr/sbin/sshd -p $PORT - if [ $? = 0 ]; then - debug "INFO: started the sshd @ port no $PORT" - sshpid=`ps -ef | grep "sshd -p $PORT" | awk '{ print $2 ; exit 0} ' ` - else - tst_resm TFAIL "Failed in starting ssh @ port $PORT" - status=1 - fi - # checking if parent ns responding - ping -q -c 2 $IP1 > /dev/null - if [ $? != 0 ] ; then + if ! ping -q -c 2 $IP1 > /dev/null ; then tst_resm TFAIL "FAIL: ParentNS not responding" status=1 cleanup $sshpid $vnet1 exit $status fi - - if [ -f $childscrpt ]; then - . $childscrpt + + if [ -f "$childscrpt" ]; then + . "$childscrpt" fi - + cleanup $sshpid $vnet1 debug "INFO: Done with executing child script $0, status is $status" - - exit $status + +fi + +exit $status diff --git a/testcases/kernel/containers/netns/common.c b/testcases/kernel/containers/netns/common.c new file mode 100644 index 00000000..c4fd0860 --- /dev/null +++ b/testcases/kernel/containers/netns/common.c @@ -0,0 +1,172 @@ +/* +* Copyright (c) International Business Machines Corp., 2008 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +* the GNU General Public License for more details. +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* +***************************************************************************/ +/*========================================================================= +* This testcase creates the network namespace. +* It creates veth pair veth8 & veth9. Also assigns IP addresses to the childNS. +* Also it starts the sshd daemon @ port 7890 +* +* Scripts Used: parentns.sh childns.sh +* +* Author: Veerendra +=========================================================================*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libclone.h" +#include "test.h" +#include "config.h" + +static int child_fn(void *c1); + +int crtchild(char *s1 , char *s2) +{ + char *cmd[] = { "--", s1, s2, (char *)0 }; + execve("/bin/sh", cmd, __environ); + printf("The code would not reach here on success\n"); + perror("execve"); + return 1; +} + +int create_net_namespace(char *p1, char *c1) +{ + int pid, status = 0, ret; + char *ltproot, *par; + long int clone_flags = 0; + int stack_size = getpagesize() * 4; + void *childstack, *stack; + + if (tst_kvercmp(2, 6, 19) < 0) + return 1; + + stack = malloc(stack_size); + if (!stack) { + perror("failled to malloc memory for stack..."); + return -1; + } + childstack = stack + stack_size; + + clone_flags |= CLONE_NEWNS; +/* Enable other namespaces too optionally */ +#ifdef CLONE_NEWPID + clone_flags |= CLONE_NEWPID; +#endif + +#ifdef __ia64__ + pid = clone2(child_fn, childstack, getpagesize(), clone_flags | SIGCHLD, + (void *)c1, NULL, NULL, NULL); +#else + pid = clone(child_fn, childstack, clone_flags | SIGCHLD, (void *)c1); +#endif + + if (pid == -1) { + perror("Failed to do clone..."); + free(stack); + return -1; + } + + /* This code will be executed in parent */ + ltproot = getenv("LTPROOT"); + + if ( !ltproot) { + printf("LTPROOT env variable is not set\n"); + printf("Please set LTPROOT and re-run the test.. Thankyou\n"); + return -1; + } + + par = malloc(FILENAME_MAX); + + if (par == NULL) { + printf("FAIL: error while allocating memory"); + exit(1); + } + + /* We need to pass the child pid to the parentns.sh script */ + sprintf(par, "parentns.sh %s %u", ltproot, p1, pid); + + ret = system(par); + status = WEXITSTATUS(ret); + if ( ret == -1 || status != 0) { + printf("Error while running the script\n"); + fflush(stdout); + exit(1); + } + fflush(stdout); + + ret = waitpid(pid, &status, __WALL); + status = WEXITSTATUS(status); + if ( ret == -1 || status != 0) { + printf("Error: waitpid() returns %d, status %d\n", ret, status); + } + + return status; +} + +/* The function to be executed in the child namespace */ +int child_fn(void *c1) +{ + char *ltproot, *child; + unsigned long flags = 0; +#if HAVE_UNSHARE + int ret; +#endif + + /* Flags to unshare different Namespaces */ + flags |= CLONE_NEWNS; + flags |= CLONE_NEWNET; + flags |= CLONE_NEWUTS; + flags |= CLONE_FS; + + ltproot = getenv("LTPROOT"); + + if (!ltproot) { + printf("LTPROOT env variable is not set\n"); + printf("Please set LTPROOT and re-run the test..\n"); + return -1; + } + + child = malloc(FILENAME_MAX); + if (child == NULL) { + printf("FAIL: error while allocating memory"); + exit(1); + } + + sprintf(child, "childns.sh", ltproot); + + /* Unshare the network namespace in the child */ +#if HAVE_UNSHARE + ret = unshare(flags); + if (ret < 0) { + perror("Failed to unshare for netns..."); + return 1; + } + return crtchild(child, c1); +#else + printf("System doesn't support unshare.\n"); + return -1; +#endif +} diff --git a/testcases/kernel/containers/netns/create_container.c b/testcases/kernel/containers/netns/create_container.c index 6ba4d0e9..f73d196e 100644 --- a/testcases/kernel/containers/netns/create_container.c +++ b/testcases/kernel/containers/netns/create_container.c @@ -27,7 +27,7 @@ * Author: Sudhir Kumar 26/08/2008 * ============================================================================*/ -#include<../libclone/libclone.h> +#include "libclone.h" int main() { diff --git a/testcases/kernel/containers/netns/crtchild.c b/testcases/kernel/containers/netns/crtchild.c index c5663718..338ad7db 100644 --- a/testcases/kernel/containers/netns/crtchild.c +++ b/testcases/kernel/containers/netns/crtchild.c @@ -26,7 +26,7 @@ * 31/07/2008 * =============================================================================*/ -#include "../libclone/libclone.h" +#include "libclone.h" int main() { diff --git a/testcases/kernel/containers/netns/crtchild_delchild.c b/testcases/kernel/containers/netns/crtchild_delchild.c index da415d63..9d96452d 100644 --- a/testcases/kernel/containers/netns/crtchild_delchild.c +++ b/testcases/kernel/containers/netns/crtchild_delchild.c @@ -29,7 +29,7 @@ * 31/07/2008 * =========================================================================*/ -#include "../libclone/libclone.h" +#include "libclone.h" int main() { diff --git a/testcases/kernel/containers/netns/initialize.sh b/testcases/kernel/containers/netns/initialize.sh index dafc9236..dd012805 100755 --- a/testcases/kernel/containers/netns/initialize.sh +++ b/testcases/kernel/containers/netns/initialize.sh @@ -25,60 +25,63 @@ # to be used and cleanup functions. # set -x -TCID=${TCID:-initialize} -TST_TOTAL=1 -TST_COUNT=1 -export TCID -export TST_COUNT -export TST_TOTAL +export TCID=${TCID:-initialize} +export TST_TOTAL=1 +export TST_COUNT=1 -IP1='192.168.0.181' -IP2='192.168.0.182' -IP3='192.168.0.183' -IP4='192.168.0.184' +TEST_SUBNET=${TEST_SUBNET:=192.168.0} +i=1 +while [ $i -le 4 ] ; do + eval "IP${i}=\"$TEST_SUBNET.18$i\"" + : $(( i += 1 )) +done mask=/24 PORT=7890 PORT2=9876 DEBUG=0 - # set the LTPROOT directory - cd `dirname $0` - env | grep -q LTPROOT - if [ $? -eq 0 ]; then - FS_BIND=${LTPROOT}/testcases/kernel/fs/fs_bind/bin/smount - if [ -f $FS_BIND ] ; then - smount=$FS_BIND - fi - else - tst_resm TFAIL "Please set the LTP root env variable, and retry again" - exit -1 +# set the LTPROOT directory +cd "$(dirname "$0")" +if [ -n "${LTPROOT:-}" ]; then + FS_BIND=${LTPROOT}/testcases/bin/smount + if [ -f $FS_BIND ] ; then + smount=$FS_BIND fi +else + tst_resm TFAIL "Please set the LTP root env variable, and retry again" + exit -1 +fi - IPver=`ip -V | awk -F"-" ' { print $2 } '` ; - if ! printf "%s\n%s\n" "ss080417" "$IPver" | sort -c ; then - tst_resm TINFO "ip version should be atleast ss080417" - exit -1 - fi - mkfifo /tmp/FIFO1 /tmp/FIFO2 /tmp/FIFO3 /tmp/FIFO4 /tmp/FIFO5 /tmp/FIFO6 2> /dev/null +IPver=`ip -V | awk -F"-" ' { print $2 } '` ; +if ! printf "%s\n%s\n" "ss080417" "$IPver" | sort -c ; then + tst_resm TINFO "ip version should be atleast ss080417" + exit -1 +fi +i=1 +while [ $i -le 6 ] ; do + mkfifo /tmp/FIFO$i 2> /dev/null + : $(( i += 1 )) +done - netdev=`ip addr show | awk '/^[0-9]*:.*UP/ { a=$2 } /inet / { b=$2 ; \ - if ( a !~ /lo/ && b ! NULL ) { print a ; exit 0 } } ' ` - netdev=`basename $netdev ":"` - if [ -z $netdev ] ; then - tst_resm TINFO "Not able to determine the ethernet dev name" - exit -1 - fi +netdev=`ip addr show | awk '/^[0-9]*:.*UP/ { a=$2 } /inet / { b=$2 ; \ + if ( a !~ /lo/ && b ! NULL ) { print a ; exit 0 } } ' ` +netdev=`basename $netdev ":"` +if [ -z "$netdev" ] ; then + tst_resm TINFO "Not able to determine the ethernet dev name" + exit -1 +fi + +# copying the values for restoring it later. +ipfwd=`cat /proc/sys/net/ipv4/ip_forward` +if [ -f "/proc/sys/net/ipv4/conf/$netdev/proxy_arp" ] ; then + arpproxy=`cat /proc/sys/net/ipv4/conf/$netdev/proxy_arp` +else + arpproxy=0 +fi - # copying the values for restoring it later. - ipfwd=`cat /proc/sys/net/ipv4/ip_forward` - if [ -f /proc/sys/net/ipv4/conf/$netdev/proxy_arp ] ; then - arpproxy=`cat /proc/sys/net/ipv4/conf/$netdev/proxy_arp` - else - arpproxy=0 - fi cleanup() { - if [ $# = 2 ]; then + if [ $# -eq 2 ]; then pid=$1 netdev=$2 fi @@ -89,7 +92,7 @@ cleanup() sleep 1 #Restoring the orignial values . - echo $ipfwd > /proc/sys/net/ipv4/ip_forward + echo "$ipfwd" > /proc/sys/net/ipv4/ip_forward if [ -f /proc/sys/net/ipv4/conf/$netdev/proxy_arp ] ; then echo $arpproxy > /proc/sys/net/ipv4/conf/$netdev/proxy_arp fi @@ -100,10 +103,7 @@ cleanup() debug() { - if [ "$DEBUG" = 1 ] - then - echo $1; - fi + [ "$DEBUG" = 1 ] && echo $1 } create_veth() @@ -112,8 +112,5 @@ create_veth() ip link add type veth sleep 1 ip link show > /tmp/net2 - eval `diff /tmp/net1 /tmp/net2 | awk -F": " ' /^> [0-9]*:/ { print "dev" i+0 "=" $2; i++ } '` + eval `diff /tmp/net1 /tmp/net2 | awk -F": " '/^> [0-9]*:/ { print "dev" i+0 "=" $2; i++ }'` } - - - diff --git a/testcases/kernel/containers/netns/nw_under_ns.sh b/testcases/kernel/containers/netns/nw_under_ns.sh index a5a470fb..6d32638a 100755 --- a/testcases/kernel/containers/netns/nw_under_ns.sh +++ b/testcases/kernel/containers/netns/nw_under_ns.sh @@ -29,8 +29,7 @@ echo "*****************************************************" echo "Running network testcases under containers..." -create_container; -if [ $? -ne 0 ]; then - echo "some of the network testcases under netns failled" +if ! create_container; then + echo "some of the network testcases under netns failed" exit 1; fi diff --git a/testcases/kernel/containers/netns/par_chld_ftp.c b/testcases/kernel/containers/netns/par_chld_ftp.c index 17371105..ac36a43d 100644 --- a/testcases/kernel/containers/netns/par_chld_ftp.c +++ b/testcases/kernel/containers/netns/par_chld_ftp.c @@ -26,7 +26,7 @@ * 31/07/2008 * =============================================================================*/ -#include "../libclone/libclone.h" +#include "libclone.h" int main() { diff --git a/testcases/kernel/containers/netns/par_chld_ipv6.c b/testcases/kernel/containers/netns/par_chld_ipv6.c index 9f309328..b869352e 100644 --- a/testcases/kernel/containers/netns/par_chld_ipv6.c +++ b/testcases/kernel/containers/netns/par_chld_ipv6.c @@ -29,7 +29,7 @@ #include #include #include -#include "../libclone/libclone.h" +#include "libclone.h" #include #include #include @@ -41,21 +41,10 @@ #include #include #include +#include "config.h" char *TCID = "netns_ipv6"; -int TST_TOTAL=1; - -extern pid_t getpgid(pid_t pid); -extern pid_t getsid(pid_t pid); - -int crtchild(char *s1) -{ - char *cmd[] = { "/bin/bash", s1, (char *)0 }; - execve("/bin/bash", cmd, __environ); - tst_resm(TFAIL, "The code would not reach here on success\n"); - perror("execve"); - return 1; -} +int TST_TOTAL = 1; int main() { @@ -81,7 +70,7 @@ int main() par = malloc (FILENAME_MAX); child = malloc (FILENAME_MAX); - if (par == NULL || child == NULL ) { + if (par == NULL || child == NULL) { tst_resm(TFAIL, "error while allocating mem"); exit(1); } @@ -93,12 +82,16 @@ ltproot); if ((pid = fork()) == 0) { // Child. +#if HAVE_UNSHARE ret = unshare(flags); if (ret < 0) { perror("unshare"); tst_resm(TFAIL, "Error:Unshare syscall failed for network namespace\n"); return 1; } +#else + tst_resm(TCONF, "System doesn't have unshare support"); +#endif return crtchild(child); } else{ diff --git a/testcases/kernel/containers/netns/sysfsview.c b/testcases/kernel/containers/netns/sysfsview.c index 894ddec1..a7863732 100644 --- a/testcases/kernel/containers/netns/sysfsview.c +++ b/testcases/kernel/containers/netns/sysfsview.c @@ -36,7 +36,7 @@ #include #include #include -#include "../libclone/libclone.h" +#include "libclone.h" int main() { diff --git a/testcases/kernel/containers/netns/two_children_ns.c b/testcases/kernel/containers/netns/two_children_ns.c index 63990bfd..48c65f4c 100644 --- a/testcases/kernel/containers/netns/two_children_ns.c +++ b/testcases/kernel/containers/netns/two_children_ns.c @@ -42,21 +42,11 @@ #include #include #include -#include "../libclone/libclone.h" +#include "libclone.h" +#include "config.h" char *TCID = "netns_2children"; -int TST_TOTAL=1; - -/* Creating Network Namespace */ -int crtchild(char *s) -{ - char *cmd[] = { "/bin/bash", s, (char *)0 }; - - execve("/bin/bash", cmd, __environ); - tst_resm(TINFO, "The code never reaches here on success\n"); - perror("execve"); - return 1; -} +int TST_TOTAL = 1; int main() { @@ -68,9 +58,14 @@ int main() flags |= CLONE_NEWNS; flags |= CLONE_NEWNET; +#if ! HAVE_UNSHARE + tst_resm(TCONF, "System doesn't support unshare."); + tst_exit(); +#endif + /* Checking for Kernel Version */ - if (tst_kvercmp(2,6,19) < 0) - return 1; + if (tst_kvercmp(2,6,19) < 0) + return 1; ltproot = getenv("LTPROOT"); if (! ltproot) { @@ -99,15 +94,17 @@ int main() for(i=0;i<2;i++) { if ((pid[i] = fork()) == 0) { - // Child1 and Child2 based on the iteration. + /* Child1 and Child2 based on the iteration. */ - ret = unshare(flags); - if (ret < 0) { - perror("Unshare"); - tst_resm(TFAIL, "Error:Unshare syscall failed for network namespace\n"); - return ret; - } - return crtchild(child[i]); +#if HAVE_UNSHARE + ret = unshare(flags); + if (ret < 0) { + perror("Unshare"); + tst_resm(TFAIL, "Error:Unshare syscall failed for network namespace\n"); + return ret; + } +#endif + return crtchild(child[i]); } else{ //Parent diff --git a/testcases/kernel/containers/pidns/Makefile b/testcases/kernel/containers/pidns/Makefile index 14f49da2..9c46fae0 100644 --- a/testcases/kernel/containers/pidns/Makefile +++ b/testcases/kernel/containers/pidns/Makefile @@ -18,24 +18,11 @@ ## ## ################################################################################ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -I../libclone -LDLIBS += -L../../../../lib -L../libclone ../libclone/libclone.a -lltp -lrt -lpthread +top_srcdir ?= ../../../.. -SRCS := $(wildcard *.c) -TARGETS := $(SRCS:%.c=%) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc -HAS_UNSHARE ?= $(shell ../check_for_unshare && echo y) -ifneq ($(HAS_UNSHARE),y) -TARGETS := -endif +LDLIBS += -lclone -lpthread -lrt -all: $(TARGETS) - -clean: - rm -f $(TARGETS) *.o - -install: -ifeq ($(HAS_UNSHARE),y) - @set -e; for i in $(TARGETS) runpidnstest.sh check_pidns_enabled; do ln -f $$i ../../../bin/$$i ; chmod +x runpidnstest.sh ; done -endif +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/containers/pidns/check_pidns_enabled.c b/testcases/kernel/containers/pidns/check_pidns_enabled.c deleted file mode 100644 index 209dbb3e..00000000 --- a/testcases/kernel/containers/pidns/check_pidns_enabled.c +++ /dev/null @@ -1,69 +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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*************************************************************************** - -* File: check_pidns_enabled.c -* -* Description: -* This testcase builds into the ltp framework to verify that kernel is -* PID NS enabled or not. -* -* Verify that: -* 1. Verify that the kernel version is 2.6.24. -* 2. Verify that clone() function return value. -* -* Test Name: check_pidns_enabled -* -* Test Assertion & Strategy: -* Check that the kernel version is 2.6.24 and clone returns no failure after passing -* the clone falg as CLONE_NEWPID. -* -* History: -* -* FLAG DATE NAME DESCRIPTION -* 27/12/07 RISHIKESH K RAJAK Created this test -* -*******************************************************************************************/ -#include -#include -#include "../libclone/libclone.h" -#include "test.h" - -int dummy(void *v) -{ - /* Simply return from the child */ - return 0; -} - -/* MAIN */ -int main() -{ - int pid; - - /* Test for the running kernel version - * provided by LTP library API - */ - if (tst_kvercmp(2,6,24) < 0) - return 1; - - pid = do_clone(CLONE_NEWPID, dummy, NULL); - - /* Check for the clone function return value */ - if (pid == -1) - return 3; - return 0; -} - diff --git a/testcases/kernel/containers/sysvipc/Makefile b/testcases/kernel/containers/sysvipc/Makefile index 94e6aeae..709642b6 100644 --- a/testcases/kernel/containers/sysvipc/Makefile +++ b/testcases/kernel/containers/sysvipc/Makefile @@ -18,23 +18,11 @@ ## ## ################################################################################ -CFLAGS += -I../../../../include -I../libclone -Wall -LDLIBS += -L../../../../lib -L../libclone ../libclone/libclone.a -lltp +top_srcdir ?= ../../../.. -SRCS := $(wildcard *.c) -TARGETS := $(SRCS:%.c=%) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc -HAS_UNSHARE ?= $(shell ../check_for_unshare && echo y) -ifneq ($(HAS_UNSHARE),y) -TARGETS := -endif +LDLIBS += -lclone -all: $(TARGETS) - -clean: - rm -f $(TARGETS) *.o - -install: -ifeq ($(HAS_UNSHARE),y) - @set -e; for i in $(TARGETS) runipcnstest.sh check_ipcns_enabled ; do ln -f $$i ../../../bin/$$i ; chmod +x runipcnstest.sh ; done -endif +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/containers/utsname/Makefile b/testcases/kernel/containers/utsname/Makefile index b65d15ab..9c46fae0 100755 --- a/testcases/kernel/containers/utsname/Makefile +++ b/testcases/kernel/containers/utsname/Makefile @@ -18,24 +18,11 @@ ## ## ################################################################################ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -I../libclone -LDLIBS += -L../../../../lib -L../libclone ../libclone/libclone.a -lltp +top_srcdir ?= ../../../.. -SRCS := $(wildcard *.c) -TARGETS := $(SRCS:%.c=%) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc -HAS_UNSHARE ?= $(shell ../check_for_unshare && echo y) -ifneq ($(HAS_UNSHARE),y) -TARGETS := -endif +LDLIBS += -lclone -lpthread -lrt -all: $(TARGETS) - -clean: - rm -f $(TARGETS) *.o - -install: -ifeq ($(HAS_UNSHARE),y) - @set -e; for i in $(TARGETS) runutstest.sh check_utsns_enabled; do ln -f $$i ../../../bin/$$i ; chmod +x runutstest.sh ; done -endif +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/Makefile b/testcases/kernel/controllers/Makefile dissimilarity index 99% index 12b246e3..0b2f1f4d 100644 --- a/testcases/kernel/controllers/Makefile +++ b/testcases/kernel/controllers/Makefile @@ -1,90 +1,47 @@ -ifdef CROSS_COMPILE -CHECK_CGROUP := $(shell test -f $(TARGET_DIR)/usr/include/linux/cgroupstats.h && echo 'cgroup') -else -CHECK_CGROUP := $(shell test -f /proc/cgroups && echo 'cgroup') -CHECK_CPUCTL := $(shell grep -w cpu /proc/cgroups 2>/dev/null|cut -f1) -CHECK_MEMCTL := $(shell grep -w memory /proc/cgroups 2>/dev/null|cut -f1) -CHECK_BLOCKIOCTL := $(shell grep -w blockio /proc/cgroups 2>/dev/null|cut -f1) -CHECK_FREEZER := $(shell grep -w freezer /proc/cgroups 2>/dev/null| cut -f1) -CHECK_CPUSETCTL = $(shell grep -w cpuset /proc/cgroups 2>/dev/null|cut -f1) -CHECK_CPUACCTCTL := $(shell grep -w cpuacct /proc/cgroups 2>/dev/null|cut -f1) -endif - -ifdef CROSS_COMPILE -ifeq ($(CHECK_CGROUP),cgroup) -SUBDIRS += cgroup -SUBDIRS += cgroup_fj -SUBDIRS += cpuctl -SUBDIRS += cpuctl_fj -SUBDIRS += memctl -SUBDIRS += io-throttle -SUBDIRS += freezer -SUBDIRS += cpuset -SUBDIRS += cpuacct -else -$(info "Kernel is not compiled with control cgroup support") -endif -else -ifeq ($(CHECK_CGROUP),cgroup) -SUBDIRS += cgroup -SUBDIRS += cgroup_fj -else -$(info "Kernel is not compiled with control cgroup support") -endif - -ifeq ($(CHECK_MEMCTL),memory) -SUBDIRS += memcg -else -$(info "Kernel is not compiled with memory resource controller support") -endif - -ifeq ($(CHECK_CPUCTL),cpu) -SUBDIRS += cpuctl -SUBDIRS += cpuctl_fj -else -$(info "Kernel is not compiled with cpu controller support") -endif -ifeq ($(CHECK_MEMCTL),memory) -SUBDIRS += memctl -else -$(info "Kernel is not compiled with memory resource controller support") -endif -ifeq ($(CHECK_BLOCKIOCTL),blockio) -SUBDIRS += io-throttle -else -$(info "Kernel is not compiled with blockio resource controller support") -endif -ifeq ($(CHECK_FREEZER),freezer) -SUBDIRS += freezer -else -$(info "Kernel is not compiled with cgroup freezer support") -endif -ifeq ($(CHECK_CPUSETCTL),cpuset) -SUBDIRS += cpuset -else -$(info "Kernel is not compiled with cpuset resource controller support") -endif -ifeq ($(CHECK_CPUACCTCTL),cpuacct) -SUBDIRS += cpuacct -else -$(info "Kernel is not compiled with cpuacct resource controller support") -endif -endif - -# If at least one of the controllers is available then build libcontrollers. -ifneq ($(SUBDIRS),) -SUBDIRS := libcontrollers $(SUBDIRS) -endif - -.PHONY: all install clean - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done - -install: test_controllers.sh - @chmod ugo+x test_controllers.sh - @ln -f test_controllers.sh ../../bin/test_controllers.sh - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done +# +# kernel/controllers test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh +LIB := $(DESTDIR)/$(libdir)/libcontrollers.a +LIBDIR := libcontrollers +FILTER_OUT_DIRS := $(LIBDIR) + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + for i in all install; do \ + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" $$i; \ + done + +trunk-all: $(LIB) + +trunk-clean:: | lib-clean + +lib-clean:: $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc new file mode 100644 index 00000000..803059f7 --- /dev/null +++ b/testcases/kernel/controllers/Makefile.inc @@ -0,0 +1,46 @@ +# +# kernel/controllers test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +# DO NOT USE THIS FILE FOR controllers / libcontrollers!!! + +LIB := $(DESTDIR)/$(libdir)/libcontrollers.a +LIBDIR := libcontrollers + +../$(LIBDIR): + mkdir -p "$@" + +$(LIB): ../$(LIBDIR) + for i in all install; do \ + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" $$i; \ + done + +all: | $(LIB) + +CPPFLAGS += -I$(abs_srcdir)/../$(LIBDIR) + +LDFLAGS += -L$(abs_builddir)/../$(LIBDIR) + +LDLIBS += -lcontrollers + +INSTALL_TARGETS ?= *.sh + +# vim: syntax=make diff --git a/testcases/kernel/controllers/cgroup/Makefile b/testcases/kernel/controllers/cgroup/Makefile dissimilarity index 98% index 62d1ace6..96da7a22 100644 --- a/testcases/kernel/controllers/cgroup/Makefile +++ b/testcases/kernel/controllers/cgroup/Makefile @@ -1,16 +1,30 @@ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -I../libcontrollers -LDLIBS += -L../../../../lib/ -lltp - -SRCS = $(wildcard *.c) - -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -clean: - rm -f $(TARGETS) *.o - -install: - @set -e; for i in $(TARGETS) *.sh; do ln -f $$i ../../../bin/$$i ; chmod +x $$i ; done - +# +# kernel/controllers/cgroup test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +INSTALL_TARGETS := *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cgroup/getdelays.c b/testcases/kernel/controllers/cgroup/getdelays.c index 9bdd879b..29e9b71d 100644 --- a/testcases/kernel/controllers/cgroup/getdelays.c +++ b/testcases/kernel/controllers/cgroup/getdelays.c @@ -22,16 +22,21 @@ #include #include #include - +#include #include "config.h" +#ifdef HAVE_LINUX_GENETLINK_H #include +#endif +#ifdef HAVE_LINUX_TASKSTATS_H #include - +#endif #ifdef HAVE_LINUX_CGROUPSTATS_H #include #endif +#if defined(HAVE_LINUX_GENETLINK_H) && defined(HAVE_LINUX_TASKSTATS_H) + /* * Generic macros for dealing with netlink sockets. Might be duplicated * elsewhere. It is recommended that commercial grade applications use @@ -68,12 +73,6 @@ __u64 stime, utime; /* Maximum number of cpus expected to be specified in a cpumask */ #define MAX_CPUS 32 -struct msgtemplate { - struct nlmsghdr n; - struct genlmsghdr g; - char buf[MAX_MSG_SIZE]; -}; - char cpumask[100+6*MAX_CPUS]; static void usage(void) @@ -87,6 +86,12 @@ static void usage(void) fprintf(stderr, " -C: container path\n"); } +struct msgtemplate { + struct nlmsghdr n; + struct genlmsghdr g; + char buf[MAX_MSG_SIZE]; +}; + /* * Create a raw netlink socket and bind */ @@ -120,7 +125,6 @@ error: return -1; } - int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, __u8 genl_cmd, __u16 nla_type, void *nla_data, int nla_len) @@ -160,7 +164,6 @@ int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, return 0; } - /* * Probe the controller in genetlink to find the family id * for the TASKSTATS family @@ -198,46 +201,45 @@ int get_family_id(int sd) void print_delayacct(struct taskstats *t) { printf("\n\nCPU %15s%15s%15s%15s\n" - " %15llu%15llu%15llu%15llu\n" - "IO %15s%15s\n" - " %15llu%15llu\n" - "SWAP %15s%15s\n" - " %15llu%15llu\n" - "RECLAIM %12s%15s\n" + " %15llu%15llu%15llu%15llu\n" + "IO %15s%15s\n" + " %15llu%15llu\n" + "SWAP %15s%15s\n" + " %15llu%15llu\n" + "RECLAIM %12s%15s\n" #ifdef HAVE_STRUCT_TASKSTATS_FREEPAGES_COUNT - " %15llu%15llu\n" + " %15llu%15llu\n" #endif - , "count", "real total", "virtual total", "delay total", - (unsigned long long)t->cpu_count, - (unsigned long long)t->cpu_run_real_total, - (unsigned long long)t->cpu_run_virtual_total, - (unsigned long long)t->cpu_delay_total, - "count", "delay total", - (unsigned long long)t->blkio_count, - (unsigned long long)t->blkio_delay_total, - "count", "delay total", - (unsigned long long)t->swapin_count, - (unsigned long long)t->swapin_delay_total, - "count", "delay total" + , "count", "real total", "virtual total", "delay total", + (unsigned long long)t->cpu_count, + (unsigned long long)t->cpu_run_real_total, + (unsigned long long)t->cpu_run_virtual_total, + (unsigned long long)t->cpu_delay_total, + "count", "delay total", + (unsigned long long)t->blkio_count, + (unsigned long long)t->blkio_delay_total, + "count", "delay total", + (unsigned long long)t->swapin_count, + (unsigned long long)t->swapin_delay_total, + "count", "delay total" #ifdef HAVE_STRUCT_TASKSTATS_FREEPAGES_COUNT - , (unsigned long long)t->freepages_count, - (unsigned long long)t->freepages_delay_total + , (unsigned long long)t->freepages_count, + (unsigned long long)t->freepages_delay_total #endif - ); + ); } void task_context_switch_counts(struct taskstats *t) { #ifdef HAVE_STRUCT_TASKSTATS_NVCSW printf("\n\nTask %15s%15s\n" - " %15llu%15llu\n", - "voluntary", "nonvoluntary", - (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw); + " %15llu%15llu\n", + "voluntary", "nonvoluntary", + (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw); #endif } #ifdef HAVE_LINUX_CGROUPSTATS_H - void print_cgroupstats(struct cgroupstats *c) { printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, " @@ -247,7 +249,6 @@ void print_cgroupstats(struct cgroupstats *c) (unsigned long long)c->nr_stopped, (unsigned long long)c->nr_uninterruptible); } - #endif void print_ioacct(struct taskstats *t) @@ -397,22 +398,22 @@ int main(int argc, char *argv[]) } if (containerset) { -#ifdef HAVE_LINUX_CGROUPSTATS_H cfd = open(containerpath, O_RDONLY); if (cfd < 0) { perror("error opening container file"); exit(1); } +#ifdef HAVE_LINUX_CGROUPSTATS_H rc = send_cmd(nl_sd, id, mypid, CGROUPSTATS_CMD_GET, CGROUPSTATS_CMD_ATTR_FD, &cfd, sizeof(__u32)); +#else + errno = ENOSYS; + rc = -1; +#endif if (rc < 0) { perror("error sending cgroupstats command"); exit(1); } -#else - printf("Header linux/cgroupstat.h was missing during compilation," - "you may have old or incomplete kernel-headers.\n"); -#endif } if (!maskset && !tid && !containerset) { usage(); @@ -439,7 +440,7 @@ int main(int argc, char *argv[]) } PRINTF("nlmsghdr size=%zu, nlmsg_len=%d, rep_len=%d\n", - sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len); + sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len); rep_len = GENLMSG_PAYLOAD(&msg.n); @@ -496,7 +497,7 @@ int main(int argc, char *argv[]) na = (struct nlattr *) ((char *) na + len2); } break; -#ifdef HAVE_LINUX_CGROUPSTATS_H +#if HAVE_LINUX_CGROUPSTATS_H case CGROUPSTATS_TYPE_CGROUP_STATS: print_cgroupstats(NLA_DATA(na)); break; @@ -526,4 +527,9 @@ done: close(cfd); return 0; } - +#else +int main (void) { + printf("System doesn't have needed netlink / taskstats support.\n"); + return 1; +} +#endif diff --git a/testcases/kernel/controllers/cgroup_fj/Makefile b/testcases/kernel/controllers/cgroup_fj/Makefile dissimilarity index 98% index 620b09fe..a9c6f94b 100644 --- a/testcases/kernel/controllers/cgroup_fj/Makefile +++ b/testcases/kernel/controllers/cgroup_fj/Makefile @@ -1,19 +1,32 @@ -CFLAGS += -Wall -O2 -Wextra - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - -test: - @./run_cgroup_test_fj.sh - -clean: - rm -f $(TARGETS) *.o - -install: - @set -e; for i in $(TARGETS) *.sh; do ln -f $$i ../../../bin/$$i ; chmod +x $$i ; done - ln -f cgroup_fj_release_agent ../../../bin/cgroup_fj_release_agent - ln -f cgroup_fj_testcases ../../../bin/cgroup_fj_testcases +# +# kernel/controllers/cgroup_fj test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +CPPFLAGS += -Wall -O2 -Wextra + +INSTALL_TARGETS := *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_utility.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_utility.sh index 4ba15d62..ed161fa2 100755 --- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_utility.sh +++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_utility.sh @@ -547,7 +547,7 @@ reclaim_foundling() if [ -e /proc/$cur_pid/ ];then echo "ERROR: pid $cur_pid reclaimed" do_echo 0 1 "$cur_pid" "/dev/cgroup/tasks" - let "foundlings = $foundlings + 1" + : $((foundlings += 1)) fi done diff --git a/testcases/kernel/controllers/cgroup_fj/run_cgroup_test_fj.sh b/testcases/kernel/controllers/cgroup_fj/run_cgroup_test_fj.sh index 70e4078b..eb2d1dba 100755 --- a/testcases/kernel/controllers/cgroup_fj/run_cgroup_test_fj.sh +++ b/testcases/kernel/controllers/cgroup_fj/run_cgroup_test_fj.sh @@ -33,7 +33,7 @@ export TMPFILE=$TESTROOT/tmp_tasks export CASENO1=0 export CASENO2=0 -if [ "$UID" -ne 0 ]; then +if [ "$(id -ru)" -ne 0 ]; then echo "***error***:you must use root to test" exit -1 fi @@ -107,17 +107,17 @@ do if [ $? -ne 0 ]; then case $CASETYPE in "function" ) - let "CASENO1 = $CASENO1 + 1" + : $(( CASENO1 += 1 )) export CASENO1=$CASENO1 $TESTROOT/cgroup_fj_function.sh $CASECMD ;; "function2" ) - let "CASENO1 = $CASENO1 + 1" + : $(( CASENO1 += 1 )) export CASENO1=$CASENO1 $TESTROOT/cgroup_fj_function2.sh $CASECMD ;; "stress" ) - let "CASENO2 = $CASENO2 + 1" + : $(( CASENO2 += 1 )) export CASENO2=$CASENO2 $TESTROOT/cgroup_fj_stress.sh $CASECMD ;; diff --git a/testcases/kernel/controllers/cpuacct/Makefile b/testcases/kernel/controllers/cpuacct/Makefile dissimilarity index 98% index 70b8e496..8b63496f 100644 --- a/testcases/kernel/controllers/cpuacct/Makefile +++ b/testcases/kernel/controllers/cpuacct/Makefile @@ -1,16 +1,32 @@ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -I../libcontrollers -LDLIBS += -lm -L../../../../lib/ -L../libcontrollers -lcontrollers -lltp - -SRCS = $(wildcard *.c) - -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -clean: - rm -f $(TARGETS) *.o - -install: - @set -e; for i in $(TARGETS) run_cpuacct_test.sh cpuacct_setup.sh cpuacct_task01 ; do ln -f $$i ../../../bin/$$i ; chmod +x $$i ; done - +# +# kernel/controllers/cpuacct test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +CPPFLAGS += -Wall + +INSTALL_TARGETS := *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuctl/Makefile b/testcases/kernel/controllers/cpuctl/Makefile dissimilarity index 98% index 03b8fee9..ab1e8ea2 100644 --- a/testcases/kernel/controllers/cpuctl/Makefile +++ b/testcases/kernel/controllers/cpuctl/Makefile @@ -1,18 +1,32 @@ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -I../libcontrollers -LDLIBS += -lm -L../../../../lib/ -L../libcontrollers -lcontrollers -lltp - -SRCS = $(wildcard *.c) - -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -clean: - rm -f $(TARGETS) *.o - -install: - @set -e; for i in $(TARGETS) run_cpuctl_test.sh \ - run_cpuctl_stress_test.sh parameters.sh run_cpuctl_latency_test.sh; \ - do ln -f $$i ../../../bin/$$i ; chmod +x $$i ; done - +# +# kernel/controllers/cpuctl test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +INSTALL_TARGETS := run_cpuctl_test.sh run_cpuctl_stress_test.sh parameters.sh run_cpuctl_latency_test.sh + +LDLIBS += -lm -lcontrollers + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuctl_fj/Makefile b/testcases/kernel/controllers/cpuctl_fj/Makefile dissimilarity index 98% index 7e686884..41cbeb40 100644 --- a/testcases/kernel/controllers/cpuctl_fj/Makefile +++ b/testcases/kernel/controllers/cpuctl_fj/Makefile @@ -1,21 +1,34 @@ -CFLAGS += -Wall -O2 -Wextra -LOADLIBES+= -lm -CPPFLAGS += -I../../../../include -I../libcontrollers -LDLIBS += -L../../../../lib/ -lltp - -SRCS=$(wildcard *.c) -OBJECTS=$(patsubst %.c,%.o,$(SRCS)) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -$(TARGETS): %: %.o - -test: - @./runtest.sh - -clean: - rm -f $(TARGETS) $(OBJECTS) - -install: - @set -e; for i in $(TARGETS) *.sh; do ln -f $$i ../../../bin/$$i ; chmod +x $$i ; done +# +# kernel/controllers/cpuctl_fj test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +CPPFLAGS += -Wall -O2 -Wextra + +INSTALL_TARGETS := *.sh + +LDLIBS += -lm + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh b/testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh index 6ab0f65f..f02f59af 100755 --- a/testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh +++ b/testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh @@ -58,8 +58,8 @@ setup() # Write the cleanup function cleanup() { - mount | grep "$CPUCTL" &> /dev/null || { - rm -rf "$CPUCTL" &> /dev/null + mount | grep "$CPUCTL" > /dev/null 2>&1 || { + rm -rf "$CPUCTL" > /dev/null 2>&1 return 0 } @@ -73,22 +73,19 @@ cleanup() done umount $CPUCTL || return 1 - rmdir $CPUCTL &> /dev/null + rmdir $CPUCTL > /dev/null 2>&1 } creat_process() { cat /dev/zero > /dev/null 2>/dev/null & - taskset -p 1 $! &>/dev/null + taskset -p 1 $! >/dev/null 2>&1 echo $! } get_cpu_usage() { - top=($(top -b -n 1 -p $1 | tail -2 | head -1)) - top=${top[8]} - top=`echo $top | awk -F "." '{print $1}'` - echo "$top" + top -b -n 1 -p $1 | tail -2 | head -1 | awk 'print $9' | awk -F "." '{print $1}' } kill_all_pid() @@ -424,7 +421,7 @@ case12 () wait $pid } -max_shares=$((2**18)) +max_shares=$((1 << 18)) # echo MAX_SHARES into shares case13 () @@ -589,7 +586,7 @@ case19() echo "pid $pid cpu_usage $cpu_usage" kill -9 $pid $pid_other - expr 96 \< "$cpu_usage" \& "$cpu_usage" \< 103 &> /dev/null || return 1 + expr 96 \< "$cpu_usage" \& "$cpu_usage" \< 103 > /dev/null 2>&1 || return 1 return 0 } @@ -605,7 +602,7 @@ case20() echo "pid $pid cpu_usage $cpu_usage" kill -9 $pid $pid_other - expr 96 \< "$cpu_usage" \& "$cpu_usage" \< 103 &> /dev/null || return 1 + expr 96 \< "$cpu_usage" \& "$cpu_usage" \< 103 > /dev/null 2>&1 || return 1 return 0 } @@ -615,7 +612,7 @@ case21() pid=$(creat_process) echo $pid > "$CPUCTL/1/tasks" - while ((1)) + while true do creat_process > "$CPUCTL/1/2/tasks" sleep 1 @@ -625,18 +622,20 @@ case21() sleep 10 ret=0 - for ((top_times=0; top_times<10 && ret==0; top_times++)) + top_times=0 + while [ "$top_times" -lt 10 -a "$ret" = 0 ] do cpu_usage=$(get_cpu_usage $pid) echo "pid $pid cpu_usage $cpu_usage" - expr 44 \< "$cpu_usage" \& "$cpu_usage" \< 56 &> /dev/null + expr 44 \< "$cpu_usage" \& "$cpu_usage" \< 56 > /dev/null 2>&1 ret=$? + : $(( top_times+=1 )) done - kill -9 $pid $loop_pid &> /dev/null - wait $pid $loop_pid &>/dev/null + kill -9 $pid $loop_pid > /dev/null 2>&1 + wait $pid $loop_pid >/dev/null 2>&1 sleep 2 - kill_all_pid < "$CPUCTL/1/2/tasks" &>/dev/null + kill_all_pid < "$CPUCTL/1/2/tasks" >/dev/null 2>&1 sleep 2 return $ret } @@ -645,7 +644,7 @@ case22() { mkdir "$CPUCTL/1" "$CPUCTL/1/2" pid=$(creat_process) - while ((1)) + while true do echo $pid > "$CPUCTL/1/tasks" echo $pid > "$CPUCTL/1/2/tasks" @@ -656,26 +655,28 @@ case22() sleep 10 ret=0 - for ((top_times=0; top_times<10 && ret==0; top_times++)) + top_times=0 + while [ "$top_times" -lt 10 -a "$ret" = 0 ] do cpu_usage=$(get_cpu_usage $pid) echo "pid $pid cpu_usage $cpu_usage" - expr 94 \< "$cpu_usage" \& "$cpu_usage" \< 106 &> /dev/null + expr 94 \< "$cpu_usage" \& "$cpu_usage" \< 106 > /dev/null 2>&1 ret=$? + : $(( top_times+=1 )) done - kill -9 $pid $loop_pid &> /dev/null - wait $pid $loop_pid &>/dev/null + kill -s KILL $pid $loop_pid > /dev/null 2>&1 + wait $pid $loop_pid >/dev/null 2>&1 return $ret } -rm -rf "$CPUCTL_TMP" &>/dev/null || exit 1 +rm -rf "$CPUCTL_TMP" >/dev/null 2>&1 || exit 1 mkdir -p "$CPUCTL_TMP" || exit 1 # test do_test () { - for (( i=1; i<=$TST_TOTAL; i++ )) + for i in $(seq 1 $TST_TOTAL) do setup || { tst_resm TFAIL "case$i FAIL" @@ -698,5 +699,5 @@ do_test () do_test -rm -rf "$CPUCTL_TMP" &>/dev/null +rm -rf "$CPUCTL_TMP" >/dev/null 2>&1 diff --git a/testcases/kernel/controllers/cpuset/Makefile b/testcases/kernel/controllers/cpuset/Makefile dissimilarity index 99% index 6621667d..a8ca9b5c 100644 --- a/testcases/kernel/controllers/cpuset/Makefile +++ b/testcases/kernel/controllers/cpuset/Makefile @@ -1,17 +1,45 @@ -SUBDIRS = cpuset_base_ops_test cpuset_lib cpuset_inherit_test -SUBDIRS += cpuset_exclusive_test cpuset_hierarchy_test cpuset_syscall_test -SUBDIRS += cpuset_hotplug_test cpuset_load_balance_test -SUBDIRS += cpuset_memory_pressure_test cpuset_memory_spread_test -SUBDIRS += cpuset_memory_test -all: - @set -e; \ - for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ;done; - -install: - @set -e; \ - for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done; - ln -f run_cpuset_test.sh ../../../bin/run_cpuset_test.sh; - chmod +x run_cpuset_test.sh; - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# kernel/controllers/cpuset testcase suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh +LIBDIR := cpuset_lib +FILTER_OUT_DIRS := $(LIBDIR) +LIB := $(LIBDIR)/libcpu_set.a + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all + +trunk-all: $(LIB) + +trunk-clean:: | lib-clean + +lib-clean:: $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc new file mode 100644 index 00000000..4b41abeb --- /dev/null +++ b/testcases/kernel/controllers/cpuset/Makefile.inc @@ -0,0 +1,41 @@ +# +# kernel/controllers/cpuset 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. +# +# Garrett Cooper, July 2009 +# + +LIBDIR := ../cpuset_lib + +LIB := $(LIBDIR)/libcpu_set.a + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all + +all: | $(LIB) + +LDFLAGS += -L$(abs_builddir)/$(LIBDIR) + +LDLIBS += -lcpu_set + +INSTALL_TARGETS ?= *.sh + +# vim: syntax=make diff --git a/testcases/kernel/controllers/cpuset/cpuset_base_ops_test/Makefile b/testcases/kernel/controllers/cpuset/cpuset_base_ops_test/Makefile dissimilarity index 97% index 70d1bc26..9ff9f8db 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_base_ops_test/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_base_ops_test/Makefile @@ -1,12 +1,30 @@ -SRCS = $(wildcard *.sh) - -all: - @true - -clean: - @true - -install: - @set -e; \ - for i in $(SRCS); do ln -f $$i ../../../../bin/$$i; chmod +x $$i; done - +# +# kernel/controllers/cpuset/cpuset_base_ops_test testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_exclusive_test/Makefile b/testcases/kernel/controllers/cpuset/cpuset_exclusive_test/Makefile dissimilarity index 97% index 70d1bc26..c430a152 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_exclusive_test/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_exclusive_test/Makefile @@ -1,12 +1,30 @@ -SRCS = $(wildcard *.sh) - -all: - @true - -clean: - @true - -install: - @set -e; \ - for i in $(SRCS); do ln -f $$i ../../../../bin/$$i; chmod +x $$i; done - +# +# kernel/controllers/cpuset/cpuset_exclusive_test testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh new file mode 100755 index 00000000..aca0aaf4 --- /dev/null +++ b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh @@ -0,0 +1,265 @@ +#!/bin/sh +# usage: . cpuset_funcs.sh +# functions for cpuset test + +################################################################################ +## ## +## Copyright (c) 2009 FUJITSU LIMITED ## +## ## +## This program is free software; you can redistribute it and#or modify ## +## it under the terms of the GNU General Public License as published by ## +## the Free Software Foundation; either version 2 of the License, or ## +## (at your option) any later version. ## +## ## +## This program is distributed in the hope that it will be useful, but ## +## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## +## for more details. ## +## ## +## You should have received a copy of the GNU General Public License ## +## along with this program; if not, write to the Free Software ## +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## +## ## +## Author: Miao Xie ## +## ## +################################################################################ + +NR_CPUS="`cat /proc/cpuinfo | grep "processor" | wc -l`" +if [ -f "/sys/devices/system/node/has_high_memory" ]; then + N_NODES="`cat /sys/devices/system/node/has_high_memory`" +else + N_NODES="`cat /sys/devices/system/node/has_normal_memory`" +fi +N_NODES=${N_NODES#*-*} +: $((N_NODES++)) + +CPUSET="/dev/cpuset" +CPUSET_TMP="/tmp/cpuset_tmp" + +HOTPLUG_CPU="1" + +cpuset_log() +{ + tst_resm TINFO "$*" +} + +# cpuset_log_error +cpuset_log_error() +{ + local error_message= + + while read error_message + do + cpuset_log "$error_message" + done < "$1" +} + +version_check() +{ + tst_kvercmp 2 6 28 + if [ $? -eq 0 ]; then + tst_brkm TCONF ignored "kernel is below 2.6.28" + return 1 + fi +} + +ncpus_check() +{ + if [ $NR_CPUS -lt 4 ]; then + tst_brkm TCONF ignored "The total of CPUs is less than 4" + return 1 + fi +} + +nnodes_check() +{ + if [ $N_NODES -lt 3 ]; then + tst_brkm TCONF ignored "The total of nodes is less than 3" + return 1 + fi +} + +user_check() +{ + if [ "$USER" != root ]; then + tst_brkm TCONF ignored "Test must be run as root" + return 1 + fi +} + +cpuset_check() +{ + grep cpuset /proc/cgroups > /dev/null 2>&1 + if [ $? -ne 0 ]; then + tst_brkm TCONF ignored "Cpuset is not supported" + return 1 + fi +} + +check() +{ + user_check + if [ $? -ne 0 ]; then + return 1 + fi + + cpuset_check + if [ $? -ne 0 ]; then + return 1 + fi + + version_check + if [ $? -ne 0 ]; then + return 1 + fi + + ncpus_check + if [ $? -ne 0 ]; then + return 1 + fi + + nnodes_check + if [ $? -ne 0 ]; then + return 1 + fi + +} + +# Create /dev/cpuset & mount the cgroup file system with cpuset +# clean any group created eralier (if any) +setup() +{ + if [ -e "$CPUSET" ] + then + tst_resm TWARN "$CPUSET already exist.. overwriting" + cleanup || { + tst_brkm TFAIL ignored "Can't cleanup... Exiting" + return 1 + } + fi + + mkdir -p "$CPUSET_TMP" + mkdir "$CPUSET" + mount -t cpuset cpuset "$CPUSET" 2> /dev/null + if [ $? -ne 0 ]; then + tst_brkm TFAIL ignored "Could not mount cgroup filesystem with"\ + " cpuset on $CPUSET..Exiting test" + cleanup + return 1 + fi +} + +# Write the cleanup function +cleanup() +{ + mount | grep "$CPUSET" >/dev/null 2>&1 || { + rm -rf "$CPUSET" >/dev/null 2>&1 + return 0 + } + + find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while read subdir + do + while read pid + do + /bin/kill $pid > /dev/null 2>&1 + if [ $? -ne 0 ]; then + tst_brkm TFAIL ignored "Couldn't kill task - "\ + "$pid in the cpuset" + return 1 + fi + done < "$subdir/tasks" + rmdir "$subdir" + if [ $? -ne 0 ]; then + tst_brkm TFAIL ignored "Couldn't remove subdir - " + "$subdir in the cpuset" + return 1 + fi + done + + umount "$CPUSET" + if [ $? -ne 0 ]; then + tst_brkm TFAIL ignored "Couldn't umount cgroup filesystem with"\ + " cpuset on $CPUSET..Exiting test" + return 1 + fi + rmdir "$CPUSET" > /dev/null 2>&1 + rm -rf "$CPUSET_TMP" > /dev/null 2>&1 +} + +# set the cpuset's parameter +# cpuset_set +cpuset_set() +{ + local path="$1" + mkdir -p "$path" + if [ $? -ne 0 ]; then + return 1 + fi + + local cpus="$2" + local mems="$3" + local load_balance="$4" + + if [ "$path" != "$CPUSET" ]; then + if [ "$cpus" != "-" ]; then + /bin/echo $cpus > $path/cpus + if [ $? -ne 0 ]; then + return 1 + fi + fi + + /bin/echo $mems > $path/mems + if [ $? -ne 0 ]; then + return 1 + fi + fi + + /bin/echo $load_balance > $path/sched_load_balance + if [ $? -ne 0 ]; then + return 1 + fi +} + +# cpu_hotplug cpu_id offline/online +cpu_hotplug() +{ + if [ "$2" = "online" ]; then + /bin/echo 1 > "/sys/devices/system/cpu/cpu$1/online" + if [ $? -ne 0 ]; then + return 1 + fi + elif [ "$2" = "offline" ]; then + /bin/echo 0 > "/sys/devices/system/cpu/cpu$1/online" + if [ $? -ne 0 ]; then + return 1 + fi + fi +} + +# setup_test_environment +# online - online a CPU in testing, so we must offline a CPU first +# offline - offline a CPU in testing, we needn't do anything +setup_test_environment() +{ + if [ "$1" = "online" ]; then + cpu_hotplug $HOTPLUG_CPU offline + if [ $? -ne 0 ]; then + return 1 + fi + fi +} + +cpu_hotplug_cleanup() +{ + local cpus_array="$(seq -s' ' 1 $((NR_CPUS-1)))" + local cpuid= + for cpuid in $cpus_array + do + local file="/sys/devices/system/cpu/cpu$cpuid/online" + local offline="$(cat $file)" + if [ $offline -eq 0 ]; then + cpu_hotplug $cpuid "online" + fi + done +} + diff --git a/testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/Makefile b/testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/Makefile dissimilarity index 97% index 70d1bc26..10c29b27 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/Makefile @@ -1,12 +1,30 @@ -SRCS = $(wildcard *.sh) - -all: - @true - -clean: - @true - -install: - @set -e; \ - for i in $(SRCS); do ln -f $$i ../../../../bin/$$i; chmod +x $$i; done - +# +# kernel/controllers/cpuset/cpuset_hierarchy_test testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/Makefile b/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/Makefile dissimilarity index 99% index c4b6bba3..e5029a1d 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/Makefile @@ -1,22 +1,30 @@ -CFLAGS += -Wall -g -Wextra -LDLIBS := -lm - -LIBSRCS=$(wildcard ../cpuset_lib/*.c) -LIBOBJECTS=$(patsubst %.c,%.o,$(LIBSRCS)) - -SRCS=$(wildcard *.c) -OBJECTS=$(patsubst %.c,%.o,$(SRCS)) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -$(TARGETS): %: %.o $(LIBOBJECTS) - -clean: - rm -f $(TARGETS) $(OBJECTS) $(LIBOBJECTS) - -install: - @set -e; \ - for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i; chmod +x $$i; done - ln -f cpuset_hotplug_test.sh ../../../../bin/cpuset_hotplug_test.sh; - chmod +x cpuset_hotplug_test.sh; +# +# kernel/controllers/cpuset/cpuset_hotplug_test testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_inherit_test/Makefile b/testcases/kernel/controllers/cpuset/cpuset_inherit_test/Makefile dissimilarity index 97% index 70d1bc26..5848ee0f 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_inherit_test/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_inherit_test/Makefile @@ -1,12 +1,30 @@ -SRCS = $(wildcard *.sh) - -all: - @true - -clean: - @true - -install: - @set -e; \ - for i in $(SRCS); do ln -f $$i ../../../../bin/$$i; chmod +x $$i; done - +# +# kernel/controllers/cpuset/cpuset_inherit_test testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_lib/Makefile b/testcases/kernel/controllers/cpuset/cpuset_lib/Makefile dissimilarity index 98% index 43df1bc7..1cd2800b 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_lib/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_lib/Makefile @@ -1,16 +1,32 @@ -CFLAGS += -Wall -g -Wextra -CPPFLAGS += -I../../../../include -LDLIBS += -lm -L../../../../lib/ -lcontrollers -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%.o,$(SRCS)) - -all: $(TARGETS) - -clean: - rm -f $(TARGETS) - -install: - @set -e; \ - ln -f cpuset_funcs.sh ../../../../bin/cpuset_funcs.sh; - chmod +x cpuset_funcs.sh; +# +# kernel/controllers/cpuset/cpuset_lib library 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. +# +# Garrett Cooper, July 2009 +# Cyril Hrubis, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LDLIBS += -lm -lcontrollers + +LIB := libcpu_set.a + +include $(top_srcdir)/include/mk/lib.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c b/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c index 3ad44328..3b69cf46 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c +++ b/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c @@ -47,6 +47,8 @@ #include "bitmask.h" #include "cpuset.h" #include "common.h" +#include "test.h" +#include "linux_syscall_numbers.h" /* Bump version, and update Change History, when libcpuset API changes */ #define CPUSET_VERSION 3 diff --git a/testcases/kernel/controllers/cpuset/cpuset_load_balance_test/Makefile b/testcases/kernel/controllers/cpuset/cpuset_load_balance_test/Makefile dissimilarity index 99% index 923d0651..de886883 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_load_balance_test/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_load_balance_test/Makefile @@ -1,24 +1,30 @@ -CFLAGS += -Wall -g -Wextra -LDLIBS := -lm - -LIBSRCS=$(wildcard ../cpuset_lib/*.c) -LIBOBJECTS=$(patsubst %.c,%.o,$(LIBSRCS)) - -SRCS=$(wildcard *.c) -OBJECTS=$(patsubst %.c,%.o,$(SRCS)) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -$(TARGETS): %: %.o $(LIBOBJECTS) - -clean: - rm -f $(TARGETS) $(OBJECTS) $(LIBOBJECTS) - -install: - @set -e; \ - for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i; chmod +x $$i; done - ln -f cpuset_load_balance_test.sh ../../../../bin/cpuset_load_balance_test.sh; - ln -f cpuset_sched_domains_test.sh ../../../../bin/cpuset_sched_domains_test.sh; - chmod +x cpuset_load_balance_test.sh; - chmod +x cpuset_sched_domains_test.sh; +# +# kernel/controllers/cpuset/cpuset_load_balance_test testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lm + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/Makefile b/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/Makefile dissimilarity index 99% index db21c206..f7fd3f2a 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/Makefile @@ -1,16 +1,27 @@ -CFLAGS += -Wall -g -Wextra - -all: cpuset_memory_pressure - -cpuset_memory_pressure: cpuset_memory_pressure.o - cc cpuset_memory_pressure.o -o cpuset_memory_pressure - -clean: - rm -f cpuset_memory_pressure.o cpuset_memory_pressure - -install: - @set -e; - ln -f cpuset_memory_pressure ../../../../bin/cpuset_memory_pressure; - ln -f cpuset_memory_pressure_testset.sh ../../../../bin/cpuset_memory_pressure_testset.sh; - chmod +x cpuset_memory_pressure; - chmod +x cpuset_memory_pressure_testset.sh; +# +# kernel/controllers/cpuset/cpuset_memory_pressure_test testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/Makefile b/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/Makefile dissimilarity index 99% index 4ff812f7..9345f3ca 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/Makefile @@ -1,16 +1,27 @@ -CFLAGS += -Wall -g -Wextra - -all: cpuset_mem_hog - -cpuset_mem_hog: cpuset_mem_hog.o - cc cpuset_mem_hog.o -o cpuset_mem_hog - -clean: - rm -f cpuset_mem_hog.o cpuset_mem_hog - -install: - @set -e; - ln -f cpuset_mem_hog ../../../../bin/cpuset_mem_hog; - ln -f cpuset_memory_spread_testset.sh ../../../../bin/cpuset_memory_spread_testset.sh; - chmod +x cpuset_mem_hog; - chmod +x cpuset_memory_spread_testset.sh; +# +# kernel/controllers/cpuset/cpuset_memory_spread_test testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_memory_test/Makefile b/testcases/kernel/controllers/cpuset/cpuset_memory_test/Makefile dissimilarity index 99% index dbdbde2b..e5bb0828 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_memory_test/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_memory_test/Makefile @@ -1,20 +1,30 @@ -CFLAGS += -Wall -g -Wextra - -LIBSRCS=$(wildcard ../cpuset_lib/*.c) -LIBOBJECTS=$(patsubst %.c,%.o,$(LIBSRCS)) - -all: cpuset_memory_test - -cpuset_memory_test: cpuset_memory_test.o $(LIBOBJECTS) - cc cpuset_memory_test.o $(LIBOBJECTS) -o cpuset_memory_test -lpthread - -clean: - rm -f cpuset_memory_test cpuset_memory_test.o - rm -f $(LIBOBJECTS) - -install: - @set -e; - ln -f cpuset_memory_test ../../../../bin/cpuset_memory_test; - ln -f cpuset_memory_testset.sh ../../../../bin/cpuset_memory_testset.sh; - chmod +x cpuset_memory_test; - chmod +x cpuset_memory_testset.sh; +# +# kernel/controllers/cpuset/cpuset_memory_test testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/Makefile b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/Makefile dissimilarity index 99% index 1757f832..edc6265f 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/Makefile +++ b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/Makefile @@ -1,18 +1,27 @@ -SRCS = $(wildcard *.c) - -OBJECTS = $(SRCS:.c=.o) - -LIBSRCS=$(wildcard ../cpuset_lib/*.c) -LIBOBJECTS=$(patsubst %.c,%.o,$(LIBSRCS)) - -all: cpuset_syscall_test - -cpuset_syscall_test: %: %.o $(LIBOBJECTS) - -clean: - rm -rf cpuset_syscall_test $(OBJECTS) $(LIBOBJECTS) - -install: - @set -e; \ - for i in *.sh; do ln -f $$i ../../../../bin/$$i; chmod +x $$i; done - ln -f cpuset_syscall_test ../../../../bin/cpuset_syscall_test; +# +# kernel/controllers/cpuset/cpuset_syscall_test testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c index c5939cbc..2e068284 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c +++ b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c @@ -37,7 +37,10 @@ #include #include #include +#include "config.h" +#if HAVE_LINUX_MEMPOLICY_H #include +#endif #include "../cpuset_lib/cpuset.h" #include "../cpuset_lib/bitmask.h" diff --git a/testcases/kernel/controllers/freezer/Makefile b/testcases/kernel/controllers/freezer/Makefile dissimilarity index 98% index f215b0e4..b9ca22df 100644 --- a/testcases/kernel/controllers/freezer/Makefile +++ b/testcases/kernel/controllers/freezer/Makefile @@ -1,32 +1,29 @@ -# Copyright (c) International Business Machines Corp., 2008 -# Author: Matt Helsley -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -CFLAGS := -Wall -O3 -PROGS := timed_forkbomb # vfork fork_exec_loop - -.PHONY: all install clean - -all: $(PROGS) - chmod u+x *.sh - -install: - -$(PROGS): %: %.c - gcc $(CFLAGS) -o $@ $^ - -clean: - rm -f $(PROGS) +# +# kernel/controllers/freezer testcase suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := *.sh libcgroup_freezer + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/freezer/run.sh b/testcases/kernel/controllers/freezer/run.sh deleted file mode 100755 index a25c564f..00000000 --- a/testcases/kernel/controllers/freezer/run.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Copyright (c) International Business Machines Corp., 2008 -# Author: Matt Helsley -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -#set -x -P='ltp-cgroup-freezer' - -export EXIT_GOOD=0 -export EXIT_TERMINATE=-1 - - -trap "exit ${EXIT_TERMINATE}" ERR - -# -# Run tests for freezer and signal controllers -# - - # TODO add: - #vfork_freeze.sh - # write signal/send_invalid_sig.sh - # write signal/read_signal.kill.sh -FREEZER_TEST_SCRIPTS=( write_freezing.sh - freeze_write_freezing.sh - freeze_thaw.sh - freeze_sleep_thaw.sh - freeze_kill_thaw.sh - freeze_move_thaw.sh - freeze_cancel.sh - freeze_self_thaw.sh - stop_freeze_thaw_cont.sh - stop_freeze_sleep_thaw_cont.sh - fork_freeze.sh ) - -TEST_SCRIPTS=( ) - -function test_setup() -{ - if [ -z "${LTPROOT}" ]; then - CGROUPS_TESTROOT="$(pwd)" - . libltp - else - CGROUPS_TESTROOT="${LTPROOT}/testcases/kernel/controllers/freezer" - fi - - ####################################################################### - ## Initialize some LTP variables -- Set _COUNT and _TOTAL to fake values - ## else LTP complains. - ####################################################################### - TCID="$0" - TST_COUNT=1 - TST_TOTAL=$(( ${#TEST_SCRIPTS[@]} + 0 )) - TMPDIR="${TMPDIR:-/tmp}" - - export LTPBIN PATH TCID TST_COUNT TST_TOTAL CGROUPS_TESTROOT - tst_resm TINFO "Preparing to run: ${P} $@" - - make all -} - -function test_prereqs() -{ - cat /proc/filesystems | grep -E '\bcgroup\b' > /dev/null 2>&1 || { - tst_resm TINFO "Kernel does not support cgroups. Skipping." - exit ${EXIT_GOOD} # 0 - } - - tst_resm TINFO " Testing prereqs for cgroup freezer tests." - if [ ! -f /proc/cgroups ]; then - tst_resm TINFO "Tests require cgroup freezer support in the kernel." - exit 1 - fi - - if [ "$(grep -w freezer /proc/cgroups | cut -f1)" != "freezer" ]; then - tst_resm TINFO "Tests require cgroup freezer support in the kernel." - exit 1 - fi - - . "${CGROUPS_TESTROOT}/libcgroup_freezer" - - tst_resm TINFO " It's ok if there's an ERROR before the next INFO." - mount_freezer && umount_freezer && { - TEST_SCRIPTS=( "${TEST_SCRIPTS[@]}" "${FREEZER_TEST_SCRIPTS[@]}" ) - } - tst_resm TINFO " OK, resume worrying about ERRORS." - export TST_TOTAL=$(( ${#TEST_SCRIPTS[@]} + 0 )) -} - -function main() -{ - local rc=0 - - for TEST in "${TEST_SCRIPTS[@]}" ; do - export TCID="${TEST}" - tst_resm TINFO " running ${TEST}" - ((TST_COUNT++)) - export TST_COUNT - "${CGROUPS_TESTROOT}/${TEST}" - rc=$? - - if [ $rc != 0 ]; then - tst_resm TFAIL "${TEST} $rc" - break - else - tst_resm TPASS "${TEST}" - fi - done - trap '' ERR - return $rc -} - -test_setup && \ -test_prereqs && \ -declare -r TST_TOTAL && \ -main -rc=$? -trap '' ERR -exit $rc diff --git a/testcases/kernel/controllers/freezer/run_freezer.sh b/testcases/kernel/controllers/freezer/run_freezer.sh new file mode 100755 index 00000000..3baf9680 --- /dev/null +++ b/testcases/kernel/controllers/freezer/run_freezer.sh @@ -0,0 +1,132 @@ +#!/bin/bash +# Copyright (c) International Business Machines Corp., 2008 +# Author: Matt Helsley +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +#set -x +P='ltp-cgroup-freezer' + +export EXIT_GOOD=0 +export EXIT_TERMINATE=-1 + + +trap "exit ${EXIT_TERMINATE}" ERR + +# +# Run tests for freezer and signal controllers +# + + # TODO add: + #vfork_freeze.sh + # write signal/send_invalid_sig.sh + # write signal/read_signal.kill.sh +FREEZER_TEST_SCRIPTS=( write_freezing.sh + freeze_write_freezing.sh + freeze_thaw.sh + freeze_sleep_thaw.sh + freeze_kill_thaw.sh + freeze_move_thaw.sh + freeze_cancel.sh + freeze_self_thaw.sh + stop_freeze_thaw_cont.sh + stop_freeze_sleep_thaw_cont.sh + fork_freeze.sh ) + +TEST_SCRIPTS=( ) + +function test_setup() +{ + if [ -z "${LTPROOT}" ]; then + CGROUPS_TESTROOT="$(pwd)" + . libltp + else + CGROUPS_TESTROOT="${LTPROOT}/testcases/bin" + fi + + ####################################################################### + ## Initialize some LTP variables -- Set _COUNT and _TOTAL to fake values + ## else LTP complains. + ####################################################################### + TCID="$0" + TST_COUNT=1 + TST_TOTAL=$(( ${#TEST_SCRIPTS[@]} + 0 )) + TMPDIR="${TMPDIR:-/tmp}" + + export LTPBIN PATH TCID TST_COUNT TST_TOTAL CGROUPS_TESTROOT + tst_resm TINFO "Preparing to run: ${P} $@" + + make all +} + +function test_prereqs() +{ + cat /proc/filesystems | grep -E '\bcgroup\b' > /dev/null 2>&1 || { + tst_resm TINFO "Kernel does not support cgroups. Skipping." + exit ${EXIT_GOOD} # 0 + } + + tst_resm TINFO " Testing prereqs for cgroup freezer tests." + if [ ! -f /proc/cgroups ]; then + tst_resm TINFO "Tests require cgroup freezer support in the kernel." + exit 1 + fi + + if [ "$(grep -w freezer /proc/cgroups | cut -f1)" != "freezer" ]; then + tst_resm TINFO "Tests require cgroup freezer support in the kernel." + exit 1 + fi + + . "${CGROUPS_TESTROOT}/libcgroup_freezer" + + tst_resm TINFO " It's ok if there's an ERROR before the next INFO." + mount_freezer && umount_freezer && { + TEST_SCRIPTS=( "${TEST_SCRIPTS[@]}" "${FREEZER_TEST_SCRIPTS[@]}" ) + } + tst_resm TINFO " OK, resume worrying about ERRORS." + export TST_TOTAL=$(( ${#TEST_SCRIPTS[@]} + 0 )) +} + +function main() +{ + local rc=0 + + for TEST in "${TEST_SCRIPTS[@]}" ; do + export TCID="${TEST}" + tst_resm TINFO " running ${TEST}" + ((TST_COUNT++)) + export TST_COUNT + "${CGROUPS_TESTROOT}/${TEST}" + rc=$? + + if [ $rc != 0 ]; then + tst_resm TFAIL "${TEST} $rc" + break + else + tst_resm TPASS "${TEST}" + fi + done + trap '' ERR + return $rc +} + +test_setup && \ +test_prereqs && \ +declare -r TST_TOTAL && \ +main +rc=$? +trap '' ERR +exit $rc diff --git a/testcases/kernel/controllers/freezer/vfork.c b/testcases/kernel/controllers/freezer/vfork.c index ec2994af..63e44edb 100644 --- a/testcases/kernel/controllers/freezer/vfork.c +++ b/testcases/kernel/controllers/freezer/vfork.c @@ -38,15 +38,11 @@ #include #include -#include -#ifndef PTRACE_O_TRACEVFORK -/* from #include except we don't want to trash defines from - * sys/ptrace.h */ -#define PTRACE_O_TRACEVFORK 0x00000004 -#endif #include +#include "config.h" -/*#define _GNU_SOURCE*/ +#include +#include #define str_expand(s) str(s) #define str(s) #s @@ -80,55 +76,6 @@ int do_vfork(int count) return EXIT_SUCCESS; } -#if 0 -void dump_siginfo(pid_t child, siginfo_t *info) -{ - printf("%d:\n\tsi_code: %#0x\n\tsi_signo: %#0x\n", - child, info->si_code, info->si_signo); -} - -void dump_status(pid_t child, int status) -{ - if (WIFEXITED(status)) - printf("exited: %d (with status: %d)\n", child, - WEXITSTATUS(status)); - if (WIFSIGNALED(status)) - printf("killed: %d (by signal: %s)\n", child, - sys_siglist[WTERMSIG(status)]); - if (WIFSTOPPED(status)) - printf("stopped: %d (by signal: %s)\n", child, - sys_siglist[WSTOPSIG(status)]); -} - -#define SI_CODE_TRAP (SIGTRAP|(PTRACE_EVENT_VFORK << 8)) - -/* This function is for debug only. - * return the number of new children to wait for */ -int trace_child(pid_t child) -{ - unsigned long data; - pid_t grandchild = -1; - siginfo_t info; - - if (ptrace(PTRACE_GETSIGINFO, child, NULL, &info) == -1) { - debug("ptrace(): "); - return 0; - } - /*dump_siginfo(child, &info);*/ - if (!((info.si_code == SI_CODE_TRAP) && (info.si_signo == SIGTRAP))) - return 0; - - printf("%d: vfork()\n", child); - if (ptrace(PTRACE_GETEVENTMSG, child, NULL, &data) == -1) { - debug("ptrace(): "); - return 0; - } - grandchild = (pid_t)data; - printf("%d: vfork() child: %d\n", child, grandchild); - return 1; -} -#endif - /* Options */ int num_vforks = 1; int do_pause = 0; @@ -215,6 +162,7 @@ void parse_opts(int argc, char **argv) int trace_grandchild(pid_t gchild) { +#if HAVE_DECL_PTRACE_GETSIGINFO siginfo_t info; if (ptrace(PTRACE_GETSIGINFO, gchild, NULL, &info) == -1) { @@ -234,6 +182,7 @@ int trace_grandchild(pid_t gchild) if (ptrace(PTRACE_DETACH, gchild, NULL, NULL) == -1) debug("ptrace(): "); return -1; /* don't wait for gchild */ +#endif } int do_trace(pid_t child, int num_children) @@ -306,8 +255,11 @@ void await_mutex(int fd) } while(1); } -int main(int argc, char** argv) +int +main(int argc, char** argv) { + +#if HAVE_DECL_PTRACE_SETOPTIONS && HAVE_DECL_PTRACE_O_VTRACEFORK pid_t child; int psync[2]; @@ -356,4 +308,8 @@ int main(int argc, char** argv) printf("%d\n", child); exit(do_trace(child, ++num_vforks)); } +#else + printf("System doesn't support have required ptrace capabilities\n."); + return 1; +#endif } diff --git a/testcases/kernel/controllers/io-throttle/Makefile b/testcases/kernel/controllers/io-throttle/Makefile dissimilarity index 98% index 5b3e370c..0e97ab2f 100644 --- a/testcases/kernel/controllers/io-throttle/Makefile +++ b/testcases/kernel/controllers/io-throttle/Makefile @@ -1,16 +1,32 @@ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -I../libcontrollers -LDLIBS += -lm -L../../../../lib/ -L../libcontrollers -lcontrollers -lltp - -SRCS = $(wildcard *.c) - -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -clean: - rm -f $(TARGETS) *.o - -install: - @set -e; for i in $(TARGETS) run_io_throttle_test.sh myfunctions-io.sh; do ln -f $$i ../../../bin/$$i ; chmod +x $$i ; done - +# +# kernel/controllers/io-throttle testcase suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +INSTALL_TARGETS := run_io_throttle_test.sh myfunctions-io.sh + +LDLIBS += -lm -lcontrollers + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/libcontrollers/Makefile b/testcases/kernel/controllers/libcontrollers/Makefile dissimilarity index 97% index d6048444..7762ce08 100644 --- a/testcases/kernel/controllers/libcontrollers/Makefile +++ b/testcases/kernel/controllers/libcontrollers/Makefile @@ -1,15 +1,29 @@ -TARGET=libcontrollers.a -SRCS=$(wildcard *.c) -OBJS=$(patsubst %.c,%.o,$(SRCS)) - -all : $(TARGET) - -$(TARGET): $(OBJS) - $(AR) -cr $@ $^ - -clean: - rm -f $(TARGET) $(OBJS) - -install: - - +# +# testcases/kernel/controllers library 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LIB := libcontrollers.a + +include $(top_srcdir)/include/mk/lib.mk diff --git a/testcases/kernel/controllers/memcg/Makefile b/testcases/kernel/controllers/memcg/Makefile dissimilarity index 98% index 9535f739..df1c98a5 100644 --- a/testcases/kernel/controllers/memcg/Makefile +++ b/testcases/kernel/controllers/memcg/Makefile @@ -1,10 +1,29 @@ -SUBDIRS = functional regression stress - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# kernel/controllers/memcg testcase suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := *.sh + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/controllers/memcg/functional/Makefile b/testcases/kernel/controllers/memcg/functional/Makefile dissimilarity index 98% index 74143fa2..0a250290 100644 --- a/testcases/kernel/controllers/memcg/functional/Makefile +++ b/testcases/kernel/controllers/memcg/functional/Makefile @@ -1,23 +1,31 @@ -CFLAGS += -Wall -O2 -g -Wextra -LDLIBS += -lm - -SRCS=$(wildcard *.c) -OBJECTS=$(patsubst %.c,%.o,$(SRCS)) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -$(TARGETS): %: %.o - -install: - @set -e; for i in $(TARGETS) *.sh; do ln -f $$i ../../../../bin/$$i ; chmod +x $$i ; done - -test: - @./memcgroup_function_test.sh - -clean: - rm -f $(TARGETS) $(OBJECTS) - -uninstall: - -.DEFAULT: ; +# +# kernel/controllers/memcg/functional testcase suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := *.sh + +LDLIBS += -lm + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh b/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh index ea4c8a2c..003af1c8 100755 --- a/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh +++ b/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh @@ -398,11 +398,12 @@ testcase_24() testcase_25() { echo -1 > memory.limit_in_bytes 2> /dev/null + ret=$? tst_kvercmp 2 6 31 if [ $? -eq 0 ]; then - result $(( !($? != 0) )) "return value is $?" + result $(( !($ret != 0) )) "return value is $ret" else - result $(( !($? == 0) )) "return value is $?" + result $(( !($ret == 0) )) "return value is $ret" fi } @@ -535,8 +536,8 @@ do_mount() } # Run all the test cases -for ((i = 1; i <= $TST_TOTAL; i++)) -{ +for i in $(seq 1 $TST_TOTAL) +do export TST_COUNT=$(( $TST_COUNT + 1 )) cur_id=$i @@ -555,7 +556,7 @@ for ((i = 1; i <= $TST_TOTAL; i++)) rmdir /dev/memcg/$i cleanup; -} +done echo $shmmax > /proc/sys/kernel/shmmax diff --git a/testcases/kernel/controllers/memcg/regression/Makefile b/testcases/kernel/controllers/memcg/regression/Makefile dissimilarity index 98% index b0a49757..8399c3fa 100644 --- a/testcases/kernel/controllers/memcg/regression/Makefile +++ b/testcases/kernel/controllers/memcg/regression/Makefile @@ -1,16 +1,33 @@ -CFLAGS += -Wall -CPPFLAGS += -I../../../../../include -I../../libcontrollers -LDLIBS += -L../../../../../lib/ -lltp - -SRCS = $(wildcard *.c) - -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -clean: - rm -f $(TARGETS) *.o - -install: - @set -e; for i in $(TARGETS) *.sh; do ln -f $$i ../../../../bin/$$i ; chmod +x $$i ; done - +# +# kernel/controllers/memcg/regression testcase suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -I$(abs_srcdir)/../../libcontrollers + +INSTALL_TARGETS := *.sh + +LDLIBS += -lm + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/memcg/stress/Makefile b/testcases/kernel/controllers/memcg/stress/Makefile dissimilarity index 98% index 8c0d8b7e..0dbc994d 100644 --- a/testcases/kernel/controllers/memcg/stress/Makefile +++ b/testcases/kernel/controllers/memcg/stress/Makefile @@ -1,23 +1,33 @@ -CFLAGS += -Wall -O2 -g -Wextra -LDLIBS += -lm - -SRCS=$(wildcard *.c) -OBJECTS=$(patsubst %.c,%.o,$(SRCS)) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -$(TARGETS): %: %.o - -install: - @set -e; for i in $(TARGETS) *.sh; do ln -f $$i ../../../../bin/$$i ; chmod +x $$i ; done - -test: - @./memcgroup_stress_test.sh - -clean: - rm -f $(TARGETS) $(OBJECTS) - -uninstall: - -.DEFAULT: ; +# +# kernel/controllers/memcg/stress testcase suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -I$(abs_srcdir)/../../libcontrollers + +INSTALL_TARGETS := *.sh + +LDLIBS += -lm + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh index 86b8cb93..6c9cd754 100755 --- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh @@ -66,29 +66,29 @@ run_stress() { do_mount; - for ((i = 0; i < $1; i++)) - { + for i in $(seq 0 $(($1-1))) + do mkdir /dev/memcg/$i 2> /dev/null ./memcg_process_stress $2 $3 & pid[$i]=$! echo ${pid[$i]} > /dev/memcg/$i/tasks - } + done - for ((i = 0; i < $1; i++)) - { + for i in $(seq 0 $(($1-1))) + do /bin/kill -s SIGUSR1 ${pid[$i]} 2> /dev/null - } + done sleep $4 - for ((i = 0; i < $1; i++)) - { + for i in $(seq 0 $(($1-1))) + do /bin/kill -s SIGINT ${pid[$i]} 2> /dev/null wait ${pid[$i]} rmdir /dev/memcg/$i 2> /dev/null - } + done cleanup; } diff --git a/testcases/kernel/controllers/memctl/Makefile b/testcases/kernel/controllers/memctl/Makefile dissimilarity index 98% index a55f9a0f..42670578 100644 --- a/testcases/kernel/controllers/memctl/Makefile +++ b/testcases/kernel/controllers/memctl/Makefile @@ -1,16 +1,30 @@ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -I../libcontrollers -LDLIBS += -lm -L../../../../lib/ -L../libcontrollers -lcontrollers -lltp - -SRCS = $(wildcard *.c) - -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -clean: - rm -f $(TARGETS) *.o - -install: - @set -e; for i in $(TARGETS) run_memctl_test.sh myfunctions.sh; do ln -f $$i ../../../bin/$$i ; chmod +x $$i ; done - +# +# kernel/controllers/memctl testcase suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +INSTALL_TARGETS := *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/controllers/test_controllers.sh b/testcases/kernel/controllers/test_controllers.sh index f8e84584..f3a1daaf 100755 --- a/testcases/kernel/controllers/test_controllers.sh +++ b/testcases/kernel/controllers/test_controllers.sh @@ -90,9 +90,7 @@ then if [ "$FREEZER" = "freezer" ] then - pushd $LTPROOT/testcases/kernel/controllers/freezer - ./run.sh - popd + "$LTPROOT/testcases/bin/run_freezer.sh" else echo "CONTROLLERS TESTCASES: WARNING"; echo "Kernel does not support freezer controller"; diff --git a/testcases/kernel/fs/Makefile b/testcases/kernel/fs/Makefile dissimilarity index 98% index 08817142..afad6f9d 100644 --- a/testcases/kernel/fs/Makefile +++ b/testcases/kernel/fs/Makefile @@ -1,12 +1,32 @@ -SUBDIRS = acls doio fs_inod fsstress fs_perms fsx-linux ftest inode lftest linktest openfile proc stream fs_di fs_bind racer quota_remount - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - - +# +# kernel/fs 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +# XXX (garrcoop): Need to add autoconf checks for JFS. +# ext4-new-features: This test need to be configured be user. +# Please read $LTPROOT/README to see the detail information +FILTER_OUT_DIRS := dmapi ext4-new-features + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/fs/acls/Makefile b/testcases/kernel/fs/acls/Makefile dissimilarity index 76% index 6610db21..d684254c 100644 --- a/testcases/kernel/fs/acls/Makefile +++ b/testcases/kernel/fs/acls/Makefile @@ -1,24 +1,40 @@ -check_header = $(shell \ - if echo "\#include <$(1)>" | $(CC) -E - > /dev/null 2>&1 ; \ - then echo yes ; \ - else echo no ; fi) - -ifeq ($(call check_header,sys/xattr.h),yes) -TARGETS := acl_file_test acl_link_test -else -TARGETS := -endif - -all: $(TARGETS) - -acl_file_test: acl_file_test.c - $(CC) $(CFLAGS) $(LDFLAGS) -o acl_file_test acl_file_test.c -acl_link_test: acl_link_test.c - $(CC) $(CFLAGS) $(LDFLAGS) -o acl_link_test acl_link_test.c - -install: - chmod 755 acl_test01 - @set -e; for i in $(TARGETS) acl_test01 ; do ln -f $$i ../../../bin/ ; done - -clean: - rm -f acl_file_test acl_link_test +# +# kernel/fs/acls testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +check_header = $(shell \ + if echo "\#include <$(1)>" | $(CC) -E - > /dev/null 2>&1 ; \ + then echo yes ; \ + else echo no ; fi) + +INSTALL_TARGETS := acl_test01 + +RESULT := $(call check_header,sys/xattr.h) + +ifneq ($(RESULT),yes) +MAKE_TARGETS := +endif + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/acls/acl_test01 b/testcases/kernel/fs/acls/acl_test01 index c892b0e0..20cd1ace 100755 --- a/testcases/kernel/fs/acls/acl_test01 +++ b/testcases/kernel/fs/acls/acl_test01 @@ -51,7 +51,7 @@ if [ "z$iam" = "z$TEST_USER1" ] then echo "" else -if [ $UID != 0 ] +if [ $(id -ru) != 0 ] then echo "FAILED: Must have root access to execute this script" exit 1 @@ -76,7 +76,7 @@ if [ $? != 0 ] then echo "" echo "FAILED: [ losetup ] Must have loop device support by kernel" - echo -e "\t to execute this script" + printf "\t to execute this script\n" exit 1 fi @@ -90,8 +90,8 @@ then then echo "" echo "FAILED: [ mount ] Make sure that ACL (Access Control List)" - echo -e "\t and Extended Attribute are built into the kernel" - echo -e "\t Can not mount ext3 file system with acl and user_xattr options" + printf "\t and Extended Attribute are built into the kernel\n" + printf "\t Can not mount ext3 file system with acl and user_xattr options\n" exit 1 fi else @@ -102,8 +102,8 @@ else then echo "" echo "FAILED: [ mount ] Make sure that ACL (Access Control List)" - echo -e "\t and Extended Attribute are built into the kernel" - echo -e "\t Can not mount ext2 file system with acl and user_xattr options" + printf "\t and Extended Attribute are built into the kernel\n" + printf "\t Can not mount ext2 file system with acl and user_xattr options\n" exit 1 fi fi diff --git a/testcases/kernel/fs/dmapi/Makefile b/testcases/kernel/fs/dmapi/Makefile index 643b4b4a..fdf96932 100644 --- a/testcases/kernel/fs/dmapi/Makefile +++ b/testcases/kernel/fs/dmapi/Makefile @@ -16,16 +16,17 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# -# Makefile -# +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk # dmapi_imp is platform for DMAPI implementation (currently supported: JFS) -dmapi_imp = JFS +dmapi_imp := JFS + # dmapi_lib is path of user space library for DMAPI implementation -dmapi_lib = /usr/lib/libjfsdm.a +LDLIBS += -ljfsdm -std_cflags = -I. -g -Wall -D$(dmapi_imp) +CFLAGS += -g -Wall -D$(dmapi_imp) # Define USER_SPACE_FAULTS if DMAPI implementation handles user space # faults (JFS has plenty of handle code in user space, which causes @@ -42,88 +43,17 @@ std_cflags = -I. -g -Wall -D$(dmapi_imp) #extra_cflags = -DDIRECTORY_LINKS #extra_cflags = -DINTERIOR_HOLES #extra_cflags = -DMULTIPLE_REGIONS -extra_cflags = -DINTERIOR_HOLES -DMULTIPLE_REGIONS +CFLAGS += -DINTERIOR_HOLES -DMULTIPLE_REGIONS cflags = $(std_cflags) $(extra_cflags) lflags = $(dmapi_lib) lflags_thd = $(dmapi_lib) -lpthread -progs = handle session event_sn event_sd event_an pmr_pre pmr_post event_am \ - hole invis attr event_us disp config objref mount token right mmap \ - mmapfile event - -all : $(progs) - -dm_test.h : dm_vars.h Makefile - touch dm_test.h - -dm_test.o : dm_test.c dm_test.h dm_impl.h Makefile - cc -c $(cflags) dm_test.c - -handle : handle.c dm_test.h Makefile dm_test.o - cc $(cflags) -o handle handle.c dm_test.o $(lflags) - -session : session.c dm_test.h Makefile dm_test.o - cc $(cflags) -o session session.c dm_test.o $(lflags) - -event_sn: event_sn.c dm_test.h Makefile dm_test.o - cc $(cflags) -o event_sn event_sn.c dm_test.o $(lflags_thd) - -event_sd: event_sd.c dm_test.h Makefile dm_test.o - cc $(cflags) -o event_sd event_sd.c dm_test.o $(lflags_thd) - -event_an: event_an.c dm_test.h Makefile dm_test.o - cc $(cflags) -o event_an event_an.c dm_test.o $(lflags_thd) - -pmr_pre : pmr_pre.c dm_test.h Makefile dm_test.o - cc $(cflags) -o pmr_pre pmr_pre.c dm_test.o $(lflags_thd) - -pmr_post: pmr_post.c dm_test.h Makefile dm_test.o - cc $(cflags) -o pmr_post pmr_post.c dm_test.o $(lflags_thd) - -event_am: event_am.c dm_test.h Makefile dm_test.o - cc $(cflags) -o event_am event_am.c dm_test.o $(lflags_thd) - -hole : hole.c dm_test.h Makefile dm_test.o - cc $(cflags) -o hole hole.c dm_test.o $(lflags) - -invis : invis.c dm_test.h Makefile dm_test.o - cc $(cflags) -o invis invis.c dm_test.o $(lflags_thd) - -attr : attr.c dm_test.h Makefile dm_test.o - cc $(cflags) -o attr attr.c dm_test.o $(lflags) - -event_us: event_us.c dm_test.h Makefile dm_test.o - cc $(cflags) -o event_us event_us.c dm_test.o $(lflags_thd) - -disp : disp.c dm_test.h Makefile dm_test.o - cc $(cflags) -o disp disp.c dm_test.o $(lflags_thd) - -config : config.c dm_test.h Makefile dm_test.o - cc $(cflags) -o config config.c dm_test.o $(lflags) - -objref : objref.c dm_test.h Makefile dm_test.o - cc $(cflags) -o objref objref.c dm_test.o $(lflags_thd) - -mount : mount.c dm_test.h Makefile dm_test.o - cc $(cflags) -o mount mount.c dm_test.o $(lflags_thd) - -token : token.c dm_test.h Makefile dm_test.o - cc $(cflags) -o token token.c dm_test.o $(lflags_thd) - -right : right.c dm_test.h Makefile dm_test.o - cc $(cflags) -o right right.c dm_test.o $(lflags_thd) - -mmap : mmap.c dm_test.h Makefile dm_test.o - cc $(cflags) -o mmap mmap.c dm_test.o $(lflags_thd) +FILTER_OUT_MAKE_TARGETS := dm_test -mmapfile: mmapfile.c dm_test.h Makefile - cc $(cflags) -o mmapfile mmapfile.c $(lflags) +dm_test.o: dm_test.c dm_impl.h -event : event.c dm_test.h Makefile dm_test.o - cc $(cflags) -o event event.c dm_test.o $(lflags_thd) +include $(top_srcdir)/include/mk/generic_leaf_target.mk -clean : - rm -f *.o - rm -f $(progs) +$(MAKE_TARGETS): %: %.o dm_test.o dm_test.h diff --git a/testcases/kernel/fs/dmapi/dm_test.h b/testcases/kernel/fs/dmapi/dm_test.h index d6cafffc..bcb3d27b 100644 --- a/testcases/kernel/fs/dmapi/dm_test.h +++ b/testcases/kernel/fs/dmapi/dm_test.h @@ -23,7 +23,9 @@ */ #include +#if HAVE_SYS_JFSDMAPI_H #include +#endif #include "dm_vars.h" /* The following constants are implementation-independent */ @@ -130,6 +132,7 @@ void dm_FailVariation(void); void dm_SkipVariation(void); void dm_EndVariation_SuccessExpected(char *funcname, int expectedRC, int actualRC); void dm_EndVariation_FailureExpected(char *funcname, int expectedRC, int actualRC, int expectedErrno); +#if HAVE_SYS_JFSDMAPI_H int dm_CheckVariation_SuccessExpected(int expectedRC, int actualRC, dm_eventtype_t expectedEvent, dm_eventtype_t actualEvent); int dm_CheckVariation_FailureExpected(int expectedRC, int actualRC, int expectedErrno, dm_eventtype_t expectedEvent, dm_eventtype_t actualEvent); void dm_LogHandle(char *hdl, int len); @@ -165,3 +168,4 @@ int dmimpl_mount(char **mountPt, char **deviceNm); extern configResult_t dmimpl_expectedResults[]; extern eventValidity_t dmimpl_validEvents[]; extern dm_eventset_t dmimpl_eventset; +#endif diff --git a/testcases/kernel/fs/doio/Makefile b/testcases/kernel/fs/doio/Makefile dissimilarity index 99% index 6e8f2de8..2e5df150 100644 --- a/testcases/kernel/fs/doio/Makefile +++ b/testcases/kernel/fs/doio/Makefile @@ -1,28 +1,32 @@ - -CFLAGS+= -Wall -I../../../../include -D_LARGEFILE64_SOURCE -LDLIBS+= -L../../../../lib -lltp -lrt -lpthread - -TARGETS=doio growfiles rwtest iogen -SRCS=$(wildcard *.c) -OBJS=$(patsubst %.c,%.o,$(SRCS)) - -all: $(TARGETS) - -doio: doio.o - $(CC) -o $@ $^ -I. $(CFLAGS) $(LDFLAGS) $(LDLIBS) - -growfiles: growfiles.o - $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LDLIBS) - -iogen: iogen.o - $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LDLIBS) - -rwtest: rwtest.sh doio iogen - cp rwtest.sh rwtest - chmod a+rx rwtest - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(OBJS) $(TARGETS) +# +# kernel/fs/doio 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CFLAGS += -D_LARGEFILE64_SOURCE +LDLIBS += -lrt -lpthread + +INSTALL_TARGETS := rwtest.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/doio/rwtest.sh b/testcases/kernel/fs/doio/rwtest.sh index 29aff015..6315c8f4 100644 --- a/testcases/kernel/fs/doio/rwtest.sh +++ b/testcases/kernel/fs/doio/rwtest.sh @@ -1,33 +1,33 @@ #!/bin/bash # 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., 59 # Temple Place - Suite 330, Boston MA 02111-1307, 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://www.sgi.com +# +# For further information regarding this notice, see: +# # http://oss.sgi.com/projects/GenInfo/NoticeExplan/ # @@ -36,7 +36,7 @@ trap "exit 0" INT # Until the smarter signal handler is engaged, below. -Prog=$(basename $0) +Prog=${0##*/} iOpts="" dOpts="" @@ -59,7 +59,7 @@ help() { echo "\ -c Cleanup test files created by this invocation on exit. - Default is to leave them. + Default is to leave them. -h This help - ignore all other options/arguments -F Only process filenames - does not run iogen & doio. -P Places Not used @@ -78,7 +78,7 @@ help() Default is 1. If -n is non-zero, doio's -k option (use file locking) is forced. - files Files to test on. File names have the following fomat: + files Files to test on. File names have the following format: [ size: ] path [ free% [ max size ] : ] path If no size is specified, the files must exist @@ -86,7 +86,7 @@ help() writea system calls. If a size is supplied, an attempt to create/grow/shrink path to the desired size will be made. size is an integer which defaults to bytes, but may be - suffixed by 'b', 'k', or 'm' for blocks (4096 byte units), + suffixed by 'b', 'k', or 'm' for blocks (4096 byte units), kilobytes (1024 byte units), or megabytes (2^20 byte units). If the size is a percentage, df is used to find how much @@ -112,7 +112,7 @@ cleanup_and_exit() then if [ -n "$Files_To_Remove" ] then - rm -f $Files_To_Remove + rm -rf $Files_To_Remove fi fi @@ -289,7 +289,7 @@ fi # 1,000,000 blocks if no limit is specified # -case $(uname -s) in +case "$(uname -s)" in IRIX | IRIX64 ) dfOpts="-Pb" ;; Linux) dfOpts="-P" ;; *) dfOpts="-PB" ;; @@ -304,6 +304,12 @@ do fi dir=$(dirname $file) + # create directory for file if non-existent + if [ ! -d "$dir" ] + then + mkdir -p $dir + Files_To_Remove="$Files_To_Remove $dir" + fi size=${f%%:*} if [[ $size = *%* ]] then @@ -326,8 +332,8 @@ do if test -h $(which df) then dir=""; dfOpts=""; - fi - + fi + blks=$(df $dfOpts $dir | (while read fs blks used avail cap mountpoint do @@ -336,33 +342,38 @@ do done echo $b) ) - case $(uname) in - Linux) blks=$( expr $blks / 2 ) ;; - esac - - szcache[${#szcache[*]}+1]=$dir - szblks[${#szblks[*]}+1]=$blks - fi - - max=${size##*\%} - if [[ "$max" = "" ]] - then - max=1000000 - fi - size=${size%%\%*} - - case $(uname) in - IRIX*) - sz=$( perl -le 'print int( '$blks' * '$size' / 100 )' ) - ;; - *) - sz=$(expr \( $blks '*' $size \) / 100) - ;; - esac - - if [ $sz -gt $max ] - then - sz=$max + # check if blks is a number, else set a default value for blks + default_sz=1000000 + if [ $blks -eq $blks 2> /dev/null ] + then + + case $(uname) in + Linux) blks=$( expr $blks / 2 ) ;; + esac + + szcache[${#szcache[*]}+1]=$dir + szblks[${#szblks[*]}+1]=$blks + + max=${size##*\%} + [ "x$max" = "x" ] && max=$default_sz + size=${size%%\%*} + + case $(uname) in + IRIX*) + sz=$( perl -le 'print int( '$blks' * '$size' / 100 )' ) + ;; + *) + sz=$(expr \( $blks '*' $size \) / 100) + ;; + esac + + if [ $sz -gt $max ] + then + sz=$max + fi + else + sz=$default_sz + fi fi f=$sz"b:"$file fi diff --git a/testcases/kernel/fs/ext4-new-features/Makefile b/testcases/kernel/fs/ext4-new-features/Makefile new file mode 100644 index 00000000..0e09dd6a --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/Makefile @@ -0,0 +1,38 @@ +# +# kernel/fs/ext4-new-features 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. +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh +INSTALL_TARGETS := ext4-test-config +INSTALL_TARGETS := ffsb-6.0-rc2/ffsb + +FILTER_OUT_DIRS := ffsb-6.0-rc2 + +trunk-all: ffsb-6.0-rc2 + +trunk-clean:: | ffsb-clean + +ffsb-clean:: ffsb-6.0-rc2 + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/fs/ext4-new-features/README b/testcases/kernel/fs/ext4-new-features/README new file mode 100644 index 00000000..0ea04604 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/README @@ -0,0 +1,147 @@ +TEST SUITE: + +The directory ext4-new-features contains the tests related to the ext4 +filesystem's new features. + +Ext4 is an advanced level of the ext3 filesystem which incorporates scalability +and reliability enhancements for supporting large filesystems(64 bit) in keeping +with increasing disk capacities and state-of-the-art feature requirements. More +extensive information of ext4 can be found at the ext4 wiki site at the URL: +http://ext4.wiki.kernel.org + +There are total 119 testcases for ext4 new features test that have been added. +Now, these testcases can test multi-block alloc/delayed alloc, inode version +field on disk, journal checksumming, nanosec timestamps, online defrag, persist +prealloc, subdirectory limit and uninit groups of ext4. +The detail information of ext4 new features can be found at the URL: +http://ext4.wiki.kernel.org/index.php/New_ext4_features + + +TESTS AIM: + +The aim of the tests is to test ext4 new features. + + +TEST STEPS: +# cd LTPROOT/testcases/kernel/fs/ext4-new-features +# ./configure +# make +# make install +# cd LTPROOT +# ./runltp -f fs_ext4 + +**This testsuite wouldn't be built when doing LTP default build. We MUST do it + by ourself. + + +NOTE: + +1. This test can be run by root only. +2. Your MUST run *configure* in this directory to config the tool of ffsb and + specify a partition to be used for test before compiling the tool, and be + CAREFUL the data on the specified partition would be DESTROYED. It is better + that the size of partition is between 5G and 10G. If the partition is too + big, the test will spend much time. It is unnecessary. +3. Before starting test ext4 new features, please check whether ext4 filesystem + is compiled into the kernel or not, and the kernel version is *2.6.31* or + above. +4. A snapshot of config file options is given below: + ONFIG_EXT4_FS=y + CONFIG_EXT4DEV_COMPAT=y + CONFIG_EXT4_FS_XATTR=y + CONFIG_EXT4_FS_POSIX_ACL=y + CONFIG_EXT4_FS_SECURITY=y + +5. Beside that, the following packages are necessary: + e2fsprogs + (http://www.rpmfind.net/linux/rpm2html/search.php?query=e2fsprogs) + e2fsprogs-devel + (http://www.rpmfind.net/linux/rpm2html/search.php?query=e2fsprogs-devel) + e2fsprogs-libs + (http://www.rpmfind.net/linux/rpm2html/search.php?query=e2fsprogs-libs) + and the version of these packages should be 1.41.4 or above, otherwise the + test will fail. + + +FILES DESCRIPTION: + +configure +--------- +This is a config script that is used to configure the ffsb tool and specify a +partition for test. And the data on the specified partition would be destroyed. +Be careful! Beside that, you MUST run this script before compile the testcases. + +ext4-delalloc-mballoc +--------------------- +Directory containing the shell script which is used to test multi-block +allocation and delayed allocation of ext4. + +ext4-ffsb-config +---------------- +Directory containing the config of ffsb for test. + +ext4-inode-version +------------------ +Directory containing the shell script which is used to test inode version field +on disk of ext4. + +ext4-journal-checksum +--------------------- +Directory containing the shell script which is used to test journal checksumming +of ext4. + +ext4-nsec-timestamps +-------------------- +Directory containing the shell script which is used to test nanosec timestamps +of ext4. + +ext4-online-defrag +------------------ +Directory containing the shell script which is used to test online defrag +feature of ext4. + +ext4-persist-prealloc +--------------------- +Directory containing the shell script which is used to test persist prealloc +feature of ext4. + +ext4-subdir-limit +----------------- +Directory containing the shell script which is used to test subdirectory limit +of ext4. According to the kernel documentation, we create more than 32000 +subdirectorys on the ext4 filesystem. + +But, when then block size is small, such as 1024, and the name of every +subdirectory is very long, such as every name is 255 bytes, we can just create +less than 20000 subdirectory. In this test suite, there is two FAIL cases by +reason of it. + +ext4-uninit-groups +------------------ +Directory containing the shell script which is used to test uninitialized groups +feature of ext4. + +ffsb-6.0-rc2 +------------ +This directory contains The Flexible Filesystem Benchmark (FFSB) tool. We use +this tool to create some files to fill the test partition. This tool was written +by Sonny Rao(raosanth@us.ibm.com). + +ext4_funcs.sh +------------- +This script contains some functions for ext4 new features test script. +such as: ext4_setup, ext4_cleanup + +run_ext4_test.sh +---------------- +This script runs all the 119 testcases. + +Makefile +-------- +Each directory in this directory has its usual makefile, it is for its +directory. + +README +------ +The one you have gone through. + diff --git a/testcases/kernel/fs/ext4-new-features/configure b/testcases/kernel/fs/ext4-new-features/configure new file mode 100755 index 00000000..13f43f97 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/configure @@ -0,0 +1,23 @@ +#!/bin/sh + +echo "Run the ffsb's configure" +cd ./ffsb-6.0-rc2 +./configure +cd .. + +EXT4_DEV= +RESULT= + +echo "Ext4 new features test configure" +echo "Please specify a partition to create ext4 filesystem:" +read EXT4_DEV + +echo "The partition is: $EXT4_DEV, Are you sure(Y/N)?" +read RESULT +if [ "$RESULT" == "Y" ] || [ "$RESULT" == "y" ]; then + echo "EXT4_DEV=$EXT4_DEV" > ./ext4-test-config +elif [ "$RESULT" == "N" ]; then + echo "Give up specifing a partition!" +else + echo "Your input is wrong($RESULT)." +fi diff --git a/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/Makefile b/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/Makefile new file mode 100644 index 00000000..1980349a --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/Makefile @@ -0,0 +1,25 @@ +# Copyright (C) 2009, Fujitsu LIMITED +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +MAKE_TARGETS := +INSTALL_TARGETS ?= *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh b/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh new file mode 100755 index 00000000..ec2f389b --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh @@ -0,0 +1,167 @@ +#!/bin/bash + +################################################################################ +# # +# Copyright (c) 2009 FUJITSU LIMITED # +# # +# This program is free software; you can redistribute it and#or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, but # +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # +# for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +################################################################################ + +cd $LTPROOT/testcases/bin + +. ./ext4_funcs.sh + +export TCID="ext4-delalloc-mballoc" +export TST_TOTAL=17 +export TST_COUNT=1 + +# $1: the test config + +export TEST_DIR=$PWD + +read_config $1 + +# Case 17: mount ext4 partition to ext3 +ext4_test_remount() +{ + mkfs.ext3 -I 256 -b 1024 $EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + + tune2fs -E test_fs $EXT4_DEV + + mount -t ext4 -o delalloc,auto_da_alloc $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount ext4 filesystem" + return 1 + fi + + ./ffsb ffsb-config0 > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "ffsb returned failure" + umount mnt_point + return 1 + fi + + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return + fi + + mount -t ext3 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount to ext3" + return 1 + fi + umount mnt_point + + fsck -p $EXT4_DEV + if [ $? -ne 0 ]; then + tst_resm TFAIL "fsck returned failure" + return 1 + fi + + tst_resm TPASS "remount test pass" +} + +# Case 1-16: Use ffsb to test mballoc and delalloc +# $1: delalloc or nodelalloc +# $2: 0 - indirect-io, 1 - direct-io +# $3: block size +# $4: auto_da_alloc +ext4_test_delalloc_mballoc() +{ + tst_resm TINFO "isDelalloc: $1, isDirectIO: $2, Blocksize: $3, \ + isAuto_da_alloc: $4" + + mkfs.ext4 -I 256 -b $3 /$EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + + tune2fs -E test_fs -O extents $EXT4_DEV + + mount -t ext4 -o $1,$4 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount ext4 filesystem" + return 1 + fi + + ./ffsb ffsb-config$2 > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "ffsb returned failure" + umount mnt_point + return 1 + fi + + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return 1 + fi + + fsck -p $EXT4_DEV + if [ $? -ne 0 ]; then + tst_resm TFAIL "fsck returned failure" + return 1 + fi + + tst_resm TPASS "delalloc/mballoc test pass" +} + +# main +ext4_setup + +DELALLOC=( "delalloc" "nodelalloc" ) +DIRECT_IO=( 0 1 ) +BLOCK_SIZE=( 1024 4096 ) +BLOCK_AUTO_DA_ALLOC=( "auto_da_alloc=1" "noauto_da_alloc" ) + +RET=0 + +for ((i = 0; i < 2; i++)) +{ + for ((j = 0; j < 2; j++)) + { + for ((k = 0; k < 2; k++)) + { + for ((l = 0; l < 2; l++)) + { + ext4_test_delalloc_mballoc ${DELALLOC[$k]} \ + ${DIRECT_IO[$j]} \ + ${BLOCK_SIZE[$i]} \ + ${BLOCK_AUTO_DA_ALLOC[$l]} + if [ $? -ne 0 ]; then + RET=1 + fi + : $((TST_COUNT++)) + } + } + } +} + +ext4_test_remount +if [ $? -ne 0 ]; then + RET=1 +fi + +ext4_cleanup + +exit $RET diff --git a/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/Makefile b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/Makefile new file mode 100644 index 00000000..19dca285 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/Makefile @@ -0,0 +1,25 @@ +# Copyright (C) 2009, FUJITSU LIMITED +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +MAKE_TARGETS := +INSTALL_TARGETS ?= ffsb-config[0-7] + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config0 b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config0 new file mode 100644 index 00000000..caf19283 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config0 @@ -0,0 +1,23 @@ +directio=0 +time=500 + +[filesystem0] +location=mnt_point +num_files=100000 +num_dirs=40 +max_filesize=40960 +min_filesize=4096 +[end0] + + +[threadgroup0] +num_threads=10 +read_weight=3 +write_weight=1 +append_weight=1 +write_random=1 +write_size=4096 +write_blocksize=4096 +read_size=4096 +read_blocksize=4096 +[end0] diff --git a/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config1 b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config1 new file mode 100644 index 00000000..9fe820dd --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config1 @@ -0,0 +1,23 @@ +directio=1 +time=400 + +[filesystem0] +location=mnt_point +num_files=100000 +num_dirs=40 +max_filesize=4096 +min_filesize=4096 +[end0] + + +[threadgroup0] +num_threads=10 +read_weight=3 +write_weight=1 +append_weight=1 +write_random=1 +write_size=4096 +write_blocksize=4096 +read_size=4096 +read_blocksize=4096 +[end0] diff --git a/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config2 b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config2 new file mode 100644 index 00000000..993fe141 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config2 @@ -0,0 +1,23 @@ +directio=0 +time=500 + +[filesystem0] +location=mnt_point +num_files=100000 +num_dirs=40 +max_filesize=20480 +min_filesize=4096 +[end0] + + +[threadgroup0] +num_threads=10 +read_weight=3 +write_weight=1 +append_weight=1 +write_random=1 +write_size=4096 +write_blocksize=4096 +read_size=4096 +read_blocksize=4096 +[end0] diff --git a/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config3 b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config3 new file mode 100644 index 00000000..d95149dd --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config3 @@ -0,0 +1,29 @@ +directio=0 +time=0 + +[filesystem0] + location=mnt_point/ + num_files=1 + num_dirs=1 + max_filesize=409600 + min_filesize=40960 + agefs=1 + [threadgroup0] + num_threads=10 + write_size=409600 + write_blocksize=40960 + create_weight=10 + append_weight=10 + delete_weight=1 + [end0] + desired_util=0.20 +[end0] + +[threadgroup0] + num_threads=32 + read_weight=1 + + read_size=4096 + read_blocksize=4096 +[end0] + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config4 b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config4 new file mode 100644 index 00000000..f1a432e2 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config4 @@ -0,0 +1,29 @@ +directio=0 +time=0 + +[filesystem0] + location=mnt_point/ + num_files=1 + num_dirs=1 + max_filesize=409600 + min_filesize=40960 + agefs=1 + [threadgroup0] + num_threads=10 + write_size=409600 + write_blocksize=40960 + create_weight=10 + append_weight=10 + delete_weight=1 + [end0] + desired_util=0.40 +[end0] + +[threadgroup0] + num_threads=32 + read_weight=1 + + read_size=4096 + read_blocksize=4096 +[end0] + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config5 b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config5 new file mode 100644 index 00000000..758ededa --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config5 @@ -0,0 +1,29 @@ +directio=0 +time=0 + +[filesystem0] + location=mnt_point/ + num_files=1 + num_dirs=1 + max_filesize=409600 + min_filesize=40960 + agefs=1 + [threadgroup0] + num_threads=10 + write_size=409600 + write_blocksize=40960 + create_weight=10 + append_weight=10 + delete_weight=1 + [end0] + desired_util=0.60 +[end0] + +[threadgroup0] + num_threads=32 + read_weight=1 + + read_size=4096 + read_blocksize=4096 +[end0] + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config6 b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config6 new file mode 100644 index 00000000..65921779 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config6 @@ -0,0 +1,29 @@ +directio=0 +time=0 + +[filesystem0] + location=mnt_point/ + num_files=1 + num_dirs=1 + max_filesize=409600 + min_filesize=40960 + agefs=1 + [threadgroup0] + num_threads=10 + write_size=409600 + write_blocksize=40960 + create_weight=10 + append_weight=10 + delete_weight=1 + [end0] + desired_util=0.80 +[end0] + +[threadgroup0] + num_threads=32 + read_weight=1 + + read_size=4096 + read_blocksize=4096 +[end0] + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config7 b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config7 new file mode 100644 index 00000000..0f6df51f --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config7 @@ -0,0 +1,29 @@ +directio=0 +time=0 + +[filesystem0] + location=mnt_point/ + num_files=1 + num_dirs=1 + max_filesize=409600 + min_filesize=40960 + agefs=1 + [threadgroup0] + num_threads=10 + write_size=409600 + write_blocksize=40960 + create_weight=10 + append_weight=10 + delete_weight=1 + [end0] + desired_util=1.00 +[end0] + +[threadgroup0] + num_threads=32 + read_weight=1 + + read_size=4096 + read_blocksize=4096 +[end0] + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-inode-version/Makefile b/testcases/kernel/fs/ext4-new-features/ext4-inode-version/Makefile new file mode 100644 index 00000000..6b8aabb9 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-inode-version/Makefile @@ -0,0 +1,25 @@ +# Copyright (C) 2009, FUJITSU LIMITED +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LDLIBS += -lm +INSTALL_TARGETS ?= *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_get_inode_version.sh b/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_get_inode_version.sh new file mode 100755 index 00000000..8f5c9071 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_get_inode_version.sh @@ -0,0 +1,41 @@ +#! /bin/bash + +################################################################################ +# # +# Copyright (c) 2009 FUJITSU LIMITED # +# # +# This program is free software; you can redistribute it and#or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, but # +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # +# for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +################################################################################ + +#$1: inode version of which file +#$2: 1 - return inode version by return value +# !1 - writting inode version to stddev + +inode_version=`debugfs -R "stat $1" $EXT4_DEV | grep 'Version' | awk '{ +print $NF }'` + +# The inode_version's format: '0x0000000a' or '0x00000000:0000000a', +# so delete ':' +inode_version=`echo $inode_version | sed 's/://'` + +inode_version=$(( $inode_version )) + +if [ "$2" == "1" ]; then + exit $inode_version +else + echo $inode_version +fi + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_inode_version_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_inode_version_test.sh new file mode 100755 index 00000000..f27248bd --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_inode_version_test.sh @@ -0,0 +1,205 @@ +#!/bin/bash + +################################################################################ +## ## +## Copyright (c) 2009 FUJITSU LIMITED ## +## ## +## This program is free software; you can redistribute it and#or modify ## +## it under the terms of the GNU General Public License as published by ## +## the Free Software Foundation; either version 2 of the License, or ## +## (at your option) any later version. ## +## ## +## This program is distributed in the hope that it will be useful, but ## +## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## +## for more details. ## +## ## +## You should have received a copy of the GNU General Public License ## +## along with this program; if not, write to the Free Software ## +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## +## ## +## Author: Li Zefan ## +## Miao Xie ## +## ## +################################################################################ + +cd $LTPROOT/testcases/bin + +. ./ext4_funcs.sh + +export TCID="ext4-inode-version" +export TST_TOTAL=8 +export TST_COUNT=1 + +export TEST_DIR=$PWD + +# $1: the test config +read_config $1 + +# Test that inode version is not 32 bits with 128 inode size +ext4_test_128_inode_version() +{ + tst_resm TINFO "Test inode version is 32 bits with 128 inode size" + + mkfs.ext4 -I 128 $EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + + tune2fs -E test_fs -O extents $EXT4_DEV + + mount -t ext4 -o i_version $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount ext4 filesystem" + return 1 + fi + + # inode version > 0 + touch mnt_point/tmp_file + sync + version=`./ext4_get_inode_version.sh tmp_file` + + if [ $version -lt 1 ]; then + tst_resm TFAIL "inode version is smaller than 1" + umount mnt_point + return 1 + fi + + # inode version is 32 bits: 0x00000000 + version=`debugfs $EXT4_DEV -R "stat tmp_file" | grep 'Version'` + version=`echo $version | awk '{ print $NF }'` + version=`echo $version | sed 's/^0x//'` + len=${#version} + + if [ $len -ne 8 ]; then + tst_resm TFAIL "inode version is not 32 bits" + umount mnt_point + return 1 + fi + + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return 1 + fi + + tst_resm TPASS "32 bits inode version with 128 inode size test pass" +} + +# Test file timestamps is nanosecond with 256 inode size +# $1: file operation +test_inode_version() +{ + mkfs.ext3 -I 256 $EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + + tune2fs -E test_fs $EXT4_DEV > /dev/null + + mount -t ext4 -o i_version $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount ext4 filesystem" + return 1 + fi + + # Check the inode version after some file operation + old_version=`./ext4_test_inode_version $1 mnt_point/tmp_file tmp_file` + if [ $? -ne 0 ]; then + tst_resm TFAIL "inode version is wrong" + umount mnt_point + return 1 + fi + + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return 1 + fi + + # Test mount to ext3 and then mount back to ext4 + mount -t ext3 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount to ext3" + return 1 + fi + umount mnt_point + + mount -t ext4 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount back to ext4" + return 1 + fi + + version=`./ext4_get_inode_version.sh tmp_file` +# echo "remount: old - $old_version" +# echo "remount: new - $version" + if [ $old_version -ne $version ]; then + tst_resm TFAIL "inode version has changed unexpected" + umount mnt_point + return 1 + else + tst_resm TPASS "inode version with 256 inode size test pass" + umount mnt_point + fi +} + +# main +ext4_setup + +RET=0 + +ext4_test_128_inode_version +if [ $? -ne 0 ]; then + RET=1 +fi +: $((TST_COUNT++)) + +test_inode_version create +if [ $? -ne 0 ]; then + RET=1 +fi +: $((TST_COUNT++)) + +test_inode_version chmod +if [ $? -ne 0 ]; then + RET=1 +fi +: $((TST_COUNT++)) + +test_inode_version chown +if [ $? -ne 0 ]; then + RET=1 +fi +: $((TST_COUNT++)) + +test_inode_version read +if [ $? -ne 0 ]; then + RET=1 +fi +: $((TST_COUNT++)) + +test_inode_version write +if [ $? -ne 0 ]; then + RET=1 +fi +: $((TST_COUNT++)) + +test_inode_version mmap_read +if [ $? -ne 0 ]; then + RET=1 +fi +: $((TST_COUNT++)) + +test_inode_version mmap_write +if [ $? -ne 0 ]; then + RET=1 +fi +: $((TST_COUNT++)) + +ext4_cleanup + +exit $RET + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_test_inode_version.c b/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_test_inode_version.c new file mode 100644 index 00000000..e9f38409 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_test_inode_version.c @@ -0,0 +1,219 @@ +/******************************************************************************/ +/* */ +/* Copyright (c) 2009 FUJITSU LIMITED */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ +/* the GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* */ +/* Author: Li Zefan */ +/* */ +/******************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +char *filename; +char *filepath; +int fd; + +int old_inode_version; +int new_inode_version; + +int get_inode_version(void) +{ + char buf[1024]; + + sprintf(buf, "./ext4_get_inode_version.sh %s 1", filename); + + /* sync before run debugfs to get inode version */ + sync(); + + return WEXITSTATUS(system(buf)); +} + +void test_chmod(void) +{ + if (fchmod(fd, S_IRUSR | S_IWUSR)) { + fprintf(stderr, "fchmod failed\n"); + exit(1); + } +} + +void test_chown(void) +{ + if (fchown(fd, 1, 1)) { + fprintf(stderr, "fchown failed\n"); + exit(1); + } +} + +void test_read(void) +{ + char buf[2]; + + /* write something before read */ + if (write(fd, "abc", 4) == -1) { + perror("write"); + exit(1); + } + close(fd); + + if (open(filepath, O_RDONLY) == -1) { + perror("open"); + exit(1); + } + + old_inode_version = get_inode_version(); + + if (read(fd, buf, 1) == -1) { + perror("read"); + exit(1); + } +} + +void test_write(void) +{ + if (write(fd, "a", 1) == -1) { + fprintf(stderr, "write failed\n"); + exit(1); + } +} + +void test_mmap_read(void) +{ + char *p; + char c; + + /* write something before read */ + if (write(fd, "abc", 4) == -1) { + perror("write"); + exit(1); + } + close(fd); + + if (open(filepath, O_RDONLY) == -1) { + perror("open"); + exit(1); + } + + old_inode_version = get_inode_version(); + + p = mmap(NULL, 1, PROT_READ, MAP_PRIVATE | MAP_FILE, fd, 0); + if (p == (void *)-1) { + perror("mmap"); + exit(1); + } + c = *p; + + new_inode_version = get_inode_version(); + + msync(p, 1, MS_SYNC); +} + +void test_mmap_write(void) +{ + char *p; + + if (write(fd, "abc", 4) == -1) { + perror("write"); + exit(1); + } + close(fd); + + if (open(filepath, O_RDWR) == -1) { + perror("open"); + exit(1); + } + + old_inode_version = get_inode_version(); + + p = mmap(NULL, 1, PROT_WRITE, + MAP_PRIVATE | MAP_FILE, fd, 0); + if (p == (void *)-1) { + perror("mmap"); + exit(1); + } + *p = 'x'; + + new_inode_version = get_inode_version(); + + msync(p, 1, MS_SYNC); +} + +/** + * argv[1]: file operation + * argv[2]: file to test (with path) + * argv[3]: file to test (without path) + */ +int main(int argc, char *argv[]) +{ + if (argc != 4) { + fprintf(stderr, "wrong argument number\n"); + return 1; + } + filepath = argv[2]; + filename = argv[3]; + + /* create file and get the initial inode version */ + fd = creat(argv[2], O_RDWR); + if (fd == -1) { + fprintf(stderr, "failed to create file: %s\n", argv[2]); + return 1; + } + + old_inode_version = get_inode_version(); + + if (strcmp(argv[1], "create") == 0) { + printf("%d\n", old_inode_version); + return 0; + } else if (strcmp(argv[1], "chmod") == 0) { + test_chmod(); + } else if (strcmp(argv[1], "chown") == 0) { + test_chown(); + } else if (strcmp(argv[1], "read") == 0) { + test_read(); + } else if (strcmp(argv[1], "write") == 0) { + test_write(); + } else if (strcmp(argv[1], "mmap_read") == 0) { + test_mmap_read(); + } else if (strcmp(argv[1], "mmap_write") == 0) { + test_mmap_write(); + } else { + fprintf(stderr, "wrong file operation: %s\n", argv[1]); + return 1; + } + + new_inode_version = get_inode_version(); +#if 0 + fprintf(stderr, "test_inode_version: old - %d\n", old_inode_version); + fprintf(stderr, "test_inode_version: new - %d\n", new_inode_version); +#endif + /* wrong inode version, test failed */ + if (new_inode_version <= old_inode_version) + return 1; + + printf("%d\n", new_inode_version); + + close(fd); + + return 0; +} + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/Makefile b/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/Makefile new file mode 100644 index 00000000..1980349a --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/Makefile @@ -0,0 +1,25 @@ +# Copyright (C) 2009, Fujitsu LIMITED +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +MAKE_TARGETS := +INSTALL_TARGETS ?= *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh b/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh new file mode 100755 index 00000000..550afa15 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh @@ -0,0 +1,148 @@ +#!/bin/bash + +################################################################################ +## ## +## Copyright (c) 2009 FUJITSU LIMITED ## +## ## +## This program is free software; you can redistribute it and#or modify ## +## it under the terms of the GNU General Public License as published by ## +## the Free Software Foundation; either version 2 of the License, or ## +## (at your option) any later version. ## +## ## +## This program is distributed in the hope that it will be useful, but ## +## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## +## for more details. ## +## ## +## You should have received a copy of the GNU General Public License ## +## along with this program; if not, write to the Free Software ## +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## +## ## +## Author: Li Zefan ## +## Miao Xie ## +## ## +################################################################################ + +cd $LTPROOT/testcases/bin + +. ./ext4_funcs.sh + +export TCID="ext4-journal-checksum" +export TST_TOTAL=36 +export TST_COUNT=1 + +# $1: the test config + +export TEST_DIR=$PWD + +read_config $1 + +# Use ffsb to test journal checksumming +# $1: journal mode: writeback, ordered, journal +# $2: commit interval: 1 sec, 100 sec +# $3: journal_checksum or not +# $4: journal_async_commit or not +# $5: barrier: 0, 1 +ext4_test_journal_checksum() +{ + local checksum= + local async_commit= + + if [ "$3" == "" ]; then + checksum="No use" + else + checksum="Used" + fi + if [ "$4" == "" ]; then + async_commit="No use" + else + async_commit="Used" + fi + + tst_resm TINFO "journal mode: $1, commit interval: $2, \ + journal_checksum: $checksum, \ + journal_async_commit: $async_commit, barrier: $5" + + mkfs.ext4 -I 256 $EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + + tune2fs -E test_fs -O extents $EXT4_DEV + + mount -t ext4 -o data=$1,commit=$2,$3,$4,barrier=$5 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount ext4 filesystem" + return 1 + fi + + ./ffsb ffsb-config2 > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "ffsb returned failure" + umount mnt_point + return 1 + fi + + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return 1 + fi + + e2fsck -p $EXT4_DEV + if [ $? -ne 0 ]; then + tst_resm TFAIL "fsck returned failure" + return 1 + fi + + tst_resm TPASS "ext4 journal checksum test pass" +} + +# main +ext4_setup + +DATA=( "writeback" "ordered" "journal" ) +COMMIT=( 1 100 ) +JOURNAL_CHECKSUM=( "journal_checksum" "" ) +JOURNAL_ASYNC_COMMIT=( "journal_async_commit" "" ) +BARRIER=( 0 1 ) + +RET=0 + +for ((i = 0; i < 2; i++)) +{ + for ((j = 0; j < 2; j++)) + { + for ((k = 0; k < 2; k++)) + { + for ((l = 0; l < 2; l++)) + { + for ((m = 0; m < 3; m++)) + { + + # when journal_async_commit is used, + # journal_checksum is set automatically + if [ $j -eq 0 -a $k -eq 1 ]; then + continue + fi + + ext4_test_journal_checksum ${DATA[$m]} \ + ${COMMIT[$l]} \ + "${JOURNAL_CHECKSUM[$k]}" \ + "${JOURNAL_ASYNC_COMMIT[$j]}" \ + ${BARRIER[$i]} + if [ $? -ne 0 ]; then + RET=1 + fi + + : $((TST_COUNT++)) + } + } + } + } +} + +ext4_cleanup + +exit $RET diff --git a/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/Makefile b/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/Makefile new file mode 100644 index 00000000..6b8aabb9 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/Makefile @@ -0,0 +1,25 @@ +# Copyright (C) 2009, FUJITSU LIMITED +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LDLIBS += -lm +INSTALL_TARGETS ?= *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_file_time.c b/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_file_time.c new file mode 100644 index 00000000..faa93838 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_file_time.c @@ -0,0 +1,70 @@ +/******************************************************************************/ +/* */ +/* Copyright (c) 2009 FUJITSU LIMITED */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ +/* the GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* */ +/* Author: Li Zefan */ +/* */ +/******************************************************************************/ + +#include +#include +#include +#include +#include + +/* + * Usage: file_time + */ +int main(int argc, char *argv[]) +{ + time_t t; + struct stat st; + + if (argc != 4) { + fprintf(stderr, "Wrong argument num!\n"); + return 1; + } + + if (stat(argv[1], &st) != 0) { + perror("stat failed"); + return 1; + } + + if (strcmp(argv[3], "sec") == 0) { + if (strcmp(argv[2], "atime") == 0) + t = st.st_atime; + else if (strcmp(argv[2], "mtime") == 0) + t = st.st_mtime; + else + t = st.st_ctime; + } else if (strcmp(argv[3], "nsec") == 0) { + if (strcmp(argv[2], "atime") == 0) + t = st.st_atim.tv_nsec; + else if (strcmp(argv[2], "mtime") == 0) + t = st.st_mtim.tv_nsec; + else + t = st.st_ctim.tv_nsec; + } else { + fprintf(stderr, "Wrong argument: %s\n", argv[3]); + return 1; + } + + printf("%lu\n", t); + + return 0; +} + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh new file mode 100755 index 00000000..ad7729ec --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh @@ -0,0 +1,196 @@ +#!/bin/bash + +################################################################################ +## ## +## Copyright (c) 2009 FUJITSU LIMITED ## +## ## +## This program is free software; you can redistribute it and#or modify ## +## it under the terms of the GNU General Public License as published by ## +## the Free Software Foundation; either version 2 of the License, or ## +## (at your option) any later version. ## +## ## +## This program is distributed in the hope that it will be useful, but ## +## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## +## for more details. ## +## ## +## You should have received a copy of the GNU General Public License ## +## along with this program; if not, write to the Free Software ## +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## +## ## +## Author: Li Zefan ## +## Miao Xie ## +## ## +################################################################################ + +cd $LTPROOT/testcases/bin + +. ./ext4_funcs.sh + +export TCID="ext4-nsec-timestamps" +export TST_TOTAL=2 +export TST_COUNT=1 + +# $1: the test config +read_config $1 + +TEST_DIR=$PWD + +# Test that file timestamps is second with 128 inode size +ext4_test_sec_timestamps() +{ + tst_resm TINFO "Test timestamps with 128 inode size" + + mkfs.ext4 -I 128 $EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + + tune2fs -E test_fs -O extents $EXT4_DEV + + mount -t ext4 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount ext4 filesystem" + return 1 + fi + + touch mnt_point/tmp_file + + atime=`./ext4_file_time mnt_point/tmp_file atime nsec` + mtime=`./ext4_file_time mnt_point/tmp_file mtime nsec` + ctime=`./ext4_file_time mnt_point/tmp_file ctime nsec` + + if [ $atime -ne 0 -o $mtime -ne 0 -o $ctime -ne 0 ]; then + tst_resm TFAIL "Timestamp is not second(atime: $atime, mtime: \ + $mtime, ctime: $ctime)" + umount mnt_point + return 1 + fi + + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return 1 + fi + + tst_resm TPASS "Ext4 nanosecond timestamps test with 128 inode size pass" +} + +# Test file timestamps is nanosecond with 256 inode size +ext4_test_nsec_timestamps() +{ + tst_resm TINFO "Test timestamps with 256 inode size" + + mkfs.ext3 -I 256 $EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + + tune2fs -E test_fs $EXT4_DEV + + mount -t ext4 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount ext4 filesystem" + return 1 + fi + + # Create file + touch mnt_point/tmp_file + sleep 1 + + # Change atime, ctime and mtime of the file + touch mnt_point/tmp_file + + cur_time=`date '+%s %N'` + sec=`echo $cur_time | awk {'print $1'}` + nsec=`echo $cur_time | awk {'print $2'}` + + sec_atime=`./ext4_file_time mnt_point/tmp_file atime sec` + sec_mtime=`./ext4_file_time mnt_point/tmp_file mtime sec` + sec_ctime=`./ext4_file_time mnt_point/tmp_file ctime sec` + nsec_atime=`./ext4_file_time mnt_point/tmp_file atime nsec` + nsec_mtime=`./ext4_file_time mnt_point/tmp_file mtime nsec` + nsec_ctime=`./ext4_file_time mnt_point/tmp_file ctime nsec` + + # Test nanosecond + if [ $nsec_atime -eq 0 -a $nsec_mtime -eq 0 -a $nsec_ctime -eq 0 ] + then + tst_resm TFAIL "The timestamp is not nanosecond(nsec_atime: $nsec_atime, nsec_mtime: $nsec_mtime, nsec_ctime: $nsec_ctime)" + umount mnt_point + return 1 + fi + + diff1=$(( $sec_atime - $sec )) + diff2=$(( $sec_mtime - $sec )) + diff3=$(( $sec_ctime - $sec )) + + # Test difference between file time and current time + if [ $diff1 -gt 1 -o $diff2 -gt 1 -o $diff2 -gt 1 ]; then + tst_resm TFAIL "The timestamp is wrong, it must be earlier \ + than the current time we got.(sec_atime: $sec_atime, \ + sec_mtime: $sec_mtime, sec_ctime: $sec_ctime, \ + cur_time[s]: $sec)" + umount mnt_point + return 1 + fi + + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return 1 + fi + + # Test mount to ext3 and then mount back to ext4 + mount -t ext3 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount to ext3" + return 1 + fi + umount mnt_point + + mount -t ext4 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount back to ext4" + return 1 + fi + + nsec_atime2=`./ext4_file_time mnt_point/tmp_file atime nsec` + nsec_mtime2=`./ext4_file_time mnt_point/tmp_file mtime nsec` + nsec_ctime2=`./ext4_file_time mnt_point/tmp_file mtime nsec` + + if [ $nsec_atime -ne $nsec_atime2 -o $nsec_ctime -ne $nsec_ctime2 -o \ + $nsec_mtime -ne $nsec_mtime2 ]; then + tst_resm TFAIL "File nanosecond timestamp has changed \ + unexpected. Before[atime mtime ctime]: $nsec_atime \ + $nsec_mtime $nsec_ctime, After[atime mtime ctime]: \ + $nsec_atime2 $nsec_mtime2 $nsec_ctime2)" + umount mnt_point + return 1 + fi + + umount mnt_point + tst_resm TPASS "Ext4 nanosecond timestamps test with 256 inode size pass" +} + +# main +ext4_setup + +RET=0 + +ext4_test_sec_timestamps +if [$? -ne 0 ]; then + RET=1 +fi +: $((TST_COUNT++)) + +ext4_test_nsec_timestamps +if [$? -ne 0 ]; then + RET=1 +fi +: $((TST_COUNT++)) + +ext4_cleanup +exit $RET + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/Makefile b/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/Makefile new file mode 100644 index 00000000..6b8aabb9 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/Makefile @@ -0,0 +1,25 @@ +# Copyright (C) 2009, FUJITSU LIMITED +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LDLIBS += -lm +INSTALL_TARGETS ?= *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c b/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c new file mode 100644 index 00000000..05d6893d --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/e4defrag.c @@ -0,0 +1,2171 @@ +/* + * e4defrag.c - ext4 filesystem defragmenter + * + * Copyright (C) 2009 NEC Software Tohoku, Ltd. + * + * Author: Akira Fujita + * Takashi Sato + */ + +#ifndef _LARGEFILE_SOURCE +#define _LARGEFILE_SOURCE +#endif + +#ifndef _LARGEFILE64_SOURCE +#define _LARGEFILE64_SOURCE +#endif + +#define _XOPEN_SOURCE 500 +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Ioctl command */ +#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap) +#define EXT4_IOC_MOVE_EXT _IOWR('f', 15, struct move_extent) + +/* Macro functions */ +#define PRINT_ERR_MSG(msg) fprintf(stderr, "%s\n", (msg)) +#define IN_FTW_PRINT_ERR_MSG(msg) \ + fprintf(stderr, "\t%s\t\t[ NG ]\n", (msg)) +#define PRINT_FILE_NAME(file) fprintf(stderr, " \"%s\"\n", (file)) +#define PRINT_ERR_MSG_WITH_ERRNO(msg) \ + fprintf(stderr, "\t%s:%s\t[ NG ]\n", (msg), strerror(errno)) +#define STATISTIC_ERR_MSG(msg) \ + fprintf(stderr, "\t%s\n", (msg)) +#define STATISTIC_ERR_MSG_WITH_ERRNO(msg) \ + fprintf(stderr, "\t%s:%s\n", (msg), strerror(errno)) +#define min(x, y) (((x) > (y)) ? (y) : (x)) +#define SECTOR_TO_BLOCK(sectors, blocksize) \ + ((sectors) / ((blocksize) >> 9)) +#define CALC_SCORE(ratio) \ + ((ratio) > 10 ? (80 + 20 * (ratio) / 100) : (8 * (ratio))) +/* Wrap up the free function */ +#define FREE(tmp) \ + do { \ + if ((tmp) != NULL) \ + free(tmp); \ + } while (0) \ +/* Insert list2 after list1 */ +#define insert(list1, list2) \ + do { \ + list2->next = list1->next; \ + list1->next->prev = list2; \ + list2->prev = list1; \ + list1->next = list2; \ + } while (0) + +/* To delete unused warning */ +#ifdef __GNUC__ +#define EXT2FS_ATTR(x) __attribute__(x) +#else +#define EXT2FS_ATTR(x) +#endif + +#ifndef __NR_fadvise64 +#define __NR_fadvise64 250 +#endif + +#ifndef __NR_sync_file_range +#define __NR_sync_file_range 314 +#endif + +#ifndef __NR_fallocate +#define __NR_fallocate 324 +#endif + +#ifndef POSIX_FADV_DONTNEED +#if defined(__s390x__) +#define POSIX_FADV_DONTNEED 6 /* Don't need these pages */ +#else +#define POSIX_FADV_DONTNEED 4 /* Don't need these pages */ +#endif +#endif + +#ifndef SYNC_FILE_RANGE_WAIT_BEFORE +#define SYNC_FILE_RANGE_WAIT_BEFORE 1 +#endif +#ifndef SYNC_FILE_RANGE_WRITE +#define SYNC_FILE_RANGE_WRITE 2 +#endif +#ifndef SYNC_FILE_RANGE_WAIT_AFTER +#define SYNC_FILE_RANGE_WAIT_AFTER 4 +#endif + +/* The mode of defrag */ +#define DETAIL 0x01 +#define STATISTIC 0x02 + +#define DEVNAME 0 +#define DIRNAME 1 +#define FILENAME 2 + +#define FTW_OPEN_FD 2000 + +#define FS_EXT4 "ext4" +#define ROOT_UID 0 + +#define BOUND_SCORE 55 +#define SHOW_FRAG_FILES 5 + +/* Magic number for ext4 */ +#define EXT4_SUPER_MAGIC 0xEF53 + +/* Definition of flex_bg */ +#define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 + +/* The following four macros are used for ioctl FS_IOC_FIEMAP + * FIEMAP_FLAG_SYNC: sync file data before map. + * FIEMAP_EXTENT_LAST: last extent in file. + * FIEMAP_MAX_OFFSET: max file offset. + * EXTENT_MAX_COUNT: the maximum number of extents for exchanging between + * kernel-space and user-space per ioctl + */ +#define FIEMAP_FLAG_SYNC 0x00000001 +#define FIEMAP_EXTENT_LAST 0x00000001 +#define FIEMAP_EXTENT_UNWRITTEN 0x00000800 +#define FIEMAP_MAX_OFFSET (~0ULL) +#define EXTENT_MAX_COUNT 512 + +/* The following macros are error message */ +#define MSG_USAGE \ +"Usage : e4defrag [-v] file...| directory...| device...\n\ + : e4defrag -c file...| directory...| device...\n" + +#define NGMSG_EXT4 "Filesystem is not ext4 filesystem" +#define NGMSG_FILE_EXTENT "Failed to get file extents" +#define NGMSG_FILE_INFO "Failed to get file information" +#define NGMSG_FILE_OPEN "Failed to open" +#define NGMSG_FILE_UNREG "File is not regular file" +#define NGMSG_LOST_FOUND "Can not process \"lost+found\"" + +/* Data type for filesystem-wide blocks number */ +typedef unsigned long long ext4_fsblk_t; + +struct fiemap_extent_data { + __u64 len; /* blocks count */ + __u64 logical; /* start logical block number */ + ext4_fsblk_t physical; /* start physical block number */ +}; + +struct fiemap_extent_list { + struct fiemap_extent_list *prev; + struct fiemap_extent_list *next; + struct fiemap_extent_data data; /* extent belong to file */ +}; + +struct fiemap_extent_group { + struct fiemap_extent_group *prev; + struct fiemap_extent_group *next; + __u64 len; /* length of this continuous region */ + struct fiemap_extent_list *start; /* start ext */ + struct fiemap_extent_list *end; /* end ext */ +}; + +struct move_extent { + __s32 reserved; /* original file descriptor */ + __u32 donor_fd; /* donor file descriptor */ + __u64 orig_start; /* logical start offset in block for orig */ + __u64 donor_start; /* logical start offset in block for donor */ + __u64 len; /* block length to be moved */ + __u64 moved_len; /* moved block length */ +}; + +struct fiemap_extent { + __u64 fe_logical; /* logical offset in bytes for the start of + * the extent from the beginning of the file */ + __u64 fe_physical; /* physical offset in bytes for the start + * of the extent from the beginning + * of the disk */ + __u64 fe_length; /* length in bytes for this extent */ + __u64 fe_reserved64[2]; + __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */ + __u32 fe_reserved[3]; +}; + +struct fiemap { + __u64 fm_start; /* logical offset (inclusive) at + * which to start mapping (in) */ + __u64 fm_length; /* logical length of mapping which + * userspace wants (in) */ + __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */ + __u32 fm_mapped_extents;/* number of extents that were mapped (out) */ + __u32 fm_extent_count; /* size of fm_extents array (in) */ + __u32 fm_reserved; + struct fiemap_extent fm_extents[0];/* array of mapped extents (out) */ +}; + +struct frag_statistic_ino { + int now_count; /* the file's extents count of before defrag */ + int best_count; /* the best file's extents count */ + float ratio; /* the ratio of fragmentation */ + char msg_buffer[PATH_MAX + 1]; /* pathname of the file */ +}; + +typedef __u16 __le16; +typedef __u32 __le32; +typedef __u64 __le64; + +/* + * Structure of the super block + */ +struct ext4_super_block { +/*00*/ __le32 s_inodes_count; /* Inodes count */ + __le32 s_blocks_count_lo; /* Blocks count */ + __le32 s_r_blocks_count_lo; /* Reserved blocks count */ + __le32 s_free_blocks_count_lo; /* Free blocks count */ +/*10*/ __le32 s_free_inodes_count; /* Free inodes count */ + __le32 s_first_data_block; /* First Data Block */ + __le32 s_log_block_size; /* Block size */ + __le32 s_obso_log_frag_size; /* Obsoleted fragment size */ +/*20*/ __le32 s_blocks_per_group; /* # Blocks per group */ + __le32 s_obso_frags_per_group; /* Obsoleted fragments per group */ + __le32 s_inodes_per_group; /* # Inodes per group */ + __le32 s_mtime; /* Mount time */ +/*30*/ __le32 s_wtime; /* Write time */ + __le16 s_mnt_count; /* Mount count */ + __le16 s_max_mnt_count; /* Maximal mount count */ + __le16 s_magic; /* Magic signature */ + __le16 s_state; /* File system state */ + __le16 s_errors; /* Behaviour when detecting errors */ + __le16 s_minor_rev_level; /* minor revision level */ +/*40*/ __le32 s_lastcheck; /* time of last check */ + __le32 s_checkinterval; /* max. time between checks */ + __le32 s_creator_os; /* OS */ + __le32 s_rev_level; /* Revision level */ +/*50*/ __le16 s_def_resuid; /* Default uid for reserved blocks */ + __le16 s_def_resgid; /* Default gid for reserved blocks */ + /* + * These fields are for EXT4_DYNAMIC_REV superblocks only. + * + * Note: the difference between the compatible feature set and + * the incompatible feature set is that if there is a bit set + * in the incompatible feature set that the kernel doesn't + * know about, it should refuse to mount the filesystem. + * + * e2fsck's requirements are more strict; if it doesn't know + * about a feature in either the compatible or incompatible + * feature set, it must abort and not try to meddle with + * things it doesn't understand... + */ + __le32 s_first_ino; /* First non-reserved inode */ + __le16 s_inode_size; /* size of inode structure */ + __le16 s_block_group_nr; /* block group # of this superblock */ + __le32 s_feature_compat; /* compatible feature set */ +/*60*/ __le32 s_feature_incompat; /* incompatible feature set */ + __le32 s_feature_ro_compat; /* readonly-compatible feature set */ +/*68*/ __u8 s_uuid[16]; /* 128-bit uuid for volume */ +/*78*/ char s_volume_name[16]; /* volume name */ +/*88*/ char s_last_mounted[64]; /* directory where last mounted */ +/*C8*/ __le32 s_algorithm_usage_bitmap; /* For compression */ + /* + * Performance hints. Directory preallocation should only + * happen if the EXT4_FEATURE_COMPAT_DIR_PREALLOC flag is on. + */ + __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ + __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ + __le16 s_reserved_gdt_blocks; /* Per group desc for online growth */ + /* + * Journaling support valid if EXT4_FEATURE_COMPAT_HAS_JOURNAL set. + */ +/*D0*/ __u8 s_journal_uuid[16]; /* uuid of journal superblock */ +/*E0*/ __le32 s_journal_inum; /* inode number of journal file */ + __le32 s_journal_dev; /* device number of journal file */ + __le32 s_last_orphan; /* start of list of inodes to delete */ + __le32 s_hash_seed[4]; /* HTREE hash seed */ + __u8 s_def_hash_version; /* Default hash version to use */ + __u8 s_reserved_char_pad; + __le16 s_desc_size; /* size of group descriptor */ +/*100*/ __le32 s_default_mount_opts; + __le32 s_first_meta_bg; /* First metablock block group */ + __le32 s_mkfs_time; /* When the filesystem was created */ + __le32 s_jnl_blocks[17]; /* Backup of the journal inode */ + /* 64bit support valid if EXT4_FEATURE_COMPAT_64BIT */ +/*150*/ __le32 s_blocks_count_hi; /* Blocks count */ + __le32 s_r_blocks_count_hi; /* Reserved blocks count */ + __le32 s_free_blocks_count_hi; /* Free blocks count */ + __le16 s_min_extra_isize; /* All inodes have at least # bytes */ + __le16 s_want_extra_isize; /* New inodes should reserve # bytes */ + __le32 s_flags; /* Miscellaneous flags */ + __le16 s_raid_stride; /* RAID stride */ + __le16 s_mmp_interval; /* # seconds to wait in MMP checking */ + __le64 s_mmp_block; /* Block for multi-mount protection */ + __le32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/ + __u8 s_log_groups_per_flex; /* FLEX_BG group size */ + __u8 s_reserved_char_pad2; + __le16 s_reserved_pad; + __u32 s_reserved[162]; /* Padding to the end of the block */ +}; + +char lost_found_dir[PATH_MAX + 1]; +int block_size; +int extents_before_defrag; +int extents_after_defrag; +int mode_flag; +unsigned int current_uid; +unsigned int defraged_file_count; +unsigned int frag_files_before_defrag; +unsigned int frag_files_after_defrag; +unsigned int regular_count; +unsigned int succeed_cnt; +unsigned int total_count; +__u8 log_groups_per_flex; +__le32 blocks_per_group; +__le32 feature_incompat; +ext4_fsblk_t files_block_count; +struct frag_statistic_ino frag_rank[SHOW_FRAG_FILES]; + +/* + * ext2fs_swab32() - Change endian. + * + * @val: the entry used for change. + */ +__u32 ext2fs_swab32(__u32 val) +{ +#if BYTE_ORDER == BIG_ENDIAN + return (val >> 24) | ((val >> 8) & 0xFF00) | + ((val << 8) & 0xFF0000) | (val << 24); +#else + return val; +#endif +} + +/* + * fadvise() - Give advice about file access. + * + * @fd: defrag target file's descriptor. + * @offset: file offset. + * @len: area length. + * @advise: process flag. + */ +int fadvise(int fd, loff_t offset, size_t len, int advise) +{ + return syscall(__NR_fadvise64, fd, offset, len, advise); +} + +/* + * sync_file_range() - Sync file region. + * + * @fd: defrag target file's descriptor. + * @offset: file offset. + * @length: area length. + * @flag: process flag. + */ +int sync_file_range(int fd, loff_t offset, loff_t length, unsigned int flag) +{ + return syscall(__NR_sync_file_range, fd, offset, length, flag); +} + +/* + * fallocate() - Manipulate file space. + * + * @fd: defrag target file's descriptor. + * @mode: process flag. + * @offset: file offset. + * @len: file size. + */ +int fallocate(int fd, int mode, loff_t offset, loff_t len) +{ + return syscall(__NR_fallocate, fd, mode, offset, len); +} + +/* + * get_mount_point() - Get device's mount point. + * + * @devname: the device's name. + * @mount_point: the mount point. + * @dir_path_len: the length of directory. + */ +int get_mount_point(const char *devname, char *mount_point, int dir_path_len) +{ + /* Refer to /etc/mtab */ + char *mtab = MOUNTED; + FILE *fp = NULL; + struct mntent *mnt = NULL; + + fp = setmntent(mtab, "r"); + if (fp == NULL) { + perror("Couldn't access /etc/mtab"); + return -1; + } + + while ((mnt = getmntent(fp)) != NULL) { + if (strcmp(devname, mnt->mnt_fsname) != 0) + continue; + + endmntent(fp); + if (strcmp(mnt->mnt_type, FS_EXT4) == 0) { + strncpy(mount_point, mnt->mnt_dir, + dir_path_len); + return 0; + } + PRINT_ERR_MSG(NGMSG_EXT4); + return -1; + } + endmntent(fp); + PRINT_ERR_MSG("Filesystem is not mounted"); + return -1; +} + +/* + * is_ext4() - Whether on an ext4 filesystem. + * + * @file: the file's name. + */ +int is_ext4(const char *file) +{ + int maxlen = 0; + int len, ret; + FILE *fp = NULL; + char *mnt_type = NULL; + /* Refer to /etc/mtab */ + char *mtab = MOUNTED; + char file_path[PATH_MAX + 1]; + struct mntent *mnt = NULL; + struct statfs64 fsbuf; + + /* Get full path */ + if (realpath(file, file_path) == NULL) { + perror("Couldn't get full path"); + PRINT_FILE_NAME(file); + return -1; + } + + if (statfs64(file_path, &fsbuf) < 0) { + perror("Failed to get filesystem information"); + PRINT_FILE_NAME(file); + return -1; + } + + if (fsbuf.f_type != EXT4_SUPER_MAGIC) { + PRINT_ERR_MSG(NGMSG_EXT4); + return -1; + } + + fp = setmntent(mtab, "r"); + if (fp == NULL) { + perror("Couldn't access /etc/mtab"); + return -1; + } + + while ((mnt = getmntent(fp)) != NULL) { + len = strlen(mnt->mnt_dir); + ret = memcmp(file_path, mnt->mnt_dir, len); + if (ret != 0) + continue; + + if (maxlen >= len) + continue; + + maxlen = len; + + mnt_type = realloc(mnt_type, strlen(mnt->mnt_type) + 1); + if (mnt_type == NULL) { + endmntent(fp); + return -1; + } + memset(mnt_type, 0, strlen(mnt->mnt_type) + 1); + strncpy(mnt_type, mnt->mnt_type, strlen(mnt->mnt_type)); + strncpy(lost_found_dir, mnt->mnt_dir, PATH_MAX); + } + + endmntent(fp); + if (strcmp(mnt_type, FS_EXT4) == 0) { + FREE(mnt_type); + return 0; + } else { + FREE(mnt_type); + PRINT_ERR_MSG(NGMSG_EXT4); + return -1; + } +} + +/* + * calc_entry_counts() - Calculate file counts. + * + * @file: file name. + * @buf: file info. + * @flag: file type. + * @ftwbuf: the pointer of a struct FTW. + */ +int calc_entry_counts(const char *file EXT2FS_ATTR((unused)), + const struct stat64 *buf, int flag EXT2FS_ATTR((unused)), + struct FTW *ftwbuf EXT2FS_ATTR((unused))) +{ + if (S_ISREG(buf->st_mode)) + regular_count++; + + total_count++; + + return 0; +} + +/* + * page_in_core() - Get information on whether pages are in core. + * + * @fd: defrag target file's descriptor. + * @defrag_data: data used for defrag. + * @vec: page state array. + * @page_num: page number. + */ +int page_in_core(int fd, struct move_extent defrag_data, + unsigned char **vec, unsigned int *page_num) +{ + long pagesize = sysconf(_SC_PAGESIZE); + void *page = NULL; + loff_t offset, end_offset, length; + + if (vec == NULL || *vec != NULL) + return -1; + + /* In mmap, offset should be a multiple of the page size */ + offset = (loff_t)defrag_data.orig_start * block_size; + length = (loff_t)defrag_data.len * block_size; + end_offset = offset + length; + /* Round the offset down to the nearest multiple of pagesize */ + offset = (offset / pagesize) * pagesize; + length = end_offset - offset; + + page = mmap(NULL, length, PROT_READ, MAP_SHARED, fd, offset); + if (page == MAP_FAILED) + return -1; + + *page_num = 0; + *page_num = (length + pagesize - 1) / pagesize; + *vec = (unsigned char *)calloc(*page_num, 1); + if (*vec == NULL) + return -1; + + /* Get information on whether pages are in core */ + if (mincore(page, (size_t)length, *vec) == -1 || + munmap(page, length) == -1) { + FREE(*vec); + return -1; + } + + return 0; +} + +/* + * defrag_fadvise() - Predeclare an access pattern for file data. + * + * @fd: defrag target file's descriptor. + * @defrag_data: data used for defrag. + * @vec: page state array. + * @page_num: page number. + */ +int defrag_fadvise(int fd, struct move_extent defrag_data, + unsigned char *vec, unsigned int page_num) +{ + int flag = 1; + long pagesize = sysconf(_SC_PAGESIZE); + int fadvise_flag = POSIX_FADV_DONTNEED; + int sync_flag = SYNC_FILE_RANGE_WAIT_BEFORE | + SYNC_FILE_RANGE_WRITE | + SYNC_FILE_RANGE_WAIT_AFTER; + unsigned int i; + loff_t offset; + + offset = (loff_t)defrag_data.orig_start * block_size; + offset = (offset / pagesize) * pagesize; + + /* Sync file for fadvise process */ + if (sync_file_range(fd, offset, + (loff_t)pagesize * page_num, sync_flag) < 0) + return -1; + + /* Try to release buffer cache which this process used, + * then other process can use the released buffer + */ + for (i = 0; i < page_num; i++) { + if ((vec[i] & 0x1) == 0) { + offset += pagesize; + continue; + } + if (fadvise(fd, offset, pagesize, fadvise_flag) < 0) { + if ((mode_flag & DETAIL) && flag) { + perror("\tFailed to fadvise"); + flag = 0; + } + } + offset += pagesize; + } + + return 0; +} + +/* + * check_free_size() - Check if there's enough disk space. + * + * @fd: defrag target file's descriptor. + * @file: file name. + * @buf: the pointer of the struct stat64. + */ +int check_free_size(int fd, const char *file, const struct stat64 *buf) +{ + ext4_fsblk_t blk_count; + ext4_fsblk_t free_blk_count; + struct statfs64 fsbuf; + + if (fstatfs64(fd, &fsbuf) < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO( + "Failed to get filesystem information"); + } + return -1; + } + + /* Target file size measured by filesystem IO blocksize */ + blk_count = SECTOR_TO_BLOCK(buf->st_blocks, fsbuf.f_bsize); + + /* Compute free space for root and normal user separately */ + if (current_uid == ROOT_UID) + free_blk_count = fsbuf.f_bfree; + else + free_blk_count = fsbuf.f_bavail; + + if (free_blk_count >= blk_count) + return 0; + + return -ENOSPC; +} + +/* + * file_frag_count() - Get file fragment count. + * + * @fd: defrag target file's descriptor. + */ +int file_frag_count(int fd) +{ + int ret; + struct fiemap fiemap_buf; + + /* When fm_extent_count is 0, + * ioctl just get file fragment count. + */ + memset(&fiemap_buf, 0, sizeof(struct fiemap)); + fiemap_buf.fm_start = 0; + fiemap_buf.fm_length = FIEMAP_MAX_OFFSET; + fiemap_buf.fm_flags |= FIEMAP_FLAG_SYNC; + + ret = ioctl(fd, FS_IOC_FIEMAP, &fiemap_buf); + if (ret < 0) + return ret; + + return fiemap_buf.fm_mapped_extents; +} + +/* + * file_check() - Check file's attributes. + * + * @fd: defrag target file's descriptor. + * @buf: a pointer of the struct stat64. + * @file: the file's name. + * @extents: the file's extents. + */ +int file_check(int fd, const struct stat64 *buf, const char *file, + int extents) +{ + int ret; + struct flock lock; + + /* Write-lock check is more reliable */ + lock.l_type = F_WRLCK; + lock.l_start = 0; + lock.l_whence = SEEK_SET; + lock.l_len = 0; + + /* Free space */ + ret = check_free_size(fd, file, buf); + if (ret < 0) { + if ((mode_flag & DETAIL) && ret == -ENOSPC) { + printf("\033[79;0H\033[K[%u/%u] \"%s\"\t\t" + " extents: %d -> %d\n", defraged_file_count, + total_count, file, extents, extents); + IN_FTW_PRINT_ERR_MSG( + "Defrag size is larger than filesystem's free space"); + } + return -1; + } + + /* Access authority */ + if (current_uid != ROOT_UID && + buf->st_uid != current_uid) { + if (mode_flag & DETAIL) { + printf("\033[79;0H\033[K[%u/%u] \"%s\"\t\t" + " extents: %d -> %d\n", defraged_file_count, + total_count, file, extents, extents); + IN_FTW_PRINT_ERR_MSG( + "File is not current user's file" + " or current user is not root"); + } + return -1; + } + + /* Lock status */ + if (fcntl(fd, F_GETLK, &lock) < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO( + "Failed to get lock information"); + } + return -1; + } else if (lock.l_type != F_UNLCK) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + IN_FTW_PRINT_ERR_MSG("File has been locked"); + } + return -1; + } + + return 0; +} + +/* + * insert_extent_by_logical() - Sequentially insert extent by logical. + * + * @ext_list_head: the head of logical extent list. + * @ext: the extent element which will be inserted. + */ +int insert_extent_by_logical(struct fiemap_extent_list **ext_list_head, + struct fiemap_extent_list *ext) +{ + struct fiemap_extent_list *ext_list_tmp = *ext_list_head; + + if (ext == NULL) + goto out; + + /* First element */ + if (*ext_list_head == NULL) { + (*ext_list_head) = ext; + (*ext_list_head)->prev = *ext_list_head; + (*ext_list_head)->next = *ext_list_head; + return 0; + } + + if (ext->data.logical <= ext_list_tmp->data.logical) { + /* Insert before head */ + if (ext_list_tmp->data.logical < + ext->data.logical + ext->data.len) + /* Overlap */ + goto out; + /* Adjust head */ + *ext_list_head = ext; + } else { + /* Insert into the middle or last of the list */ + do { + if (ext->data.logical < ext_list_tmp->data.logical) + break; + ext_list_tmp = ext_list_tmp->next; + } while (ext_list_tmp != (*ext_list_head)); + if (ext->data.logical < + ext_list_tmp->prev->data.logical + + ext_list_tmp->prev->data.len) + /* Overlap */ + goto out; + + if (ext_list_tmp != *ext_list_head && + ext_list_tmp->data.logical < + ext->data.logical + ext->data.len) + /* Overlap */ + goto out; + } + ext_list_tmp = ext_list_tmp->prev; + /* Insert "ext" after "ext_list_tmp" */ + insert(ext_list_tmp, ext); + return 0; +out: + errno = EINVAL; + return -1; +} + +/* + * insert_extent_by_physical() - Sequentially insert extent by physical. + * + * @ext_list_head: the head of physical extent list. + * @ext: the extent element which will be inserted. + */ +int insert_extent_by_physical(struct fiemap_extent_list **ext_list_head, + struct fiemap_extent_list *ext) +{ + struct fiemap_extent_list *ext_list_tmp = *ext_list_head; + + if (ext == NULL) + goto out; + + /* First element */ + if (*ext_list_head == NULL) { + (*ext_list_head) = ext; + (*ext_list_head)->prev = *ext_list_head; + (*ext_list_head)->next = *ext_list_head; + return 0; + } + + if (ext->data.physical <= ext_list_tmp->data.physical) { + /* Insert before head */ + if (ext_list_tmp->data.physical < + ext->data.physical + ext->data.len) + /* Overlap */ + goto out; + /* Adjust head */ + *ext_list_head = ext; + } else { + /* Insert into the middle or last of the list */ + do { + if (ext->data.physical < ext_list_tmp->data.physical) + break; + ext_list_tmp = ext_list_tmp->next; + } while (ext_list_tmp != (*ext_list_head)); + if (ext->data.physical < + ext_list_tmp->prev->data.physical + + ext_list_tmp->prev->data.len) + /* Overlap */ + goto out; + + if (ext_list_tmp != *ext_list_head && + ext_list_tmp->data.physical < + ext->data.physical + ext->data.len) + /* Overlap */ + goto out; + } + ext_list_tmp = ext_list_tmp->prev; + /* Insert "ext" after "ext_list_tmp" */ + insert(ext_list_tmp, ext); + return 0; +out: + errno = EINVAL; + return -1; +} + +/* + * insert_exts_group() - Insert a exts_group. + * + * @ext_group_head: the head of a exts_group list. + * @exts_group: the exts_group element which will be inserted. + */ +int insert_exts_group(struct fiemap_extent_group **ext_group_head, + struct fiemap_extent_group *exts_group) +{ + struct fiemap_extent_group *ext_group_tmp = NULL; + + if (exts_group == NULL) { + errno = EINVAL; + return -1; + } + + /* Initialize list */ + if (*ext_group_head == NULL) { + (*ext_group_head) = exts_group; + (*ext_group_head)->prev = *ext_group_head; + (*ext_group_head)->next = *ext_group_head; + return 0; + } + + ext_group_tmp = (*ext_group_head)->prev; + insert(ext_group_tmp, exts_group); + + return 0; +} + +/* + * join_extents() - Find continuous region(exts_group). + * + * @ext_list_head: the head of the extent list. + * @ext_group_head: the head of the target exts_group list. + */ +int join_extents(struct fiemap_extent_list *ext_list_head, + struct fiemap_extent_group **ext_group_head) +{ + __u64 len = ext_list_head->data.len; + struct fiemap_extent_list *ext_list_start = ext_list_head; + struct fiemap_extent_list *ext_list_tmp = ext_list_head->next; + + do { + struct fiemap_extent_group *ext_group_tmp = NULL; + + /* This extent and previous extent are not continuous, + * so, all previous extents are treated as an extent group. + */ + if ((ext_list_tmp->prev->data.logical + + ext_list_tmp->prev->data.len) + != ext_list_tmp->data.logical) { + ext_group_tmp = + malloc(sizeof(struct fiemap_extent_group)); + if (ext_group_tmp == NULL) + return -1; + + memset(ext_group_tmp, 0, + sizeof(struct fiemap_extent_group)); + ext_group_tmp->len = len; + ext_group_tmp->start = ext_list_start; + ext_group_tmp->end = ext_list_tmp->prev; + + if (insert_exts_group(ext_group_head, + ext_group_tmp) < 0) { + FREE(ext_group_tmp); + return -1; + } + ext_list_start = ext_list_tmp; + len = ext_list_tmp->data.len; + ext_list_tmp = ext_list_tmp->next; + continue; + } + + /* This extent and previous extent are continuous, + * so, they belong to the same extent group, and we check + * if the next extent belongs to the same extent group. + */ + len += ext_list_tmp->data.len; + ext_list_tmp = ext_list_tmp->next; + } while (ext_list_tmp != ext_list_head->next); + + return 0; +} + +/* + * get_file_extents() - Get file's extent list. + * + * @fd: defrag target file's descriptor. + * @ext_list_head: the head of the extent list. + */ +int get_file_extents(int fd, struct fiemap_extent_list **ext_list_head) +{ + __u32 i; + int ret; + int ext_buf_size, fie_buf_size; + __u64 pos = 0; + struct fiemap *fiemap_buf = NULL; + struct fiemap_extent *ext_buf = NULL; + struct fiemap_extent_list *ext_list = NULL; + + /* Convert units, in bytes. + * Be careful : now, physical block number in extent is 48bit, + * and the maximum blocksize for ext4 is 4K(12bit), + * so there is no overflow, but in future it may be changed. + */ + + /* Alloc space for fiemap */ + ext_buf_size = EXTENT_MAX_COUNT * sizeof(struct fiemap_extent); + fie_buf_size = sizeof(struct fiemap) + ext_buf_size; + + fiemap_buf = malloc(fie_buf_size); + if (fiemap_buf == NULL) + return -1; + + ext_buf = fiemap_buf->fm_extents; + memset(fiemap_buf, 0, fie_buf_size); + fiemap_buf->fm_length = FIEMAP_MAX_OFFSET; + fiemap_buf->fm_flags |= FIEMAP_FLAG_SYNC; + fiemap_buf->fm_extent_count = EXTENT_MAX_COUNT; + + do { + fiemap_buf->fm_start = pos; + memset(ext_buf, 0, ext_buf_size); + ret = ioctl(fd, FS_IOC_FIEMAP, fiemap_buf); + if (ret < 0) + goto out; + for (i = 0; i < fiemap_buf->fm_mapped_extents; i++) { + ext_list = NULL; + ext_list = malloc(sizeof(struct fiemap_extent_list)); + if (ext_list == NULL) + goto out; + + ext_list->data.physical = ext_buf[i].fe_physical + / block_size; + ext_list->data.logical = ext_buf[i].fe_logical + / block_size; + ext_list->data.len = ext_buf[i].fe_length + / block_size; + + ret = insert_extent_by_physical( + ext_list_head, ext_list); + if (ret < 0) { + FREE(ext_list); + goto out; + } + } + /* Record file's logical offset this time */ + pos = ext_buf[EXTENT_MAX_COUNT-1].fe_logical + + ext_buf[EXTENT_MAX_COUNT-1].fe_length; + /* + * If fm_extents array has been filled and + * there are extents left, continue to cycle. + */ + } while (fiemap_buf->fm_mapped_extents + == EXTENT_MAX_COUNT && + !(ext_buf[EXTENT_MAX_COUNT-1].fe_flags + & FIEMAP_EXTENT_LAST)); + + FREE(fiemap_buf); + return 0; +out: + FREE(fiemap_buf); + return -1; +} + +/* + * get_logical_count() - Get the file logical extents count. + * + * @logical_list_head: the head of the logical extent list. + */ +int get_logical_count(struct fiemap_extent_list *logical_list_head) +{ + int ret = 0; + struct fiemap_extent_list *ext_list_tmp = logical_list_head; + + do { + ret++; + ext_list_tmp = ext_list_tmp->next; + } while (ext_list_tmp != logical_list_head); + + return ret; +} + +/* + * get_physical_count() - Get the file physical extents count. + * + * @physical_list_head: the head of the physical extent list. + */ +int get_physical_count(struct fiemap_extent_list *physical_list_head) +{ + int ret = 0; + struct fiemap_extent_list *ext_list_tmp = physical_list_head; + + do { + if ((ext_list_tmp->data.physical + ext_list_tmp->data.len) + != ext_list_tmp->next->data.physical) { + /* This extent and next extent are not continuous. */ + ret++; + } + + ext_list_tmp = ext_list_tmp->next; + } while (ext_list_tmp != physical_list_head); + + return ret; +} + +/* + * change_physical_to_logical() - Change list from physical to logical. + * + * @physical_list_head: the head of physical extent list. + * @logical_list_head: the head of logical extent list. + */ +int change_physical_to_logical(struct fiemap_extent_list **physical_list_head, + struct fiemap_extent_list **logical_list_head) +{ + int ret; + struct fiemap_extent_list *ext_list_tmp = *physical_list_head; + struct fiemap_extent_list *ext_list_next = ext_list_tmp->next; + + while (1) { + if (ext_list_tmp == ext_list_next) { + ret = insert_extent_by_logical( + logical_list_head, ext_list_tmp); + if (ret < 0) + return -1; + + *physical_list_head = NULL; + break; + } + + ext_list_tmp->prev->next = ext_list_tmp->next; + ext_list_tmp->next->prev = ext_list_tmp->prev; + *physical_list_head = ext_list_next; + + ret = insert_extent_by_logical( + logical_list_head, ext_list_tmp); + if (ret < 0) { + FREE(ext_list_tmp); + return -1; + } + ext_list_tmp = ext_list_next; + ext_list_next = ext_list_next->next; + } + + return 0; +} + +/* + * free_ext() - Free the extent list. + * + * @ext_list_head: the extent list head of which will be free. + */ +void free_ext(struct fiemap_extent_list *ext_list_head) +{ + struct fiemap_extent_list *ext_list_tmp = NULL; + + if (ext_list_head == NULL) + return; + + while (ext_list_head->next != ext_list_head) { + ext_list_tmp = ext_list_head; + ext_list_head->prev->next = ext_list_head->next; + ext_list_head->next->prev = ext_list_head->prev; + ext_list_head = ext_list_head->next; + free(ext_list_tmp); + } + free(ext_list_head); +} + +/* + * free_exts_group() - Free the exts_group. + * + * @*ext_group_head: the exts_group list head which will be free. + */ + void free_exts_group(struct fiemap_extent_group *ext_group_head) +{ + struct fiemap_extent_group *ext_group_tmp = NULL; + + if (ext_group_head == NULL) + return; + + while (ext_group_head->next != ext_group_head) { + ext_group_tmp = ext_group_head; + ext_group_head->prev->next = ext_group_head->next; + ext_group_head->next->prev = ext_group_head->prev; + ext_group_head = ext_group_head->next; + free(ext_group_tmp); + } + free(ext_group_head); +} + +/* + * get_superblock_info() - Get superblock info by the file name. + * + * @file: the file's name. + * @sb: the pointer of the struct ext4_super_block. + */ +int get_superblock_info(const char *file, struct ext4_super_block *sb) +{ + /* Refer to /etc/mtab */ + char *mtab = MOUNTED; + FILE *fp = NULL; + + int fd = -1; + int ret; + size_t maxlen = 0; + size_t len; + char dev_name[PATH_MAX + 1]; + struct mntent *mnt = NULL; + + fp = setmntent(mtab, "r"); + if (fp == NULL) + return -1; + + while ((mnt = getmntent(fp)) != NULL) { + len = strlen(mnt->mnt_dir); + ret = memcmp(file, mnt->mnt_dir, len); + if (ret != 0) + continue; + + if (len < maxlen) + continue; + + maxlen = len; + + memset(dev_name, 0, PATH_MAX + 1); + strncpy(dev_name, mnt->mnt_fsname, + strnlen(mnt->mnt_fsname, PATH_MAX)); + } + + fd = open64(dev_name, O_RDONLY); + if (fd < 0) { + ret = -1; + goto out; + } + + /* Set offset to read superblock */ + ret = lseek64(fd, SUPERBLOCK_OFFSET, SEEK_SET); + if (ret < 0) + goto out; + + ret = read(fd, sb, sizeof(struct ext4_super_block)); + if (ret < 0) + goto out; + +out: + if (fd != -1) + close(fd); + endmntent(fp); + return ret; +} + +/* + * get_best_count() - Get the file best extents count. + * + * @block_count: the file's physical block count. + */ +int get_best_count(ext4_fsblk_t block_count) +{ + int ret; + unsigned int flex_bg_num; + + /* Calcuate best extents count */ + if (feature_incompat & EXT4_FEATURE_INCOMPAT_FLEX_BG) { + flex_bg_num = 1 << log_groups_per_flex; + ret = ((block_count - 1) / + ((ext4_fsblk_t)blocks_per_group * + flex_bg_num)) + 1; + } else + ret = ((block_count - 1) / blocks_per_group) + 1; + + return ret; +} + + +/* + * file_statistic() - Get statistic info of the file's fragments. + * + * @file: the file's name. + * @buf: the pointer of the struct stat64. + * @flag: file type. + * @ftwbuf: the pointer of a struct FTW. + */ +int file_statistic(const char *file, const struct stat64 *buf, + int flag EXT2FS_ATTR((unused)), + struct FTW *ftwbuf EXT2FS_ATTR((unused))) +{ + int fd; + int ret; + int now_ext_count, best_ext_count, physical_ext_count; + int i, j; + float ratio = 0.0; + ext4_fsblk_t blk_count = 0; + char msg_buffer[PATH_MAX + 24]; + struct fiemap_extent_list *physical_list_head = NULL; + struct fiemap_extent_list *logical_list_head = NULL; + + defraged_file_count++; + + if (mode_flag & DETAIL) { + if (total_count == 1 && regular_count == 1) + printf("\n"); + else { + printf("[%u/%u]", defraged_file_count, total_count); + fflush(stdout); + } + } + if (lost_found_dir[0] != '\0' && + !memcmp(file, lost_found_dir, strnlen(lost_found_dir, PATH_MAX))) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + STATISTIC_ERR_MSG(NGMSG_LOST_FOUND); + } + return 0; + } + + if (!S_ISREG(buf->st_mode)) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + STATISTIC_ERR_MSG(NGMSG_FILE_UNREG); + } + return 0; + } + + /* Access authority */ + if (current_uid != ROOT_UID && + buf->st_uid != current_uid) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + STATISTIC_ERR_MSG( + "File is not current user's file" + " or current user is not root"); + } + return 0; + } + + /* Empty file */ + if (buf->st_size == 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + STATISTIC_ERR_MSG("File size is 0"); + } + return 0; + } + + fd = open64(file, O_RDONLY); + if (fd < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + STATISTIC_ERR_MSG_WITH_ERRNO(NGMSG_FILE_OPEN); + } + return 0; + } + + /* Get file's physical extents */ + ret = get_file_extents(fd, &physical_list_head); + if (ret < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + STATISTIC_ERR_MSG_WITH_ERRNO(NGMSG_FILE_EXTENT); + } + goto out; + } + + /* Get the count of file's continuous physical region */ + physical_ext_count = get_physical_count(physical_list_head); + + /* Change list from physical to logical */ + ret = change_physical_to_logical(&physical_list_head, + &logical_list_head); + if (ret < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + STATISTIC_ERR_MSG_WITH_ERRNO(NGMSG_FILE_EXTENT); + } + goto out; + } + + /* Count file fragments before defrag */ + now_ext_count = get_logical_count(logical_list_head); + + if (current_uid == ROOT_UID) { + /* Calculate fragment ratio */ + blk_count = + SECTOR_TO_BLOCK(buf->st_blocks, block_size); + + best_ext_count = get_best_count(blk_count); + + ratio = (float)(physical_ext_count - best_ext_count) * 100 / + blk_count; + + extents_before_defrag += now_ext_count; + extents_after_defrag += best_ext_count; + files_block_count += blk_count; + } + + if (total_count == 1 && regular_count == 1) { + /* File only */ + if (mode_flag & DETAIL) { + int count = 0; + struct fiemap_extent_list *ext_list_tmp = + logical_list_head; + + /* Print extents info */ + do { + count++; + printf("[ext %d]:\tstart %llu:\tlogical " + "%llu:\tlen %llu\n", count, + ext_list_tmp->data.physical, + ext_list_tmp->data.logical, + ext_list_tmp->data.len); + ext_list_tmp = ext_list_tmp->next; + } while (ext_list_tmp != logical_list_head); + + } else { + printf("%-40s%10s/%-10s%9s\n", + "", "now", "best", "ratio"); + if (current_uid == ROOT_UID) { + if (strlen(file) > 40) + printf("%s\n%50d/%-10d%8.2f%%\n", + file, now_ext_count, + best_ext_count, ratio); + else + printf("%-40s%10d/%-10d%8.2f%%\n", + file, now_ext_count, + best_ext_count, ratio); + } else { + if (strlen(file) > 40) + printf("%s\n%50d/%-10s%7s\n", + file, now_ext_count, + "-", "-"); + else + printf("%-40s%10d/%-10s%7s\n", + file, now_ext_count, + "-", "-"); + } + } + succeed_cnt++; + goto out; + } + + if (mode_flag & DETAIL) { + /* Print statistic info */ + sprintf(msg_buffer, "[%u/%u]%s", + defraged_file_count, total_count, file); + if (current_uid == ROOT_UID) { + if (strlen(msg_buffer) > 40) + printf("\033[79;0H\033[K%s\n" + "%50d/%-10d%8.2f%%\n", + msg_buffer, now_ext_count, + best_ext_count, ratio); + else + printf("\033[79;0H\033[K%-40s" + "%10d/%-10d%8.2f%%\n", + msg_buffer, now_ext_count, + best_ext_count, ratio); + } else { + if (strlen(msg_buffer) > 40) + printf("\033[79;0H\033[K%s\n%50d/%-10s%7s\n", + msg_buffer, now_ext_count, + "-", "-"); + else + printf("\033[79;0H\033[K%-40s%10d/%-10s%7s\n", + msg_buffer, now_ext_count, + "-", "-"); + } + } + + for (i = 0; i < SHOW_FRAG_FILES; i++) { + if (ratio >= frag_rank[i].ratio) { + for (j = SHOW_FRAG_FILES - 1; j > i; j--) { + memcpy(&frag_rank[j], &frag_rank[j - 1], + sizeof(struct frag_statistic_ino)); + } + memset(&frag_rank[i], 0, + sizeof(struct frag_statistic_ino)); + strncpy(frag_rank[i].msg_buffer, file, + strnlen(file, PATH_MAX)); + frag_rank[i].now_count = now_ext_count; + frag_rank[i].best_count = best_ext_count; + frag_rank[i].ratio = ratio; + break; + } + } + + succeed_cnt++; + +out: + close(fd); + free_ext(physical_list_head); + free_ext(logical_list_head); + return 0; +} + +/* + * print_progress - Print defrag progress + * + * @file: file name. + * @start: logical offset for defrag target file + * @file_size: defrag target filesize + */ +void print_progress(const char *file, loff_t start, loff_t file_size) +{ + int percent = (start * 100) / file_size; + printf("\033[79;0H\033[K[%u/%u]%s:\t%3d%%", + defraged_file_count, total_count, file, min(percent, 100)); + fflush(stdout); + + return; +} + +/* + * call_defrag() - Execute the defrag program. + * + * @fd: target file descriptor. + * @donor_fd: donor file descriptor. + * @file: target file name. + * @buf: pointer of the struct stat64. + * @ext_list_head: head of the extent list. + */ +int call_defrag(int fd, int donor_fd, const char *file, + const struct stat64 *buf, struct fiemap_extent_list *ext_list_head) +{ + loff_t start = 0; + unsigned int page_num; + unsigned char *vec = NULL; + int defraged_ret = 0; + int ret; + struct move_extent move_data; + struct fiemap_extent_list *ext_list_tmp = NULL; + + memset(&move_data, 0, sizeof(struct move_extent)); + move_data.donor_fd = donor_fd; + + /* Print defrag progress */ + print_progress(file, start, buf->st_size); + + ext_list_tmp = ext_list_head; + do { + move_data.orig_start = ext_list_tmp->data.logical; + /* Logical offset of orig and donor should be same */ + move_data.donor_start = move_data.orig_start; + move_data.len = ext_list_tmp->data.len; + move_data.moved_len = 0; + + ret = page_in_core(fd, move_data, &vec, &page_num); + if (ret < 0) { + if (mode_flag & DETAIL) { + printf("\n"); + PRINT_ERR_MSG_WITH_ERRNO( + "Failed to get file map"); + } else { + printf("\t[ NG ]\n"); + } + return -1; + } + + /* EXT4_IOC_MOVE_EXT */ + defraged_ret = + ioctl(fd, EXT4_IOC_MOVE_EXT, &move_data); + + /* Free pages */ + ret = defrag_fadvise(fd, move_data, vec, page_num); + if (vec) { + free(vec); + vec = NULL; + } + if (ret < 0) { + if (mode_flag & DETAIL) { + printf("\n"); + PRINT_ERR_MSG_WITH_ERRNO( + "Failed to free page"); + } else { + printf("\t[ NG ]\n"); + } + return -1; + } + + if (defraged_ret < 0) { + if (mode_flag & DETAIL) { + printf("\n"); + PRINT_ERR_MSG_WITH_ERRNO( + "Failed to defrag"); + } else { + printf("\t[ NG ]\n"); + } + return -1; + } + /* Adjust logical offset for next ioctl */ + move_data.orig_start += move_data.moved_len; + move_data.donor_start = move_data.orig_start; + + start = move_data.orig_start * buf->st_blksize; + + /* Print defrag progress */ + print_progress(file, start, buf->st_size); + + /* End of file */ + if (start >= buf->st_size) + break; + + ext_list_tmp = ext_list_tmp->next; + } while (ext_list_tmp != ext_list_head); + + return 0; +} + +/* + * file_defrag() - Check file attributes and call ioctl to defrag. + * + * @file: the file's name. + * @buf: the pointer of the struct stat64. + * @flag: file type. + * @ftwbuf: the pointer of a struct FTW. + */ +int file_defrag(const char *file, const struct stat64 *buf, + int flag EXT2FS_ATTR((unused)), + struct FTW *ftwbuf EXT2FS_ATTR((unused))) +{ + int fd; + int donor_fd = -1; + int ret; + int best; + int file_frags_start, file_frags_end; + int orig_physical_cnt, donor_physical_cnt; + char tmp_inode_name[PATH_MAX + 8]; + struct fiemap_extent_list *orig_list_physical = NULL; + struct fiemap_extent_list *orig_list_logical = NULL; + struct fiemap_extent_list *donor_list_physical = NULL; + struct fiemap_extent_list *donor_list_logical = NULL; + struct fiemap_extent_group *orig_group_head = NULL; + struct fiemap_extent_group *orig_group_tmp = NULL; + + defraged_file_count++; + + if (mode_flag & DETAIL) { + printf("[%u/%u]", defraged_file_count, total_count); + fflush(stdout); + } + + if (lost_found_dir[0] != '\0' && + !memcmp(file, lost_found_dir, strnlen(lost_found_dir, PATH_MAX))) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + IN_FTW_PRINT_ERR_MSG(NGMSG_LOST_FOUND); + } + return 0; + } + + if (!S_ISREG(buf->st_mode)) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + IN_FTW_PRINT_ERR_MSG(NGMSG_FILE_UNREG); + } + return 0; + } + + /* Empty file */ + if (buf->st_size == 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + IN_FTW_PRINT_ERR_MSG("File size is 0"); + } + return 0; + } + + fd = open64(file, O_RDONLY); + if (fd < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO(NGMSG_FILE_OPEN); + } + return 0; + } + + /* Get file's extents */ + ret = get_file_extents(fd, &orig_list_physical); + if (ret < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO(NGMSG_FILE_EXTENT); + } + goto out; + } + + /* Get the count of file's continuous physical region */ + orig_physical_cnt = get_physical_count(orig_list_physical); + + /* Change list from physical to logical */ + ret = change_physical_to_logical(&orig_list_physical, + &orig_list_logical); + if (ret < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO(NGMSG_FILE_EXTENT); + } + goto out; + } + + /* Count file fragments before defrag */ + file_frags_start = get_logical_count(orig_list_logical); + + if (file_check(fd, buf, file, file_frags_start) < 0) + goto out; + + if (fsync(fd) < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO("Failed to sync(fsync)"); + } + goto out; + } + + if (current_uid == ROOT_UID) + best = + get_best_count(SECTOR_TO_BLOCK(buf->st_blocks, block_size)); + else + best = 1; + + if (file_frags_start <= best) + goto check_improvement; + + /* Combine extents to group */ + ret = join_extents(orig_list_logical, &orig_group_head); + if (ret < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO(NGMSG_FILE_EXTENT); + } + goto out; + } + + /* Create donor inode */ + memset(tmp_inode_name, 0, PATH_MAX + 8); + sprintf(tmp_inode_name, "%.*s.defrag", strnlen(file, PATH_MAX), file); + donor_fd = open64(tmp_inode_name, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR); + if (donor_fd < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + if (errno == EEXIST) + PRINT_ERR_MSG_WITH_ERRNO( + "File is being defraged by other program"); + else + PRINT_ERR_MSG_WITH_ERRNO(NGMSG_FILE_OPEN); + } + goto out; + } + + /* Unlink donor inode */ + ret = unlink(tmp_inode_name); + if (ret < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO("Failed to unlink"); + } + goto out; + } + + /* Allocate space for donor inode */ + orig_group_tmp = orig_group_head; + do { + ret = fallocate(donor_fd, 0, + (loff_t)orig_group_tmp->start->data.logical * block_size, + (loff_t)orig_group_tmp->len * block_size); + if (ret < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO("Failed to fallocate"); + } + goto out; + } + + orig_group_tmp = orig_group_tmp->next; + } while (orig_group_tmp != orig_group_head); + + /* Get donor inode's extents */ + ret = get_file_extents(donor_fd, &donor_list_physical); + if (ret < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO(NGMSG_FILE_EXTENT); + } + goto out; + } + + /* Calcuate donor inode's continuous physical region */ + donor_physical_cnt = get_physical_count(donor_list_physical); + + /* Change donor extent list from physical to logical */ + ret = change_physical_to_logical(&donor_list_physical, + &donor_list_logical); + if (ret < 0) { + if (mode_flag & DETAIL) { + PRINT_FILE_NAME(file); + PRINT_ERR_MSG_WITH_ERRNO(NGMSG_FILE_EXTENT); + } + goto out; + } + +check_improvement: + if (mode_flag & DETAIL) { + if (file_frags_start != 1) + frag_files_before_defrag++; + + extents_before_defrag += file_frags_start; + } + + if (file_frags_start <= best || + orig_physical_cnt <= donor_physical_cnt) { + printf("\033[79;0H\033[K[%u/%u]%s:\t%3d%%", + defraged_file_count, total_count, file, 100); + if (mode_flag & DETAIL) + printf(" extents: %d -> %d", + file_frags_start, file_frags_start); + + printf("\t[ OK ]\n"); + succeed_cnt++; + + if (file_frags_start != 1) + frag_files_after_defrag++; + + extents_after_defrag += file_frags_start; + goto out; + } + + /* Defrag the file */ + ret = call_defrag(fd, donor_fd, file, buf, donor_list_logical); + + /* Count file fragments after defrag and print extents info */ + if (mode_flag & DETAIL) { + file_frags_end = file_frag_count(fd); + if (file_frags_end < 0) { + printf("\n"); + PRINT_ERR_MSG_WITH_ERRNO(NGMSG_FILE_INFO); + goto out; + } + + if (file_frags_end != 1) + frag_files_after_defrag++; + + extents_after_defrag += file_frags_end; + + if (ret < 0) + goto out; + + printf(" extents: %d -> %d", + file_frags_start, file_frags_end); + fflush(stdout); + } + + if (ret < 0) + goto out; + + printf("\t[ OK ]\n"); + fflush(stdout); + succeed_cnt++; + +out: + close(fd); + if (donor_fd != -1) + close(donor_fd); + free_ext(orig_list_physical); + free_ext(orig_list_logical); + free_ext(donor_list_physical); + free_exts_group(orig_group_head); + return 0; +} + +/* + * main() - Ext4 online defrag. + * + * @argc: the number of parameter. + * @argv[]: the pointer array of parameter. + */ +int main(int argc, char *argv[]) +{ + int opt; + int i, j; + int flags = FTW_PHYS | FTW_MOUNT; + int arg_type = -1; + int success_flag = 0; + char dir_name[PATH_MAX + 1]; + struct stat64 buf; + struct ext4_super_block sb; + + /* Parse arguments */ + if (argc == 1) + goto out; + + while ((opt = getopt(argc, argv, "vc")) != EOF) { + switch (opt) { + case 'v': + mode_flag |= DETAIL; + break; + case 'c': + mode_flag |= STATISTIC; + break; + default: + goto out; + } + } + + if (argc == optind) + goto out; + + current_uid = getuid(); + + /* Main process */ + for (i = optind; i < argc; i++) { + succeed_cnt = 0; + regular_count = 0; + total_count = 0; + frag_files_before_defrag = 0; + frag_files_after_defrag = 0; + extents_before_defrag = 0; + extents_after_defrag = 0; + defraged_file_count = 0; + files_block_count = 0; + blocks_per_group = 0; + feature_incompat = 0; + log_groups_per_flex = 0; + + memset(dir_name, 0, PATH_MAX + 1); + memset(lost_found_dir, 0, PATH_MAX + 1); + memset(frag_rank, 0, + sizeof(struct frag_statistic_ino) * SHOW_FRAG_FILES); + + if ((mode_flag & STATISTIC) && i > optind) + printf("\n"); + +#if BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN + PRINT_ERR_MSG("Endian's type is not big/little endian"); + PRINT_FILE_NAME(argv[i]); + continue; +#endif + + if (lstat64(argv[i], &buf) < 0) { + perror(NGMSG_FILE_INFO); + PRINT_FILE_NAME(argv[i]); + continue; + } + + if (S_ISBLK(buf.st_mode)) { + /* Block device */ + if (get_mount_point(argv[i], dir_name, PATH_MAX) < 0) + continue; + if (lstat64(dir_name, &buf) < 0) { + perror(NGMSG_FILE_INFO); + PRINT_FILE_NAME(argv[i]); + continue; + } + arg_type = DEVNAME; + if (!(mode_flag & STATISTIC)) + printf("ext4 defragmentation for device(%s)\n", + argv[i]); + } else if (S_ISDIR(buf.st_mode)) { + /* Directory */ + if (access(argv[i], R_OK) < 0) { + perror(argv[i]); + continue; + } + arg_type = DIRNAME; + strncpy(dir_name, argv[i], strnlen(argv[i], PATH_MAX)); + } else if (S_ISREG(buf.st_mode)) { + /* Regular file */ + arg_type = FILENAME; + } else { + /* Irregular file */ + PRINT_ERR_MSG(NGMSG_FILE_UNREG); + PRINT_FILE_NAME(argv[i]); + continue; + } + + /* Set blocksize */ + block_size = buf.st_blksize; + + /* For device case, + * filesystem type checked in get_mount_point() + */ + if (arg_type == FILENAME || arg_type == DIRNAME) { + if (is_ext4(argv[i]) < 0) + continue; + if (realpath(argv[i], dir_name) == NULL) { + perror("Couldn't get full path"); + PRINT_FILE_NAME(argv[i]); + continue; + } + } + + if (current_uid == ROOT_UID) { + /* Get super block info */ + memset(&sb, 0, sizeof(struct ext4_super_block)); + if (get_superblock_info(dir_name, &sb) < 0) { + if (mode_flag & DETAIL) { + perror("Can't get super block info"); + PRINT_FILE_NAME(argv[i]); + } + continue; + } + + blocks_per_group = ext2fs_swab32(sb.s_blocks_per_group); + feature_incompat = ext2fs_swab32(sb.s_feature_incompat); + log_groups_per_flex = sb.s_log_groups_per_flex; + } + + switch (arg_type) { + case DIRNAME: + if (!(mode_flag & STATISTIC)) + printf("ext4 defragmentation " + "for directory(%s)\n", argv[i]); + + int mount_dir_len = 0; + mount_dir_len = strnlen(lost_found_dir, PATH_MAX); + + strncat(lost_found_dir, "/lost+found", + PATH_MAX - strnlen(lost_found_dir, PATH_MAX)); + + /* Not the case("e4defrag mount_piont_dir") */ + if (dir_name[mount_dir_len] != '\0') { + /* + * "e4defrag mount_piont_dir/lost+found" + * or "e4defrag mount_piont_dir/lost+found/" + */ + if (strncmp(lost_found_dir, dir_name, + strnlen(lost_found_dir, + PATH_MAX)) == 0 && + (dir_name[strnlen(lost_found_dir, + PATH_MAX)] == '\0' || + dir_name[strnlen(lost_found_dir, + PATH_MAX)] == '/')) { + PRINT_ERR_MSG(NGMSG_LOST_FOUND); + PRINT_FILE_NAME(argv[i]); + continue; + } + + /* "e4defrag mount_piont_dir/else_dir" */ + memset(lost_found_dir, 0, PATH_MAX + 1); + } + case DEVNAME: + if (arg_type == DEVNAME) { + strncpy(lost_found_dir, dir_name, + strnlen(dir_name, PATH_MAX)); + strncat(lost_found_dir, "/lost+found/", + PATH_MAX - strnlen(lost_found_dir, + PATH_MAX)); + } + + nftw64(dir_name, calc_entry_counts, FTW_OPEN_FD, flags); + + if (mode_flag & STATISTIC) { + if (mode_flag & DETAIL) + printf("%-40s%10s/%-10s%9s\n", + "", "now", "best", "ratio"); + + if (!(mode_flag & DETAIL) && + current_uid != ROOT_UID) { + printf(" Done.\n"); + continue; + } + + nftw64(dir_name, file_statistic, + FTW_OPEN_FD, flags); + + if (succeed_cnt != 0 && + current_uid == ROOT_UID) { + if (mode_flag & DETAIL) + printf("\n"); + printf("%-40s%10s/%-10s%9s\n", + "", "now", + "best", "ratio"); + for (j = 0; j < SHOW_FRAG_FILES; j++) { + if (strlen(frag_rank[j]. + msg_buffer) > 37) { + printf("%d. %s\n%50d/" + "%-10d%8.2f%%\n", j + 1, + frag_rank[j].msg_buffer, + frag_rank[j].now_count, + frag_rank[j].best_count, + frag_rank[j].ratio); + } else if (strlen(frag_rank[j]. + msg_buffer) > 0) { + printf("%d. %-37s%10d/" + "%-10d%8.2f%%\n", j + 1, + frag_rank[j].msg_buffer, + frag_rank[j].now_count, + frag_rank[j].best_count, + frag_rank[j].ratio); + } else + break; + } + } + break; + } + /* File tree walk */ + nftw64(dir_name, file_defrag, FTW_OPEN_FD, flags); + printf("\n\tSuccess:\t\t\t[ %u/%u ]\n", succeed_cnt, + total_count); + printf("\tFailure:\t\t\t[ %u/%u ]\n", + total_count - succeed_cnt, total_count); + if (mode_flag & DETAIL) { + printf("\tTotal extents:\t\t\t%4d->%d\n", + extents_before_defrag, + extents_after_defrag); + printf("\tFragmented percentage:\t\t" + "%3llu%%->%llu%%\n", + !regular_count ? 0 : + ((unsigned long long) + frag_files_before_defrag * 100) / + regular_count, + !regular_count ? 0 : + ((unsigned long long) + frag_files_after_defrag * 100) / + regular_count); + } + break; + case FILENAME: + total_count = 1; + regular_count = 1; + strncat(lost_found_dir, "/lost+found/", + PATH_MAX - strnlen(lost_found_dir, + PATH_MAX)); + if (strncmp(lost_found_dir, dir_name, + strnlen(lost_found_dir, + PATH_MAX)) == 0) { + PRINT_ERR_MSG(NGMSG_LOST_FOUND); + PRINT_FILE_NAME(argv[i]); + continue; + } + + if (mode_flag & STATISTIC) { + file_statistic(argv[i], &buf, FTW_F, NULL); + break; + } else + printf("ext4 defragmentation for %s\n", + argv[i]); + /* Defrag single file process */ + file_defrag(argv[i], &buf, FTW_F, NULL); + if (succeed_cnt != 0) + printf(" Success:\t\t\t[1/1]\n"); + else + printf(" Success:\t\t\t[0/1]\n"); + + break; + } + + if (succeed_cnt != 0) + success_flag = 1; + if (mode_flag & STATISTIC) { + if (current_uid != ROOT_UID) { + printf(" Done.\n"); + continue; + } + + if (!succeed_cnt) { + if (mode_flag & DETAIL) + printf("\n"); + + if (arg_type == DEVNAME) + printf(" In this device(%s), " + "none can be defragmented.\n", argv[i]); + else if (arg_type == DIRNAME) + printf(" In this directory(%s), " + "none can be defragmented.\n", argv[i]); + else + printf(" This file(%s) " + "can't be defragmented.\n", argv[i]); + } else { + float files_ratio = 0.0; + float score = 0.0; + files_ratio = (float)(extents_before_defrag - + extents_after_defrag) * + 100 / files_block_count; + score = CALC_SCORE(files_ratio); + printf("\n Total/best extents\t\t\t\t%d/%d\n" + " Fragmentation ratio\t\t\t\t%.2f%%\n" + " Fragmentation score\t\t\t\t%.2f\n", + extents_before_defrag, + extents_after_defrag, + files_ratio, score); + printf(" [0-30 no problem:" + " 31-55 a little bit fragmented:" + " 55- needs defrag]\n"); + + if (arg_type == DEVNAME) + printf(" This device(%s) ", argv[i]); + else if (arg_type == DIRNAME) + printf(" This directory(%s) ", argv[i]); + else + printf(" This file(%s) ", argv[i]); + + if (score > BOUND_SCORE) + printf("needs defragmentation.\n"); + else + printf("does not need " + "defragmentation.\n"); + } + printf(" Done.\n"); + } + + } + + if (success_flag) + return 0; + + exit(1); + +out: + printf(MSG_USAGE); + exit(1); +} + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh new file mode 100755 index 00000000..84613c87 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh @@ -0,0 +1,192 @@ +#!/bin/bash + +################################################################################ +# # +# Copyright (c) 2009 FUJITSU LIMITED # +# # +# This program is free software; you can redistribute it and#or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, but # +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # +# for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +################################################################################ + +cd $LTPROOT/testcases/bin + +. ./ext4_funcs.sh + +export TCID="ext4-online-defrag" +export TST_TOTAL=18 +export TST_COUNT=1 + +export TEST_DIR=$PWD + +# $1: the test config +read_config $1 + +# How to age filesystem +EMPTY=1 +SMALL=2 +LARGE=3 + +# Defrag what +FILE=1 +DIR=2 +FILESYSTEM=3 + +age_filesystem() +{ + local dirId= + local idx= + rm -rf mnt_point/* + if [ $1 -eq $EMPTY ]; then + if [ $2 -eq $FILE -o $2 -eq $FILESYSTEM ]; then + touch mnt_point/tmp_file + echo "abc" > mnt_point/tmp_file + elif [ $2 -eq $DIR ]; then + mkdir mnt_point/tmp_dir + echo "abc" > mnt_point/tmp_dir/tmp_file + fi + elif [ $1 -eq $SMALL ]; then + + dd if=/dev/zero of=mnt_point/occupy bs=1M count=40 + + # age filesystem from 0.0 to 0.2 -> 0.4 -> 0.6 -> 0.8 -> 1.0 + for ((idx = 3; idx < 8; idx++)) + { + ./ffsb ffsb-config$idx > /dev/null + dirId=$((idx - 3)) + mv mnt_point/data mnt_point/data$dirId + } + + rm mnt_point/occupy + + df + else + rm -rf mnt_point/* + if [ $2 -eq $DIR ]; then + mkdir mnt_point/tmp_dir + dest=mnt_point/tmp_dir/tmp_file + else + dest=mnt_point/tmp_file + fi + + bsize=`dumpe2fs -h $EXT4_DEV | grep 'Block size'` + bsize=`echo $bsize | awk '{ print $NF }'` + bcount=`dumpe2fs -h $EXT4_DEV | grep 'Free blocks'` + bcount=`echo $bcount | awk '{ print $NF }'` + bcount=$(( $bcount / 2 - 100 )) + dd if=/dev/zero of=$dest bs=$bsize count=$bcount + + fi +} + +my_e4defrag() +{ + if [ $1 -eq $FILE ]; then + if [ $2 -eq $SMALL ]; then + ./e4defrag mnt_point/data0/ + return $? + # EMPTY or LARGE + else + ./e4defrag mnt_point/tmp_file + return $? + fi + elif [ $1 -eq $DIR ]; then + if [ $2 -eq $SMALL ]; then + ./e4defrag mnt_point/data0/ + return $? + else + ./e4defrag mnt_point/tmp_dir + return $? + fi + else + ./e4defrag $EXT4_DEV + return $? + fi +} + +# Test online defragmentation feature +# $1: defrag type +# $2: 1 - empty, 2 - full with small files, 3 - full with large files +# $3: block size +ext4_test_online_defrag() +{ + tst_resm TINFO "defrag type: $1, defrag obj: $2, block size: $3" + + mkfs.ext4 -m 0 -b $3 -O ^flex_bg $EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + + tune2fs -E test_fs -O extents $EXT4_DEV + + mount -t ext4 -o nodelalloc $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL"failed to mount ext4 filesystem" + return 1 + fi + + age_filesystem $2 $1 + + my_e4defrag $1 $2 >> $LTPROOT/output/ext4_online_defrag_result.txt + if [ $? -ne 0 ]; then + tst_resm TFAIL "e4defrag returned failure" + umount mnt_point + return 1 + fi + + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return 1 + fi + + e2fsck -p $EXT4_DEV + if [ $? -ne 0 ]; then + tst_resm TFAIL "fsck returned failure" + return 1 + fi + + tst_resm TPASS "ext4 online defrag test pass(defrag type: $1, Aging: $2, block size: $3)" +} + +# main +ext4_setup + +DEFRAG=( $FILE $DIR $FILESYSTEM ) +AGING=( $EMPTY $SMALL $LARGE ) +BLOCK_SIZE=( 1024 4096 ) + +RET=0 + +for ((i = 0; i < 2; i++)) +{ + for ((j = 0; j < 3; j++)) + { + for ((k = 0; k < 3; k++)) + { + ext4_test_online_defrag ${DEFRAG[$j]} ${AGING[$k]} \ + ${BLOCK_SIZE[$i]} + if [ $? -ne 0 ]; then + RET=1 + fi + : $((TST_COUNT++)) + } + } +} + +ext4_cleanup + +exit $RET + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/Makefile b/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/Makefile new file mode 100644 index 00000000..1980349a --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/Makefile @@ -0,0 +1,25 @@ +# Copyright (C) 2009, Fujitsu LIMITED +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +MAKE_TARGETS := +INSTALL_TARGETS ?= *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh new file mode 100755 index 00000000..0d293e89 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh @@ -0,0 +1,113 @@ +#!/bin/bash + +################################################################################ +## ## +## Copyright (c) 2009 FUJITSU LIMITED ## +## ## +## This program is free software; you can redistribute it and#or modify ## +## it under the terms of the GNU General Public License as published by ## +## the Free Software Foundation; either version 2 of the License, or ## +## (at your option) any later version. ## +## ## +## This program is distributed in the hope that it will be useful, but ## +## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## +## for more details. ## +## ## +## You should have received a copy of the GNU General Public License ## +## along with this program; if not, write to the Free Software ## +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## +## ## +## Author: Li Zefan ## +## Miao Xie ## +## ## +################################################################################ + +cd $LTPROOT/testcases/bin + +. ./ext4_funcs.sh + +export TCID="ext4-persistent-preallocation" +export TST_TOTAL=2 +export TST_COUNT=1 + +export TEST_DIR=$PWD + +# $1: the test config +read_config $1 + +# The test path of fallocate +export TDIRECTORY=$PWD/mnt_point/ + +# Use ltp's syscall/fallocate to test this feature +# $1: 1024 or 4096 +ext4_test_persist_prealloc() +{ + mkfs.ext4 -I 256 -b $1 $EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + + mount -t ext4 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount ext4 filesystem" + return 1 + fi + + ret=1 + + for ((i = 1; i <= 3; i++)) + { + if [ ! -f fallocate0${i} ]; then + tst_resm TFAIL "file - fallocate0${i} doesn't exist. Please \ + check whether it was compiled and installed.\ + (Path: LTPROOT/testcases/kernel/syscalls/fallocate)" + umount mnt_point + return 1 + fi + + ./fallocate0${i} | grep -q "CONF" + if [ $? -ne $ret ]; then + tst_resm TFAIL "fallocate's return value is not expected" + umount mnt_point + return 1 + fi + } + + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return 1 + fi + + e2fsck -p $EXT4_DEV + if [ $? -ne 0 ]; then + tst_resm TFAIL "fsck returned failure" + return 1 + fi + + tst_resm TPASS "ext4 persistent preallocation test pass" +} + +# main +ext4_setup + +RET=0 + +ext4_test_persist_prealloc 1024 +if [ $? -ne 0 ]; then + RET=1; +fi +: $((TST_COUNT++)) + +ext4_test_persist_prealloc 4096 +if [ $? -ne 0 ]; then + RET=1; +fi +: $((TST_COUNT++)) + +ext4_cleanup + +exit $RET + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/Makefile b/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/Makefile new file mode 100644 index 00000000..6b8aabb9 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/Makefile @@ -0,0 +1,25 @@ +# Copyright (C) 2009, FUJITSU LIMITED +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LDLIBS += -lm +INSTALL_TARGETS ?= *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_long_dirs.c b/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_long_dirs.c new file mode 100644 index 00000000..55c3d0a5 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_long_dirs.c @@ -0,0 +1,156 @@ +/******************************************************************************/ +/* */ +/* Copyright (c) 2009 FUJITSU LIMITED */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ +/* the GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* */ +/* Author: Li Zefan */ +/* */ +/******************************************************************************/ + +#define _ATFILE_SOURCE +#include +#include +#include +#include +#include +#include +#include +//#define __USE_ATFILE +#include + +#define NAME_LEN 255 +#define NCHARS 62 +#define MAX_LEN1 62 +#define MAX_LEN2 (62 * 62) +#define MAX_LEN3 (62 * 62 * 62) + +/* valid characters for the directory name */ +char chars[NCHARS + 1] = + "0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"; + +/* to store the generated directory name */ +char name[NAME_LEN + 1]; +int names; +int parent_fd; + +/* + * init_name - initialize the directory name + * + * Generate a randomized directory name, and then we generate more + * directory names based on it. + */ +void init_name(void) +{ + int i; + + srand(time(NULL)); + + for (i = 0; i < NAME_LEN; i++) + name[i] = chars[rand() % 62]; +} + +void create_dir(void) +{ + if (mkdirat(parent_fd, name, S_IRWXU)) { + perror("mkdir"); + exit(1); + } +} + +/* + * create_dirs - create @names directory names + * @n: how many names to be created + * + * if n <= 62, we need to modify 1 char of the name + * if n <= 62*62, we need to modify 2 chars + * if n <= 62*62*62, we need to modify 3 chars + */ +void create_dirs(int n) +{ + int i, j, k; + int depth; + + if (n <= MAX_LEN1) + depth = 1; + else if (n <= MAX_LEN2) + depth = 2; + else + depth = 3; + + for (i = 0; i < NCHARS; i++) { + name[0] = chars[i]; + if (depth == 1) { + create_dir(); + if (--n == 0) + return; + continue; + } + + for (j = 0; j < NCHARS; j++) { + name[1] = chars[j]; + if (depth == 2) { + create_dir(); + if (--n == 0) + return; + continue; + } + + for (k = 0; k < NCHARS; k++) { + name[2] = chars[k]; + create_dir(); + if (--n == 0) + return; + } + } + } +} + +void usage() +{ + fprintf(stderr, "Usage: create_long_dirs nr_dirs parent_dir\n"); +} + +/* + * Create long-name directories + * @argv[1]: directory number + * @argv[2]: parent directory + */ +int main(int argc, char *argv[]) +{ + if (argc != 3) { + usage(); + return 1; + } + + names = atoi(argv[1]); + if (names > MAX_LEN3 || names <= 0) { + usage(); + return 1; + } + + parent_fd = open(argv[2], O_RDONLY); + if (parent_fd == -1) { + perror("open parent dir failed"); + return 1; + } + + init_name(); + + create_dirs(names); + + return 0; +} + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_short_dirs.c b/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_short_dirs.c new file mode 100644 index 00000000..328daa2c --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_short_dirs.c @@ -0,0 +1,158 @@ +/******************************************************************************/ +/* */ +/* Copyright (c) 2009 FUJITSU LIMITED */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ +/* the GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* */ +/* Author: Li Zefan */ +/* */ +/******************************************************************************/ + +#define _ATFILE_SOURCE +#include +#include +#include +#include +#include +#include +#include + +/* valid characters for a directory name */ +char chars[] = "0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"; + +/* to store the generated directory name */ +char name[10]; +int names; +int parent_fd; + +/* NCHARS = 10 + 26 + 26 = 62 */ +#define NCHARS 62 +#define MAX_LEN1 62 +#define MAX_LEN2 (62 * 62) +#define MAX_LEN3 (62 * 62 * 62) +#define MAX_NAMES (MAX_LEN1 + MAX_LEN2 + MAX_LEN3) + +void create_dir(void) +{ + if (mkdirat(parent_fd, name, S_IRWXU)) { + perror("mkdir"); + exit(1); + } +} + +/* + * create_1 - create length-1 directory names + * @n: how name names to be created + */ +void create_1(int n) +{ + int i; + + name[1] = '\0'; + for (i = 0; i < NCHARS; i++) { + name[0] = chars[i]; + create_dir(); + if (--n == 0) + return ; + } +} + +/* + * create_2 - generate length-2 directory names + * @n: how many names to be created + */ +void create_2(int n) +{ + int i, j; + + name[2] = '\0'; + for (i = 0; i < NCHARS; i++) { + name[0] = chars[i]; + for (j = 0; j < NCHARS; j++) { + name[1] = chars[j]; + create_dir(); + if (--n == 0) + return ; + } + } +} + +/* + * create_3 - generate length-3 directory names + * @n: how many names to be created + */ +void create_3(int n) +{ + int i, j, k; + + name[3] = '\0'; + for (i = 0; i < NCHARS; i++) { + name[0] = chars[i]; + for (j = 0; j < NCHARS; j++) { + name[1] = chars[j]; + for (k = 0; k < NCHARS; k++) { + name[2] = chars[k]; + create_dir(); + if (--n == 0) + return ; + } + } + } +} + +void usage() +{ + fprintf(stderr, "Usage: create_short_dirs nr_dirs parent_dir\n"); +} + +/* + * Create short-name directoriess + * @argv[1]: director number + * @argv[2]: the parent directory + */ +int main(int argc, char *argv[]) +{ + if (argc != 3) { + usage(); + return 1; + } + + names = atoi(argv[1]); + if (names > MAX_NAMES || names <= 0) { + usage(); + return 1; + } + + parent_fd = open(argv[2], O_RDONLY); + if (parent_fd == -1) { + perror("open parent dir"); + return 1; + } + + create_1(names); + if (names <= MAX_LEN1) + return 0; + + names -= MAX_LEN1; + create_2(names); + if (names <= MAX_LEN2) + return 0; + + names -= MAX_LEN2; + create_3(names); + + return 0; +} + diff --git a/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh new file mode 100755 index 00000000..42c43361 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh @@ -0,0 +1,167 @@ +#!/bin/bash + +################################################################################ +## ## +## Copyright (c) 2009 FUJITSU LIMITED ## +## ## +## This program is free software; you can redistribute it and#or modify ## +## it under the terms of the GNU General Public License as published by ## +## the Free Software Foundation; either version 2 of the License, or ## +## (at your option) any later version. ## +## ## +## This program is distributed in the hope that it will be useful, but ## +## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## +## for more details. ## +## ## +## You should have received a copy of the GNU General Public License ## +## along with this program; if not, write to the Free Software ## +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## +## ## +## Author: Li Zefan ## +## Miao Xie ## +## ## +################################################################################ + +cd $LTPROOT/testcases/bin + +. ./ext4_funcs.sh + +export TCID="ext4-subdir-limit" +export TST_TOTAL=12 +export TST_COUNT=1 + +# $1: the test config +read_config $1 + +TEST_DIR=$PWD +SHORT_DIR=1 +LONG_DIR=2 + +FAIL=1 +PASS=0 + +prev_block_size=-1 +prev_result=$FAIL + +# Run a test case +# $1: Number of directories to create +# $2: create short dir or long dir +# $3: parent directory +# $4: filesystem block size +ext4_run_case() +{ + local dir_name_len= + + if [ $2 -eq $SHORT_DIR ]; then + dir_name_len="short name" + else + dir_name_len="long name" + fi + + tst_resm TINFO "Num of dirs to create: $1, Dir name len: $dir_name_len \ + Parent dir: $3, Block size: $4" + + # only mkfs if block size has been changed, + # or previous case failed + if [ $prev_result -ne $PASS -o $4 -ne $prev_block_size ]; then + mkfs.ext4 -b $4 -I 256 $EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + prev_block_size=$4 + + tune2fs -E test_fs -O extents $EXT4_DEV + fi + + prev_result=$FAIL + + # mount ext4 filesystem + mount -t ext4 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount ext4 filesystem" + return 1 + fi + + # create directories + mkdir -p $3 2> /dev/null + + if [ $2 -eq $SHORT_DIR ]; then + ./create_short_dirs $1 $3 + else + ./create_long_dirs $1 $3 + fi + + if [ $? -ne 0 ]; then + nr_dirs=`ls $3 | wc -l` + tst_resm TFAIL "failed to create directories - $nr_dirs" + umount mnt_point + return 1 + fi + + # delete directories + cd $3 + ls | xargs rmdir + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to remove directories" + + cd $TEST_DIR + umount mnt_point + return 1 + fi + cd $TEST_DIR + + # unmount ext4 filesystem + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return 1 + fi + + # run fsck to make sure the filesystem has no errors + e2fsck -p $EXT4_DEV + if [ $? -ne 0 ]; then + tst_resm TFAIL "fsck: the filesystem has errors" + return 1 + fi + + # check dir_nlink is set + dumpe2fs $EXT4_DEV | grep '^Filesystem features' | grep -q dir_nlink + if [ $? -ne 0 ]; then + tst_resm TFAIL "feature dir_nlink is not set" + return 1 + fi + + prev_result=$PASS + tst_resm TPASS "ext4 subdir limit test pass" +} + +# main +ext4_setup + +DIR_LEN=( $SHORT_DIR $LONG_DIR ) +PARENT_DIR=( "mnt_point" "mnt_point/sub" ) +BLOCK_SIZE=( 1024 2048 4096 ) + +RET=0 + +for ((i = 0; i < 3; i++)) +{ + for ((j = 0; j < 2; j++)) + { + for ((k = 0; k < 2; k++)) + { + ext4_run_case 65537 ${DIR_LEN[$k]} ${PARENT_DIR[$j]} \ + ${BLOCK_SIZE[$i]} + if [ $? -ne 0 ]; then + RET=1 + fi + : $((TST_COUNT++)) + } + } +} + +ext4_cleanup + +exit $RET diff --git a/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/Makefile b/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/Makefile new file mode 100644 index 00000000..1980349a --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/Makefile @@ -0,0 +1,25 @@ +# Copyright (C) 2009, Fujitsu LIMITED +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +MAKE_TARGETS := +INSTALL_TARGETS ?= *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh new file mode 100755 index 00000000..27cbb5f0 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh @@ -0,0 +1,161 @@ +#!/bin/bash + +################################################################################ +# # +# Copyright (c) 2009 FUJITSU LIMITED # +# # +# This program is free software; you can redistribute it and#or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, but # +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # +# for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +################################################################################ + +cd $LTPROOT/testcases/bin + +. ./ext4_funcs.sh + +export TCID="ext4-uninit-groups" +export TST_TOTAL=24 +export TST_COUNT=1 + +export TEST_DIR=$PWD +# $1: the test config +read_config $1 + +# How to age filesystem +EMPTY=1 +SMALL=2 +LARGE=3 + +# filesystem free size in bytes: blocks_size * free_blocks +filesystem_free_size() +{ + bsize=`dumpe2fs -h $EXT4_DEV | grep 'Block size' | awk '{ print $2 }'` + blocks=`dumpe2fs -h $EXT4_DEV | grep 'Free blocks'| awk '{ print $2 }'` + + echo $bsize * $blocks +} + +age_filesystem() +{ + if [ $1 -eq $EMPTY ]; then + # aging, then del + ./ffsb ffsb-config3 > /dev/null + rm -rf mnt_point/* + elif [ $1 -eq $SMALL ]; then + # age filesystem from 0.0 to 0.2 -> 0.4 -> 0.6 -> 0.8 -> 1.0 + for ((n = 3; n < 8; n++)) + { + ./ffsb ffsb-config$n > /dev/null + mv mnt_point/data mnt_point/data$n + } + elif [ $1 -eq $LARGE ]; then + rm -rf mnt_point/* + bsize=`dumpe2fs -h $EXT4_DEV | grep 'Block size'` + bsize=`echo $bsize | awk '{ print $3 }'` + bcount=`dumpe2fs -h $EXT4_DEV | grep 'Free blocks'` + bcount=`echo $bcount | awk '{ print $3 }'` + dd if=/dev/zero of=mnt_point/tmp_dir bs=$bsize count=$bcount + else + return 1 + fi + + return 0 +} + +# Test uninitialized groups +# $1: orlov, oldalloc +# $2: delalloc +# $3: flex_bg +# $4: age filesystem: $EMPTY, $SMALL, $LARGE +ext4_test_uninit_groups() +{ + mkfs.ext4 -I 256 -m 0 $EXT4_DEV > /dev/null + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to create ext4 filesystem" + return 1 + fi + + if [ $3 == "no_flex_bg" ]; then + flag="" + else + flag=$3 + fi + + tune2fs -E test_fs -O extents,uninit_groups,$flag $EXT4_DEV + + # Must run fsck after setting uninit_groups + fsck -p $EXT4_DEV > /dev/null + + mount -t ext4 -o $1,$2 $EXT4_DEV mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to mount ext4 filesystem" + return 1 + fi + + age_filesystem $4 + if [ $? -ne 0 ]; then + tst_resm TFAIL "age filesystem failed" + umount mnt_point + return 1 + fi + + umount mnt_point + if [ $? -ne 0 ]; then + tst_resm TFAIL "failed to umount ext4 filesystem" + return 1 + fi + + fsck -p $EXT4_DEV + if [ $? -ne 0 ]; then + tst_resm TFAIL "fsck returned failure" + return 1 + fi + + tst_resm TPASS "ext4 uninit groups test pass" +} + +# main +ext4_setup + +ORLOV=( "orlov" "oldalloc" ) +DELALLOC=( "delalloc" "nodelalloc" ) +FLEX_BG=( "flex_bg" "no_flex_bg" ) +AGING=( $EMPTY $SMALL $LARGE ) + +RET=0 + +for ((i = 0; i < 2; i++)) +{ + for ((j = 0; j < 2; j++)) + { + for ((k = 0; k < 2; k++)) + { + for ((l = 0; l < 3; l++)) + { + ext4_test_uninit_groups ${ORLOV[$i]} \ + ${DELALLOC[$j]} \ + ${FLEX_BG[$k]} \ + ${AGING[$l]} + if [ $? -ne 0 ]; then + RET=1 + fi + : $((TST_COUNT++)) + } + } + } +} + +ext4_cleanup + +exit $RET diff --git a/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh b/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh new file mode 100755 index 00000000..34fb65cd --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +################################################################################ +## ## +## Copyright (c) 2009 FUJITSU LIMITED ## +## ## +## This program is free software; you can redistribute it and#or modify ## +## it under the terms of the GNU General Public License as published by ## +## the Free Software Foundation; either version 2 of the License, or ## +## (at your option) any later version. ## +## ## +## This program is distributed in the hope that it will be useful, but ## +## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## +## for more details. ## +## ## +## You should have received a copy of the GNU General Public License ## +## along with this program; if not, write to the Free Software ## +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## +## ## +## Author: Li Zefan ## +## Miao Xie ## +## ## +################################################################################ + +ext4_setup() +{ + mkdir mnt_point +} + +ext4_cleanup() +{ + rmdir mnt_point +} + +# $1: the config file +read_config() +{ + while read config + do + echo $config | grep -q -E ".*=.*" + if [ $? -eq 0 ]; then + export $config + fi + done < $1 +} + diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/AUTHORS b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/AUTHORS new file mode 100644 index 00000000..85d037dc --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/AUTHORS @@ -0,0 +1,7 @@ +Dominique Heger (dheger@us.ibm.com) +Josh Jacobs (josh@mit.edu) + +-> up to Version 3.0 of FFSB + +Sonny Rao (raosanth@us.ibm.com) +versions 3.1 and beyond diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/COPYING b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/COPYING new file mode 100644 index 00000000..e90dfed1 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/COPYING @@ -0,0 +1,340 @@ + 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) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 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/fs/ext4-new-features/ffsb-6.0-rc2/INSTALL b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/INSTALL new file mode 100644 index 00000000..b42a17ac --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/INSTALL @@ -0,0 +1,182 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/LICENSE b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/LICENSE new file mode 100644 index 00000000..76d9f618 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/LICENSE @@ -0,0 +1,347 @@ + 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. + +The Free Software Foundation has exempted Bash from the requirement of +Paragraph 2c of the General Public License. This is to say, there is +no requirement for Bash to print a notice when it is started +interactively in the usual way. We made this exception because users +and standards expect shells not to print such messages. This +exception applies to any program that serves as a shell and that is +based primarily on Bash as opposed to other GNU software. + + 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 + + Appendix: 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/fs/ext4-new-features/ffsb-6.0-rc2/Makefile.am b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/Makefile.am new file mode 100644 index 00000000..9ed678b3 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/Makefile.am @@ -0,0 +1,46 @@ +bin_PROGRAMS = ffsb #ffsb_test +ffsb_SOURCES = \ + fileops.c \ + rand.c \ + config.h \ + fileops.h \ + ffsb.h \ + rand.h \ + main.c \ + fh.h \ + fh.c \ + filelist.c \ + filelist.h \ + metaops.c \ + metaops.h \ + rwlock.h \ + rwlock.c \ + cirlist.c \ + cirlist.h \ + rbt.c \ + rbt.h \ + ffsb_tg.h \ + ffsb_tg.c \ + ffsb_fs.h \ + ffsb_fs.c \ + ffsb_thread.c \ + ffsb_thread.h \ + ffsb_op.h \ + ffsb_op.c \ + util.h \ + util.c \ + parser.c \ + parser.h \ + ffsb_fc.c \ + ffsb_stats.c \ + list.c + +#ffsb_test_SOURCES = config.h fileops.h ffsb.h rand.h fh.h filelist.h metaops.h rwlock.h cirlist.h rbt.h ffsb_tg.h ffsb_fs.h ffsb_thread.h ffsb_op.h util.h parser.c parser.h ffsb_test.c + +EXTRA_DIST = *.txt *.tex + +AM_CFLAGS = -D_GNU_SOURCE + +#CFLAGS += -Wall -Werror -g -Wconversion -ansi +#LDFLAGS += -lefence + diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/Makefile.in b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/Makefile.in new file mode 100644 index 00000000..131dd5fb --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/Makefile.in @@ -0,0 +1,628 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = ffsb$(EXEEXT) +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + config.guess config.sub depcomp install-sh missing \ + mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_ffsb_OBJECTS = fileops.$(OBJEXT) rand.$(OBJEXT) main.$(OBJEXT) \ + fh.$(OBJEXT) filelist.$(OBJEXT) metaops.$(OBJEXT) \ + rwlock.$(OBJEXT) cirlist.$(OBJEXT) rbt.$(OBJEXT) \ + ffsb_tg.$(OBJEXT) ffsb_fs.$(OBJEXT) ffsb_thread.$(OBJEXT) \ + ffsb_op.$(OBJEXT) util.$(OBJEXT) parser.$(OBJEXT) \ + ffsb_fc.$(OBJEXT) ffsb_stats.$(OBJEXT) list.$(OBJEXT) +ffsb_OBJECTS = $(am_ffsb_OBJECTS) +ffsb_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(ffsb_SOURCES) +DIST_SOURCES = $(ffsb_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ffsb_SOURCES = \ + fileops.c \ + rand.c \ + config.h \ + fileops.h \ + ffsb.h \ + rand.h \ + main.c \ + fh.h \ + fh.c \ + filelist.c \ + filelist.h \ + metaops.c \ + metaops.h \ + rwlock.h \ + rwlock.c \ + cirlist.c \ + cirlist.h \ + rbt.c \ + rbt.h \ + ffsb_tg.h \ + ffsb_tg.c \ + ffsb_fs.h \ + ffsb_fs.c \ + ffsb_thread.c \ + ffsb_thread.h \ + ffsb_op.h \ + ffsb_op.c \ + util.h \ + util.c \ + parser.c \ + parser.h \ + ffsb_fc.c \ + ffsb_stats.c \ + list.c + + +#ffsb_test_SOURCES = config.h fileops.h ffsb.h rand.h fh.h filelist.h metaops.h rwlock.h cirlist.h rbt.h ffsb_tg.h ffsb_fs.h ffsb_thread.h ffsb_op.h util.h parser.c parser.h ffsb_test.c +EXTRA_DIST = *.txt *.tex +AM_CFLAGS = -D_GNU_SOURCE +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +ffsb$(EXEEXT): $(ffsb_OBJECTS) $(ffsb_DEPENDENCIES) + @rm -f ffsb$(EXEEXT) + $(LINK) $(ffsb_OBJECTS) $(ffsb_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cirlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffsb_fc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffsb_fs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffsb_op.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffsb_stats.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffsb_tg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffsb_thread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fh.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filelist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileops.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metaops.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rand.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rbt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rwlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) config.h +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ + distclean distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS + + +#CFLAGS += -Wall -Werror -g -Wconversion -ansi +#LDFLAGS += -lefence +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/README b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/README new file mode 100644 index 00000000..746f0f5f --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/README @@ -0,0 +1,413 @@ +Introduction: + +The Flexible Filesystem Benchmark (FFSB) is a filesystem performance +measurement tool. It is a multi-threaded application (using +pthreads), written entirely in C with cross-platform portability in +mind. It differs from other filesystem benchmarks in that the user +may supply a profile to create custom workloads, while most other +filesystem benchmarks use a fixed set of workloads. + +As of version 5.1, it supports seven different basic operations, support +for multiple groups of threads with different operation mixtures, +support for operation across multiple filesystems, and support for +filesystem aging prior to benchmarking. + + +Differences from version 4.0 and older: + +Version 5.0 and above represent almost a total re-write and many +things have changed. In version 5.0 and above FFSB moved to a +time-regulated run versus doing a set number of different operations +and timing the whole thing. This is primarily to better deal with the +use of multiple threadgroups which would otherwise not be synchronized +at termination time. + +Additionally, the FFSB configuration file format has changed in +version 5.0, although we do support old-style configuration files +along with a run-time passed on the command line. In this mode, +version 5.0 and above ignores the iterations parameter, and simply +uses the time specified on the command line. + +Behaviorally, most of the old operations are the same -- sequential +reads and sequential writes work as they did before. One change in +version 5.0 is the skip-read behavior of reading then seeking forward +a fixed amount then reading again is removed, we now support fully +randomized reads and writes from random offsets within the file. + +Version 4.0 didn't support overwrites (only appends) so we interpret +writes in old config files to be append operations. + +On Linux, CPU utilization information will only be accurate for +systems using NPTL, older Linuxthreads systems will probably only see +zeros for CPU utilization because Linuxthreads is non-compliant to +POSIX. Version 4.0 and older could be recompiled to work on +Linuxthreads, but in 5.0 and later we no longer support this. + +We no longer support the "outputfile" on the command line. + +One should simply use tee or similar to capture the output. FFSB +unbuffers standard out for this purpose, and errors are sent on +standard error. + +Global options: + +There are eight valid global options placed at the beginning of the +profile. Three of them are required: num_filesystems (number of +filesystems), num_threadgroups (number of threadgroups), and time +(running time of the benchmark). The other five options are: + +directio - each call to open will be made using O_DIRECT +alignio - aligns all block operations for random reads and writes + on 4k boundaries. +bufferedio - currently ignorred: it is intended to use libc + fread,rwrite, instead of just unix read and write calls +verbose - currently ignored + +callout - calls and external command and waits for its termination + before FFSB begins the benchmark phase. + This is useful for synchronizing distributed clients, + starting profilers, etc. + +They must be specified in the above order (num_filesystems, +num_threadgroups, time, directio, alignio, bufferedio, verbose, +callout). + + + +Filesystems: + +Filesystems are specified to FFSB in the form of a directory. FFSB +assumes that the filesystem is mounted at this directory and will not +do any verification of this fact beyond ensuring it can read/write to +the location. So be careful to ensure something with enough space to +handle the dataset is in fact mounted at the specified location. + +In the filesystem clause of the profile, one may set the starting +number of files and directories as well as a minimum and maximum +filesize for the filesystem. One may also specify the blocksize +used for creating the files separately in the filesystem clause. + +Also, if a filesystem is to be aged, a special threadgroup clause may +be embedded in a filesystem clause to specify the operation mixture +and number of threads used to age the filesystem. This threadgroup is +run until filesystem utilization reaches the specified amount. + +Inheritance -- if you are using multiple filesystems, all attributes +except the location should be inherited from the previous filesystem. +This is done to make it easier to add groups of similar filesystems. +In this case, only the location is required in the filesystem clause. + +As of version 5.1, filesystem re-use is supported if a given +filesystem hasn't been modified beyond it's orginal specifications +(number of files and directories is correct, and file sizes are within +specifications). This can be a huge time saver if one wishes to do +multiple runs on the same data-set without altering it during a run, +because the fileset doesn't need to be recreated before each run. + +To do this, specify "reuse=1" in the filesystem clause, and FFSB will +verify the fileset first, and if it checks out it will use it. +Otherwise, it will remove everything and re-create the filesets for +that filesystem. + +Threadgroups: + +An arbitrary number of threadgroups with differing numbers of threads +and operation mixes can be specified. The operations are specified +using a weighting for each operation, if an operation isn't specified +it's weighting is assumed to be zero (not used). + +"Think-time" for a threadgroup may also be specified in millisecond +amounts using the "op_delay" parameter, where every thread will wait +for the specified amount between each operation. + +Operations: + +All operations begin by randomly selecting a filesystem from the list +of filesystems specified in the profile. The distribution aims to be +uniform across all filesystems. + + +The seven operations are: + +reads - read() calls with an overall amount and a blocksize + operates on existing files. Care must be taken to ensure + that the read amount is smaller than the size of any possible + file. + + If random_read is specified, then the each individual blocks + will be read starting from a random point with the file, and + this will continune until the entire amount specifed has been + read. This offset of each random block will be totally + random to the byte level, unless the "alignio" global parameter + is on, and then the reads will be 4096 byte aligned. This is + generally recommended. + + +readall - Very similar to read above, except it doesn't take an + amount; it simply reads the entire file sequentially using the + read_blocksize. This is useful for situations where + different filesystems have differently sized files, and sequential + read patterns across all filesystems are desired. + +writes - write() calls with an overall amount and blocksize + this is an overwrite operation and will not enlarge an existing + file, again one must be careful not to specify a write amount + that is larger than any possible file in the data set. + + If random_write is specified, then the each individual blocks + will be written starting from a random point with the file, and + this will continune until the entire amount specifed has been + written out. This offset of each random block will be totally + random to the byte level, unless the "alignio" global parameter + is on, and then the writes will be 4096 byte aligned. This + is generally recommended. + + If the fsync_flag parameter for the threadgroup is non-zero, + then after all of the write calls are finished, fsync() will + be called on the file descriptor before the file is closed. + + +creates - creates a file using open() call and determines the size + randomly between on the constraints (min_filesize and + max_filesize) for the selected filesystem. Write operations will + be done using the same blocksize as is specified for the + write operation. +deletes - calls unlink() on a filename and removes it from the + internal data-structures. One must be careful to ensure + there are enough files to delete at all times or else the benchmark + will terminate. +appends - calls write() using the append flag with an overall amount + and a blocksize to be appended onto a randomly chosen file. +metas - this is actually a mix of several different directory + operations. Each "meta" operation consists of two directory + creates, one directory remove, and a directory rename. + These operations are all carried out separately from the + other 5 operations. + +Operation accounting: + +Each operation which uses a blocksize counts each read/write of a +blocksize as an operation (reads,writes,creates, and appends) whereas +deletes and metas are considered single operations. + +Running the benchmark: + +There are three phases to running the benchmark, aging, fileset +creates, and the benchmark phase. + +The create phase is carried out across all filesystems simultanously +with one dedicated thread per filesystem. + +After the create phase, sync() is called to ensure all dirty data gets +written out before the benchmark phase begins, and sync() is again +called at the end of the benchmark phase. The time in sync() at the +end of the benchmark phase is counted as part of the benchmark phase. + +Caveats/Holes/Bugs: + +Aging and aging across multiple filesystems simultaneously hasn't been tested +very much. + +If *any* i/o operation or system call/libc call fails, the benchmark +will terminate immediately. + +The parser doesn't handle mal-formed or incorrect profiles very well +(or at all). + +The parser doesn't check to make sure all of the appropriate options +have been specified. For example, if writes are specified in a +threadgroup but write_blocksize isn't specified, the parse won't catch +it, but the benchmark run will fail later on. + + +Configuration Files (new style): + +New Style Configuration allows for arbitrary newlines between lines, +and comments using '#' at the start of a line. Also it allows tabs, +whitespace before and after configuration parameters. + +The new style configuration file is broken up into three main parts: + +global parameters, filesystems, and threadgroups + +The sections must be in the above order. + +Global parameters: + +Global Paramters are described above, the first three are always +required. Example: + +---------- + +num_filesystems=1 +num_threadgroups=1 +time=30 # time is in seconds + +directio=0 # don't use direct io +alignio=1 # align random IOs to 4k +bufferedio=0 # this does nothing right now +verbose=0 # this does nothing right now + + # calls and external command and waits + # everything until the newline is taken + # so you can have abritrary parmeters +callout=synchronize.sh myhostname + +--------- + +All of these must appear in this order, though you can leave out the +optional ones. + +Filesystems: + +Filesystems describe differnt logical sets of files residing in +different directorys. There is no strict requirement that they +actually be on different filesystems, only that the directory +specified already exists. + +Filesystems are specified by a clause with a filesystem number like +this: + +[filesystem0] + location=/mnt/testing/ + num_files=10 + num_dirs=1 + max_filesize=4096 + min_filesize=4096 +[end0] + + +The clause must always begin with [filesystemX] and end with [endX] +where X is the number of that filesystem. + +You should start wiht X = 0, and increment by one for each following +filesystem. If they are out of order, things will likely break. + +The required information for each filesystem is: location, num_files, +num_dirs, max_filesize, and min_filesize. Beyond those the following +four options are supported: + + + +reuse=1 # check the filesystem to see if it is reusable + + # filesystem aging, three components required + # takes agefs=1 to turn it on + # then a valid threadgroup specification + # then a desired utilization percentage + +agefs=1 # age the filesystem according to the following threadgroup + [threadgroup0] + num_threads=10 + write_size=40960 + write_blocksize=4096 + create_weight=10 + append_weight=10 + delete_weight=1 + [end0] +desired_util=0.20 # In this case, age until the fs is 20% full + +create_blocksize=4096 # specify the blocksize to write() + # for creating the fileset, defaults to 4096 + +age_blocksize=4096 # specify the blocksize to write() for aging + + +Also, to allow lazy people to use lots of filesystems, we support +filesystem inheritance, which simply copies all options but the +location from the previous filesystem clause if nothing is specified. +Obviously, this doesn't work for filesystem0. (May not work for aging +either?) + +Full blown filesystem clause example: + +---- + +[filesystem0] + + # required parts + + location=/home/sonny/tmp + num_files=100 + num_dirs=100 + max_filesize=65536 + min_filesize=4096 + + # aging part + agefs=0 + [threadgroup0] + num_threads=10 + write_size=40960 + write_blocksize=4096 + create_weight=10 + append_weight=10 + delete_weight=1 + [end0] + desired_util=0.02 # age until 2% full + + # other optional commands + + create_blocksize=1024 # use a small create blocksize + age_blocksize=1024 # and smaller age create blocksize + reuse=0 # don't reuse it +[end0] + + + +-- + +Threadgroups: + +Threadgropus are very similar to filesystems in that any number of +them can be specified in clauses, and they must be in order starting +with threadgroup0. + +Example: + +--- + +[threadgroup0] + num_threads=32 + read_weight=4 + append_weight=1 + + write_size=4096 + write_blocksize=4096 + + read_size=4096 + read_blocksize=4096 +[end0] + +--- + +In a threadgroup clause, num_threads is required and must be at least +1. Then, at least one operation must be given a weight greater than 0 +to be a valid threadgroup. Operations can be given a weighting of 0, +and in this case they are ignored. + +Certain operations will also require other commands, for example, if +read_weight is greater than zero, then one must also include a +read_size and a read_blocksize. Here's the table of requirements and +options: + + +Operation Requirements Options +-- -- -- +read_weight read_size, read_blocksize read_random +readall_weight read_blocksize none +write_weight write_size, write_blocksize write_random,fsync_file +create_weight write_blocksize or create_blocksize none +append_weight write_blocksize, write_size none +delete_weight none none +meta_weight none none + + + +Other threadgroup options: + +op_delay=10 # specify a wait between operations in milli-seconds + +bindfs=3 # This allows you to restrict a threadgroup's operation + # to a specific filesystem number. Currently only + # binding to one specific filesystem is supported + diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/cirlist.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/cirlist.c new file mode 100644 index 00000000..799ae449 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/cirlist.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include + +#include "cirlist.h" +#include "util.h" + + +void init_cirlist(struct cirlist *cl) +{ + cl->count = 0; + cl->head = NULL; +} + +int cl_empty(struct cirlist *cl) +{ + return !(cl->count); +} + +void cl_insert_tail(struct cirlist *cl , cldatatype object) +{ + struct cnode *new = ffsb_malloc(sizeof(struct cnode)); + new->obj = object; + if (cl->count == 0) { + assert(cl->head == NULL); + cl->head = new; + cl->head->next = cl->head; + cl->head->prev = cl->head; + cl->count = 1; + } else { + if (cl->count == 1) { + assert(cl->head->next == cl->head); + assert(cl->head->prev == cl->head); + cl->head->next = new; + cl->head->prev = new; + new->next = cl->head; + new->prev = cl->head; + } else { + assert(cl->head->next != cl->head); + assert(cl->head->prev != cl->head); + + new->next = cl->head; + new->prev = (cl->head)->prev; + cl->head->prev->next = new; + cl->head->prev = new; + } + cl->count++; + } +} + +cldatatype cl_remove_head(struct cirlist *cl) +{ + struct cnode *oldhead = NULL; + struct cnode *newhead = NULL; + cldatatype ret = NULL; + + if (cl->count == 0) { + assert(cl->head == NULL); + return NULL; + } + if (cl->count == 1) { + assert(cl->head->next == cl->head); + assert(cl->head->prev == cl->head); + oldhead = cl->head; + cl->head = NULL; + cl->count = 0; + } else if (cl->count == 2) { + oldhead = cl->head; + newhead = oldhead->next; + newhead->next = newhead; + newhead->prev = newhead; + cl->head = newhead; + cl->count = 1; + } else { + assert(cl->head->next != cl->head); + assert(cl->head->prev != cl->head); + oldhead = cl->head; + newhead = oldhead->next; + newhead->prev = oldhead->prev; + newhead->prev->next = newhead; + cl->head = newhead; + cl->count--; + } + ret = oldhead->obj; + oldhead->obj = (void *)(-1); + oldhead->next = (void *)(-1); + oldhead->prev = (void *)(-1); + free(oldhead); + + return ret; +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/cirlist.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/cirlist.h new file mode 100644 index 00000000..565578c2 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/cirlist.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _CIRLIST_H +#define _CIRLIST_H + +#include "filelist.h" + +typedef struct ffsb_file *cldatatype; + +struct cnode { + cldatatype obj; + struct cnode *next; + struct cnode *prev; +}; + +struct cirlist { + int count; + struct cnode *head; +}; + +void init_cirlist(struct cirlist *cl); +int cl_empty(struct cirlist *cl); +void cl_insert_tail(struct cirlist *cl , cldatatype object); +cldatatype cl_remove_head(struct cirlist *cl); + +#endif /* _CIRLIST_H */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/config.h.in b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/config.h.in new file mode 100644 index 00000000..8e1aa840 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/config.h.in @@ -0,0 +1,130 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `fseeko64' function. */ +#undef HAVE_FSEEKO64 + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#undef HAVE_LIBPTHREAD + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the `lrand48_r' function. */ +#undef HAVE_LRAND48_R + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mkdir' function. */ +#undef HAVE_MKDIR + +/* Define to 1 if you have the `open64' function. */ +#undef HAVE_OPEN64 + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define to 1 if you have the `srand48_r' function. */ +#undef HAVE_SRAND48_R + +/* Define to 1 if you have the `stat64' function. */ +#undef HAVE_STAT64 + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `system' function. */ +#undef HAVE_SYSTEM + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_VFS_H + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if the C compiler supports function prototypes. */ +#undef PROTOTYPES + +/* Define to 1 if the `setvbuf' function takes the buffering type as its + second argument and the buffer pointer as the third, as on System V before + release 3. */ +#undef SETVBUF_REVERSED + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif + +/* Define like PROTOTYPES; this can be used by system headers. */ +#undef __PROTOTYPES + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/configure b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/configure new file mode 100755 index 00000000..12d5202f --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/configure @@ -0,0 +1,7000 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="main.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +am__isrc +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +CPP +GREP +EGREP +LIBOBJS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.10' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_save_IFS + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=ffsb + VERSION=6.0-RC2 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +ac_config_headers="$ac_config_headers config.h" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +{ echo "$as_me:$LINENO: checking for AIX" >&5 +echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef _AIX + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF + +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +rm -f conftest* + + + +case "${host}" in + *aix*) + CFLAGS="${CFLAGS} -D_THREAD_SAFE" + ;; + *linux*) + CFLAGS="${CFLAGS} -D_REENTRANT" + ;; + *) + echo "detected unknown platform : ${host} : compiles may fail" + CFLAGS="${CFLAGS} -D_REENTRANT" + ;; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + +{ echo "$as_me:$LINENO: checking for main in -lm" >&5 +echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6; } +if test "${ac_cv_lib_m_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_m_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_m_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 +echo "${ECHO_T}$ac_cv_lib_m_main" >&6; } +if test $ac_cv_lib_m_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + + +{ echo "$as_me:$LINENO: checking for main in -lpthread" >&5 +echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; } +if test "${ac_cv_lib_pthread_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_pthread_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; } +if test $ac_cv_lib_pthread_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +fi + + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main () +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_sys_wait_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_sys_wait_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SYS_WAIT_H 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + +for ac_header in pthread.h fcntl.h limits.h stdint.h sys/time.h unistd.h sys/vfs.h sys/limits.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_time=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + + +{ echo "$as_me:$LINENO: checking for function prototypes" >&5 +echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6; } +if test "$ac_cv_prog_cc_c89" != no; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define PROTOTYPES 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define __PROTOTYPES 1 +_ACEOF + +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +{ echo "$as_me:$LINENO: checking whether setvbuf arguments are reversed" >&5 +echo $ECHO_N "checking whether setvbuf arguments are reversed... $ECHO_C" >&6; } +if test "${ac_cv_func_setvbuf_reversed+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_func_setvbuf_reversed=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +# ifdef PROTOTYPES + int (setvbuf) (FILE *, int, char *, size_t); +# endif +int +main () +{ +char buf; return setvbuf (stdout, _IOLBF, &buf, 1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +# ifdef PROTOTYPES + int (setvbuf) (FILE *, int, char *, size_t); +# endif +int +main () +{ +char buf; return setvbuf (stdout, &buf, _IOLBF, 1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + # It compiles and links either way, so it must not be declared + # with a prototype and most likely this is a K&R C compiler. + # Try running it. + if test "$cross_compiling" = yes; then + : # Assume setvbuf is not reversed when cross-compiling. +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +/* This call has the arguments reversed. + A reversed system may check and see that the address of buf + is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */ + char buf; + if (setvbuf (stdout, _IOLBF, &buf, 1) != 0) + return 1; + putchar ('\r'); + return 0; /* Non-reversed systems SEGV here. */ + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_setvbuf_reversed=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + ac_cv_func_setvbuf_reversed=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_setvbuf_reversed" >&5 +echo "${ECHO_T}$ac_cv_func_setvbuf_reversed" >&6; } +if test $ac_cv_func_setvbuf_reversed = yes; then + +cat >>confdefs.h <<\_ACEOF +#define SETVBUF_REVERSED 1 +_ACEOF + +fi + + + + + + + + + + +for ac_func in system gettimeofday mkdir strerror open64 stat64 fseeko64 lrand48_r srand48_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + +ac_config_files="$ac_config_files Makefile" + +ac_config_commands="$ac_config_commands default" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 88; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f $ac_file + mv "$tmp/config.h" $ac_file + fi + else + echo "/* $configure_input */" + cat "$ac_result" + fi + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_arg=$ac_file +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + "default":C) echo timestamp > stamp-h ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/configure.in b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/configure.in new file mode 100644 index 00000000..9ce49d21 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/configure.in @@ -0,0 +1,49 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(main.c) +AM_INIT_AUTOMAKE(ffsb, 6.0-RC2) + +AM_CONFIG_HEADER(config.h) +AC_CANONICAL_HOST + +dnl need to define _ALL_SOURCE and _THREAD_SAFE on AIX +AC_AIX + +case "${host}" in + *aix*) + CFLAGS="${CFLAGS} -D_THREAD_SAFE" + ;; + *linux*) + CFLAGS="${CFLAGS} -D_REENTRANT" + ;; + *) + echo "detected unknown platform : ${host} : compiles may fail" + CFLAGS="${CFLAGS} -D_REENTRANT" + ;; +esac + +dnl Checks for programs. +AC_PROG_CC + +dnl Checks for libraries. +dnl Replace `main' with a function in -lm: +AC_CHECK_LIB(m, main) +dnl Replace `main' with a function in -lpthread: +AC_CHECK_LIB(pthread, main) + + +dnl Checks for header files. +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS(pthread.h fcntl.h limits.h stdint.h sys/time.h unistd.h sys/vfs.h sys/limits.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_HEADER_TIME + +dnl Checks for library functions. +AC_FUNC_SETVBUF_REVERSED +AC_CHECK_FUNCS(system gettimeofday mkdir strerror open64 stat64 fseeko64 lrand48_r srand48_r) + +AC_SUBST(CFLAGS) +AC_SUBST(CC) +AC_OUTPUT(Makefile, echo timestamp > stamp-h) diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/depcomp b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/depcomp new file mode 100755 index 00000000..aea3d007 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/depcomp @@ -0,0 +1,472 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000 Free Software Foundation, 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, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi +# `libtool' can also be set to `yes' or `no'. + +if test -z "$depfile"; then + base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` + dir=`echo "$object" | sed 's,/.*$,/,'` + if test "$dir" = "$object"; then + dir= + fi + # FIXME: should be _deps on DOS. + depfile="$dir.deps/$base" +fi + +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. This file always lives in the current directory. + # Also, the AIX compiler puts `$object:' at the start of each line; + # $object doesn't have directory information. + stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + outname="$stripped.o" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + tmpdepfile1="$dir.libs/$base.lo.d" + tmpdepfile2="$dir.libs/$base.d" + "$@" -Wc,-MD + else + tmpdepfile1="$dir$base.o.d" + tmpdepfile2="$dir$base.d" + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a space and a tab in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/examples/profile_everything b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/examples/profile_everything new file mode 100644 index 00000000..67972e1e --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/examples/profile_everything @@ -0,0 +1,119 @@ +directio = 0 +time = 10 + +[filesystem] + location = /mnt/test1 + + num_dirs = 100 + + size_weight 4k 33 + size_weight 8k 21 + size_weight 16k 13 + size_weight 32k 10 + size_weight 64k 8 + size_weight 128k 5 + size_weight 256k 4 + size_weight 512k 3 + size_weight 8m 2 + size_weight 32m 1 +# size_weight 1g 1 + +# min_filesize = 4k +# max_filesize = 10m + +# num_files = 0 + init_size = 100m +# init_size = 6GB +# init_size = 1gb +# init_util = 0.002 + + agefs = 0 + [threadgroup] + num_threads = 10 + write_size = 400 + write_blocksize = 1024 + create_weight = 10 + append_weight = 10 + delete_weight = 1 + [end] + desired_util = 0.005 + + +[end] + +#[filesystem] +# location = /mnt/test1 +# clone = /mnt/test2 +#[end] + +[threadgroup] + num_threads = 4 + +# bindfs = /mnt/test1 + + append_weight = 1 + append_fsync_weight = 1 + stat_weight = 1 +# write_weight = 1 +# write_fsync_weight = 1 +# read_weight = 1 + create_weight = 1 + create_fsync_weight = 1 + delete_weight = 1 + readall_weight = 1 + writeall_weight = 1 + writeall_fsync_weight = 1 + open_close_weight = 1 + + read_random = 0 + write_random = 0 + + write_size = 40k + write_blocksize = 4k + read_size = 40k + read_blocksize = 4k + + op_delay = 0 + + [stats] + enable_stats = 1 + enable_range = 0 + +# ignore = close +# ignore = open +# ignore = lseek +# ignore = write +# ignore = read + + msec_range 0.00 0.01 + msec_range 0.01 0.02 + msec_range 0.02 0.03 + msec_range 0.03 0.04 + msec_range 0.04 0.05 + msec_range 0.05 0.1 + msec_range 0.1 0.2 + msec_range 0.2 0.5 + msec_range 0.5 1.0 + msec_range 1.0 2.0 + msec_range 2.0 3.0 + msec_range 3.0 4.0 + msec_range 4.0 5.0 + msec_range 5.0 10.0 + msec_range 10.0 10000.0 + [end] +[end] + +#[threadgroup] +# num_threads = 1 +# +# readall_weight = 0 +# writeall_weight = 0 +# createdir_weight = 0 +# +# write_size = 4096 +# write_blocksize = 4096 +# read_size = 4096 +# read_blocksize = 4096 +# +# op_delay = 12 +#[end] diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb.h new file mode 100644 index 00000000..ad9fcad6 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _FFSB_H_ +#define _FFSB_H_ + +#include +#include +#include +#include +#include + +#include "config.h" + +#include "ffsb_op.h" +#include "ffsb_tg.h" +#include "ffsb_fs.h" + +/* + * The main thread wakes up once in so many seconds to check elapsed + * time this is a tunable for that sleep interval in seconds + */ + +#define FFSB_TG_WAIT_TIME (1) + +#define MARK printf("MARK FUNC: %s() @ %s:%d\n", __FUNCTION__, __FILE__, __LINE__); + +struct results { + struct rusage before; + struct rusage after; + double runtime; + double cputime; + double cpu_before; + double cpu_after; + double cpu_total; +}; + +struct ffsb_tg; +struct ffsb_fs; + +typedef struct profile_config { + struct config_options *global; + struct container *fs_container; + struct container *tg_container; +} profile_config_t; + +typedef struct ffsb_config { + unsigned time; + + unsigned num_filesys; + unsigned num_threadgroups; + + int num_totalthreads; /* gets calculated after init() */ + + struct ffsb_tg *groups; + struct ffsb_fs *filesystems; + + struct profile_config *profile_conf; + char *callout; /* we will try and exec this */ + + struct results results; +} ffsb_config_t; + +void init_ffsb_config(ffsb_config_t *fc, unsigned num_fs, unsigned num_tg); + +/* + * this is kind of like a special case "constructor" which is only + * used by fs-aging code to build a fake config for the aging tg + */ +void init_ffsb_config_1fs(ffsb_config_t *fc, struct ffsb_fs *fs, + struct ffsb_tg *tg); + +void destroy_ffsb_config(ffsb_config_t *fc); + +/* getters/setters, parser only should use setters */ + +void fc_set_time(ffsb_config_t *fc, unsigned time); + +void fc_set_num_totalthreads(ffsb_config_t *fc, int num); + +/* num is zero-based */ +/* get a particular threadgroup object */ +struct ffsb_tg *fc_get_tg(ffsb_config_t *fc, unsigned num); + +/* get a particular filesystem object */ +struct ffsb_fs *fc_get_fs(ffsb_config_t *fc, unsigned num); + +void fc_set_callout(ffsb_config_t *fc, char *callout); +char *fc_get_callout(ffsb_config_t *fc); + +#endif diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fc.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fc.c new file mode 100644 index 00000000..99de871e --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fc.c @@ -0,0 +1,112 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "config.h" + +#include "ffsb.h" +#include "util.h" +#include "parser.h" + +void init_ffsb_config(ffsb_config_t *fc, unsigned num_fs, unsigned num_tg) +{ + memset(fc, 0, sizeof(ffsb_config_t)); + + fc->num_totalthreads = -1; + fc->num_threadgroups = num_tg; + fc->num_filesys = num_fs; + + fc->groups = ffsb_malloc(sizeof(ffsb_tg_t) * num_tg); + fc->filesystems = ffsb_malloc(sizeof(ffsb_fs_t) * num_fs); +} + +void init_ffsb_config_1fs(ffsb_config_t *fc, ffsb_fs_t *fs, ffsb_tg_t *tg) +{ + memset(fc, 0, sizeof(*fc)); + + fc->num_totalthreads = tg_get_numthreads(tg); + fc->num_threadgroups = 1; + fc->num_filesys = 1; + + fc->groups = tg; + fc->filesystems = fs; +} + +void destroy_ffsb_config(ffsb_config_t *fc) +{ + int i; + for (i = 0; i < fc->num_filesys; i++) + destroy_ffsb_fs(&fc->filesystems[i]); + + for (i = 0; i < fc->num_threadgroups; i++) + destroy_ffsb_tg(&fc->groups[i]); + + free(fc->groups); + free(fc->filesystems); +} + +void fc_set_time(ffsb_config_t *fc, unsigned time) +{ + fc->time = time; +} + +unsigned fc_get_num_filesys(ffsb_config_t *fc) +{ + return fc->num_filesys; +} + + + +struct ffsb_tg *fc_get_tg(ffsb_config_t *fc, unsigned num) +{ + assert(num < fc->num_threadgroups); + return &fc->groups[num]; +} + +struct ffsb_fs *fc_get_fs(ffsb_config_t *fc, unsigned num) +{ + assert(num < fc->num_filesys); + return &fc->filesystems[num]; +} + +void fc_set_num_totalthreads(ffsb_config_t *fc, int num) +{ + assert(num > 0); + fc->num_totalthreads = num; +} + +void fc_set_callout(ffsb_config_t *fc, char *callout) +{ + if (fc->callout) + free(fc->callout); + fc->callout = ffsb_strdup(callout); +} + +char *fc_get_callout(ffsb_config_t *fc) +{ + return fc->callout; +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.c new file mode 100644 index 00000000..9715406d --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.c @@ -0,0 +1,634 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include +#include + +#include "ffsb_fs.h" +#include "util.h" +#include "fh.h" + +/* First zero out struct, set num_dirs, and strdups basedir */ +void init_ffsb_fs(ffsb_fs_t *fs, char *basedir, uint32_t num_data_dirs, + uint32_t numstartfiles, unsigned flags) +{ + memset(fs, 0, sizeof(ffsb_fs_t)); + fs->basedir = ffsb_strdup(basedir); + fs->num_dirs = num_data_dirs; + fs->num_start_files = numstartfiles; + fs->flags = flags; + fs->create_blocksize = FFSB_FS_DEFAULT_CREATE_BLOCKSIZE; + fs->age_blocksize = FFSB_FS_DEFAULT_AGE_BLOCKSIZE; + fs->age_fs = 0; +} + +/* + * Does not remove files/dirs on disk, only frees up data + * structures +*/ +void destroy_ffsb_fs(ffsb_fs_t *fs) +{ + free(fs->basedir); + destroy_filelist(&fs->files); + destroy_filelist(&fs->fill); + destroy_filelist(&fs->meta); +} + +void clone_ffsb_fs(ffsb_fs_t *target, ffsb_fs_t *orig) +{ + target->basedir = orig->basedir; + target->flags = orig->flags; + + /* !!!! hackish, write a filelist_clone() function later */ + memcpy(&target->files, &orig->files, sizeof(orig->files)); + memcpy(&target->fill, &orig->fill, sizeof(orig->fill)); + memcpy(&target->meta, &orig->meta, sizeof(orig->meta)); + + target->num_dirs = orig->num_dirs; + target->num_start_files = orig->num_start_files; + target->minfilesize = orig->minfilesize; + target->maxfilesize = orig->maxfilesize; + + target->start_fsutil = orig->start_fsutil; + target->desired_fsutil = orig->desired_fsutil; + + target->age_fs = orig->age_fs; + target->num_age_dirs = orig->num_age_dirs; + target->aging_tg = orig->aging_tg; + + target->create_blocksize = orig->create_blocksize; + target->age_blocksize = orig->age_blocksize; + + memcpy(target->op_data, orig->op_data, sizeof(void *) * FFSB_NUMOPS); +} + +static void add_files(ffsb_fs_t *fs, struct benchfiles *bf, int num, + uint64_t minsize, uint64_t maxsize, unsigned blocksize) +{ + struct ffsb_file *cur; + int i, fd, condition = 0, has_directio = 0; + randdata_t rd; + char *buf = ffsb_malloc(blocksize); + uint64_t initial_free = getfsutil_size(fs->basedir); + + if (fs_get_directio(fs)) { + has_directio = 1; + fs_set_directio(fs, 0); + } + + assert(blocksize); + + init_random(&rd, 0); + + if (num) + condition = num; + else if (fs->init_size) { + if (getfsutil(fs->basedir) != initial_free || + fs->init_size > (getfsutil_size(fs->basedir) - + initial_free)) + condition = 1; + else + condition = 0; + } + else if (fs->init_fsutil) { + if (fs->init_fsutil > getfsutil(fs->basedir)) + condition = 1; + else + condition = 0; + } + + while (condition) { + uint64_t size; + if (fs->num_weights) { + int num = 1 + getrandom(&rd, fs->sum_weights); + int curop = 0; + + while (fs->size_weights[curop].weight < num) { + num -= fs->size_weights[curop].weight; + curop++; + } + size = fs->size_weights[curop].size; + } + else + size = minsize + getllrandom(&rd, maxsize - minsize); + + cur = add_file(bf, size, &rd); + fd = fhopencreate(cur->name, NULL, fs); + writefile_helper(fd, size, blocksize, buf, NULL, fs); + fhclose(fd, NULL, fs); + unlock_file_writer(cur); + + if (num) + condition--; + else if (fs->init_size) { + if (fs->init_size > getfsutil_size(fs->basedir) - + initial_free) + condition = 1; + else + condition = 0; + } + else if (fs->init_fsutil) { + if (fs->init_fsutil > getfsutil(fs->basedir)) + condition = 1; + else + condition = 0; + } + + } + free(buf); + if (has_directio) + fs_set_directio(fs, 1); +} + +static void age_fs(ffsb_fs_t *fs, double utilization); +static ffsb_fs_t *construct_new_fileset(ffsb_fs_t *fs); +static ffsb_fs_t *check_existing_fileset(ffsb_fs_t *fs); + +void *construct_ffsb_fs(void *data) +{ + ffsb_fs_t *fs = (ffsb_fs_t *)data; + ffsb_fs_t *ret = NULL; + + if (fs_get_reuse_fs(fs)) { + printf("checking existing fs: %s\n", fs->basedir); + ret = check_existing_fileset(fs); + if (ret == NULL) { + printf("recreating new fileset\n"); + ret = construct_new_fileset(fs); + } + } else { + printf("creating new fileset %s\n", fs->basedir); + ret = construct_new_fileset(fs); + } + if (ret == NULL) { + printf("fs setup on %s failed\n", fs->basedir); + exit(1); + } + return ret; +} + +static int verify_file(struct benchfiles *bf, char *fname, void *fs_ptr) +{ + ffsb_fs_t *fs = (ffsb_fs_t *)fs_ptr; + uint64_t minsize = fs->minfilesize; + uint64_t maxsize = fs->maxfilesize; + uint64_t filesize = 0; + int fd = 0; + DIR *dirptr = NULL; + + /* If it is a directory and it passed the name verification we + * don't need to do anything here + */ + dirptr = opendir(fname); + if (dirptr) { + closedir(dirptr); + return 0; + } + + fd = open(fname, O_RDONLY); + /* If we can't open it for read we're done */ + if (fd < 0) { + printf("verify_file: error opening %s for readonly\n", fname); + perror(fname); + return 1; + } + close(fd); + filesize = ffsb_get_filesize(fname); + + if (filesize < minsize || filesize > maxsize) { + printf("size %llu bytes for file %s is invalid\n", + filesize, fname); + return 1; + } + + return 0; +} + +/* Record the number of files and directorys there are supposed to be + * grab (check and build the structures) the regular data fileset then + * check to make sure the number of directories and files in that + * filelist matches up. Then grab the meta filelist and verify that + * the meta filelist is empty. Set up the filelist for fill (aging) + * and setup the ops for the benchmark. +*/ +static ffsb_fs_t *check_existing_fileset(ffsb_fs_t *fs) +{ + char buf[FILENAME_MAX * 3]; + int retval = 0; + uint32_t num_dirs = fs->num_dirs; + uint32_t num_files = fs->num_start_files; + + if (fs->age_fs) { + printf("Aging and reusing the fileset are mutually " + "exclusive\n"); + printf("aborting\n"); + return NULL; + } + + /* Set up bench/age dir */ + if (FILENAME_MAX <= + snprintf(buf, FILENAME_MAX, "%s/%s", fs->basedir, FILES_BASE)) { + printf("pathname \"%s\" is too long, aborting\n", buf); + return NULL; + } + + /* Make a "dummy" filelist that has numsubdirs set to 0 and + * numstartfiles set to 0 + */ + init_filelist(&fs->files, buf, FILES_BASE, 0, 0); + + retval = grab_old_fileset(&fs->files, buf, verify_file, fs); + + if (retval) + return NULL; + + if ((get_listsize(&fs->files) != num_files) || + (get_numsubdirs(&fs->files) != num_dirs)) { + printf("check_existing_fileset: number of files (%u)" + " or directorys (%u) don't match up\n", + get_listsize(&fs->files), get_numsubdirs(&fs->files)); + destroy_filelist(&fs->files); + return NULL; + } + + if (FILENAME_MAX <= + snprintf(buf, FILENAME_MAX, "%s/%s", fs->basedir, META_BASE)) { + printf("pathname \"%s\" is too long, aborting\n", buf); + return NULL; + } + + init_filelist(&fs->meta, buf, META_BASE, 0, 1); + retval = grab_old_fileset(&fs->meta, buf, verify_file, fs); + + if (retval) { + destroy_filelist(&fs->files); + return NULL; + } + + if ((get_listsize(&fs->meta) != 0) || + (get_numsubdirs(&fs->meta) != 0)) { + printf("check_existing_fileset: meta directory isn't empty\n" + "aborting\n"); + destroy_filelist(&fs->files); + destroy_filelist(&fs->meta); + return NULL; + } + + /* Even though we won't use it, we still need to be consistent + * here. + */ + init_filelist(&fs->fill, buf, AGE_BASE, 0, 0); + + /* Have to do this or everything else could break. */ + ops_setup_bench(fs); + + return fs; +} + +/* + * clean up fs, "rm -rf data meta" + * record utilization + * set up the dirs: files, meta + * age filesystem + * have ffsb_ops setup their data + * create starting files in files + */ +static ffsb_fs_t *construct_new_fileset(ffsb_fs_t *fs) +{ + char buf[FILENAME_MAX * 3]; + + /* TODO: Convert this quick and dirty rm -rf to a "real" + * programmatic version, that doesn't rely on the rm command. + */ + if (FILENAME_MAX * 3 <= snprintf(buf, FILENAME_MAX * 3, + "rm -rf %s/data %s/meta", + fs->basedir, fs->basedir)) { + printf("pathname too long for command \"%s\"\n", buf); + return NULL; + } + + if (ffsb_system(buf) < 0) { + perror(buf); + return NULL; + } + + fs->start_fsutil = getfsutil(fs->basedir); + + /* Set up bench/age dir */ + if (FILENAME_MAX <= + snprintf(buf, FILENAME_MAX, "%s/%s", fs->basedir, FILES_BASE)) { + printf("pathname \"%s\" is too long, aborting\n", buf); + return NULL; + } + + ffsb_mkdir(buf); + + /* Regular files and aging share this directory */ + init_filelist(&fs->files, buf, FILES_BASE, fs->num_dirs, 1); + init_filelist(&fs->fill, buf, AGE_BASE, fs->num_age_dirs, 1); + + /* Set up meta dir */ + snprintf(buf, FILENAME_MAX, "%s/%s", fs->basedir, META_BASE); + + ffsb_mkdir(buf); + + init_filelist(&fs->meta, buf, META_BASE, 0, 1); + + /* Do aging */ + if (fs->age_fs) + age_fs(fs, fs->desired_fsutil); + + /* Call back into ops, set for benchmark */ + ops_setup_bench(fs); + + /* Create initial fileset */ + add_files(fs, &fs->files, fs->num_start_files, fs->minfilesize, + fs->maxfilesize, fs->create_blocksize); + return fs; +} + + +struct poll_data { + ffsb_fs_t *fs; + double util; +}; + +static int fs_get_util(void *data) +{ + struct poll_data *pd = (struct poll_data *) data; + double fsutil = getfsutil(pd->fs->basedir); + + if (fsutil >= pd->util) + return 1; + + return 0; +} + +static void age_fs(ffsb_fs_t *fs, double utilization) +{ + ffsb_barrier_t barrier; + pthread_t thread; + struct poll_data pdata; + ffsb_tg_t *tg = fs_get_aging_tg(fs); + tg_run_params_t params; + ffsb_config_t fc; + + printf("aging fs %s from %.2lf to %.2lf\n", fs->basedir, + fs->start_fsutil, utilization); + ffsb_barrier_init(&barrier, tg_get_numthreads(tg)); + + init_ffsb_config_1fs(&fc, fs, tg); + + pdata.fs = fs; + pdata.util = utilization; + + params.tg = tg; + params.poll_fn = fs_get_util; + params.poll_data = &pdata; + params.wait_time = 1; + params.fc = &fc; + + params.tg_barrier = NULL; + params.thread_barrier = &barrier; + + /* Call back into ops, setup for aging */ + ops_setup_age(fs); + + /* Throw in some files to start off, so there's something */ + add_files(fs, &fs->fill, 10, 0, 0, fs->age_blocksize); + + pthread_create(&thread, NULL, tg_run, ¶ms); + pthread_join(thread, NULL); +} + +void fs_set_create_blocksize(ffsb_fs_t *fs, uint32_t blocksize) +{ + fs->create_blocksize = blocksize; +} + +void fs_set_age_blocksize(ffsb_fs_t *fs, uint32_t blocksize) +{ + fs->age_blocksize = blocksize; +} + +uint32_t fs_get_create_blocksize(ffsb_fs_t *fs) +{ + return fs->create_blocksize; +} + +uint32_t fs_get_age_blocksize(ffsb_fs_t *fs) +{ + return fs->age_blocksize; +} + +char *fs_get_basedir(ffsb_fs_t *fs) +{ + return fs->basedir; +} + +uint32_t fs_get_numstartfiles(ffsb_fs_t *fs) +{ + return fs->num_start_files; +} + +uint32_t fs_get_numdirs(ffsb_fs_t *fs) +{ + return fs->num_dirs; +} + +int fs_get_libcio(ffsb_fs_t *fs) +{ + return fs->flags & FFSB_FS_LIBCIO; +} + +void fs_set_libcio(ffsb_fs_t *fs, int lio) +{ + if (lio) + fs->flags |= FFSB_FS_LIBCIO; + else + fs->flags &= ~0 & ~FFSB_FS_LIBCIO; +} + +int fs_get_directio(ffsb_fs_t *fs) +{ + return fs->flags & FFSB_FS_DIRECTIO; +} + +void fs_set_directio(ffsb_fs_t *fs, int dio) +{ + if (dio) + fs->flags |= FFSB_FS_DIRECTIO; + else + fs->flags &= ~0 & ~FFSB_FS_DIRECTIO; +} + +int fs_get_alignio(ffsb_fs_t *fs) +{ + return fs->flags & FFSB_FS_ALIGNIO4K; +} + +void fs_set_alignio(ffsb_fs_t *fs, int aio) +{ + if (aio) + fs->flags |= FFSB_FS_ALIGNIO4K; + else + fs->flags &= ~0 & ~FFSB_FS_ALIGNIO4K; +} + +int fs_get_reuse_fs(ffsb_fs_t *fs) +{ + return fs->flags & FFSB_FS_REUSE_FS; +} + +void fs_set_reuse_fs(ffsb_fs_t *fs, int rfs) +{ + if (rfs) + fs->flags |= FFSB_FS_REUSE_FS; + else + fs->flags &= ~0 & ~FFSB_FS_REUSE_FS; +} + +struct benchfiles *fs_get_datafiles(ffsb_fs_t *fs) +{ + return &fs->files; +} + +struct benchfiles *fs_get_metafiles(ffsb_fs_t *fs) +{ + return &fs->meta; +} + +struct benchfiles *fs_get_agefiles(ffsb_fs_t *fs) +{ + return &fs->fill; +} + +void fs_set_aging_tg(ffsb_fs_t *fs, struct ffsb_tg *tg, double util) +{ + fs->aging_tg = tg; + fs->age_fs = 1; + fs->desired_fsutil = util; +} + +struct ffsb_tg *fs_get_aging_tg(ffsb_fs_t *fs) +{ + return fs->aging_tg; +} + +int fs_get_agefs(ffsb_fs_t *fs) +{ + return fs->age_fs; +} + +/* TODO: Implement this!!!*/ +void fs_set_num_age_dirs(ffsb_fs_t *fs, uint32_t numdirs) +{ + fs->num_age_dirs = numdirs; +} + +void fs_set_opdata(ffsb_fs_t *fs, void *data, unsigned opnum) +{ + fs->op_data[opnum] = data; +} + +void *fs_get_opdata(ffsb_fs_t *fs, unsigned opnum) +{ + return fs->op_data[opnum]; +} + +void fs_set_min_filesize(ffsb_fs_t *fs, uint64_t size) +{ + fs->minfilesize = size; +} + +void fs_set_max_filesize(ffsb_fs_t *fs, uint64_t size) +{ + fs->maxfilesize = size; +} + +uint64_t fs_get_min_filesize(ffsb_fs_t *fs) +{ + return fs->minfilesize; +} + +uint64_t fs_get_max_filesize(ffsb_fs_t *fs) +{ + return fs->maxfilesize; +} + +double fs_get_desired_fsutil(ffsb_fs_t *fs) +{ + return fs->desired_fsutil; +} + +void fs_print_config(ffsb_fs_t *fs) +{ + char buf[256]; + + printf("FileSystem %s\n", fs->basedir); + printf("==========\n"); + printf("\t num_dirs = %u\n", fs->num_dirs); + printf("\t starting files = %u\n", fs->num_start_files); + printf("\t\n"); + if (fs->num_weights) { + int i; + printf("\t Fileset weight:\n"); + for (i = 0; i < fs->num_weights; i++) + printf("\t\t %12llu (%6s) -> %u (%.2f\%)\n", + fs->size_weights[i].size, + ffsb_printsize(buf, fs->size_weights[i].size, 256), + fs->size_weights[i].weight, + ((float)fs->size_weights[i].weight / + (float)fs->sum_weights) * 100); + } + else { + printf("\t min file size = %llu\t(%s)\n", fs->minfilesize, + ffsb_printsize(buf, fs->minfilesize, 256)); + printf("\t max file size = %llu\t(%s)\n", fs->maxfilesize, + ffsb_printsize(buf, fs->maxfilesize, 256)); + } + printf("\t directio = %s\n", (fs->flags & FFSB_FS_DIRECTIO) ? + "on" : "off"); + printf("\t alignedio = %s\n", (fs->flags & FFSB_FS_ALIGNIO4K) ? + "on" : "off"); + printf("\t bufferedio = %s\n", (fs->flags & FFSB_FS_LIBCIO) ? + "on" : "off"); + printf("\t\n"); + printf("\t aging is %s\n", (fs->age_fs) ? "on" : "off"); + printf("\t current utilization = %.2f\%\n", getfsutil(fs->basedir)*100); + if (fs->age_fs) { + printf("\t desired utilization = %.2lf%\n", fs->desired_fsutil * 100); + printf("\t \n"); + tg_print_config_aging(fs->aging_tg, fs->basedir); + } + printf("\t\n"); +} + +int fs_needs_stats(ffsb_fs_t *fs, syscall_t sys) +{ + return (fs != NULL) ? (int)fs->fsd.config : 0; +} + +void fs_add_stat(ffsb_fs_t *fs, syscall_t sys, uint32_t val) +{ + if (fs) + ffsb_add_data(&fs->fsd, sys, val); +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.h new file mode 100644 index 00000000..7b381043 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_fs.h @@ -0,0 +1,184 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _FFSB_FS_H_ +#define _FFSB_FS_H_ + +#include "filelist.h" +#include "ffsb_op.h" +#include "ffsb_tg.h" +#include "ffsb_stats.h" + +/* These are the base names for the different file types on a + * filesystem. +*/ +#define FILES_BASE "data" +#define META_BASE "meta" +#define AGE_BASE "fill" + +struct ffsb_tg; + +typedef struct size_weight { + uint64_t size; + int weight; +} size_weight_t; + +/* A filesystem object + * -- + * represents a filesystem on disk, and maintains access to the different + * directories within it. Currently there are two directories created in + * each filesystem: data and meta + * "data" contains the aging files and the working set files + * "meta" only contains directories for use in the metadata operation + * + * Aging + * This object contains methods for aging the filesystem if needed + * a properly set up threadgroup is supplied by the parser which is run + * until the filesystem reaches the desired utilization + * + * Operations + * The semantics of a ffsb operation are always such that they occur on + * a filesystem, so the filesystem also hold operation specific data as + * an opaque type + * One example of how this is useful is the aging process, where a different + * set of files is operated upon than in the regular benchmark and the + * op_data is pointing to the "fill" set rather than the "files" set + */ + +typedef struct ffsb_fs { + char *basedir; + + struct benchfiles files; + struct benchfiles meta; + struct benchfiles fill; + + int flags; +#define FFSB_FS_DIRECTIO (1 << 0) +#define FFSB_FS_ALIGNIO4K (1 << 1) +#define FFSB_FS_LIBCIO (1 << 2) +#define FFSB_FS_REUSE_FS (1 << 3) + + /* These pararmeters pertain to files in the files and fill + * dirs. Meta dir only contains directories, starting with 0. + */ + uint32_t num_dirs; + uint32_t num_start_files; + uint64_t minfilesize, maxfilesize; + double init_fsutil; + uint64_t init_size; + + /* These two parameters specify the blocksize to use for + * writes when creating and aging the fs. + */ + uint32_t create_blocksize, age_blocksize; +#define FFSB_FS_DEFAULT_CREATE_BLOCKSIZE 4096 +#define FFSB_FS_DEFAULT_AGE_BLOCKSIZE 4096 + + double start_fsutil; + + /* Aging data/parameters */ + double desired_fsutil; + int age_fs; + uint32_t num_age_dirs; + + /* Use an ffsb thread group to do the aging work */ + struct ffsb_tg *aging_tg; + + /* If a particular operation wants to maintain fs-specific + * data, it should use this array. Naturally, the ops must + * synchonize access to the data for now, they are all just + * putting pointers to a particular benchfiles struct here, + * which is already sync'ed + */ + void *op_data[FFSB_NUMOPS]; + + /* per-fs stats */ + ffsb_statsc_t fsc; + ffsb_statsd_t fsd; + + size_weight_t *size_weights; + unsigned num_weights; + unsigned sum_weights; + +} ffsb_fs_t; + +/* Set up the structure, zeros everything out and dups the basedir + * string + */ +void init_ffsb_fs(ffsb_fs_t *fs, char *basedir, uint32_t num_data_dirs, + uint32_t num_start_files, unsigned flags); + +/* Does not remove files/dirs on disk, only frees up data + * structures + */ +void destroy_ffsb_fs(ffsb_fs_t *fs); + +/* Set up the files and such on the disk including aging if requested. + * Should call back into each op, which initialize its op_data[] + * entry. Aging is done by starting the aging_tg thread group, and + * waiting until the desired utilization is achieved. It can (and is) + * be used with pthread_create(). Parameter should be a ffsb_fs_t * , + * and it will return the same type + */ +void *construct_ffsb_fs(void *ffsb_fs_ptr); + +/* Shallow clone, original should simply be discarded (not destroyed). + * Generally should only be used by parser to write into the config + * object + */ +void clone_ffsb_fs(ffsb_fs_t *target, ffsb_fs_t *original); + +void fs_print_config(ffsb_fs_t *fs); + +char *fs_get_basedir(ffsb_fs_t *fs); +int fs_get_directio(ffsb_fs_t *fs); +void fs_set_directio(ffsb_fs_t *fs, int dio); +int fs_get_alignio(ffsb_fs_t *fs); +void fs_set_alignio(ffsb_fs_t *fs, int aio); +int fs_get_libcio(ffsb_fs_t *fs); +void fs_set_libcio(ffsb_fs_t *fs, int lio); +int fs_get_reuse_fs(ffsb_fs_t *fs); +void fs_set_reuse_fs(ffsb_fs_t *fs, int rfs); + +struct benchfiles *fs_get_datafiles(ffsb_fs_t *fs); +struct benchfiles *fs_get_metafiles(ffsb_fs_t *fs); +struct benchfiles *fs_get_agefiles(ffsb_fs_t *fs); + +void fs_set_aging_tg(ffsb_fs_t *fs, struct ffsb_tg *, double util); +struct ffsb_tg *fs_get_aging_tg(ffsb_fs_t *fs); +int fs_get_agefs(ffsb_fs_t *fs); + +void fs_set_opdata(ffsb_fs_t *fs, void *data, unsigned opnum); +void *fs_get_opdata(ffsb_fs_t *fs, unsigned opnum); +void fs_set_min_filesize(ffsb_fs_t *fs, uint64_t size); +void fs_set_max_filesize(ffsb_fs_t *fs, uint64_t size); +void fs_set_create_blocksize(ffsb_fs_t *fs, uint32_t blocksize); +void fs_set_age_blocksize(ffsb_fs_t *fs, uint32_t blocksize); +uint32_t fs_get_create_blocksize(ffsb_fs_t *fs); +uint32_t fs_get_age_blocksize(ffsb_fs_t *fs); +uint64_t fs_get_min_filesize(ffsb_fs_t *fs); +uint64_t fs_get_max_filesize(ffsb_fs_t *fs); +uint32_t fs_get_numstartfiles(ffsb_fs_t *fs); +uint32_t fs_get_numdirs(ffsb_fs_t *fs); + +double fs_get_desired_fsutil(ffsb_fs_t *fs); + +/* For these two, fs == NULL is OK */ +int fs_needs_stats(ffsb_fs_t *fs, syscall_t s); +void fs_add_stat(ffsb_fs_t *fs, syscall_t sys, uint32_t val); + +#endif /* _FFSB_FS_H_ */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.c new file mode 100644 index 00000000..0cae5995 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.c @@ -0,0 +1,178 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include + +#include "ffsb_op.h" +#include "fileops.h" +#include "metaops.h" + +ffsb_op_t ffsb_op_list[] = +{{0, "read", ffsb_readfile, READ, fop_bench, NULL}, + {1, "readall", ffsb_readall, READ, fop_bench, NULL}, + {2, "write", ffsb_writefile, WRITE, fop_bench, NULL}, + {3, "create", ffsb_createfile, WRITE, fop_bench, fop_age}, + {4, "append", ffsb_appendfile, WRITE, fop_bench, fop_age}, + {5, "delete", ffsb_deletefile, NA, fop_bench, fop_age}, + {6, "metaop", ffsb_metaops, NA, metaops_metadir, NULL}, + {7, "createdir", ffsb_createdir, NA, fop_bench, NULL}, + {8, "stat", ffsb_stat, NA, fop_bench, NULL}, + {9, "writeall", ffsb_writeall, WRITE, fop_bench, NULL}, + {10, "writeall_fsync", ffsb_writeall_fsync, WRITE, fop_bench, NULL}, + {11, "open_close", ffsb_open_close, NA, fop_bench, NULL}, + {12, "write_fsync", ffsb_writefile_fsync, WRITE, fop_bench, NULL}, + {13, "create_fsync", ffsb_createfile_fsync, WRITE, fop_bench, fop_age}, + {14, "append_fsync", ffsb_appendfile_fsync, WRITE, fop_bench, fop_age}, +}; + +void init_ffsb_op_results(ffsb_op_results_t *results) +{ + memset(results, 0, sizeof(ffsb_op_results_t)); +} + +static int exclusive_op(ffsb_op_results_t *results, unsigned int op_num) +{ + int i; + int ret = 0; + for (i = 0; i < FFSB_NUMOPS ; i++) { + if (i == op_num) + continue; + ret += results->ops[i]; + } + + if (ret) + return 0; + return 1; +} + +static void generic_op_print(char *name, unsigned num, double op_pcnt, + double weigth_pcnt, double runtime, char *tput) +{ + printf("%20s : %12u\t%10.2lf\t%6.3lf%%\t\t%6.3lf%%\t %11s\n", + name, num, num/runtime, op_pcnt, weigth_pcnt, tput); +} + +static void print_op_results(unsigned int op_num, ffsb_op_results_t *results, + double runtime, unsigned total_ops, + unsigned total_weight) +{ + char buf[256]; + + double op_pcnt = 100 * (double)results->ops[op_num] / + (double)total_ops; + double weight_pcnt = 100 * (double)results->op_weight[op_num] / + (double)total_weight; + if (ffsb_op_list[op_num].throughput) { + ffsb_printsize (buf, results->bytes[op_num] / runtime, 256); + sprintf(buf, "%s/sec\0", buf); + } + else + sprintf(buf, "NA\0"); + generic_op_print(ffsb_op_list[op_num].op_name, results->ops[op_num], + op_pcnt, weight_pcnt, runtime, buf); +} + +#if 0 +static void print_op_throughput(unsigned int op_num, ffsb_op_results_t *results, + double runtime) +{ + if (ffsb_op_list[op_num].op_exl_print_fn != NULL) + ffsb_op_list[op_num].op_exl_print_fn(results, runtime, op_num); +} +#endif + +void print_results(struct ffsb_op_results *results, double runtime) +{ + int i; + uint64_t total_ops = 0; + uint64_t total_weight = 0; + char buf[256]; + + for (i = 0; i < FFSB_NUMOPS ; i++) { + total_ops += results->ops[i]; + total_weight += results->op_weight[i]; + } + + printf(" Op Name Transactions\t Trans/sec\t% Trans\t % Op Weight\t Throughput\n"); + printf(" ======= ============\t =========\t=======\t ===========\t ==========\n"); + for (i = 0; i < FFSB_NUMOPS ; i++) + if (results->ops[i] != 0) + print_op_results(i, results, runtime, total_ops, + total_weight); + printf("-\n%.2lf Transactions per Second\n\n", (double)total_ops / runtime); + + if (results->write_bytes || results->read_bytes) + printf("Throughput Results\n===================\n"); + if (results->read_bytes) { + ffsb_printsize(buf, results->read_bytes / runtime, 256); + printf("Read Throughput: %s/sec\n", buf); + } + if (results->write_bytes) { + ffsb_printsize(buf, results->write_bytes / runtime, 256); + printf("Write Throughput: %s/sec\n", buf); + } +} + + +char *op_get_name(int opnum) +{ + return ffsb_op_list[opnum].op_name; +} + +void ops_setup_bench(ffsb_fs_t *fs) +{ + int i; + for (i = 0; i < FFSB_NUMOPS; i++) + ffsb_op_list[i].op_bench(fs, i); +} + +void ops_setup_age(ffsb_fs_t *fs) +{ + int i; + for (i = 0; i < FFSB_NUMOPS; i++) + if (ffsb_op_list[i].op_age) + ffsb_op_list[i].op_age(fs, i); +} + +int ops_find_op(char *opname) +{ + int i; + for (i = 0; i < FFSB_NUMOPS; i++) + if (!strcmp(opname, ffsb_op_list[i].op_name)) + return i; + return -1; +} + +void add_results(struct ffsb_op_results *target, struct ffsb_op_results *src) +{ + int i; + target->read_bytes += src->read_bytes; + target->write_bytes += src->write_bytes; + + for (i = 0; i < FFSB_NUMOPS; i++) { + target->ops[i] += src->ops[i]; + target->op_weight[i] += src->op_weight[i]; + target->bytes[i] += src->bytes[i]; + } +} + +void do_op(struct ffsb_thread *ft, struct ffsb_fs *fs, unsigned op_num) +{ + ffsb_op_list[op_num].op_fn(ft, fs, op_num); +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.h new file mode 100644 index 00000000..1b4509b1 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_op.h @@ -0,0 +1,102 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _FFSB_OP_H_ +#define _FFSB_OP_H_ + +#include +#include +#include + +struct ffsb_op_results; +struct ffsb_thread; +struct ffsb_fs; + +#define NA 0x00 +#define READ 0x01 +#define WRITE 0x02 + +/* This file handles all of the operations FFSB supports. It has + * tight interactions with the filesystem objects, but is otherwise + * pretty abstract. + */ + +/* The op callback */ +typedef void (*ffsb_op_fn)(struct ffsb_thread *, struct ffsb_fs *, + unsigned op_num); + +/* Operation results printing function */ +typedef void (*ffsb_op_print_fn)(struct ffsb_op_results *, double secs, + unsigned int op_num); + +/* Operation specific initialization for a filesystem */ +typedef void (*ffsb_op_fs_fn)(struct ffsb_fs *, unsigned opnum); + +typedef struct ffsb_op { + unsigned int op_id; + char *op_name; + ffsb_op_fn op_fn; + + unsigned int throughput; + /* The point of these two fields is to determine which set of + * files are being worked on. Currently either data, meta, or + * aging. Data and meta are mutually exclusive, so we only + * need two funcs. + */ + ffsb_op_fs_fn op_bench; + ffsb_op_fs_fn op_age; +} ffsb_op_t; + +/* List of all operations, located in ffsb_op.c */ +extern ffsb_op_t ffsb_op_list[]; + +/* This *must* be updated when a new operation is added or one is + * removed several other structures use it for statically sized arrays + */ +#define FFSB_NUMOPS (15) + +/* Returns index of an op. + * Returns -1 if opname isn't found, and its case sensitive :) + */ +int ops_find_op(char *opname); + +typedef struct ffsb_op_results { + /* Count of how many times each op was run */ + unsigned int ops[FFSB_NUMOPS]; + unsigned int op_weight[FFSB_NUMOPS]; + uint64_t bytes[FFSB_NUMOPS]; + + uint64_t read_bytes; + uint64_t write_bytes; +} ffsb_op_results_t; + +void init_ffsb_op_results(struct ffsb_op_results *); +void print_results(struct ffsb_op_results *results, double runtime); +char *op_get_name(int opnum); + +/* Setup the ops for the benchmark */ +void ops_setup_bench(struct ffsb_fs *fs); + +/* setup the ops for aging the filesystem */ +void ops_setup_age(struct ffsb_fs *fs); + +void add_results(struct ffsb_op_results *target, struct ffsb_op_results *src); + +/* Run this op, using this thread state, on this filesystem */ +void do_op(struct ffsb_thread *ft, struct ffsb_fs *fs, unsigned op_num); + +#endif /* _FFSB_OP_H_ */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.c new file mode 100644 index 00000000..d3e20fd3 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.c @@ -0,0 +1,241 @@ +#include +#include +#include +#include "ffsb_stats.h" +#include "util.h" + +char *syscall_names[] = { + "open", + "read", + "write", + "create", + "lseek", + "unlink", + "close", + "stat", +}; + +/* yuck, just for the parser anyway.. */ +int ffsb_stats_str2syscall(char *str, syscall_t *sys) +{ + int i; + int ret; + for (i = 0; i < FFSB_NUM_SYSCALLS; i++) { + ret = strncasecmp(syscall_names[i], str, + strlen(syscall_names[i])); + /* printf("%s = syscall_names[%d] vs %str ret = %d\n", + * syscall_names[i],i,str,ret); + */ + if (0 == ret) { + *sys = (syscall_t)i; /* ewww */ + /* printf("matched syscall %s\n",syscall_names[i]); */ + return 1; + } + } + printf("warning: failed to get match for syscall %s\n", str); + return 0; +} + +void ffsb_statsc_init(ffsb_statsc_t *fsc) +{ + fsc->num_buckets = 0; + fsc->buckets = NULL; + fsc->ignore_stats = 0; +} + +void ffsb_statsc_addbucket(ffsb_statsc_t *fsc, uint32_t min, uint32_t max) +{ + struct stat_bucket *temp; + fsc->num_buckets++; + + /* printf("ffsb_realloc(): fsc_buckets = %d\n",fsc->num_buckets); */ + temp = ffsb_realloc(fsc->buckets, sizeof(struct stat_bucket) * + fsc->num_buckets); + + fsc->buckets = temp; + + /* Convert to micro-secs from milli-secs */ + fsc->buckets[fsc->num_buckets-1].min = min ; + fsc->buckets[fsc->num_buckets-1].max = max ; +} + +void ffsb_statsc_destroy(ffsb_statsc_t *fsc) +{ + free(fsc->buckets); +} + +void ffsb_statsc_ignore_sys(ffsb_statsc_t *fsc, syscall_t s) +{ + /* printf("fsis: oring 0x%x with 0x%x\n", + * fsc->ignore_stats, + * (1 << s ) ); + */ + fsc->ignore_stats |= (1 << s); +} + +int fsc_ignore_sys(ffsb_statsc_t *fsc, syscall_t s) +{ + return fsc->ignore_stats & (1 << s); +} + +void ffsb_statsd_init(ffsb_statsd_t *fsd, ffsb_statsc_t *fsc) +{ + int i; + memset(fsd, 0, sizeof(*fsd)); + + for (i = 0; i < FFSB_NUM_SYSCALLS; i++) { + fsd->totals[i] = 0; + fsd->mins[i] = UINT_MAX; + fsd->maxs[i] = 0; + fsd->buckets[i] = ffsb_malloc(sizeof(uint32_t) * + fsc->num_buckets); + assert(fsd->buckets[i] != NULL); + + memset(fsd->buckets[i], 0, sizeof(uint32_t) * + fsc->num_buckets); + } + fsd->config = fsc; +} + +void ffsb_statsd_destroy(ffsb_statsd_t *fsd) +{ + int i ; + for (i = 0 ; i < FFSB_NUM_SYSCALLS; i++) + free(fsd->buckets[i]); +} + +void ffsb_add_data(ffsb_statsd_t *fsd, syscall_t s, uint32_t value) +{ + unsigned num_buckets, i; + struct stat_bucket *bucket_defs; + + if (!fsd || fsc_ignore_sys(fsd->config, s)) + return; + + if (value < fsd->mins[s]) + fsd->mins[s] = value; + if (value > fsd->maxs[s]) + fsd->maxs[s] = value; + + fsd->counts[s]++; + fsd->totals[s] += value; + + if (fsd->config->num_buckets == 0) + return; + + num_buckets = fsd->config->num_buckets; + bucket_defs = fsd->config->buckets; + + for (i = 0; i < num_buckets; i++) { + struct stat_bucket *b = &bucket_defs[i]; + + if (value <= b->max && value >= b->min) { + fsd->buckets[s][i]++; + break; + } + } +} + +void ffsb_statsc_copy(ffsb_statsc_t *dest, ffsb_statsc_t *src) +{ + memcpy(dest, src, sizeof(*src)); +} + +void ffsb_statsd_add(ffsb_statsd_t *dest, ffsb_statsd_t *src) +{ + int i, j; + unsigned num_buckets; + if (dest->config != src->config) + printf("ffsb_statsd_add: warning configs do not" + "match for data being collected\n"); + + num_buckets = dest->config->num_buckets; + + for (i = 0; i < FFSB_NUM_SYSCALLS; i++) { + dest->counts[i] += src->counts[i]; + dest->totals[i] += src->totals[i]; + + if (src->mins[i] < dest->mins[i]) + dest->mins[i] = src->mins[i]; + if (src->maxs[i] > dest->maxs[i]) + dest->maxs[i] = src->maxs[i]; + + for (j = 0; j < num_buckets; j++) + dest->buckets[i][j] += src->buckets[i][j]; + } +} + +static void print_buckets_helper(ffsb_statsc_t *fsc, uint32_t *buckets) +{ + int i; + if (fsc->num_buckets == 0) { + printf(" -\n"); + return; + } + for (i = 0; i < fsc->num_buckets; i++) { + struct stat_bucket *sb = &fsc->buckets[i]; + printf("\t\t msec_range[%d]\t%f - %f : %8u\n", + i, (double)sb->min/1000.0f, (double)sb->max/1000.0f, + buckets[i]); + } + printf("\n"); +} + +void ffsb_statsd_print(ffsb_statsd_t *fsd) +{ + int i; + printf("\nSystem Call Latency statistics in millisecs\n" "=====\n"); + printf("\t\tMin\t\tAvg\t\tMax\t\tTotal Calls\n"); + printf("\t\t========\t========\t========\t============\n"); + for (i = 0; i < FFSB_NUM_SYSCALLS; i++) + if (fsd->counts[i]) { + printf("[%7s]\t%05f\t%05lf\t%05f\t%12u\n", + syscall_names[i], (float)fsd->mins[i] / 1000.0f, + (fsd->totals[i] / (1000.0f * + (double)fsd->counts[i])), + (float)fsd->maxs[i] / 1000.0f, fsd->counts[i]); + print_buckets_helper(fsd->config, fsd->buckets[i]); + } +} + +#if 0 /* Testing */ + +void *ffsb_malloc(size_t s) +{ + void *p = malloc(s); + assert(p != NULL); + return p; +} + +int main(int arc, char *argv[]) +{ + ffsb_statsc_t fsc; + ffsb_statsd_t fsd; + int i ; + + printf("init\n"); + + ffsb_statsc_init(&fsc, 10); + ffsb_statsc_setbucket(&fsc, 0, 0.0f, 50.0f); + ffsb_statsc_setbucket(&fsc, 1, 50.0f, 10000.0f); + ffsb_statsc_setbucket(&fsc, 2, 0.1f, 0.2f); + ffsb_statsc_setbucket(&fsc, 3, 0.0f, 50.0f); + ffsb_statsc_setbucket(&fsc, 4, 50.0f, 10000.0f); + ffsb_statsc_setbucket(&fsc, 5, 0.1f, 0.2f); + ffsb_statsc_setbucket(&fsc, 6, 0.0f, 50.0f); + ffsb_statsc_setbucket(&fsc, 7, 50.0f, 10000.0f); + ffsb_statsc_setbucket(&fsc, 8, 0.1f, 0.2f); + ffsb_statsc_setbucket(&fsc, 9, 50.0f, 10000.0f); + ffsb_statsd_init(&fsd, &fsc); + + printf("test\n"); + for (i = 0; i < 50000000; i++) + ffsb_add_data(&fsd, SYS_READ, (float)i); + + printf("cleanup\n"); + ffsb_statsd_destroy(&fsd); + ffsb_statsc_destroy(&fsc); + return 0; +} + +#endif /* Testing */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.h new file mode 100644 index 00000000..8718eed5 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_stats.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _FFSB_STATS_H_ +#define _FFSB_STATS_H_ + +#include + +/* Latency statistics collection extension. + * + * For now, we are going to collect latency info on each (most) + * syscalls using gettimeofday. Unfortunately, it is the + * responsibility of each operation to collect this timing info. We + * try to make this easier by providing a function that does the + * timing for supported syscalls. + * + * We want the ability to collect the average latency for a particular + * call, and also to collect latency info for user specified intervals + * -- called "buckets" + */ + +struct stat_bucket { + uint32_t min; + uint32_t max; + /* max = 0 indicates uninitialized bucket */ +}; + +/* These are all the syscalls we currently support */ +typedef enum { SYS_OPEN = 0, + SYS_READ, + SYS_WRITE, + SYS_CREATE, + SYS_LSEEK, + SYS_UNLINK, + SYS_CLOSE, + SYS_STAT +} syscall_t; + +/* ASCII versions of the syscall names */ +extern char *syscall_names[]; + +/* Return 1 on success, 0 on error */ +int ffsb_stats_str2syscall(char *, syscall_t *); + +/* Keep it in sync with syscall_t */ +#define FFSB_NUM_SYSCALLS (8UL) + +/* What stats to collect, shared among all threads */ +typedef struct ffsb_stats_config { + unsigned num_buckets; + struct stat_bucket *buckets; + + /* Ignore stats collection for some syscalls. + * Each bit corresponds to one syscall. + */ + uint32_t ignore_stats; +} ffsb_statsc_t; + +void ffsb_statsc_init(ffsb_statsc_t *); +void ffsb_statsc_addbucket(ffsb_statsc_t *, uint32_t min, uint32_t max); +void ffsb_statsc_ignore_sys(ffsb_statsc_t *, syscall_t s); +void ffsb_statsc_destroy(ffsb_statsc_t *); + +/* If we are collecting stats, then the config field is non-NULL */ +typedef struct ffsb_stats_data { + ffsb_statsc_t *config; + uint32_t counts[FFSB_NUM_SYSCALLS]; + uint64_t totals[FFSB_NUM_SYSCALLS]; /* cumulative sums */ + uint64_t mins[FFSB_NUM_SYSCALLS]; + uint64_t maxs[FFSB_NUM_SYSCALLS]; + uint32_t *buckets[FFSB_NUM_SYSCALLS]; /* bucket counters */ +} ffsb_statsd_t ; + +/* constructor/destructor */ +void ffsb_statsd_init(ffsb_statsd_t *, ffsb_statsc_t *); +void ffsb_statsd_destroy(ffsb_statsd_t *); + +/* Add data to a stats data struct. Value should be in microsecs + * _NOT_ milli-secs + */ +void ffsb_add_data(ffsb_statsd_t *, syscall_t, uint32_t); + +/* Make a copy of a stats config */ +void ffsb_statsc_copy(ffsb_statsc_t *, ffsb_statsc_t *); + +/* Add two statsd structs together */ +void ffsb_statsd_add(ffsb_statsd_t *, ffsb_statsd_t *); + +/* Print out statsd structure */ +void ffsb_statsd_print(ffsb_statsd_t *fsd); + +/* Do we want stats for the specified syscall */ +int fsc_ignore_sys(ffsb_statsc_t *fsc, syscall_t s); + +#endif /* _FFSB_STATS_H_ */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.c new file mode 100644 index 00000000..908e89c2 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.c @@ -0,0 +1,369 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include + +#include "ffsb_tg.h" +#include "util.h" + +void init_ffsb_tg(ffsb_tg_t *tg, unsigned num_threads, unsigned tg_num) +{ + int i; + memset(tg, 0, sizeof(ffsb_tg_t)); + + tg->threads = ffsb_malloc(sizeof(ffsb_thread_t) * num_threads); + tg->tg_num = tg_num; + tg->num_threads = num_threads; + + tg->bindfs = -1; /* default is not bound */ + + tg->thread_bufsize = 0; + for (i = 0 ; i < num_threads ; i++) + init_ffsb_thread(tg->threads + i, tg, 0, tg_num, i); +} + +void destroy_ffsb_tg(ffsb_tg_t *tg) +{ + int i; + for (i = 0; i < tg->num_threads; i++) + destroy_ffsb_thread(tg->threads + i); + free(tg->threads); + if (tg_needs_stats(tg)) + ffsb_statsc_destroy(&tg->fsc); +} + +void *tg_run(void *data) +{ + tg_run_params_t *params = (tg_run_params_t *)data; + ffsb_tg_t *tg = params->tg; + int i; + pthread_attr_t attr; + + pthread_attr_init(&attr); + pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); + + tg->start_barrier = params->thread_barrier; + + /* Sum up the weights for use later by tg_get_op() */ + tg->sum_weights = 0; + for (i = 0; i < FFSB_NUMOPS; i++) + tg->sum_weights += tg->op_weights[i]; + + tg->fc = params->fc; + tg->flagval = -1; + tg->stopval = 1; + + /* spawn threads */ + for (i = 0; i < tg->num_threads; i++) { + ffsb_thread_t *ft = &tg->threads[i]; + pthread_create(&ft->ptid, &attr, ft_run, ft); + } + + if (params->tg_barrier) + ffsb_barrier_wait(params->tg_barrier); + + /* wait for termination condition to be true */ + do { + ffsb_sleep(params->wait_time); + } while (params->poll_fn(params->poll_data) == 0); + + /* set flag value */ + tg->flagval = tg->stopval; + + /* wait on theads to finish */ + for (i = 0; i < tg->num_threads; i++) + pthread_join(tg->threads[i].ptid, NULL); + + return NULL; +} + +/* Needs to set params->opnum and params->fs */ +void tg_get_op(ffsb_tg_t *tg, randdata_t *rd, tg_op_params_t *params) +{ + unsigned curop; + int num; + int fsnum; + + num = 1 + getrandom(rd, tg->sum_weights); + curop = 0; + + while (tg->op_weights[curop] < num) { + num -= tg->op_weights[curop]; + curop++; + } + + params->opnum = curop; + + /* If we're bound to a particular filesystem, use that, + * otherwise, pick one at random. + */ + fsnum = tg->bindfs; + if (fsnum < 0) + fsnum = getrandom(rd, tg->fc->num_filesys); + + params->fs = fc_get_fs(tg->fc, fsnum); +} + +void tg_set_op_weight(ffsb_tg_t *tg, char *opname, unsigned weight) +{ + int opnum = ops_find_op(opname); + assert(opnum >= 0); + tg->op_weights[opnum] = weight; +} + +unsigned tg_get_op_weight(ffsb_tg_t *tg, char *opname) +{ + int opnum = ops_find_op(opname); + assert(opnum >= 0); + return tg->op_weights[opnum]; +} + +void tg_set_bindfs(ffsb_tg_t *tg, int fsnum) +{ + tg->bindfs = fsnum; +} + +int tg_get_bindfs(ffsb_tg_t *tg) +{ + return tg->bindfs; +} + +unsigned tg_get_numthreads(ffsb_tg_t *tg) +{ + return tg->num_threads; +} + +static void update_bufsize(ffsb_tg_t *tg) +{ + int i; + uint32_t newmax = max(tg->read_blocksize, tg->write_blocksize); + + if (newmax == max(newmax, tg->thread_bufsize)) + for (i = 0; i < tg->num_threads ; i++) + ft_alter_bufsize(tg->threads + i, newmax); +} + +void tg_set_read_random(ffsb_tg_t *tg, int rr) +{ + tg->read_random = rr; +} + +void tg_set_write_random(ffsb_tg_t *tg, int wr) +{ + tg->write_random = wr; +} + +void tg_set_fsync_file(ffsb_tg_t *tg, int fsync) +{ + tg->fsync_file = fsync; +} + +void tg_set_read_size(ffsb_tg_t *tg, uint64_t rs) +{ + tg->read_size = rs; +} + +void tg_set_read_blocksize(ffsb_tg_t *tg, uint32_t rs) +{ + tg->read_blocksize = rs; + update_bufsize(tg); +} + +void tg_set_read_skip(ffsb_tg_t *tg, int rs) +{ + tg->read_skip = rs; +} + +void tg_set_read_skipsize(ffsb_tg_t *tg, uint32_t rs) +{ + tg->read_skipsize = rs; +} + +void tg_set_write_size(ffsb_tg_t *tg, uint64_t ws) +{ + tg->write_size = ws; +} + +void tg_set_write_blocksize(ffsb_tg_t *tg, uint32_t ws) +{ + tg->write_blocksize = ws; + update_bufsize(tg); +} + +int tg_get_read_random(ffsb_tg_t *tg) +{ + return tg->read_random; +} + +int tg_get_write_random(ffsb_tg_t *tg) +{ + return tg->write_random; +} + +int tg_get_fsync_file(ffsb_tg_t *tg) +{ + return tg->fsync_file; +} + +uint64_t tg_get_read_size(ffsb_tg_t *tg) +{ + return tg->read_size; +} + +uint32_t tg_get_read_blocksize(ffsb_tg_t *tg) +{ + return tg->read_blocksize; +} + +int tg_get_read_skip(ffsb_tg_t *tg) +{ + return tg->read_skip; +} + +uint32_t tg_get_read_skipsize(ffsb_tg_t *tg) +{ + return tg->read_skipsize; +} + +uint64_t tg_get_write_size(ffsb_tg_t *tg) +{ + return tg->write_size; +} + +uint32_t tg_get_write_blocksize(ffsb_tg_t *tg) +{ + return tg->write_blocksize; +} + +int tg_get_stopval(ffsb_tg_t *tg) +{ + return tg->stopval; +} + +ffsb_barrier_t *tg_get_start_barrier(ffsb_tg_t *tg) +{ + return tg->start_barrier; +} + +static void tg_print_config_helper(ffsb_tg_t *tg) +{ + int i; + int sumweights = 0; + char buf[256]; + + printf("\t num_threads = %d\n", tg->num_threads); + printf("\t\n"); + printf("\t read_random = %s\n", (tg->read_random) ? "on" : "off"); + printf("\t read_size = %llu\t(%s)\n", tg->read_size, + ffsb_printsize(buf, tg->read_size, 256)); + printf("\t read_blocksize = %u\t(%s)\n", tg->read_blocksize, + ffsb_printsize(buf, tg->read_blocksize, 256)); + printf("\t read_skip = %s\n", (tg->read_skip) ? "on" : "off"); + printf("\t read_skipsize = %u\t(%s)\n", tg->read_skipsize, + ffsb_printsize(buf, tg->read_skipsize, 256)); + printf("\t\n"); + printf("\t write_random = %s\n", (tg->write_random) ? "on" : "off"); + printf("\t write_size = %llu\t(%s)\n", tg->write_size, + ffsb_printsize(buf, tg->write_size, 256)); + printf("\t fsync_file = %d\n", tg->fsync_file); + printf("\t write_blocksize = %u\t(%s)\n", tg->write_blocksize, + ffsb_printsize(buf, tg->write_blocksize, 256)); + printf("\t wait time = %u\n", tg->wait_time); + if (tg->bindfs >= 0) { + printf("\t\n"); + printf("\t bound to fs %d\n", tg->bindfs); + } + printf("\t\n"); + printf("\t op weights\n"); + + for (i = 0; i < FFSB_NUMOPS; i++) + sumweights += tg->op_weights[i]; + + for (i = 0; i < FFSB_NUMOPS; i++) + printf("\t %20s = %d (%.2f%%)\n", op_get_name(i), + tg->op_weights[i], 100 * (float)tg->op_weights[i] / + (float)sumweights); + printf("\t\n"); +} + +void tg_print_config(ffsb_tg_t *tg) +{ + printf("ThreadGroup %d\n", tg->tg_num); + printf("================\n"); + tg_print_config_helper(tg); +} + +void tg_print_config_aging(ffsb_tg_t *tg, char *fsname) +{ + printf("\t Aging ThreadGroup for fs %s\n", fsname); + printf("\t ================\n"); + tg_print_config_helper(tg); +} + +void tg_collect_results(ffsb_tg_t *tg, ffsb_op_results_t *r) +{ + int i; + for (i = 0; i < tg_get_numthreads(tg); i++) + add_results(r, ft_get_results(tg->threads + i)); +} + +void tg_set_waittime(ffsb_tg_t *tg, unsigned time) +{ + tg->wait_time = time; +} + +unsigned tg_get_waittime(ffsb_tg_t *tg) +{ + return tg->wait_time; +} + +int tg_get_flagval(ffsb_tg_t *tg) +{ + return tg->flagval; +} + +void tg_set_statsc(ffsb_tg_t *tg, ffsb_statsc_t *fsc) +{ + if (fsc) { + int i; + + tg->need_stats = 1; + ffsb_statsc_copy(&tg->fsc, fsc); + + for (i = 0; i < tg->num_threads; i++) + ft_set_statsc(tg->threads + i, &tg->fsc); + } +} + +void tg_collect_stats(ffsb_tg_t *tg, ffsb_statsd_t *fsd) +{ + int i; + + assert(tg->need_stats); + ffsb_statsd_init(fsd, &tg->fsc); + + for (i = 0; i < tg_get_numthreads(tg); i++) + ffsb_statsd_add(fsd, ft_get_stats_data(tg->threads+i)); +} + +int tg_needs_stats(ffsb_tg_t *tg) +{ + return tg->need_stats; +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.h new file mode 100644 index 00000000..2611e0a0 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_tg.h @@ -0,0 +1,206 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _FFSB_TG_H_ +#define _FFSB_TG_H_ +#include +#include +#include + +#include + +#include "ffsb.h" +#include "ffsb_op.h" +#include "ffsb_thread.h" +#include "ffsb_fs.h" +#include "ffsb_stats.h" + +#include "util.h" /* for barrier obj */ + +/* "Thread Group" object defs. + * + * A thread group contains configuration information and can run its + * "gang" of threads performing a particular mix of operations. + * + * The thread group is responsible for creating the ffsb_thread + * objects which must ask the thread group object to select an + * operation and a filesystem to run that operation on. The thread + * objects don't contain any of the configuration information. + * + * Thread groups are also abstracted so they can be "run" arbitrarily + * which is useful because we can reuse them for aging. The running + * is a bit complex, the thread group has to have a callback function + * which is runs at a specified interval to determine when to + * terminate. + * + * To synchronize starting across many thread groups there are two + * barriers used, the first one "tg_barrier" in the run_params is to + * synchronize multiple thread-groups being ready to start, meaning + * that all their threads have been spawned The second one + * "thread_barrier" synchronizes all threads across multiple thread + * groups, so that they all start at once. +*/ + +struct ffsb_thread; +struct ffsb_config; + +typedef struct ffsb_tg { + unsigned tg_num; + unsigned num_threads; + unsigned op_weights[FFSB_NUMOPS]; + struct ffsb_thread *threads; + + /* A threadgroup can be bound to just one filesystem. + * A value * < 0 , means we aren't bound to any. + */ + int bindfs; + + int read_random; /* boolean */ + uint64_t read_size; + uint32_t read_blocksize; + + int read_skip; /* boolean */ + uint32_t read_skipsize; + + int write_random; /* boolean */ + uint64_t write_size; + uint32_t write_blocksize; + + int fsync_file; /* boolean */ + + /* Should be max(write_blocksize, read_blocksize) */ + uint32_t thread_bufsize; + + /* these fields are calculated/set by tg_run() */ + unsigned sum_weights; + struct ffsb_config *fc; + ffsb_barrier_t *start_barrier; + + /* Used for stopping the threads */ + int flagval; + int stopval; + + /* Delay between every operation, in milliseconds*/ + unsigned wait_time; + + /* stats configuration */ + int need_stats; + ffsb_statsc_t fsc; +} ffsb_tg_t; + +/* Init should be the very first thing called on the tg. After that, + * the user can call the set methods and finally run. + */ +void init_ffsb_tg(ffsb_tg_t *tg, unsigned num_threads, unsigned tg_num); +void destroy_ffsb_tg(ffsb_tg_t *tg); + +/* Parameters needed to fire off a thread group. The main thread will + * evaluate poll_fn(poll_data) until it gets a nonzero return value. + * It will sleep for wait_time secs between calls The ffsb_config + * struct is needed for fs selection. Barriers are to synchronize + * multiple tgs and all threads pt is for pthread_create() + */ +typedef struct tg_run_params { + ffsb_tg_t *tg; + int (*poll_fn)(void *); + void *poll_data; + unsigned wait_time; /* in sec */ + struct ffsb_config *fc; + ffsb_barrier_t *tg_barrier; + + /* Should be initialized by caller to tg_run() */ + ffsb_barrier_t *thread_barrier; + pthread_t pt; +} tg_run_params_t; + +/* This function is meant to be called as a parameter to + * pthread_create() + */ +void *tg_run(void *); + +void tg_print_config(ffsb_tg_t *tg); +void tg_print_config_aging(ffsb_tg_t *tg, char *fsname); + +/* Adds all of this tg's results to res */ +void tg_collect_results(ffsb_tg_t *tg, ffsb_op_results_t *res); + +/* Adds up all this tg's stats to totals */ +void tg_collect_stats(ffsb_tg_t *tg, ffsb_statsd_t *totals); + +/* getters/setters, setters should not be called after a run has begun */ + +void tg_set_statsc(ffsb_tg_t *tg, ffsb_statsc_t *fsc); + +void tg_set_bindfs(ffsb_tg_t *tg, int fsnum); +int tg_get_bindfs(ffsb_tg_t *tg); + +unsigned tg_get_numthreads(ffsb_tg_t *tg); + +void tg_set_op_weight(ffsb_tg_t *tg, char *opname, unsigned weight); +unsigned tg_get_op_weight(ffsb_tg_t *tg, char *opname); + +void tg_set_read_random(ffsb_tg_t *tg, int rr); +void tg_set_write_random(ffsb_tg_t *tg, int wr); +void tg_set_fsync_file(ffsb_tg_t *tg, int fsync); + +int tg_get_read_random(ffsb_tg_t *tg); +int tg_get_write_random(ffsb_tg_t *tg); +int tg_get_fsync_file(ffsb_tg_t *tg); + +void tg_set_read_size(ffsb_tg_t *tg, uint64_t rs); +void tg_set_read_blocksize(ffsb_tg_t *tg, uint32_t rs); + +void tg_set_read_skipsize(ffsb_tg_t *tg, uint32_t rs); +void tg_set_read_skip(ffsb_tg_t *tg, int rs); + +void tg_set_write_size(ffsb_tg_t *tg, uint64_t ws); +void tg_set_write_blocksize(ffsb_tg_t *tg, uint32_t ws); + +uint64_t tg_get_read_size(ffsb_tg_t *tg); +uint32_t tg_get_read_blocksize(ffsb_tg_t *tg); + +int tg_get_read_skip(ffsb_tg_t *tg); +uint32_t tg_get_read_skipsize(ffsb_tg_t *tg); + +uint64_t tg_get_write_size(ffsb_tg_t *tg); +uint32_t tg_get_write_blocksize(ffsb_tg_t *tg); + +void tg_set_waittime(ffsb_tg_t *tg, unsigned time); +unsigned tg_get_waittime(ffsb_tg_t *tg); + +/* The threads in the tg should be the only ones using these (below) + * funcs. + */ +ffsb_barrier_t *tg_get_start_barrier(ffsb_tg_t *tg); +int tg_get_stopval(ffsb_tg_t *tg); +int tg_get_flagval(ffsb_tg_t *tg); + +/* The threads in this tg will use this function to get an op to run, + * so all configuration specific information is kept in this object. + */ +typedef struct tg_op_params { + struct ffsb_fs *fs; /* out parameter */ + unsigned opnum; /* out parameter */ +} tg_op_params_t; + +/* tg and rd and in parameters, everything in params is out */ +void tg_get_op(ffsb_tg_t *tg, randdata_t *rd, tg_op_params_t *params); + +/* want stats for this tg ? */ +int tg_needs_stats(ffsb_tg_t *tg); + +#endif /* _FFSB_TG_H_ */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_thread.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_thread.c new file mode 100644 index 00000000..e3a20399 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_thread.c @@ -0,0 +1,171 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "ffsb_tg.h" +#include "ffsb_thread.h" +#include "ffsb_op.h" +#include "util.h" + +void init_ffsb_thread(ffsb_thread_t *ft, struct ffsb_tg *tg, unsigned bufsize, + unsigned tg_num, unsigned thread_num) +{ + memset(ft, 0, sizeof(ffsb_thread_t)); + + ft->tg = tg; + ft->tg_num = tg_num; + ft->thread_num = thread_num; + + if (bufsize) + ft_alter_bufsize(ft, bufsize); + + init_random(&ft->rd, MAX_RANDBUF_SIZE); +} + +void destroy_ffsb_thread(ffsb_thread_t *ft) +{ + free(ft->mallocbuf); + destroy_random(&ft->rd); + if (ft->fsd.config) + ffsb_statsd_destroy(&ft->fsd); +} + +void ft_set_statsc(ffsb_thread_t *ft, ffsb_statsc_t *fsc) +{ + ffsb_statsd_init(&ft->fsd, fsc); +} + +void *ft_run(void *data) +{ + ffsb_thread_t *ft = (ffsb_thread_t *)data; + tg_op_params_t params; + unsigned wait_time = tg_get_waittime(ft->tg); + int stopval = tg_get_stopval(ft->tg); + + ffsb_barrier_wait(tg_get_start_barrier(ft->tg)); + + while (tg_get_flagval(ft->tg) != stopval) { + tg_get_op(ft->tg, &ft->rd, ¶ms); + do_op(ft, params.fs, params.opnum); + ffsb_milli_sleep(wait_time); + } + return NULL; +} + +void ft_alter_bufsize(ffsb_thread_t *ft, unsigned bufsize) +{ + if (ft->mallocbuf != NULL) + free(ft->mallocbuf); + ft->mallocbuf = ffsb_malloc(bufsize + 4096); + ft->alignedbuf = ffsb_align_4k(ft->mallocbuf + (4096 - 1)); +} + +char *ft_getbuf(ffsb_thread_t *ft) +{ + return ft->alignedbuf; +} + + +int ft_get_read_random(ffsb_thread_t *ft) +{ + return tg_get_read_random(ft->tg); +} + +uint32_t ft_get_read_size(ffsb_thread_t *ft) +{ + return tg_get_read_size(ft->tg); +} + +uint32_t ft_get_read_blocksize(ffsb_thread_t *ft) +{ + return tg_get_read_blocksize(ft->tg); +} + +int ft_get_write_random(ffsb_thread_t *ft) +{ + return tg_get_write_random(ft->tg); +} + +uint32_t ft_get_write_size(ffsb_thread_t *ft) +{ + return tg_get_write_size(ft->tg); +} + +uint32_t ft_get_write_blocksize(ffsb_thread_t *ft) +{ + return tg_get_write_blocksize(ft->tg); +} + +int ft_get_fsync_file(ffsb_thread_t *ft) +{ + return tg_get_fsync_file(ft->tg); +} + +randdata_t *ft_get_randdata(ffsb_thread_t *ft) +{ + return &ft->rd; +} + +void ft_incr_op(ffsb_thread_t *ft, unsigned opnum, unsigned increment, uint64_t bytes) +{ + ft->results.ops[opnum] += increment; + ft->results.op_weight[opnum]++; + ft->results.bytes[opnum] += bytes; +} + +void ft_add_readbytes(ffsb_thread_t *ft, uint32_t bytes) +{ + ft->results.read_bytes += bytes; +} + +void ft_add_writebytes(ffsb_thread_t *ft, uint32_t bytes) +{ + ft->results.write_bytes += bytes; +} + +ffsb_op_results_t *ft_get_results(ffsb_thread_t *ft) +{ + return &ft->results; +} + +int ft_get_read_skip(ffsb_thread_t *ft) +{ + return tg_get_read_skip(ft->tg); +} + +uint32_t ft_get_read_skipsize(ffsb_thread_t *ft) +{ + return tg_get_read_skipsize(ft->tg); +} + +int ft_needs_stats(ffsb_thread_t *ft, syscall_t sys) +{ + int ret = 0; + if (ft && ft->fsd.config && !fsc_ignore_sys(ft->fsd.config, sys)) + ret = 1; + return ret; +} + +void ft_add_stat(ffsb_thread_t *ft, syscall_t sys, uint32_t val) +{ + if (ft) + ffsb_add_data(&ft->fsd, sys, val); +} + +ffsb_statsd_t *ft_get_stats_data(ffsb_thread_t *ft) +{ + return &ft->fsd; +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_thread.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_thread.h new file mode 100644 index 00000000..c4315a5c --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/ffsb_thread.h @@ -0,0 +1,108 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _FFSB_THREAD_H_ +#define _FFSB_THREAD_H_ + +#include +#include + +#include "rand.h" +#include "ffsb_op.h" +#include "ffsb_tg.h" +#include "ffsb_stats.h" + +#include "util.h" /* for barrier stuff */ + +struct ffsb_tg; +struct ffsb_op_results; + +/* FFSB thread object + * + * The thread object doesn't store any configuration information, it + * mostly just holds per-thread state information such as the random + * data store and the per-thread buffer to copy data to/from disk + */ + +typedef struct ffsb_thread { + unsigned thread_num; + unsigned tg_num; + pthread_t ptid; + struct randdata rd; + struct ffsb_tg *tg; /* owning thread group */ + + /* If we are using Direct IO, then we must only use a 4k + * aligned buffer so, alignedbuf_4k is a pointer into + * "mallocbuf" which is what malloc gave us. + */ + char *alignedbuf; + char *mallocbuf; + + struct ffsb_op_results results; + + /* stats */ + ffsb_statsd_t fsd; +} ffsb_thread_t ; + +void init_ffsb_thread(ffsb_thread_t *, struct ffsb_tg *, unsigned, + unsigned, unsigned); +void destroy_ffsb_thread(ffsb_thread_t *); + +/* Owning thread group will start thread with this, thread runs until + * *ft->checkval == ft->stopval. Yes this is not strictly + * synchronized, but that is okay for our purposes, and it limits (IMO + * expensive) bus-locking. + * + * pthread_create() is called by tg with this function as a parameter + * data is a (ffsb_thread_t*) + */ +void *ft_run(void *); + +void ft_alter_bufsize(ffsb_thread_t *, unsigned); +char *ft_getbuf(ffsb_thread_t *); + +int ft_get_read_random(ffsb_thread_t *); +uint32_t ft_get_read_size(ffsb_thread_t *); +uint32_t ft_get_read_blocksize(ffsb_thread_t *); + +int ft_get_write_random(ffsb_thread_t *); +uint32_t ft_get_write_size(ffsb_thread_t *); +uint32_t ft_get_write_blocksize(ffsb_thread_t *); + +int ft_get_fsync_file(ffsb_thread_t *); + +randdata_t *ft_get_randdata(ffsb_thread_t *); + +void ft_incr_op(ffsb_thread_t *ft, unsigned opnum, unsigned increment, uint64_t bytes); + +void ft_add_readbytes(ffsb_thread_t *, uint32_t); +void ft_add_writebytes(ffsb_thread_t *, uint32_t); + +int ft_get_read_skip(ffsb_thread_t *); +uint32_t ft_get_read_skipsize(ffsb_thread_t *); + +ffsb_op_results_t *ft_get_results(ffsb_thread_t *); + +void ft_set_statsc(ffsb_thread_t *, ffsb_statsc_t *); + +/* for these two, ft == NULL is OK */ +int ft_needs_stats(ffsb_thread_t *, syscall_t); +void ft_add_stat(ffsb_thread_t *, syscall_t, uint32_t); + +ffsb_statsd_t *ft_get_stats_data(ffsb_thread_t *); + +#endif /* _FFSB_THREAD_H_ */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.c new file mode 100644 index 00000000..8a5aa0f5 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.c @@ -0,0 +1,278 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define FILE_OFFSET_BITS 64 + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ffsb.h" +#include "fh.h" + +#include "config.h" + +/* !!! ugly */ +#ifndef HAVE_OPEN64 +#define open64 open +#endif + +#ifndef HAVE_FSEEKO64 +#define lseek64 lseek +#endif + +/* All these functions read the global mainconfig->bufferedio variable + * to determine if they are to do buffered i/o or normal. + * + * ha, well, they're supposed to anyway...!!! TODO -SR 2006/05/14 + */ + +static void do_stats(struct timeval *start, struct timeval *end, + ffsb_thread_t *ft, ffsb_fs_t *fs, syscall_t sys) +{ + struct timeval diff; + uint32_t value = 0; + + if (!ft && !fs) + return; + + timersub(end, start, &diff); + + value = 1000000 * diff.tv_sec + diff.tv_usec; + + if (ft && ft_needs_stats(ft, sys)) + ft_add_stat(ft, sys, value); + if (fs && fs_needs_stats(fs, sys)) + fs_add_stat(fs, sys, value); +} + +static int fhopenhelper(char *filename, char *bufflags, int flags, + ffsb_thread_t *ft, ffsb_fs_t *fs) +{ + int fd = 0; + struct timeval start, end; + int need_stats = ft_needs_stats(ft, SYS_OPEN) || + fs_needs_stats(fs, SYS_OPEN); + + flags |= O_LARGEFILE; + + if (need_stats) + gettimeofday(&start, NULL); + + fd = open64(filename, flags, S_IRWXU); + if (fd < 0) { + perror(filename); + exit(0); + } + + if (need_stats) { + gettimeofday(&end, NULL); + do_stats(&start, &end, ft, fs, SYS_OPEN); + } + + return fd; +} + +int fhopenread(char *filename, ffsb_thread_t *ft, ffsb_fs_t *fs) +{ + int flags = O_RDONLY; + int directio = fs_get_directio(fs); + + if (directio) + flags |= O_DIRECT; + return fhopenhelper(filename, "r", flags, ft, fs); +} + +int fhopenappend(char *filename, ffsb_thread_t *ft, ffsb_fs_t *fs) +{ + int flags = O_APPEND | O_WRONLY; + int directio = fs_get_directio(fs); + + if (directio) + flags |= O_DIRECT; + return fhopenhelper(filename, "a", flags, ft, fs); +} + +int fhopenwrite(char *filename, ffsb_thread_t *ft, ffsb_fs_t *fs) +{ + int flags = O_WRONLY; + int directio = fs_get_directio(fs); + + if (directio) + flags |= O_DIRECT; + return fhopenhelper(filename, "w", flags, ft, fs); +} + +int fhopencreate(char *filename, ffsb_thread_t *ft, ffsb_fs_t *fs) +{ + int flags = O_CREAT | O_RDWR | O_TRUNC; + int directio = fs_get_directio(fs); + + if (directio) + flags |= O_DIRECT; + return fhopenhelper(filename, "rw", flags, ft, fs); +} + +void fhread(int fd, void *buf, uint64_t size, ffsb_thread_t *ft, ffsb_fs_t *fs) +{ + ssize_t realsize; + struct timeval start, end; + int need_stats = ft_needs_stats(ft, SYS_READ) || + fs_needs_stats(fs, SYS_READ); + + assert(size <= SIZE_MAX); + if (need_stats) + gettimeofday(&start, NULL); + realsize = read(fd, buf, size); + + if (need_stats) { + gettimeofday(&end, NULL); + do_stats(&start, &end, ft, fs, SYS_READ); + } + + if (realsize != size) { + printf("Read %lld instead of %llu bytes.\n", + (unsigned long long)realsize, (unsigned long long)size); + perror("read"); + exit(1); + } +} + +void fhwrite(int fd, void *buf, uint32_t size, ffsb_thread_t *ft, ffsb_fs_t *fs) +{ + ssize_t realsize; + struct timeval start, end; + int need_stats = ft_needs_stats(ft, SYS_WRITE) || + fs_needs_stats(fs, SYS_WRITE); + + assert(size <= SIZE_MAX); + if (need_stats) + gettimeofday(&start, NULL); + + realsize = write(fd, buf, size); + + if (need_stats) { + gettimeofday(&end, NULL); + do_stats(&start, &end, ft, fs, SYS_WRITE); + } + + if (realsize != size) { + printf("Wrote %d instead of %d bytes.\n" + "Probably out of disk space\n", realsize, size); + perror("write"); + exit(1); + } +} + +void fhseek(int fd, uint64_t offset, int whence, ffsb_thread_t *ft, + ffsb_fs_t *fs) +{ + uint64_t res; + struct timeval start, end; + int need_stats = ft_needs_stats(ft, SYS_LSEEK) || + fs_needs_stats(fs, SYS_LSEEK); + + if ((whence == SEEK_CUR) && (offset == 0)) + return; + + if (need_stats) + gettimeofday(&start, NULL); + + res = lseek64(fd, offset, whence); + + if (need_stats) { + gettimeofday(&end, NULL); + do_stats(&start, &end, ft, fs, SYS_LSEEK); + } + if ((whence == SEEK_SET) && (res != offset)) + perror("seek"); + + if (res == -1) { + if (whence == SEEK_SET) + fprintf(stderr, "tried to seek to %lld\n", offset); + else + fprintf(stderr, "tried to seek from current " + "position to %lld\n", offset); + + perror("seek"); + exit(1); + } +} + +void fhclose(int fd, ffsb_thread_t *ft, ffsb_fs_t *fs) +{ + struct timeval start, end; + int need_stats = ft_needs_stats(ft, SYS_CLOSE) || + fs_needs_stats(fs, SYS_CLOSE); + + if (need_stats) + gettimeofday(&start, NULL); + + close(fd); + + if (need_stats) { + gettimeofday(&end, NULL); + do_stats(&start, &end, ft, fs, SYS_CLOSE); + } +} + +void fhstat(char *name, ffsb_thread_t *ft, ffsb_fs_t *fs) +{ + struct timeval start, end; + struct stat tmp_stat; + + int need_stats = ft_needs_stats(ft, SYS_STAT) || + fs_needs_stats(fs, SYS_CLOSE); + + if (need_stats) + gettimeofday(&start, NULL); + + if (stat(name, &tmp_stat)) { + fprintf (stderr, "stat call failed for file %s\n", name); + exit(1); + } + + if (need_stats) { + gettimeofday(&end, NULL); + do_stats(&start, &end, ft, fs, SYS_STAT); + } +} + +int writefile_helper(int fd, uint64_t size, uint32_t blocksize, char *buf, + struct ffsb_thread *ft, struct ffsb_fs *fs) +{ + uint64_t iterations, a; + uint64_t last; + + iterations = size / blocksize; + last = size % blocksize; + + for (a = 0; a < iterations; a++) + fhwrite(fd, buf, blocksize, ft, fs); + + if (last) { + a++; + fhwrite(fd, buf, last, ft, fs); + } + return a; +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.h new file mode 100644 index 00000000..d047b391 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fh.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _FH_H_ +#define _FH_H_ + +#include + +struct ffsb_thread; +struct ffsb_fs; + +int fhopenread(char *, struct ffsb_thread *, struct ffsb_fs *); +int fhopenwrite(char *, struct ffsb_thread *, struct ffsb_fs *); +int fhopencreate(char *, struct ffsb_thread *, struct ffsb_fs *); +int fhopenappend(char *, struct ffsb_thread *, struct ffsb_fs *); + +void fhread(int, void *, uint64_t, struct ffsb_thread *, struct ffsb_fs *); + +/* can only write up to size_t bytes at a time, so size is a uint32_t */ +void fhwrite(int, void *, uint32_t, struct ffsb_thread *, struct ffsb_fs *); +void fhseek(int, uint64_t, int, struct ffsb_thread *, struct ffsb_fs *); +void fhclose(int, struct ffsb_thread *, struct ffsb_fs *); + +int writefile_helper(int, uint64_t, uint32_t, char *, struct ffsb_thread *, + struct ffsb_fs *); + +#endif /* _FH_H_ */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/filelist.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/filelist.c new file mode 100644 index 00000000..647674b3 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/filelist.c @@ -0,0 +1,503 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "rand.h" +#include "filelist.h" +#include "util.h" +#include "rwlock.h" +#include "rbt.h" +#include "cirlist.h" + +#if 0 +static +void print_cl(struct cirlist *cl) +{ + struct cnode *cur = cl->head; + printf("curlist: "); + if (cur == NULL) { + printf("\n"); + return; + } + do { + printf("%d ", cur->obj->num); + cur = cur->next; + } while (cur != cl->head); + printf("\n"); +} +#endif + +#if 0 +static +int node_cmp(struct ffsb_file *a, struct ffsb_file *b) +{ + return a->num - b->num; +} +#endif + +static +void build_dirs(struct benchfiles *bf) +{ + char buf[FILENAME_MAX]; + int i; + + if (mkdir(bf->basedir, S_IRWXU) < 0) + if (errno != EEXIST) { + perror(bf->basedir); + exit(1); + } + for (i = 0; i < bf->numsubdirs; i++) { + snprintf(buf, FILENAME_MAX, "%s/%s%s%d", + bf->basedir, bf->basename, + SUBDIRNAME_BASE, i); + if (mkdir(buf, S_IRWXU) == -1) + if (errno != EEXIST) { + perror(buf); + exit(1); + } + } +} + + +void init_filelist(struct benchfiles *b, char *basedir, char *basename, + uint32_t numsubdirs, int builddirs) +{ + memset(b, 0, sizeof(struct benchfiles)); + b->basedir = ffsb_strdup(basedir); + b->basename = ffsb_strdup(basename); + b->numsubdirs = numsubdirs; + init_rwlock(&b->fileslock); + b->files = rbtree_construct(); + b->dirs = rbtree_construct(); + b->holes = ffsb_malloc(sizeof(struct cirlist)); + b->dholes = ffsb_malloc(sizeof(struct cirlist)); + init_cirlist(b->holes); + init_cirlist(b->dholes); + + if (builddirs) + build_dirs(b); +} + +static void file_destructor(struct ffsb_file *file) +{ + free(file->name); + free(file); +} + +void destroy_filelist(struct benchfiles *bf) +{ + free(bf->basedir); + free(bf->basename); + + while (!cl_empty(bf->holes)) { + struct ffsb_file *cur = cl_remove_head(bf->holes); + file_destructor(cur); + } + free(bf->holes); + rbtree_clean(bf->files, file_destructor); + free(bf->files); +} + +struct ffsb_file *add_file(struct benchfiles *b, uint64_t size, randdata_t *rd) +{ + struct ffsb_file *newfile, *oldfile = NULL; + int filenum = 0; + + /* We pre-allocate here, because I don't want to spend time + * malloc'ing while the list is locked we free it later if + * necessary + */ + newfile = ffsb_malloc(sizeof(struct ffsb_file)); + + newfile->size = size; + init_rwlock(&(newfile->lock)); + + /* Write lock the filelist, begin critical section */ + rw_lock_write(&b->fileslock); + + /* First check "holes" for a file */ + if (!cl_empty(b->holes)) { + oldfile = cl_remove_head(b->holes); + rbtree_insert(b->files, oldfile); + rw_lock_write(&oldfile->lock); + } else { + filenum = b->listsize; + b->listsize++; + + newfile->num = filenum; + rbtree_insert(b->files, newfile); + + rw_lock_write(&newfile->lock); + } + + /* unlock filelist */ + rw_unlock_write(&b->fileslock); + + if (oldfile == NULL) { + char buf[FILENAME_MAX]; + int randdir = getrandom(rd, b->numsubdirs+1); + int namesize = 0; + if (randdir == 0) + namesize = snprintf(buf, FILENAME_MAX, "%s/%s%s%d", + b->basedir, b->basename, + FILENAME_BASE, filenum); + else + namesize = snprintf(buf, FILENAME_MAX, + "%s/%s%s%d/%s%s%d", b->basedir, + b->basename, SUBDIRNAME_BASE, + randdir - 1, b->basename, + FILENAME_BASE, filenum); + if (namesize >= FILENAME_MAX) + /* !!! do something about this ? */ + printf("warning: filename \"%s\" too long\n", buf); + newfile->name = ffsb_strdup(buf); + return newfile; + } else { + free(newfile); + return oldfile; + } +} + +struct ffsb_file *add_dir(struct benchfiles *b, uint64_t size, randdata_t *rd) +{ + struct ffsb_file *newdir, *olddir = NULL; + int dirnum = 0; + + newdir = ffsb_malloc(sizeof(struct ffsb_file)); + + init_rwlock(&newdir->lock); + + /* write lock the filelist, beging critical section */ + rw_lock_write(&b->fileslock); + + /* First check "holes" for a file */ + if (!cl_empty(b->dholes)) { + olddir = cl_remove_head(b->dholes); + rbtree_insert(b->files, olddir); + rw_lock_write(&olddir->lock); + } else { + dirnum = b->numsubdirs; + b->numsubdirs++; + printf("dirnum: %d\n", dirnum); + newdir->num = dirnum; + rbtree_insert(b->dirs, newdir); + + rw_lock_write(&newdir->lock); + } + + /* unlock filelist */ + rw_unlock_write(&b->fileslock); + + if (olddir == NULL) { + char buf[FILENAME_MAX]; + int namesize = 0; + namesize = snprintf(buf, FILENAME_MAX, "%s/%s%s%d", + b->basedir, b->basename, + SUBDIRNAME_BASE, dirnum); + if (namesize >= FILENAME_MAX) + printf("warning: filename \"%s\" too long\n", buf); + /* TODO: take action here... */ + newdir->name = ffsb_strdup(buf); + return newdir; + } else { + free(newdir); + return olddir; + } +} + +/* Private version of above function used only for reusing a + * fileset. + */ +static struct ffsb_file *add_file_named(struct benchfiles *b, uint64_t size, + char *name) +{ + struct ffsb_file *newfile = NULL; + + newfile = ffsb_malloc(sizeof(struct ffsb_file)); + memset(newfile, 0, sizeof(struct ffsb_file)); + newfile->name = ffsb_strdup(name); + newfile->size = size; + init_rwlock(&newfile->lock); + + /* Write lock the filelist, begin critical section */ + rw_lock_write(&b->fileslock); + + newfile->num = b->listsize; + b->listsize++; + + /* Add a new file to the rbtree */ + rbtree_insert(b->files, newfile); + + rw_lock_write(&newfile->lock); + + /* Unlock filelist */ + rw_unlock_write(&b->fileslock); + + return newfile; +} + + +#if 0 +static void print_rb_helper(rb_node *cur) +{ + if (cur != NULL) { + print_rb_helper(cur->left); + printf("%d ", cur->object->num); + print_rb_helper(cur->right); + } +} + +static void print_rb(rb_tree *tree) +{ + print_rb_helper(tree->root); +} +#endif + +void remove_file(struct benchfiles *b, struct ffsb_file *entry) +{ + rw_lock_write(&b->fileslock); + + rbtree_remove(b->files, entry, NULL); + /* add node to the cir. list of "holes" */ + cl_insert_tail(b->holes, entry); + + rw_unlock_write(&b->fileslock); +} + +static struct ffsb_file *choose_file(struct benchfiles *b, randdata_t *rd) +{ + rb_node *cur = NULL; + int chosen = 0; + struct ffsb_file temp; + temp.num = chosen; + + if (b->listsize == 0) { + fprintf(stderr, "No more files to operate on," + " try making more initial files " + "or fewer delete operations\n"); + exit(0); + } + + while (cur == NULL) { + chosen = getrandom(rd, b->listsize); + temp.num = chosen; + cur = rbtree_find(b->files, &temp); + } + return cur->object; +} + +struct ffsb_file *choose_file_reader(struct benchfiles *bf, randdata_t *rd) +{ + struct ffsb_file *ret; + + rw_lock_read(&bf->fileslock); + /* If b->holes->count == bf->listsize, all files have been + * deleted! + */ + assert(bf->holes->count != bf->listsize); + + ret = choose_file(bf, rd); + if (rw_trylock_read(&ret->lock)) { + rw_unlock_read(&bf->fileslock); + return choose_file_reader(bf, rd); + } + + rw_unlock_read(&bf->fileslock); + return ret; +} + +struct ffsb_file *choose_file_writer(struct benchfiles *bf, randdata_t *rd) +{ + struct ffsb_file *ret ; + + rw_lock_read(&bf->fileslock); + assert(bf->holes->count != bf->listsize); + ret = choose_file(bf, rd); + + if (rw_trylock_write(&ret->lock)) { + rw_unlock_read(&bf->fileslock); + return choose_file_writer(bf, rd); + } + + rw_unlock_read(&bf->fileslock); + return ret; +} + +void unlock_file_reader(struct ffsb_file *file) +{ + rw_unlock_read(&file->lock) ; +} + +void unlock_file_writer(struct ffsb_file *file) +{ + rw_unlock_write(&file->lock) ; +} + +void rename_file(struct ffsb_file *file) +{ + char *newname = malloc(strlen(file->name) + 2); + sprintf(newname, "%sa", file->name); + file->name = newname; +} + +int validate_filename(struct benchfiles *bf, char *name) +{ + int retval = -1; + char fmt_str[FILENAME_MAX]; + if (FILENAME_MAX <= snprintf(fmt_str, FILENAME_MAX, + "%s%s%%d", bf->basename, FILENAME_BASE)) { + printf("filename is too long declaring it invalid\n"); + return -1; + } + + sscanf(name, fmt_str, &retval); + return retval; +} + +int validate_dirname(struct benchfiles *bf, char *name) +{ + int retval = -1; + char fmt_str[FILENAME_MAX]; + if (FILENAME_MAX <= snprintf(fmt_str, FILENAME_MAX, "%s%s%%d", + bf->basename, SUBDIRNAME_BASE)) { + printf("dirname is too long declaring it invalid\n"); + return -1; + } + + sscanf(name, fmt_str, &retval); + return retval; +} + +/* Do all the dirty work of recursing through a directory structure + * check everything for validitiy and update everything properly. + * Note it does not check filesizes !!!, it doesn't know anything + * about them + */ +static int add_dir_to_filelist(struct benchfiles *bf, DIR *subdir, + char *subdir_path, fl_validation_func_t vfunc, + void *vf_data) +{ + int retval = 0; + struct dirent *d_ent = NULL; + + while ((d_ent = readdir(subdir)) != NULL) { + DIR *tmp = NULL; + char filename_buf[FILENAME_MAX*2]; + + if (FILENAME_MAX < snprintf(filename_buf, FILENAME_MAX, "%s/%s", + subdir_path, d_ent->d_name)) { + printf("filename \"%s\" too long aborting\n", + filename_buf); + return -1; + } + tmp = opendir(filename_buf); + if (tmp == NULL) { + struct ffsb_file *ffsb_file = NULL; + + if (validate_filename(bf, d_ent->d_name) < 0) { + printf("filename \"%s\" is invalid aborting\n", + d_ent->d_name); + return -1; + } + /* Verify size/other attributes via callback */ + if (vfunc(bf, filename_buf, vf_data)) { + printf("filename \"%s\" didn't pass " + "validation\n", d_ent->d_name); + return -1; + } + /* Add file to data structure */ + ffsb_file = add_file_named(bf, ffsb_get_filesize(filename_buf), + filename_buf); + unlock_file_writer(ffsb_file); + } else { + /* Check for the usual suspects and skip them */ + if ((0 == strcmp(".", d_ent->d_name)) || + (0 == strcmp("..", d_ent->d_name))) { + closedir(tmp); + continue; + } + if (validate_dirname(bf, d_ent->d_name) < 0) { + printf("dirname \"%s\" is invalid aborting\n", + d_ent->d_name); + closedir(tmp); + return -1; + } + if (vfunc(bf, filename_buf, vf_data)) { + printf("dir \"%s\" didn't pass validation\n", + d_ent->d_name); + closedir(tmp); + return -1; + } + /* Update filelist */ + bf->numsubdirs++; + + /* recurse */ + retval += add_dir_to_filelist(bf, tmp, filename_buf, + vfunc, vf_data); + + /* clean up */ + closedir(tmp); + } + } + return retval; +} + + +int grab_old_fileset(struct benchfiles *bf, char *basename, + fl_validation_func_t vfunc, void *vfunc_data) +{ + int retval = 0; + char buf[FILENAME_MAX*2]; + DIR *lc_dir = NULL; + + if (FILENAME_MAX < snprintf(buf, FILENAME_MAX, "%s", + bf->basedir)) { + printf("filename \"%s\" is too long aborting\n", buf); + return -1; + } + + lc_dir = opendir(buf); + if (lc_dir == NULL) { + perror("opendir"); + return -1; + } + + retval = add_dir_to_filelist(bf, lc_dir, buf, vfunc, vfunc_data); + + closedir(lc_dir); + return retval ; +} + +/* Get the number of files */ +uint32_t get_listsize(struct benchfiles *bf) +{ + return bf->listsize; +} + +/* Get the number of subdirectories */ +uint32_t get_numsubdirs(struct benchfiles *bf) +{ + return bf->numsubdirs; +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/filelist.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/filelist.h new file mode 100644 index 00000000..f94120c8 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/filelist.h @@ -0,0 +1,145 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _FILELIST_H_ +#define _FILELIST_H_ + +#include +#include "rand.h" +#include "rwlock.h" +#include "cirlist.h" +#include "rbt.h" + +#define SUBDIRNAME_BASE "dir" +#define FILENAME_BASE "file" + +struct ffsb_file { + char *name; + uint64_t size; + struct rwlock lock; + uint32_t num; +}; + +struct cirlist; + +/* Tree of ffsb_file structs and associated state info struct must be + * locked during use. + */ +struct benchfiles { + /* The base directory in which all subdirs and files are + * created + */ + char *basedir; + + /* The name to prepend to all directory and file names */ + char *basename; + uint32_t numsubdirs; + + /* Files which currently exist on the filesystem */ + struct red_black_tree *files; + + /* Directories which currently exist on the filesystem */ + struct red_black_tree *dirs; + + /* Files which have been deleted, and whose numbers should be + * reused + */ + struct cirlist *holes; + struct cirlist *dholes; + + /* This lock must be held while manipulating the structure */ + struct rwlock fileslock; + uint32_t listsize; /* Sum size of nodes in files and holes */ +}; + +/* Initializes the list, user must call this before anything else it + * will create the basedir and subdirs on the filesystem automatically + * if the builddirs arg. is nonzero + */ +void init_filelist(struct benchfiles *, char *, char *, uint32_t, int); +void destroy_filelist(struct benchfiles *); + +/* Allocates a new file, adds to list, (write) locks it, and returns + * it. This function also randomly selects a filename + path to + * assign to the new file. + * + * It first checks the "holes" list for any available filenames. + * Caller must ensure file is actually created on disk + */ +struct ffsb_file *add_file(struct benchfiles *b, uint64_t size, randdata_t *rd); +struct ffsb_file *add_dir(struct benchfiles *, uint64_t, randdata_t *); + +/* Removes file from list, decrements listsize. + * + * File should be writer-locked before calling this function. + * + * This function does not unlock file after removal from list. + * + * Caller must ensure file is actually removed on disk. + * + * Caller must NOT free file->name and file, since oldfiles are being + * put into holes list. + */ +void remove_file(struct benchfiles *, struct ffsb_file *); + +/* Picks a file at random, locks it for reading and returns it + * locked + */ +struct ffsb_file *choose_file_reader(struct benchfiles *, randdata_t *); + +/* Picks a file at random, locks it for writing and returns it + * locked + */ +struct ffsb_file *choose_file_writer(struct benchfiles *, randdata_t *); + +/* changes the file->name of a file, file must be write locked + * it does not free the old file->name, so caller must keep a ref to it + * and free after the call + */ +void rename_file(struct ffsb_file *); + +void unlock_file_reader(struct ffsb_file *); +void unlock_file_writer(struct ffsb_file *); + +/* Uses SUBDIRNAME_BASE/FILENAME_BASE + bf->basename to validate a + * name returns a negative on invalid names, and the actual file + * number if valid + */ +int validate_filename(struct benchfiles *, char *); +int validate_dirname(struct benchfiles *, char *); + +/* Function type which, does some validation of existing files + * currently only used by ffsb_fs stuff, returns 0 on success + */ +typedef int (*fl_validation_func_t)(struct benchfiles *, char *, void *); + +/* Provided for re-use of filesets. Also runs the validation callback + * on each file/dir that is found, after verifying the name is + * conformant. The fileset should be initialized with init_fileset() + * beforehand. + * Returns 0 on success + */ +int grab_old_fileset(struct benchfiles *, char *, fl_validation_func_t, + void *); + +/* Get the number of files */ +uint32_t get_listsize(struct benchfiles *); + +/* Get the number of subdirectories */ +uint32_t get_numsubdirs(struct benchfiles *); + +#endif /* _FILELIST_H_ */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fileops.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fileops.c new file mode 100644 index 00000000..e8aa2fc1 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fileops.c @@ -0,0 +1,547 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#define _LARGEFILE64_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "fh.h" +#include "util.h" +#include "ffsb.h" +#include "fileops.h" +#include "ffsb_op.h" + +static void do_stats(struct timeval *start, struct timeval *end, + ffsb_thread_t *ft, ffsb_fs_t *fs, syscall_t sys) +{ + struct timeval diff; + uint32_t value = 0; + + if (!ft && !fs) + return; + + timersub(end, start, &diff); + + value = 1000000 * diff.tv_sec + diff.tv_usec; + + if (ft && ft_needs_stats(ft, sys)) + ft_add_stat(ft, sys, value); + if (fs && fs_needs_stats(fs, sys)) + fs_add_stat(fs, sys, value); +} + +void fop_bench(ffsb_fs_t *fs, unsigned opnum) +{ + fs_set_opdata(fs, fs_get_datafiles(fs), opnum); +} + +void fop_age(ffsb_fs_t *fs, unsigned opnum) +{ + fs_set_opdata(fs, fs_get_agefiles(fs), opnum); +} + +static unsigned readfile_helper(int fd, uint64_t size, uint32_t blocksize, + char *buf, ffsb_thread_t *ft, ffsb_fs_t *fs) +{ + int iterations, a; + int last; + + iterations = size / blocksize; + last = size % blocksize; + + for (a = 0; a < iterations; a++) + fhread(fd, buf, blocksize, ft, fs); + if (last) + fhread(fd, buf, last, ft, fs); + return iterations; +} + +static uint64_t get_random_offset(randdata_t *rd, uint64_t filesize, + int aligned) +{ + if (!aligned) + return getllrandom(rd, filesize); + + filesize /= 4096; + return getllrandom(rd, filesize) * 4096; +} + +void ffsb_readfile(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + struct ffsb_file *curfile = NULL; + + int fd; + uint64_t filesize; + + char *buf = ft_getbuf(ft); + int read_random = ft_get_read_random(ft); + uint64_t read_size = ft_get_read_size(ft); + uint32_t read_blocksize = ft_get_read_blocksize(ft); + uint32_t read_skipsize = ft_get_read_skipsize(ft); + int skip_reads = ft_get_read_skip(ft); + struct randdata *rd = ft_get_randdata(ft); + + uint64_t iterations = 0; + + curfile = choose_file_reader(bf, rd); + fd = fhopenread(curfile->name, ft, fs); + + filesize = ffsb_get_filesize(curfile->name); + + assert(filesize >= read_size); + + /* Sequential read, starting at a random point */ + if (!read_random) { + uint64_t range = filesize - read_size; + uint64_t offset = 0; + /* Skip or "stride" reads option */ + if (skip_reads) { + unsigned i, last; + uint64_t minfilesize; + iterations = read_size / read_blocksize; + last = read_size % read_blocksize; + + /* Double check that the user hasn't specified + * a read_size that is too large when combined + * with the seeks + */ + if (last) + minfilesize = last + iterations * + (read_blocksize + read_skipsize); + else + minfilesize = read_blocksize + iterations - 1 * + (read_blocksize + read_skipsize); + + if (minfilesize > filesize) { + printf("Error: read size %llu bytes too big " + "w/ skipsize %u and blocksize %u," + " for file of size %llu bytes\n" + " aborting\n\n", read_size, + read_skipsize, read_blocksize, + filesize); + printf("minimum file size must be at least " + " %llu bytes\n", minfilesize); + exit(1); + } + + for (i = 0; i < iterations; i++) { + fhread(fd, buf, read_blocksize, ft, fs); + fhseek(fd, (uint64_t)read_skipsize, SEEK_CUR, + ft, fs); + } + if (last) { + fhread(fd, buf, (uint64_t)last, ft, fs); + iterations++; + } + } else { + /* Regular sequential reads */ + if (range) { + offset = get_random_offset(rd, range, + fs_get_alignio(fs)); + fhseek(fd, offset, SEEK_SET, ft, fs); + } + iterations = readfile_helper(fd, read_size, + read_blocksize, buf, + ft, fs); + } + } else { + /* Randomized read */ + uint64_t range = filesize - read_blocksize; + int i; + + iterations = read_size / read_blocksize; + + for (i = 0; i < iterations; i++) { + uint64_t offset = get_random_offset(rd, range, + fs_get_alignio(fs)); + fhseek(fd, offset, SEEK_SET, ft, fs); + fhread(fd, buf, read_blocksize, ft, fs); + } + } + + unlock_file_reader(curfile); + fhclose(fd, ft, fs); + + ft_incr_op(ft, opnum, iterations, read_size); + ft_add_readbytes(ft, read_size); +} + +/* Just like ffsb_readfile but we read the whole file from start to + * finish regardless of file size. + */ +void ffsb_readall(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + struct ffsb_file *curfile = NULL; + int fd; + uint64_t filesize; + + char *buf = ft_getbuf(ft); + uint32_t read_blocksize = ft_get_read_blocksize(ft); + struct randdata *rd = ft_get_randdata(ft); + + unsigned iterations = 0; + + curfile = choose_file_reader(bf, rd); + fd = fhopenread(curfile->name, ft, fs); + + filesize = ffsb_get_filesize(curfile->name); + iterations = readfile_helper(fd, filesize, read_blocksize, buf, ft, fs); + + unlock_file_reader(curfile); + fhclose(fd, ft, fs); + + ft_incr_op(ft, opnum, iterations, filesize); + ft_add_readbytes(ft, filesize); +} + +/* Shared core between ffsb_writefile and ffsb_writefile_fsync.*/ + +static unsigned ffsb_writefile_core(ffsb_thread_t *ft, ffsb_fs_t *fs, + unsigned opnum, uint64_t *filesize_ret, + int fsync_file) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + struct ffsb_file *curfile = NULL; + + int fd; + uint64_t filesize; + + char *buf = ft_getbuf(ft); + int write_random = ft_get_write_random(ft); + uint32_t write_size = ft_get_write_size(ft); + uint32_t write_blocksize = ft_get_write_blocksize(ft); + struct randdata *rd = ft_get_randdata(ft); + unsigned iterations = 0; + + curfile = choose_file_reader(bf, rd); + fd = fhopenwrite(curfile->name, ft, fs); + + filesize = ffsb_get_filesize(curfile->name); + + assert(filesize >= write_size); + + /* Sequential write, starting at a random point */ + if (!write_random) { + uint64_t range = filesize - write_size; + uint64_t offset = 0; + if (range) { + offset = get_random_offset(rd, range, + fs_get_alignio(fs)); + fhseek(fd, offset, SEEK_SET, ft, fs); + } + iterations = writefile_helper(fd, write_size, write_blocksize, + buf, ft, fs); + } else { + /* Randomized write */ + uint64_t range = filesize - write_blocksize; + int i; + iterations = write_size / write_blocksize; + + for (i = 0; i < iterations; i++) { + uint64_t offset = get_random_offset(rd, range, + fs_get_alignio(fs)); + fhseek(fd, offset, SEEK_SET, ft, fs); + fhwrite(fd, buf, write_blocksize, ft, fs); + } + } + + if (fsync_file) { + if (fsync(fd)) { + perror("fsync"); + printf("aborting\n"); + exit(1); + } + } + unlock_file_reader(curfile); + fhclose(fd, ft, fs); + *filesize_ret = filesize; + return iterations; +} + +void ffsb_writefile(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + unsigned iterations; + uint64_t filesize; + + iterations = ffsb_writefile_core(ft, fs, opnum, &filesize, 0); + ft_incr_op(ft, opnum, iterations, filesize); + ft_add_writebytes(ft, filesize); +} + +void ffsb_writefile_fsync(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + unsigned iterations; + uint64_t filesize; + + iterations = ffsb_writefile_core(ft, fs, opnum, &filesize, 1); + ft_incr_op(ft, opnum, iterations, filesize); + ft_add_writebytes(ft, filesize); +} + + +/* Shared core between ffsb_writeall and ffsb_writeall_fsync.*/ + +static unsigned ffsb_writeall_core(ffsb_thread_t *ft, ffsb_fs_t *fs, + unsigned opnum, uint64_t *filesize_ret, + int fsync_file) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + struct ffsb_file *curfile = NULL; + int fd; + uint64_t filesize; + + char *buf = ft_getbuf(ft); + uint32_t write_blocksize = ft_get_write_blocksize(ft); + struct randdata *rd = ft_get_randdata(ft); + + unsigned iterations = 0; + + curfile = choose_file_reader(bf, rd); + fd = fhopenwrite(curfile->name, ft, fs); + + filesize = ffsb_get_filesize(curfile->name); + iterations = writefile_helper(fd, filesize, write_blocksize, buf, + ft, fs); + if (fsync_file) + if (fsync(fd)) { + perror("fsync"); + printf("aborting\n"); + exit(1); + } + + unlock_file_reader(curfile); + fhclose(fd, ft, fs); + *filesize_ret = filesize; + return iterations; +} + +/* Just like ffsb_writefile but we write the whole file from start to + * finish regardless of file size + */ +void ffsb_writeall(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + unsigned iterations; + uint64_t filesize; + + iterations = ffsb_writeall_core(ft, fs, opnum, &filesize, 0); + ft_incr_op(ft, opnum, iterations, filesize); + ft_add_writebytes(ft, filesize); +} + +void ffsb_writeall_fsync(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + unsigned iterations; + uint64_t filesize; + + iterations = ffsb_writeall_core(ft, fs, opnum, &filesize, 1); + ft_incr_op(ft, opnum, iterations, filesize); + ft_add_writebytes(ft, filesize); +} + + +static unsigned ffsb_appendfile_core(ffsb_thread_t *ft, ffsb_fs_t *fs, + unsigned opnum, uint64_t *filesize_ret, + int fsync_file) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + struct ffsb_file *curfile; + + int fd; + + char *buf = ft_getbuf(ft); + uint32_t write_size = ft_get_write_size(ft); + uint32_t write_blocksize = ft_get_write_blocksize(ft); + struct randdata *rd = ft_get_randdata(ft); + unsigned iterations = 0; + + curfile = choose_file_reader(bf, rd); + fd = fhopenappend(curfile->name, ft, fs); + + unlock_file_reader(curfile); + + curfile->size += (uint64_t)write_size; + + iterations = writefile_helper(fd, write_size, write_blocksize, buf, + ft, fs); + if (fsync_file) + if (fsync(fd)) { + perror("fsync"); + printf("aborting\n"); + exit(1); + } + + fhclose(fd, ft, fs); + *filesize_ret = write_size; + return iterations; +} + +void ffsb_appendfile(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + unsigned iterations; + uint64_t filesize; + + iterations = ffsb_appendfile_core(ft, fs, opnum, &filesize, 0); + ft_incr_op(ft, opnum, iterations, filesize); + ft_add_writebytes(ft, filesize); +} + +void ffsb_appendfile_fsync(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + unsigned iterations; + uint64_t filesize; + + iterations = ffsb_appendfile_core(ft, fs, opnum, &filesize, 1); + ft_incr_op(ft, opnum, iterations, filesize); + ft_add_writebytes(ft, filesize); +} + +static unsigned ffsb_createfile_core(ffsb_thread_t *ft, ffsb_fs_t *fs, + unsigned opnum, uint64_t *filesize_ret, + int fsync_file) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + struct ffsb_file *newfile = NULL; + + int fd; + uint64_t size; + + char *buf = ft_getbuf(ft); + uint32_t write_blocksize = ft_get_write_blocksize(ft); + struct randdata *rd = ft_get_randdata(ft); + unsigned iterations = 0; + + if (fs->num_weights) { + int num = 1 + getrandom(rd, fs->sum_weights); + int curop = 0; + + while (fs->size_weights[curop].weight < num) { + num -= fs->size_weights[curop].weight; + curop++; + } + size = fs->size_weights[curop].size; + } + else { + uint64_t range = fs_get_max_filesize(fs) - fs_get_min_filesize(fs); + size = fs_get_min_filesize(fs); + if (range != 0) + size += getllrandom(rd, range); + } + + newfile = add_file(bf, size, rd); + fd = fhopencreate(newfile->name, ft, fs); + iterations = writefile_helper(fd, size, write_blocksize, buf, ft, fs); + + if (fsync_file) + if (fsync(fd)) { + perror("fsync"); + printf("aborting\n"); + exit(1); + } + + fhclose(fd, ft, fs); + unlock_file_writer(newfile); + *filesize_ret = size; + return iterations; +} + +void ffsb_createfile(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + unsigned iterations; + uint64_t filesize; + + iterations = ffsb_createfile_core(ft, fs, opnum, &filesize, 0); + ft_incr_op(ft, opnum, iterations, filesize); + ft_add_writebytes(ft, filesize); +} + +void ffsb_createfile_fsync(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + unsigned iterations; + uint64_t filesize; + + iterations = ffsb_createfile_core(ft, fs, opnum, &filesize, 1); + ft_incr_op(ft, opnum, iterations, filesize); + ft_add_writebytes(ft, filesize); +} + +void ffsb_deletefile(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + struct ffsb_file *curfile = NULL; + randdata_t *rd = ft_get_randdata(ft); + struct timeval start, end; + int need_stats = ft_needs_stats(ft, SYS_UNLINK) || + fs_needs_stats(fs, SYS_UNLINK); + + curfile = choose_file_writer(bf, rd); + remove_file(bf, curfile); + + if (need_stats) + gettimeofday(&start, NULL); + + if (unlink(curfile->name) == -1) { + printf("error deleting %s in deletefile\n", curfile->name); + perror("deletefile"); + exit(0); + } + + if (need_stats) { + gettimeofday(&end, NULL); + do_stats(&start, &end, ft, fs, SYS_UNLINK); + } + + rw_unlock_write(&curfile->lock); + + ft_incr_op(ft, opnum, 1, 0); +} + +void ffsb_open_close(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + struct ffsb_file *curfile = NULL; + randdata_t *rd = ft_get_randdata(ft); + int fd; + + curfile = choose_file_reader(bf, rd); + fd = fhopenread(curfile->name, ft, fs); + fhclose(fd, ft, fs); + unlock_file_reader(curfile); + ft_incr_op(ft, opnum, 1, 0); +} + +void ffsb_stat(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + struct ffsb_file *curfile = NULL; + randdata_t *rd = ft_get_randdata(ft); + + curfile = choose_file_reader(bf, rd); + fhstat(curfile->name, ft, fs); + unlock_file_reader(curfile); + + ft_incr_op(ft, opnum, 1, 0); +} + diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fileops.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fileops.h new file mode 100644 index 00000000..9d35e949 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/fileops.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _FILEOPS_H_ +#define _FILEOPS_H_ + +#include "ffsb_thread.h" +#include "ffsb.h" +#include "ffsb_op.h" +#include "ffsb_fs.h" + +void ffsb_readfile(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_readall(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_writefile(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_writefile_fsync(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_writeall(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_writeall_fsync(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_createfile(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_createfile_fsync(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_deletefile(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_appendfile(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_appendfile_fsync(ffsb_thread_t *tconfig, ffsb_fs_t *, unsigned opnum); +void ffsb_stat(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum); +void ffsb_open_close(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum); + +struct ffsb_op_results; + +void ffsb_read_print_exl(struct ffsb_op_results *, double secs, unsigned op_num); +void ffsb_write_print_exl(struct ffsb_op_results *, double secs, unsigned op_num); +void ffsb_create_print_exl(struct ffsb_op_results *, double secs, unsigned op_num); +void ffsb_append_print_exl(struct ffsb_op_results *, double secs, unsigned op_num); + +/* Set up ops for either aging or benchmarking */ +void fop_bench(ffsb_fs_t *fs, unsigned opnum); +void fop_age(ffsb_fs_t *fs, unsigned opnum); + +#endif /* _FILEOPS_H_ */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/list.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/list.c new file mode 100644 index 00000000..9a902847 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/list.c @@ -0,0 +1,55 @@ + +/* + * Simple list implementation mostly take from the Linux Kernel + */ + +#include +#include "list.h" + +void INIT_LIST_HEAD(struct list_head *list) +{ + list->next = list; + list->prev = list; +} + +void __list_add(struct list_head *new, + struct list_head *prev, + struct list_head *next) +{ + next->prev = new; + new->next = next; + new->prev = prev; + prev->next = new; +} + +void __list_del(struct list_head *prev, struct list_head *next) +{ + next->prev = prev; + prev->next = next; +} + +void list_add(struct list_head *new, struct list_head *head) +{ + __list_add(new, head, head->next); +} + +void list_add_tail(struct list_head *new, struct list_head *head) +{ + __list_add(new, head->prev, head); +} + +void list_del(struct list_head *entry) +{ + __list_del(entry->prev, entry->next); + entry->next = NULL; + entry->prev = NULL; +} + +void list_replace(struct list_head *old, + struct list_head *new) +{ + new->next = old->next; + new->next->prev = new; + new->prev = old->prev; + new->prev->next = new; +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/list.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/list.h new file mode 100644 index 00000000..e14709d2 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/list.h @@ -0,0 +1,53 @@ + +/* + * Simple list implementation mostly take from the Linux Kernel + */ + +#ifndef _LIST_H_ +#define _LIST_H_ + +struct list_head { + struct list_head *next, *prev; +}; + +void INIT_LIST_HEAD(struct list_head *list); +void __list_add(struct list_head *new, struct list_head *prev, + struct list_head *next); +void __list_del(struct list_head *prev, struct list_head *next); +void list_add(struct list_head *new, struct list_head *head); +void list_add_tail(struct list_head *new, struct list_head *head); +void list_del(struct list_head *entry); +void list_replace(struct list_head *old, struct list_head *new); + +#define LIST_HEAD_INIT(name) { &(name), &(name) } + +#define LIST_HEAD(name) struct list_head name = LIST_HEAD_INIT(name) + +#define list_for_each(pos, head) \ + for (pos = (head)->next; pos->next, pos != (head); pos = pos->next) + +#define offsetof(type, member) ((int) &((type *)0)->member) + +#define container_of(ptr, type, member) ({ \ + const typeof(((type *)0)->member) *__mptr = (ptr); \ + (type *)((char *)__mptr - offsetof(type, member)); }) + +#define list_entry(ptr, type, member) \ + container_of(ptr, type, member) + +#define list_for_each_entry(pos, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member); \ + pos->member.next, &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) + +#define list_for_each_entry_safe(pos, n, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) + +#define list_for_each_safe(pos, n, head) \ + for (pos = (head)->next, n = pos->next; pos != (head); \ + pos = n, n = pos->next) + +#endif diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/main.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/main.c new file mode 100644 index 00000000..abee1f35 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/main.c @@ -0,0 +1,258 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "config.h" + +#include "ffsb.h" +#include "util.h" +#include "parser.h" + +/* State information for the polling function below */ +struct ffsb_time_poll { + struct timeval starttime; + int wait_time; +}; + +/* This is the polling function used by the threadgroups to check + * elapsed time, when it returns 1 they know it is time to stop + */ +static int ffsb_poll_fn(void *ptr) +{ + struct ffsb_time_poll *data = (struct ffsb_time_poll *)ptr; + struct timeval curtime, difftime; + gettimeofday(&curtime, NULL); + + timersub(&curtime, &data->starttime, &difftime); + if (difftime.tv_sec >= data->wait_time) + return 1; + return 0; +} + +int main(int argc, char *argv[]) +{ + int i; + ffsb_config_t fc; + ffsb_barrier_t thread_barrier, tg_barrier; + tg_run_params_t *params; + struct ffsb_time_poll pdata; + struct timeval starttime, endtime, difftime; + pthread_attr_t attr; + ffsb_op_results_t total_results; + double totaltime = 0.0f, usertime = 0.0f, systime = 0.0f; + struct rusage before_self, before_children, after_self, after_children; + pthread_t *fs_pts; /* threads to do filesystem creates in parallel */ + char *callout = NULL; + + char ctime_start_buf[32]; + char ctime_end_buf[32]; + + memset(&before_self, 0, sizeof(before_self)); + memset(&before_children, 0, sizeof(before_children)); + memset(&after_self, 0, sizeof(after_self)); + memset(&after_children, 0, sizeof(after_children)); + + ffsb_unbuffer_stdout(); + + if (argc < 2) { + fprintf(stderr, "usage: %s \n", + argv[0]); + exit(1); + } + + /* VERSION comes from config.h (which is autogenerated by autoconf) */ + printf("FFSB version %s started\n\n", VERSION); + + ffsb_parse_newconfig(&fc, argv[1]); + pdata.wait_time = fc.time; + + if (fc.time) + printf("benchmark time = %u\n", fc.time); + else + printf("Only creating the fileset, not running benchmark.\n"); + + pthread_attr_init(&attr); + pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); + + for (i = 0; i < fc.num_threadgroups; i++) + tg_print_config(&fc.groups[i]); + + fs_pts = ffsb_malloc(sizeof(pthread_t) * fc.num_filesys); + + gettimeofday(&starttime, NULL); + for (i = 0; i < fc.num_filesys; i++) { + fs_print_config(&fc.filesystems[i]); + pthread_create(fs_pts + i, &attr, construct_ffsb_fs, + &fc.filesystems[i]); + } + + fflush(stdout); + for (i = 0; i < fc.num_filesys; i++) + pthread_join(fs_pts[i], NULL); + + gettimeofday(&endtime, NULL); + timersub(&endtime, &starttime, &difftime); + printf("fs setup took %ld secs\n", difftime.tv_sec); + free(fs_pts); + + if (fc.time == 0) { + printf("Setup complete, exiting\n"); + return 0; + } + + params = ffsb_malloc(sizeof(tg_run_params_t) * fc.num_threadgroups); + + init_ffsb_op_results(&total_results); + ffsb_barrier_init(&thread_barrier, fc.num_totalthreads); + ffsb_barrier_init(&tg_barrier, fc.num_threadgroups + 1); + + ffsb_sync(); + + /* Execute the callout if any and wait for it to return */ + callout = fc_get_callout(&fc); + if (callout) { + printf("executing callout: \n %s\n", callout); + if (ffsb_system(callout) < 0) { + perror("system"); + exit(1); + } + } + + /* Spawn all of the threadgroup master threads */ + for (i = 0; i < fc.num_threadgroups; i++) { + params[i].tg = &fc.groups[i]; + params[i].fc = &fc; + params[i].poll_fn = ffsb_poll_fn; + params[i].poll_data = &pdata; + params[i].wait_time = FFSB_TG_WAIT_TIME; + params[i].tg_barrier = &tg_barrier; + params[i].thread_barrier = &thread_barrier; + + pthread_create(¶ms[i].pt, &attr, tg_run, ¶ms[i]); + } + + ffsb_getrusage(&before_self, &before_children); + gettimeofday(&pdata.starttime, NULL); + + ffsb_barrier_wait(&tg_barrier); /* sync with tg's to start*/ + printf("Starting Actual Benchmark At: %s\n", + ctime_r(&pdata.starttime.tv_sec, ctime_start_buf)); + fflush(stdout); + + /* Wait for all of the threadgroup master threads to finish */ + for (i = 0; i < fc.num_threadgroups; i++) + pthread_join(params[i].pt, NULL); + + ffsb_sync(); + gettimeofday(&endtime, NULL); + ffsb_getrusage(&after_self, &after_children); + + printf("FFSB benchmark finished at: %s\n", + ctime_r(&endtime.tv_sec, ctime_end_buf)); + printf("Results:\n"); + fflush(stdout); + + timersub(&endtime, &pdata.starttime, &difftime); + + totaltime = tvtodouble(&difftime); + + printf("Benchmark took %.2lf sec\n", totaltime); + printf("\n"); + + for (i = 0; i < fc.num_threadgroups; i++) { + struct ffsb_op_results tg_results; + ffsb_tg_t *tg = fc.groups + i; + + init_ffsb_op_results(&tg_results); + + /* Grab the individual tg results */ + tg_collect_results(tg, &tg_results); + + if (fc.num_threadgroups == 1) + printf("Total Results\n"); + else + printf("ThreadGroup %d\n", i); + + printf("===============\n"); + print_results(&tg_results, totaltime); + + if (tg_needs_stats(tg)) { + ffsb_statsd_t fsd; + tg_collect_stats(tg, &fsd); + ffsb_statsd_print(&fsd); + } + printf("\n"); + + /* Add the tg results to the total */ + tg_collect_results(&fc.groups[i], &total_results); + } + + if (fc.num_threadgroups > 1) { + printf("Total Results\n"); + printf("===============\n"); + print_results(&total_results, totaltime); + } + +#define USEC_PER_SEC ((double)(1000000.0f)) + + /* sum up self and children after */ + usertime = (after_self.ru_utime.tv_sec + + ((after_self.ru_utime.tv_usec)/USEC_PER_SEC)) + + ((after_children.ru_utime.tv_sec + + ((after_children.ru_utime.tv_usec)/USEC_PER_SEC))); + + /* subtract away the before */ + usertime -= (before_self.ru_utime.tv_sec + + ((before_self.ru_utime.tv_usec)/USEC_PER_SEC)) + + ((before_children.ru_utime.tv_sec + + ((before_children.ru_utime.tv_usec)/USEC_PER_SEC))); + + + /* sum up self and children after */ + systime = (after_self.ru_stime.tv_sec + + ((after_self.ru_stime.tv_usec)/USEC_PER_SEC)) + + ((after_children.ru_stime.tv_sec + + ((after_children.ru_stime.tv_usec)/USEC_PER_SEC))); + + /* subtract away the before */ + systime -= (before_self.ru_stime.tv_sec + + ((before_self.ru_stime.tv_usec)/USEC_PER_SEC)) + + ((before_children.ru_stime.tv_sec + + ((before_children.ru_stime.tv_usec)/USEC_PER_SEC))); + + printf("\n\n"); + printf("%.1lf%% User Time\n", 100 * usertime / totaltime); + printf("%.1lf%% System Time\n", 100 * systime / totaltime); + printf("%.1f%% CPU Utilization\n", 100 * (usertime + systime) / + totaltime); + free(params); + destroy_ffsb_config(&fc); + + return 0; +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/metaops.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/metaops.c new file mode 100644 index 00000000..c9e2409f --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/metaops.c @@ -0,0 +1,112 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include +#include + +#include "ffsb.h" +#include "metaops.h" +#include "rand.h" +#include "filelist.h" + +/* metaops: + * createdir + * removedir + * renamedir + * renamefile + */ + +void metaops_metadir(ffsb_fs_t *fs, unsigned opnum) +{ + fs_set_opdata(fs, fs_get_metafiles(fs), opnum); +} + +static void createdir(struct benchfiles *dirs, randdata_t *rd) +{ + struct ffsb_file *newdir; + + newdir = add_file(dirs, 0, rd); + if (mkdir(newdir->name, S_IRWXU) < 0) { + perror("mkdir"); + exit(1); + } + unlock_file_writer(newdir); +} + +static void removedir(struct benchfiles *dirs, randdata_t *rd) +{ + struct ffsb_file *deldir; + + deldir = choose_file_writer(dirs, rd); + remove_file(dirs, deldir); + + if (rmdir(deldir->name) < 0) { + perror("rmdir"); + exit(1); + } + unlock_file_writer(deldir); +} + +static void renamedir(struct benchfiles *dirs, randdata_t *rd) +{ + struct ffsb_file *dir; + char *oldname; + + dir = choose_file_writer(dirs, rd); + oldname = dir->name; + rename_file(dir); + + if (rename(oldname, dir->name) < 0) { + perror("rename"); + exit(1); + } + unlock_file_writer(dir); + free(oldname); +} + +void ffsb_metaops(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + randdata_t *rd = ft_get_randdata(ft); + + createdir(bf, rd); + createdir(bf, rd); + removedir(bf, rd); + renamedir(bf, rd); + + ft_incr_op(ft, opnum, 1, 0); +} + +void ffsb_createdir(ffsb_thread_t *ft, ffsb_fs_t *fs, unsigned opnum) +{ + struct benchfiles *bf = (struct benchfiles *)fs_get_opdata(fs, opnum); + struct ffsb_file *newdir; + randdata_t *rd = ft_get_randdata(ft); + + newdir = add_dir(bf, 0, rd); + if (mkdir(newdir->name, S_IRWXU) < 0) { + perror("mkdir"); + exit(1); + } + unlock_file_writer(newdir); + + ft_incr_op(ft, opnum, 1, 0); +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/metaops.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/metaops.h new file mode 100644 index 00000000..04cbe9f2 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/metaops.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _METAOPS_H_ +#define _METAOPS_H_ + +#include "ffsb.h" +#include "fileops.h" + +void ffsb_metaops(struct ffsb_thread *, ffsb_fs_t *, unsigned); +void ffsb_createdir(struct ffsb_thread *, ffsb_fs_t *, unsigned); +void metaops_metadir(ffsb_fs_t *, unsigned); + +#endif /* _METAOPS_H_ */ diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/mkinstalldirs b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/mkinstalldirs new file mode 100755 index 00000000..1790da11 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 2009/10/26 11:25:55 subrata_modak Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/parser.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/parser.c new file mode 100644 index 00000000..1c2b7809 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/parser.c @@ -0,0 +1,1033 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include + +#include "ffsb.h" +#include "parser.h" +#include "ffsb_tg.h" +#include "ffsb_stats.h" +#include "util.h" +#include "list.h" + +#define BUFSIZE 1024 + +config_options_t global_options[] = GLOBAL_OPTIONS; +config_options_t tg_options[] = THREADGROUP_OPTIONS; +config_options_t fs_options[] = FILESYSTEM_OPTIONS; +config_options_t stats_options[] = STATS_OPTIONS; +container_desc_t container_desc[] = CONTAINER_DESC; + +/* strips out whitespace and comments, returns NULL on eof */ +void parseerror(char *msg) +{ + fprintf(stderr, "Error parsing %s\n", msg); + exit(1); +} + +static char *get_next_line(FILE *f) +{ + static char buf[BUFSIZE]; + char *ret, *tmp; + int flag = 1; + while (flag) { + ret = fgets(buf, BUFSIZE, f); + if (ret == NULL) + return NULL; + ret = buf; + while (isspace(*ret)) + ret++; + + if ((*ret == COMMENT_CHAR) || (*ret == '\0')) + continue; + + tmp = ret; + while (*tmp != '\0') { + if (*tmp == COMMENT_CHAR) { + *tmp = '\0'; + break; + } + tmp++; + } + flag = 0; + } + return ret; +} + +static char *strip_space(char *buf) +{ + int len; + char *tmp, *tmp2; + int flag = 1; + + len = strnlen(buf, BUFSIZE); + tmp = malloc(sizeof(char) * len); + memset(tmp, 0, sizeof(char) * len); + tmp2 = tmp; + while (flag) { + if (!isspace(*buf)) { + *tmp = *buf; + tmp++; + } + buf++; + if (*buf != '\0') + continue; + flag = 0; + } + return tmp2; +} + +static uint64_t size64_convert(char *buf) +{ + size_t buf_size = strlen(buf); + char unit[3] = {0}; + char search_str[256]; + uint64_t size; + uint64_t multiplier = 1; + int i; + + if (buf_size == 1) + goto out; + + strcpy(unit, buf + (buf_size - 2)); + for (i = 0; i < 2; i++) { + if (isdigit(unit[i])) + goto try_single; + unit[i] = toupper(unit[i]); + } + goto do_multiplier; + +try_single: + memcpy(unit, "\0", 3); + strcpy(unit, buf + (buf_size - 1)); + if (isdigit(unit[0])) { + unit[0] = 0; + goto out; + } + unit[0] = toupper(unit[0]); + +do_multiplier: + if (!strcmp("KB", unit) || !strcmp("K", unit)) + multiplier = 1024; + if (!strcmp("MB", unit) || !strcmp("M", unit)) + multiplier = 1048576; + if (!strcmp("GB", unit) || !strcmp("G", unit)) + multiplier = 1073741824; + if (multiplier == 1) { + unit[0] = 0; + multiplier = 0; + } +out: + sprintf(search_str, "%%llu%s", unit); + if (1 == sscanf(buf, search_str, &size)) + return size * multiplier; + return 0; +} + +static uint64_t *get_opt64(char *buf, char string[]) +{ + char search_str[256]; + char *line = strip_space(buf); + uint64_t temp; + uint64_t *ret; + + sprintf(search_str, "%s=%%llu\\n", string); + if (1 == sscanf(line, search_str, &temp)) { + ret = malloc(sizeof(uint64_t)); + *ret = temp; + return ret; + } + free(line); + return NULL; +} + +static uint32_t *get_opt32(char *buf, char string[]) +{ + uint32_t *ret; + uint64_t *res; + res = get_opt64(buf, string); + if (res) { + ret = malloc(sizeof(uint32_t)); + *ret = *res; + free(res); + return ret; + } + return NULL; +} + +static uint8_t *get_optbool(char *buf, char string[]) +{ + uint8_t *ret; + uint64_t *res; + res = get_opt64(buf, string); + if (res) { + if ((int)*res < 0 || (int)*res > 1) { + printf("Error in: %s", buf); + printf("%llu not boolean\n", (long long unsigned) *res); + exit(1); + } + ret = malloc(sizeof(uint8_t)); + *ret = *res; + free(res); + return ret; + } + return NULL; +} + +static char *get_optstr(char *buf, char string[]) +{ + char search_str[256]; + char *line = strip_space(buf); + char *ret_buf; + char temp[BUFSIZE]; + int len; + + len = strnlen(string, BUFSIZE); + sprintf(search_str, "%s=%%%ds\\n", string, BUFSIZE - len-1); + if (1 == sscanf(line, search_str, &temp)) { + len = strnlen(temp, 4096); + ret_buf = malloc(len); + strncpy(ret_buf, temp, len); + return ret_buf; + } + free(line); + return NULL; +} + +static double *get_optdouble(char *buf, char string[]) +{ + char search_str[256]; + char *line = strip_space(buf); + double temp; + double *ret; + + sprintf(search_str, "%s=%%lf\\n", string); + if (1 == sscanf(line, search_str, &temp)) { + ret = malloc(sizeof(double)); + *ret = temp; + return ret; + } + free(line); + return NULL; +} + +static range_t *get_optrange(char *buf, char string[]) +{ + char search_str[256]; + double a, b; + range_t *ret; + + sprintf(search_str, "%s %%lf %%lf\\n", string); + if (2 == sscanf(buf, search_str, &a, &b)) { + ret = malloc(sizeof(struct range)); + ret->a = a; + ret->b = b; + return ret; + } + return NULL; +} + +static size_weight_t *get_optsizeweight(char *buf, char string[]) +{ + char search_str[256]; + char size[256]; + int weight; + size_weight_t *ret; + + sprintf(search_str, "%s %%s %%d\\n", string); + if (2 == sscanf(buf, search_str, &size, &weight)) { + ret = malloc(sizeof(struct size_weight)); + ret->size = size64_convert(size); + ret->weight = weight; + return ret; + } + return NULL; +} + +static uint64_t * get_optsize64(char *buf, char string[]) +{ + char search_str[256]; + char *line = strip_space(buf); + char temp[256]; + uint64_t size; + uint64_t *ret = NULL; + + sprintf(search_str, "%s=%%s\\n", string); + if (1 == sscanf(line, search_str, &temp)) { + ret = malloc(sizeof(uint64_t)); + *ret = size64_convert(temp); + } + free(line); + return ret; +} + +static uint32_t * get_optsize32(char *buf, char string []) +{ + uint32_t *ret; + uint64_t *res; + res = get_optsize64(buf, string); + if (res) { + ret = malloc(sizeof(uint32_t)); + *ret = *res; + free(res); + return ret; + } + return NULL; +} + +static uint64_t *get_deprecated(char *buf, char string[]) +{ + char search_str[256]; + char temp[BUFSIZE]; + int len; + + len = strnlen(string, BUFSIZE); + sprintf(search_str, "%s%%%ds\\n", string, BUFSIZE - len-1); + if (1 == sscanf(buf, search_str, &temp)) + printf("WARNING: The \"%s\" option is deprecated!!!\n", string); + + return NULL; +} + +static container_t *init_container(void) +{ + container_t *container; + container = malloc(sizeof(container_t)); + container->config = NULL; + container->type = 0; + container->next = NULL; + return container; +} + +static int set_option(char *buf, config_options_t *options) +{ + void *value; + + while (options->name) { + switch (options->type) { + case TYPE_WEIGHT: + case TYPE_U32: + value = get_opt32(buf, options->name); + if (value) + goto out; + break; + case TYPE_U64: + value = get_opt64(buf, options->name); + if (value) + goto out; + break; + case TYPE_STRING: + value = get_optstr(buf, options->name); + if (value) + goto out; + break; + case TYPE_BOOLEAN: + value = get_optbool(buf, options->name); + if (value) + goto out; + break; + case TYPE_DOUBLE: + value = get_optdouble(buf, options->name); + if (value) + goto out; + break; + case TYPE_RANGE: + value = get_optrange(buf, options->name); + if (value) + goto out; + break; + case TYPE_SIZEWEIGHT: + value = get_optsizeweight(buf, options->name); + if (value) + goto out; + break; + case TYPE_DEPRECATED: + value = get_deprecated(buf, options->name); + if (value) + goto out; + break; + case TYPE_SIZE32: + value = get_optsize32(buf, options->name); + if (value) + goto out; + break; + case TYPE_SIZE64: + value = get_optsize64(buf, options->name); + if (value) + goto out; + break; + default: + printf("Unknown type\n"); + break; + } + options++; + } + return 0; + +out: + if (options->storage_type == STORE_SINGLE) + options->value = value; + if (options->storage_type == STORE_LIST) { + if (!options->value) { + value_list_t *lhead; + lhead = malloc(sizeof(struct value_list)); + INIT_LIST_HEAD(&lhead->list); + options->value = lhead; + } + value_list_t *tmp_list, *tmp_list2; + tmp_list = malloc(sizeof(struct value_list)); + INIT_LIST_HEAD(&tmp_list->list); + tmp_list->value = value; + tmp_list2 = (struct value_list *)options->value; + list_add(&(tmp_list->list), &(tmp_list2->list)); + } + + return 1; +} + +void insert_container(container_t *container, container_t *new_container) +{ + while (container->next) + container = container->next; + container->next = new_container; +} + +container_t *search_group(char *, FILE *); + +container_t *handle_container(char *buf, FILE *f, uint32_t type, + config_options_t *options) +{ + container_desc_t *desc = container_desc; + container_t *ret_container; + container_t *tmp_container, *tmp2_container; + container_t *child = NULL; + int is_option; + + while (desc->name) + if (desc->type == type) + break; + else + desc++; + + if (!desc->name) + return NULL; + + buf = get_next_line(f); + while (buf) { + is_option = set_option(buf, options); + tmp_container = search_group(buf, f); + if (tmp_container) { + if (tmp_container->type == END) { + free(tmp_container); + break; + } else { + if (child == NULL) + child = tmp_container; + else { + tmp2_container = child; + while (tmp2_container->next) + tmp2_container = tmp2_container->next; + tmp2_container->next = tmp_container; + } + + } + } + if (!is_option && !tmp_container) { + printf("ERROR!!! Unknow option: %s", buf); + exit(1); + } + buf = get_next_line(f); + } + ret_container = init_container(); + ret_container->config = options; + ret_container->type = type; + if (child) + ret_container->child = child; + + return ret_container; +} + +container_t *search_group(char *buf, FILE *f) +{ + char temp[BUFSIZE]; + char *ptr; + config_options_t *options; + container_desc_t *desc = container_desc; + container_t *ret_container; + + if (1 == sscanf(buf, "[%s]\n", (char *) &temp)) + while (desc->name) { + ptr = strstr(buf, desc->name); + if (ptr) + switch (desc->type) { + case FILESYSTEM: + options = malloc(sizeof(fs_options)); + memcpy(options, fs_options, + sizeof(fs_options)); + return handle_container(buf, f, + desc->type, + options); + break; + case THREAD_GROUP: + options = malloc(sizeof(tg_options)); + memcpy(options, tg_options, + sizeof(tg_options)); + return handle_container(buf, f, + desc->type, + options); + break; + case STATS: + options = malloc(sizeof(stats_options)); + memcpy(options, stats_options, + sizeof(stats_options)); + return handle_container(buf, f, + desc->type, + options); + break; + case END: + ret_container = init_container(); + ret_container->type = END; + return ret_container; + break; + } + desc++; + } + return NULL; +} + +void *get_value(config_options_t *config, char *name) +{ + while (config->name) { + if (!strcmp(config->name, name)) { + if (config->value) + return config->value; + else + return NULL; + } + config++; + } + return 0; +} + +char *get_config_str(config_options_t *config, char *name) +{ + return get_value(config, name); +} + +uint32_t get_config_u32(config_options_t *config, char *name) +{ + void *value = get_value(config, name); + if (value) + return *(uint32_t *)value; + return 0; +} + +uint8_t get_config_bool(config_options_t *config, char *name) +{ + void *value = get_value(config, name); + if (value) + return *(uint8_t *)value; + return 0; +} + +uint64_t get_config_u64(config_options_t *config, char *name) +{ + void *value = get_value(config, name); + if (value) + return *(uint64_t *)value; + return 0; +} + +double get_config_double(config_options_t *config, char *name) +{ + void *value = get_value(config, name); + if (value) + return *(double *)value; + return 0; +} + +static profile_config_t *parse(FILE *f) +{ + char *buf; + profile_config_t *profile_conf; + container_t *tmp_container; + + profile_conf = malloc(sizeof(profile_config_t)); + profile_conf->global = malloc(sizeof(global_options)); + memcpy(profile_conf->global, global_options, sizeof(global_options)); + profile_conf->fs_container = NULL; + profile_conf->tg_container = NULL; + int is_option; + buf = get_next_line(f); + + while (buf) { + is_option = set_option(buf, profile_conf->global); + tmp_container = search_group(buf, f); + if (tmp_container) + switch (tmp_container->type) { + case FILESYSTEM: + if (profile_conf->fs_container == NULL) + profile_conf->fs_container = tmp_container; + else + insert_container(profile_conf->fs_container, + tmp_container); + break; + case THREAD_GROUP: + if (profile_conf->tg_container == NULL) + profile_conf->tg_container = tmp_container; + else + insert_container(profile_conf->tg_container, + tmp_container); + break; + default: + break; + } + if (!is_option && !tmp_container) { + printf("ERROR!!! Unknow option: %s", buf); + exit(1); + } + buf = get_next_line(f); + } + return profile_conf; +} + +void set_weight(ffsb_tg_t *tg, config_options_t *config) +{ + char *op; + int len; + config_options_t *tmp_config = config; + + while (tmp_config->name) { + if (tmp_config->type == TYPE_WEIGHT) { + len = strlen(tmp_config->name); + op = malloc(sizeof(char) * len - 6); + memset(op, 0, sizeof(char) * len - 6); + strncpy (op, tmp_config->name, len - 7); + tg_set_op_weight(tg, op, + get_config_u32(config, + tmp_config->name)); + free(op); + } + tmp_config++; + } +} + +int get_weight_total(ffsb_tg_t *tg) +{ + char *op; + int len; + int total = 0; + config_options_t *tmp_config = tg_options; + + while (tmp_config->name) { + if (tmp_config->type == TYPE_WEIGHT) { + len = strlen(tmp_config->name); + op = malloc(sizeof(char) * len - 6); + memset(op, 0, sizeof(char) * len - 6); + strncpy (op, tmp_config->name, len - 7); + total += tg_get_op_weight(tg, op); + free(op); + } + tmp_config++; + } + return total; +} + +/* !!! hackish verification function, we should somehow roll this into the */ +/* op descriptions/struct themselves at some point with a callback verify */ +/* op requirements: */ +/* require tg->read_blocksize: read, readall */ +/* require tg->write_blocksize: write, create, append, rewritefsync */ +/* */ + +static int verify_tg(ffsb_tg_t *tg) +{ + uint32_t read_weight = tg_get_op_weight(tg, "read"); + uint32_t readall_weight = tg_get_op_weight(tg, "readall"); + uint32_t write_weight = tg_get_op_weight(tg, "write"); + uint32_t create_weight = tg_get_op_weight(tg, "create"); + uint32_t append_weight = tg_get_op_weight(tg, "append"); + uint32_t createdir_weight = tg_get_op_weight(tg, "createdir"); + uint32_t delete_weight = tg_get_op_weight(tg, "delete"); + uint32_t writeall_weight = tg_get_op_weight(tg, "writeall"); + uint32_t writeall_fsync_weight = tg_get_op_weight(tg, "writeall_fsync"); + + uint32_t sum_weight = get_weight_total(tg); + + uint32_t read_blocksize = tg_get_read_blocksize(tg); + uint32_t write_blocksize = tg_get_write_blocksize(tg); + + int read_random = tg_get_read_random(tg); + int read_skip = tg_get_read_skip(tg); + uint32_t read_skipsize = tg_get_read_skipsize(tg); + + if (sum_weight == 0) { + printf("Error: A threadgroup must have at least one weighted " + "operation\n"); + return 1; + } + + if ((read_weight || readall_weight) && !(read_blocksize)) { + printf("Error: read and readall operations require a " + "read_blocksize\n"); + return 1; + } + + if ((write_weight || create_weight || append_weight || writeall_weight + || writeall_fsync_weight) && !(write_blocksize)) { + printf("Error: write, writeall, create, append" + "operations require a write_blocksize\n"); + return 1; + } + + if (read_random && read_skip) { + printf("Error: read_random and read_skip are mutually " + "exclusive\n"); + return 1; + } + + if (read_skip && !(read_skipsize)) { + printf("Error: read_skip specified but read_skipsize is " + "zero\n"); + return 1; + } + + return 0; +} + +static unsigned get_num_containers(container_t *container) +{ + int numtg = 0; + while (container) { + numtg++; + container = container->next; + } + return numtg; +} + +static unsigned get_num_threadgroups(profile_config_t *profile_conf) +{ + return get_num_containers(profile_conf->tg_container); +} + +static unsigned get_num_filesystems(profile_config_t *profile_conf) +{ + return get_num_containers(profile_conf->fs_container); +} + +static int get_num_totalthreads(profile_config_t *profile_conf) +{ + int num_threads = 0; + container_t *tg = profile_conf->tg_container; + config_options_t *tg_config; + + while (tg) { + tg_config = tg->config; + while (tg_config->name) { + if (!strcmp(tg_config->name, "num_threads")) + num_threads += *(uint32_t *) tg_config->value; + tg_config++; + } + if (tg->next) + tg = tg->next; + else + break; + } + + return num_threads; +} + +container_t *get_container(container_t *head_cont, int pos) +{ + int count = 0; + while (head_cont) { + if (count == pos) + return head_cont; + head_cont = head_cont->next; + count++; + } + return NULL; +} + +config_options_t *get_fs_config(ffsb_config_t *fc, int pos) +{ + container_t *tmp_cont; + + assert(pos < fc->num_filesys); + tmp_cont = get_container(fc->profile_conf->fs_container, pos); + if (tmp_cont) + return tmp_cont->config; + return NULL; +} + +container_t *get_fs_container(ffsb_config_t *fc, int pos) +{ + assert(pos < fc->num_filesys); + return get_container(fc->profile_conf->fs_container, pos); +} + +config_options_t *get_tg_config(ffsb_config_t *fc, int pos) +{ + container_t *tmp_cont; + + assert(pos < fc->num_threadgroups); + tmp_cont = get_container(fc->profile_conf->tg_container, pos); + if (tmp_cont) + return tmp_cont->config; + return NULL; +} + +container_t *get_tg_container(ffsb_config_t *fc, int pos) +{ + assert(pos < fc->num_threadgroups); + return get_container(fc->profile_conf->tg_container, pos); +} + +static void init_threadgroup(ffsb_config_t *fc, config_options_t *config, + ffsb_tg_t *tg, int tg_num) +{ + int num_threads; + memset(tg, 0, sizeof(ffsb_tg_t)); + + num_threads = get_config_u32(config, "num_threads"); + + init_ffsb_tg(tg, num_threads, tg_num); + + if (get_config_str(config, "bindfs")) { + int i; + config_options_t *tmp_config; + for (i = 0; i < fc->num_filesys; i++) { + tmp_config = get_fs_config(fc, i); + if (!strcmp(get_config_str(config, "bindfs"), + get_config_str(tmp_config, "location"))) + break; + } + if (strcmp(get_config_str(config, "bindfs"), + get_config_str(tmp_config, "location"))) { + printf ("Bind fs failed: Base fs \"%s\" not found\n", + get_config_str(config, "bindfs")); + exit(1); + } + printf("%d\n", i); + tg->bindfs = i; + } + + tg->read_random = get_config_bool(config, "read_random"); + tg->read_size = get_config_u64(config, "read_size"); + tg->read_skip = get_config_bool(config, "read_skip"); + tg->read_skipsize = get_config_u32(config, "read_skipsize"); + + tg->write_random = get_config_bool(config, "write_random"); + tg->write_size = get_config_u64(config, "write_size"); + tg->fsync_file = get_config_bool(config, "fsync_file"); + + tg->wait_time = get_config_u32(config, "op_delay"); + + tg_set_read_blocksize(tg, get_config_u32(config, "read_blocksize")); + tg_set_write_blocksize(tg, get_config_u32(config, "write_blocksize")); + + set_weight(tg, config); + + if (verify_tg(tg)) { + printf("threadgroup %d verification failed\n", tg_num); + exit(1); + } +} + +static void init_filesys(ffsb_config_t *fc, int num) +{ + config_options_t *config = get_fs_config(fc, num); + profile_config_t *profile_conf = fc->profile_conf; + ffsb_fs_t *fs = &fc->filesystems[num]; + value_list_t *tmp_list, *list_head; + + memset(fs, 0, sizeof(ffsb_fs_t)); + + fs->basedir = get_config_str(config, "location"); + + if (get_config_str(config, "clone")) { + int i; + config_options_t *tmp_config; + for (i = 0; i < fc->num_filesys; i++) { + tmp_config = get_fs_config(fc, i); + if (!strcmp(get_config_str(config, "clone"), + get_config_str(tmp_config, "location"))) + break; + } + if (strcmp(get_config_str(config, "clone"), + get_config_str(tmp_config, "location"))) { + printf ("Clone fs failed: Base fs \"%s\" not found\n", + get_config_str(config, "clone")); + exit(1); + } + config = tmp_config; + } + + fs->num_dirs = get_config_u32(config, "num_dirs"); + fs->num_start_files = get_config_u32(config, "num_files"); + fs->minfilesize = get_config_u64(config, "min_filesize"); + fs->maxfilesize = get_config_u64(config, "max_filesize"); + fs->desired_fsutil = get_config_double(config, "desired_util"); + fs->init_fsutil = get_config_double(config, "init_util"); + fs->init_size = get_config_u64(config, "init_size"); + + fs->flags = 0; + if (get_config_bool(config, "reuse")) + fs->flags |= FFSB_FS_REUSE_FS; + + if (get_config_bool(profile_conf->global, "directio")) + fs->flags |= FFSB_FS_DIRECTIO | FFSB_FS_ALIGNIO4K; + + if (get_config_bool(profile_conf->global, "bufferio")) + fs->flags |= FFSB_FS_LIBCIO; + + if (get_config_bool(profile_conf->global, "alignio")) + fs->flags |= FFSB_FS_ALIGNIO4K; + + if (get_config_bool(config, "agefs")) { + container_t *age_cont = get_fs_container(fc, num); + if (!age_cont->child) { + printf("No age threaggroup in profile"); + exit(1); + } + + age_cont = age_cont->child; + ffsb_tg_t *age_tg = ffsb_malloc(sizeof(ffsb_tg_t)); + init_threadgroup(fc, age_cont->config, age_tg, 0); + fs->aging_tg = age_tg; + fs->age_fs = 1; + } + + if (get_config_u32(config, "create_blocksize")) + fs->create_blocksize = get_config_u32(config, + "create_blocksize"); + else + fs->create_blocksize = FFSB_FS_DEFAULT_CREATE_BLOCKSIZE; + + if (get_config_u32(config, "age_blocksize")) + fs->age_blocksize = get_config_u32(config, "age_blocksize"); + else + fs->age_blocksize = FFSB_FS_DEFAULT_AGE_BLOCKSIZE; + + list_head = (value_list_t *) get_value(config, "size_weight"); + if (list_head) { + int count = 0; + size_weight_t *sizew; + list_for_each_entry(tmp_list, &list_head->list, list) + count++; + + fs->num_weights=count; + fs->size_weights = malloc(sizeof(size_weight_t) * fs->num_weights); + + count = 0; + list_for_each_entry(tmp_list, &list_head->list, list) { + sizew = (size_weight_t *)tmp_list->value; + fs->size_weights[count].size = sizew->size; + fs->size_weights[count].weight = sizew->weight; + fs->sum_weights += sizew->weight; + count++; + } + } +} + +static void init_tg_stats(ffsb_config_t *fc, int num) +{ + config_options_t *config; + container_t *tmp_cont; + value_list_t *tmp_list, *list_head; + syscall_t sys; + ffsb_statsc_t fsc = { 0, }; + char *sys_name; + range_t *bucket_range; + uint32_t min, max; + + tmp_cont = get_tg_container(fc, num); + if (tmp_cont->child) { + if (tmp_cont->type == STATS) { + config = tmp_cont->config; + if (get_config_bool(config, "enable_stats")) { + + list_head = (value_list_t *) get_value(config, "ignore"); + if (list_head) + list_for_each_entry(tmp_list, + &list_head->list, list) { + sys_name = (char *)tmp_list->value; + ffsb_stats_str2syscall(sys_name, &sys); + ffsb_statsc_ignore_sys(&fsc, sys); + } + + list_head = (value_list_t *) get_value(config, "msec_range"); + if (list_head && get_config_bool(config, "enable_range")) + list_for_each_entry(tmp_list, + &list_head->list, list) { + bucket_range = (range_t *)tmp_list->value; + min = (uint32_t)(bucket_range->a * 1000.0f); + max = (uint32_t)(bucket_range->b * 1000.0f); + ffsb_statsc_addbucket(&fsc, min, max); + } + + tg_set_statsc(&fc->groups[num], &fsc); + } + } + } +} + +static void init_config(ffsb_config_t *fc, profile_config_t *profile_conf) +{ + config_options_t *config; + container_t *tmp_cont; + int i; + + fc->time = get_config_u32(profile_conf->global, "time"); + fc->num_filesys = get_num_filesystems(profile_conf); + fc->num_threadgroups = get_num_threadgroups(profile_conf); + fc->num_totalthreads = get_num_totalthreads(profile_conf); + fc->profile_conf = profile_conf; + fc->callout = get_config_str(profile_conf->global, "callout"); + + fc->filesystems = ffsb_malloc(sizeof(ffsb_fs_t) * fc->num_filesys); + for (i = 0; i < fc->num_filesys; i++) + init_filesys(fc, i); + + fc->groups = ffsb_malloc(sizeof(ffsb_tg_t) * fc->num_threadgroups); + for (i = 0; i < fc->num_threadgroups; i++) { + config = get_tg_config(fc, i); + init_threadgroup(fc, config, &fc->groups[i], i); + init_tg_stats(fc, i); + } +} + +void ffsb_parse_newconfig(ffsb_config_t *fc, char *filename) +{ + FILE *f; + + profile_config_t *profile_conf; + + f = fopen(filename, "r"); + if (f == NULL) { + perror(filename); + exit(1); + } + profile_conf = parse(f); + fclose(f); + + init_config(fc, profile_conf); +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/parser.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/parser.h new file mode 100644 index 00000000..3df4ffed --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/parser.h @@ -0,0 +1,151 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _PARSER_H_ +#define _PARSER_H_ + +#include "ffsb.h" +#include "list.h" + +#define COMMENT_CHAR '#' + +#define STORE_SINGLE 0x0001 +#define STORE_LIST 0x0002 + +#define TYPE_U32 0x0001 +#define TYPE_U64 0x0002 +#define TYPE_STRING 0x0004 +#define TYPE_BOOLEAN 0x0008 +#define TYPE_DOUBLE 0x0010 +#define TYPE_RANGE 0x0020 +#define TYPE_SIZEWEIGHT 0x0040 +#define TYPE_DEPRECATED 0x0080 +#define TYPE_WEIGHT 0x0100 +#define TYPE_SIZE32 0x0200 +#define TYPE_SIZE64 0x0400 + +#define ROOT 0x0001 +#define THREAD_GROUP 0x0002 +#define FILESYSTEM 0x0004 +#define END 0x0008 +#define STATS 0x0010 + +#define GLOBAL_OPTIONS { \ + {"num_filesystems", NULL, TYPE_DEPRECATED, STORE_SINGLE}, \ + {"num_threadgroups", NULL, TYPE_DEPRECATED, STORE_SINGLE}, \ + {"verbose", NULL, TYPE_BOOLEAN, STORE_SINGLE}, \ + {"time", NULL, TYPE_U32, STORE_SINGLE}, \ + {"directio", NULL, TYPE_BOOLEAN, STORE_SINGLE}, \ + {"bufferio", NULL, TYPE_BOOLEAN, STORE_SINGLE}, \ + {"alignio", NULL, TYPE_BOOLEAN, STORE_SINGLE}, \ + {"callout", NULL, TYPE_STRING, STORE_SINGLE}, \ + {NULL, NULL, 0, 0} } + +#define THREADGROUP_OPTIONS { \ + {"bindfs", NULL, TYPE_STRING, STORE_SINGLE}, \ + {"num_threads", NULL, TYPE_U32, STORE_SINGLE}, \ + {"read_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"readall_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"read_random", NULL, TYPE_BOOLEAN, STORE_SINGLE}, \ + {"read_skip", NULL, TYPE_U32, STORE_SINGLE}, \ + {"read_size", NULL, TYPE_SIZE64, STORE_SINGLE}, \ + {"read_blocksize", NULL, TYPE_SIZE32, STORE_SINGLE}, \ + {"read_skipsize", NULL, TYPE_SIZE32, STORE_SINGLE}, \ + {"write_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"write_fsync_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"write_random", NULL, TYPE_BOOLEAN, STORE_SINGLE}, \ + {"fsync_file", NULL, TYPE_DEPRECATED, STORE_SINGLE}, \ + {"write_size", NULL, TYPE_SIZE64, STORE_SINGLE}, \ + {"write_blocksize", NULL, TYPE_SIZE32, STORE_SINGLE}, \ + {"create_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"create_fsync_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"delete_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"append_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"append_fsync_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"metaop_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"createdir_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"op_delay", NULL, TYPE_U32, STORE_SINGLE}, \ + {"stat_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"writeall_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"writeall_fsync_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {"open_close_weight", NULL, TYPE_WEIGHT, STORE_SINGLE}, \ + {NULL, NULL, 0} } + +#define FILESYSTEM_OPTIONS { \ + {"location", NULL, TYPE_STRING, STORE_SINGLE}, \ + {"num_files", NULL, TYPE_U32, STORE_SINGLE}, \ + {"num_dirs", NULL, TYPE_U32, STORE_SINGLE}, \ + {"reuse", NULL, TYPE_BOOLEAN, STORE_SINGLE}, \ + {"min_filesize", NULL, TYPE_SIZE64, STORE_SINGLE}, \ + {"max_filesize", NULL, TYPE_SIZE64, STORE_SINGLE}, \ + {"create_blocksize", NULL, TYPE_SIZE32, STORE_SINGLE}, \ + {"age_blocksize", NULL, TYPE_SIZE32, STORE_SINGLE}, \ + {"desired_util", NULL, TYPE_DOUBLE, STORE_SINGLE}, \ + {"agefs", NULL, TYPE_BOOLEAN, STORE_SINGLE}, \ + {"size_weight", NULL, TYPE_SIZEWEIGHT, STORE_LIST}, \ + {"init_util", NULL, TYPE_DOUBLE, STORE_SINGLE}, \ + {"init_size", NULL, TYPE_SIZE64, STORE_SINGLE}, \ + {"clone", NULL, TYPE_STRING, STORE_SINGLE}, \ + {NULL, NULL, 0} } + +#define STATS_OPTIONS { \ + {"enable_stats", NULL, TYPE_BOOLEAN, STORE_SINGLE}, \ + {"enable_range", NULL, TYPE_BOOLEAN, STORE_SINGLE}, \ + {"ignore", NULL, TYPE_STRING, STORE_LIST}, \ + {"msec_range", NULL, TYPE_RANGE, STORE_LIST}, \ + {NULL, NULL, 0} } + +#define CONTAINER_DESC { \ + {"filesystem", FILESYSTEM, 10}, \ + {"threadgroup", THREAD_GROUP, 11}, \ + {"end", END, 3}, \ + {"stats", STATS, 5}, \ + {NULL, 0, 0} } + +typedef struct container { + struct config_options *config; + uint32_t type; + struct container *child; + struct container *next; +} container_t; + +typedef struct config_options { + char *name; + void *value; + int type; + int storage_type; +} config_options_t; + +typedef struct container_desc { + char *name; + uint16_t type; + uint16_t size; +} container_desc_t; + +typedef struct range { + double a; + double b; +} range_t; + +typedef struct value_list { + void *value; + struct list_head list; +} value_list_t; + +void ffsb_parse_newconfig(ffsb_config_t *fc, char *filename); + +#endif diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/public-description b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/public-description new file mode 100644 index 00000000..f770dd0c --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/public-description @@ -0,0 +1,4 @@ +The Flexible Filesystem Benchmark (FFSB) is a filesystem performance +measurement tool. It uses customizable profiles to measure of different +workloads, and it supports multiple groups of threads across multiple +filesystems. diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rand.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rand.c new file mode 100644 index 00000000..b8c4a2cf --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rand.c @@ -0,0 +1,188 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "config.h" +#include "rand.h" +#include "util.h" + +#define RANDSRC "/dev/urandom" + +static int randfd = -1; + +/* close the file after we're done with the benchmark */ +void randcleanup(void) +{ + if (randfd > 0) + close(randfd); +} + +/* We fill up the array with random bits from RANDSRC here and set index */ +/* to 0 */ +/* pre: state->size must be set and state->mt must be allocated! */ +static void sgenrand(randdata_t *state) +{ + int got = 0; + got = read(randfd, state->mt, state->size); + if (got != state->size) { + int i ; + /* fall back on lrand48 */ + /* printf("fallback_rand\n"); */ + + for (i = got ; i < state->size ; i += 4) { + long int rand = 0; +#ifdef HAVE_LRAND48 + lrand48_r(&(state->data), &rand); +#else + rand = random(); +#endif + assert(rand != 0); + state->mt[i] = (rand >> 24) & (512 - 1); + state->mt[i+1] = (rand >> 16) & (512 - 1); + state->mt[i+2] = (rand >> 8) & (512 - 1); + state->mt[i+3] = (rand) & (512 - 1); + } + + } + state->mti = 0; +} + +/* returns 8 random bits */ +static uint8_t genrand8(randdata_t *state) +{ + unsigned long ret = 0; + if (state->mti >= state->size) { +/* sgenrand(state); */ + state->mti = 0; + } + ret = state->mt[state->mti]; + state->mti++; + return ret; +} + +/* returns 32 random bits */ +static uint32_t genrand32(randdata_t *state) +{ + uint8_t bytes[4]; + uint32_t ret = 0; + + bytes[0] = genrand8(state); + bytes[1] = genrand8(state); + bytes[2] = genrand8(state); + bytes[3] = genrand8(state); + + ret = *((uint32_t *)bytes); /* !!! hack */ + return ret; +} + +void init_random(randdata_t *state, uint32_t iter) +{ + struct timeval time; + if (iter == 0) + state->size = MIN_RANDBUF_SIZE * AVG_ITR_RNDBTS; + else if (iter > MAX_RANDBUF_SIZE) + state->size = MAX_RANDBUF_SIZE * AVG_ITR_RNDBTS; + else + state->size = iter * AVG_ITR_RNDBTS; + + state->mt = ffsb_malloc(state->size); + + /* !!!! racy? add pthread_once stuff later */ + if ((randfd < 0) && (randfd = open(RANDSRC, O_RDONLY)) < 0) { + perror("open " RANDSRC); + exit(1); + } + sgenrand(state); + gettimeofday(&time, NULL); +#ifdef HAVE_LRAND48 + srand48_r(time.tv_sec, &state->data); +#endif +} + +void destroy_random(randdata_t *rd) +{ + free(rd->mt); +} + +/* + * I've taken the liberty of slightly redesigning this stuff. + * Instead of simply getting the full word of random bits + * and throwing away most of it using the mod operator, + * we should only get byte-sized chunks of random bits and + * construct our random number that way with less wasteage - SR + */ +uint32_t getrandom(randdata_t *state, uint32_t mod) +{ + + uint8_t bytes[4] = { 0, 0, 0, 0 }; + uint32_t ret; + int num_bytes = 4; + int i; + + if ((mod == 0) || (mod == 1)) + return 0; + + if (!(mod >> 8)) + num_bytes = 1; + else if (!(mod >> 16)) + num_bytes = 2; + else if (!(mod >> 24)) + num_bytes = 3; + + for (i = 0; i < num_bytes; i++) + bytes[i] = genrand8(state); + + ret = (bytes[3] << 24) + (bytes[2] << 16) + (bytes[1] << 8) + bytes[0]; + + return ret % mod; +} + +uint64_t getllrandom(randdata_t *state, uint64_t mod) +{ + uint64_t result = 0; + uint64_t high = 0; + uint32_t low = 0; + + if (mod == 0) + return 0; + + /* ULONG_MAX comes from limits.h */ + if (mod < ULONG_MAX) + return (uint64_t)getrandom(state, (uint32_t)mod); + + high = genrand32(state); + + low = genrand32(state); + + result = high << 32; + result |= (uint64_t)low; + + assert(result != 0); + assert(result > 0); + + return result % mod; +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rand.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rand.h new file mode 100644 index 00000000..13215511 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rand.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _MTINT_H_ +#define _MTINT_H_ + +#include "config.h" + +#include +#include +#include + +/* A guess of how many random bytes (not bits) */ +/* will be consumed per iteration */ +/* This is multiplied by the iteration count */ +/* to get the size of the array in init_random() */ +#define AVG_ITR_RNDBTS 2 + +/* Set a cap on the size of the array, note this */ +/* is multiplied by AVG_ITR_RNDBTS */ +#define MAX_RANDBUF_SIZE (10 * 1024) + +#define MIN_RANDBUF_SIZE 1024 + + +typedef struct randdata { + int size; + uint8_t *mt; /* the array of random bits */ + int mti; /* mti==N+1 means mt[N] is not initialized */ + + /* fallback random source, lrand48_r() */ +#ifdef HAVE_LRAND48_R + struct drand48_data data; +#endif +} randdata_t; + +uint32_t getrandom(randdata_t *rd, uint32_t mod); +uint64_t getllrandom(randdata_t *rd, uint64_t mod); + +/* pass in thread-local state, and est. number of "uses" */ +/* pass in 0 for size if size is unknown/not important */ +void init_random(randdata_t *state, uint32_t size); +void destroy_random(randdata_t *rd); +void randcleanup(void); + +#endif diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.c new file mode 100644 index 00000000..b8147f35 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.c @@ -0,0 +1,1040 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include "rbt.h" + +/* + * *********************************************** + * + * D.H. IBM, S. Rao + * + * Module: Operations executed on red-black struct + * + * *********************************************** + */ + +/* Construct a red-black tree node */ + +rb_node *rbnode_construct(datatype object, rb_color color) +{ + rb_node *node = (rb_node *) malloc(sizeof(rb_node)); + if (!node) { + fprintf(stderr, "Memory Shortage - No Execution Possible\n"); + return NULL; + } + node->object = object; + node->color = color; + node->parent = node->right = node->left = NULL; + return node; +} + +/* Destructor of a red-black tree node */ + +void rbnode_destruct(rb_node *node, destructor d) +{ + if (!node) + return; + if (d != NULL) + d(node->object); + rbnode_destruct(node->right, d); + rbnode_destruct(node->left, d); + free(node); +} + +/* Determine the depth of the subtree spanned by a given node */ + +int rbnode_depth(rb_node *node) +{ + /* Recursively determine the depth of the left and right + * subtrees + */ + int irightdepth = (node->right) ? rbnode_depth(node->right) : 0; + int ileftdepth = (node->left) ? rbnode_depth(node->left) : 0; + + /* Return the maximal child depth + 1 (the current node) */ + return ((irightdepth > ileftdepth) ? (irightdepth + 1) : (ileftdepth + 1)); +} + +/* Return the leftmost leaf in the tree */ + +rb_node *rbnode_minimum(rb_node *node) +{ + while (node->left) + node = node->left; + return node; +} + +/* Return the rightmost leaf in the tree */ + +rb_node *rbnode_maximum(rb_node *node) +{ + while (node->right) + node = node->right; + return node; +} + +/* Replace an object */ + +void rbnode_replace(rb_node *node, datatype object) +{ + /* Make sure the replacement does not violate the tree order + * Replace the object at the node + */ + node->object = object; +} + +/* Get the next node in the tree (according to the tree order) */ + +rb_node *rbnode_successor(rb_node *node) +{ + rb_node *succ_node; + + if (node->right) { + + /* If there is a right child, the successor is the + * minimal object in the sub-tree spanned by this + * child. + */ + + succ_node = node->right; + while (succ_node->left) + succ_node = succ_node->left; + } else { + + /* Otherwise, go up the tree until reaching the parent + * from the left direction. + */ + + rb_node *prev_node = node; + succ_node = node->parent; + while (succ_node && prev_node == succ_node->right) { + prev_node = succ_node; + succ_node = succ_node->parent; + } + } + + return (succ_node); +} + +/* Get the previous node in the tree (according to the tree order) */ + +rb_node *rbnode_predecessor(rb_node *node) +{ + rb_node *pred_node; + + if (node->left) { + + /* If there is a left child, the predecessor is the + * maximal object in the sub-tree spanned by this + * child. + */ + + pred_node = node->left; + while (pred_node->right) + pred_node = pred_node->right; + } else { + + /* Otherwise, go up the tree until reaching the parent + * from the right direction. + */ + + rb_node *prev_node = node; + pred_node = node->parent; + while (pred_node && prev_node == pred_node->left) { + prev_node = pred_node; + pred_node = pred_node->parent; + } + } + + return (pred_node); +} + +/* Return a pointer to a duplication of the given node */ + +rb_node *rbnode_duplicate(rb_node *node) +{ + /* Create a node of the same color, containing the same + * object + */ + rb_node *dup_node = rbnode_construct(node->object, node->color); + if (!dup_node) + return NULL; + + /* Duplicate the children recursively */ + if (node->right) { + dup_node->right = rbnode_duplicate(node->right); + dup_node->right->parent = dup_node; + } else { + dup_node->right = NULL; + } + + if (node->left) { + dup_node->left = rbnode_duplicate(node->left); + dup_node->left->parent = dup_node; + } else { + dup_node->left = NULL; + } + + return dup_node; /* Return the duplicated node */ +} + +/* Traverse a red-black subtree */ + +void rbnode_traverse(rb_node *node, opr *op) +{ + if (!node) + return; + rbnode_traverse(node->left, op); + op(node->object); + rbnode_traverse(node->right, op); +} + +/* + * *********************************** + * + * Operations on rb_tree struct + * + * *********************************** + */ + +/* Intialize a tree */ +void rbtree_init(rb_tree *tree) +{ +/* tree->comp = comp; */ + tree->isize = 0; + tree->root = NULL; +} + +/* Construct a tree given a comparison function */ + +rb_tree *rbtree_construct() +{ + rb_tree *tree = (rb_tree *) malloc(sizeof(rb_tree)); + if (!tree) { + fprintf(stderr, "Memory Issue - Shortge Exists!\n"); + return NULL; + } + rbtree_init(tree); + return tree; +} + +/* Remove all objects from a black-red tree */ + +void rbtree_clean(rb_tree *tree, destructor d) +{ + if (tree->root) + rbnode_destruct(tree->root, d); + tree->root = NULL; + tree->isize = 0; +} + +/* Destruct a red-black tree */ + +void rbtree_destruct(rb_tree *tree, destructor d) +{ + rbtree_clean(tree, d); + free(tree); +} + +/* Returns the size of the tree */ + +int rbtree_size(rb_tree *tree) +{ + return tree->isize; +} + +/* Returns the depth of the tree */ + +int rbtree_depth(rb_tree *tree) +{ + if (!(tree->root)) + return 0; + return rbnode_depth(tree->root); +} + +/* Check whether the tree contains a certain object */ + +int rbtree_contains(rb_tree *tree, datatype object) +{ + return (rbtree_find(tree, object) != NULL); +} + +/* Insert an object into the rb-tree */ + +rb_node *rbtree_insert(rb_tree *tree, datatype object) +{ + rb_node *cur_node; + rb_node *new_node; + int comp_result = 0; + + if (!(tree->root)) { + /* Assign a new root node (the root is always + * black) + */ + new_node = rbnode_construct(object, black); + if (!new_node) + return NULL; + tree->root = new_node; + tree->isize = 1; + return new_node; + } + + /* Find a spot for the new object, insert the object as a red + * leaf + */ + + cur_node = tree->root; + new_node = rbnode_construct(object, red); + if (!new_node) + return NULL; + + while (cur_node) { + /* Compare inserted object with the object stored in + * the current node + */ + comp_result = COMP_NODES(object, cur_node->object); + if (comp_result == 0) { + printf("Attempted to insert duplicate node, aborting\n"); + free(new_node); + return NULL; + } + if (comp_result > 0) { + if (!(cur_node->left)) { + /* Insert the new leaf as the left + * child of the current node + */ + cur_node->left = new_node; + new_node->parent = cur_node; + cur_node = NULL; /* Terminate the while loop */ + } else { + /* Go to the left subtree */ + cur_node = cur_node->left; + } + } else { + if (!(cur_node->right)) { + /* Insert the new leaf as the right + * child of the current node + */ + cur_node->right = new_node; + new_node->parent = cur_node; + cur_node = NULL; /* Terminate the while loop */ + } else { + /* Go to the right subtree */ + cur_node = cur_node->right; + } + } + } + + /* Mark the fact that a new node was added */ + tree->isize++; + + /* Fix the tree properties */ + rbtree_insert_fixup(tree, new_node); + + return new_node; +} + +/* Insert a new object to the tree as the a successor of a given + * node + */ + +rb_node *insert_successor_at(rb_tree *tree, rb_node *at_node, datatype object) +{ + rb_node *parent; + rb_node *new_node; + + if (!(tree->root)) { + /* Assign a new root node (the root is always + * black) + */ + new_node = rbnode_construct(object, black); + if (!new_node) + return NULL; + tree->root = new_node; + tree->isize = 1; + return new_node; + } + + /* Insert the new object as a red leaf, being the successor of + * node + */ + new_node = rbnode_construct(object, red); + if (!new_node) + return NULL; + + if (!at_node) { + /* The new node should become the tree's minimum Place + * is as the left child of the current minimal leaf + */ + parent = rbnode_minimum(tree->root); + parent->left = new_node; + } else { + /* Make sure the insertion does not violate the tree + * order In case given node has no right child, place + * the new node as its right child. Otherwise, place + * it at the leftmost position at the sub-tree rooted + * at its right side. + */ + if (!at_node->right) { + parent = at_node; + parent->right = new_node; + } else { + parent = rbnode_minimum(at_node->right); + parent->left = new_node; + } + } + + new_node->parent = parent; + + /* Mark that a new node was added */ + tree->isize++; + + /* Fix the tree properties */ + rbtree_insert_fixup(tree, new_node); + + return new_node; +} + +/* Insert a new object to the tree as the a predecessor of a given node */ + +rb_node *insert_predecessor_at(rb_tree *tree, rb_node *at_node, datatype object) +{ + rb_node *parent; + rb_node *new_node; + + if (!(tree->root)) { + /* Assign a new root node (the root is always + * black) + */ + new_node = rbnode_construct(object, black); + if (!new_node) + return NULL; + tree->root = new_node; + tree->isize = 1; + return new_node; + } + + /* Insert the new object as a red leaf, being the predecessor + * of at_node + */ + new_node = rbnode_construct(object, red); + if (!new_node) + return NULL; + + if (!at_node) { + /* The new node should become the tree maximum. Place + * is as the right child of the current maximal leaf + */ + parent = rbnode_maximum(tree->root); + parent->right = new_node; + } else { + /* Make sure the insertion does not violate the tree + * order In case given node has no left child, place + * the new node as its left child. Otherwise, place it + * at the rightmost position at the sub-tree rooted at + * its left side. + */ + if (!(at_node->left)) { + parent = at_node; + parent->left = new_node; + } else { + parent = rbnode_maximum(at_node->left); + parent->right = new_node; + } + } + + new_node->parent = parent; + + /* Mark that a new node was added */ + tree->isize++; + + /* Fix the tree properties */ + rbtree_insert_fixup(tree, new_node); + + return new_node; +} + +/* Remove an object from the tree */ + +void rbtree_remove(rb_tree *tree, datatype object, destructor d) +{ + rb_node *node = rbtree_find(tree, object); /* Find the node */ + rbtree_remove_at(tree, node, d); /* Remove the node */ +} + +/* Remove the object pointed by the given node. */ + +void rbtree_remove_at(rb_tree *tree, rb_node *node, destructor d) +{ + rb_node *child = NULL; + + /* In case of deleting the single object stored in the tree, + * free the root, thus emptying the tree + */ + if (tree->isize == 1) { + rbnode_destruct(tree->root, d); + tree->root = NULL; + tree->isize = 0; + return; + } + + /* Remove the given node from the tree */ + if (node->left && node->right) { + /* If the node we want to remove has two children, + * find its successor, which is the leftmost child in + * its right sub-tree and has at most one child (it + * may have a right child). + */ + rb_node *succ_node = rbnode_minimum(node->right); + + /* Now physically swap node and its successor. Notice + * this may temporarily violate the tree properties, + * but we are going to remove node anyway. This way + * we have moved node to a position were it is more + * convinient to delete it. + */ + int immediate_succ = (node->right == succ_node); + rb_node *succ_parent = succ_node->parent; + rb_node *succ_left = succ_node->left; + rb_node *succ_right = succ_node->right; + rb_color succ_color = succ_node->color; + + succ_node->parent = node->parent; + succ_node->left = node->left; + succ_node->right = immediate_succ ? node : node->right; + succ_node->color = node->color; + + node->parent = immediate_succ ? succ_node : succ_parent; + node->left = succ_left; + node->right = succ_right; + node->color = succ_color; + + if (!immediate_succ) { + if (succ_node == node->parent->left) + node->parent->left = node; + else + node->parent->right = node; + } + + if (node->left) + node->left->parent = node; + if (node->right) + node->right->parent = node; + + if (succ_node->parent) { + if (node == succ_node->parent->left) + succ_node->parent->left = succ_node; + else + succ_node->parent->right = succ_node; + } else { + tree->root = succ_node; + } + + if (succ_node->left) + succ_node->left->parent = succ_node; + if (succ_node->right) + succ_node->right->parent = succ_node; + } + + /* At this stage, the node we are going to remove has at most + * one child + */ + child = (node->left) ? node->left : node->right; + + /* Splice out the node to be removed, by linking its parent + * straight to the removed node's single child. + */ + if (child) + child->parent = node->parent; + + if (!(node->parent)) { + /* If we are deleting the root, make the child the new + * tree node + */ + tree->root = child; + } else { + /* Link the removed node parent to its child */ + if (node == node->parent->left) + node->parent->left = child; + else + node->parent->right = child; + } + + /* Fix-up the red-black properties that may have been damaged: + * If we have just removed a black node, the black-depth + * property is no longer valid + */ + if (node->color == black && child) + rbtree_remove_fixup(tree, child); + + /* Delete the un-necessary node (nullify both its children + * because the node's destructor is recursive). + */ + node->left = NULL; + node->right = NULL; + free(node); + + /* Decrease the number of objects in the tree */ + tree->isize--; +} + +/* Get the tree minimum */ + +rb_node *rbtree_minimum(rb_tree *tree) +{ + if (!(tree->root)) + return NULL; + + /* Return the leftmost leaf in the tree */ + return rbnode_minimum(tree->root); +} + +/* Get the tree maximum */ + +rb_node *rbtree_maximum(rb_tree *tree) +{ + if (!(tree->root)) + return NULL; + + /* Return the rightmost leaf in the tree */ + return rbnode_maximum(tree->root); +} + +/* Return a pointer to the node containing the given object */ + +rb_node *rbtree_find(rb_tree *tree, datatype object) +{ + rb_node *cur_node = tree->root; + int comp_result; + + while (cur_node) { + comp_result = COMP_NODES(object, cur_node->object); + /* In case of equality, we can return the current + * node. + */ + if (comp_result == 0) + return cur_node; + /* Go down to the left or right child. */ + cur_node = (comp_result > 0) ? cur_node->left : cur_node->right; + } + + /* If we get here, the object is not in the tree */ + return NULL; +} + +void rbtree_rotate_left(rb_tree *tree, rb_node *x_node) +{ + /* Get the right child of the node */ + rb_node *y_node = x_node->right; + + /* Change its left subtree (T2) to x's right subtree */ + x_node->right = y_node->left; + + /* Link T2 to its new parent x */ + if (y_node->left != NULL) + y_node->left->parent = x_node; + + /* Assign x's parent to be y's parent */ + y_node->parent = x_node->parent; + + if (!(x_node->parent)) { + /* Make y the new tree root */ + tree->root = y_node; + } else { + /* Assign a pointer to y from x's parent */ + if (x_node == x_node->parent->left) + x_node->parent->left = y_node; + else + x_node->parent->right = y_node; + } + + /* Assign x to be y's left child */ + y_node->left = x_node; + x_node->parent = y_node; +} + +/* Right-rotate the sub-tree spanned by the given node */ + +void rbtree_rotate_right(rb_tree *tree, rb_node *y_node) +{ + /* Get the left child of the node */ + rb_node *x_node = y_node->left; + + /* Change its right subtree (T2) to y's left subtree */ + y_node->left = x_node->right; + + /* Link T2 to its new parent y */ + if (x_node->right != NULL) + x_node->right->parent = y_node; + + /* Assign y's parent to be x's parent */ + x_node->parent = y_node->parent; + + if (!(y_node->parent)) { + /* Make x the new tree root */ + tree->root = x_node; + } else { + /* Assign a pointer to x from y's parent */ + if (y_node == y_node->parent->left) + y_node->parent->left = x_node; + else + y_node->parent->right = x_node; + } + + /* Assign y to be x's right child */ + x_node->right = y_node; + y_node->parent = x_node; +} + +/* Fix the tree so it maintains the red-black properties after an insert */ + +void rbtree_insert_fixup(rb_tree *tree, rb_node *node) +{ + /* Fix the red-black propreties. We may have inserted a red + * leaf as the child of a red parent - so we have to fix the + * coloring of the parent recursively. + */ + rb_node *curr_node = node; + rb_node *grandparent; + rb_node *uncle; + + assert(node && node->color == red); + + while (curr_node != tree->root && curr_node->parent->color == red) { + /* Get a pointer to the current node's grandparent + * (the root is always black, so the red parent must + * have a parent). + */ + + grandparent = curr_node->parent->parent; + + if (curr_node->parent == grandparent->left) { + /* If the red parent is a left child, the + * uncle is the right child of the grandparent. + */ + uncle = grandparent->right; + + if (uncle && uncle->color == red) { + + /* If both parent and uncle are red, + * color them black and color the + * grandparent red. In case of a NULL + * uncle, treat it as a black node + */ + curr_node->parent->color = black; + uncle->color = black; + grandparent->color = red; + + /* Move to the grandparent */ + curr_node = grandparent; + } else { + /* Make sure the current node is a + * right child. If not, left-rotate the + * parent's sub-tree so the parent + * becomes the right child of the + * current node (see _rotate_left). + */ + if (curr_node == curr_node->parent->right) { + curr_node = curr_node->parent; + rbtree_rotate_left(tree, curr_node); + } + + /* Color the parent black and the + * grandparent red + */ + curr_node->parent->color = black; + grandparent->color = red; + + /* Right-rotate the grandparent's + * sub-tree + */ + rbtree_rotate_right(tree, grandparent); + } + } else { + /* If the red parent is a right child, the + * uncle is the left child of the grandparent. + */ + uncle = grandparent->left; + + if (uncle && uncle->color == red) { + /* If both parent and uncle are red, + * color them black and color the + * grandparent red. In case of a NULL + * uncle, treat it as a black node + */ + curr_node->parent->color = black; + uncle->color = black; + grandparent->color = red; + + /* Move to the grandparent */ + curr_node = grandparent; + } else { + /* Make sure the current node is a + * left child. If not, right-rotate + * the parent's sub-tree so the parent + * becomes the left child of the + * current node. + */ + if (curr_node == curr_node->parent->left) { + curr_node = curr_node->parent; + rbtree_rotate_right(tree, curr_node); + } + + /* Color the parent black and the + * grandparent red + */ + curr_node->parent->color = black; + grandparent->color = red; + + /* Left-rotate the grandparent's + * sub-tree + */ + rbtree_rotate_left(tree, grandparent); + } + } + } + + /* Make sure that the root is black */ + tree->root->color = black; +} + +void rbtree_remove_fixup(rb_tree *tree, rb_node *node) +{ + rb_node *curr_node = node; + rb_node *sibling; + + while (curr_node != tree->root && curr_node->color == black) { + /* Get a pointer to the current node's sibling (notice + * that the node's parent must exist, since the node + * is not the root). + */ + if (curr_node == curr_node->parent->left) { + /* If the current node is a left child, its + * sibling is the right child of the parent. + */ + sibling = curr_node->parent->right; + + /* Check the sibling's color. Notice that NULL + * nodes are treated as if they are colored + * black. + */ + if (sibling && sibling->color == red) { + /* In case the sibling is red, color + * it black and rotate. Then color + * the parent red (the grandparent is + * now black) + */ + sibling->color = black; + curr_node->parent->color = red; + rbtree_rotate_left(tree, curr_node->parent); + sibling = curr_node->parent->right; + } + + if (sibling && + (!(sibling->left) || sibling->left->color == black) && + (!(sibling->right) || sibling->right->color == black)) { + /* If the sibling has two black + * children, color it red + */ + sibling->color = red; + if (curr_node->parent->color == red) { + /* If the parent is red, we + * can safely color it black + * and terminate the fix + * process. + */ + curr_node->parent->color = black; + /* In order to stop the while loop */ + curr_node = tree->root; + } else { + /* The black depth of the + * entire sub-tree rooted at + * the parent is now too small + * - fix it up recursively. + */ + curr_node = curr_node->parent; + } + } else { + if (!sibling) { + /* Take special care of the + * case of a NULL sibling + */ + if (curr_node->parent->color == red) { + curr_node->parent->color = black; + /* In order to stop + * the while loop */ + curr_node = tree->root; + } else { + curr_node = curr_node->parent; + } + } else { + /* In this case, at least one + * of the sibling's children + * is red. It is therfore + * obvious that the sibling + * itself is black. + */ + if (sibling->right && sibling->right->color == red) { + /* If the right child + * of the sibling is + * red, color it black + * and rotate around + * the current parent. + */ + sibling->right->color = black; + rbtree_rotate_left(tree, curr_node->parent); + } else { + /* If the left child + * of the sibling is + * red, rotate around + * the sibling, then + * rotate around the + * new sibling of our + * current node. + */ + rbtree_rotate_right(tree, sibling); + sibling = curr_node->parent->right; + rbtree_rotate_left(tree, sibling); + } + + /* It is now safe to color the + * parent black and to + * terminate the fix process. + */ + if (curr_node->parent->parent) + curr_node->parent->parent->color = curr_node->parent->color; + curr_node->parent->color = black; + /* In order to stop the while loop */ + curr_node = tree->root; + } + } + } else { + /* If the current node is a right child, its + * sibling is the left child of the parent. + */ + sibling = curr_node->parent->left; + + /* Check the sibling's color. Notice that NULL + * nodes are treated as if they are colored + * black. + */ + if (sibling && sibling->color == red) { + /* In case the sibling is red, color + * it black and rotate. Then color + * the parent red (the grandparent is + * now black). + */ + sibling->color = black; + curr_node->parent->color = red; + rbtree_rotate_right(tree, curr_node->parent); + + sibling = curr_node->parent->left; + } + + if (sibling && + (!(sibling->left) || sibling->left->color == black) && + (!(sibling->right) || sibling->right->color == black)) { + /* If the sibling has two black children, color it red */ + sibling->color = red; + if (curr_node->parent->color == red) { + /* If the parent is red, we + * can safely color it black + * and terminate the fix-up + * process. + */ + curr_node->parent->color = black; + /* In order to stop the while + * loop + */ + curr_node = tree->root; + } else { + /* The black depth of the + * entire sub-tree rooted at + * the parent is now too small + * - fix it up recursively. + */ + curr_node = curr_node->parent; + } + } else { + if (!sibling) { + /* Take special care of the + * case of a NULL sibling */ + if (curr_node->parent->color == red) { + curr_node->parent->color = black; + /* In order to stop + * the while loop */ + curr_node = tree->root; + } else { + curr_node = curr_node->parent; + } + } else { + /* In this case, at least one + * of the sibling's children is + * red. It is therfore obvious + * that the sibling itself is + * black. + */ + if (sibling->left && sibling->left->color == red) { + /* If the left child + * of the sibling is + * red, color it black + * and rotate around + * the current parent + */ + sibling->left->color = black; + rbtree_rotate_right(tree, curr_node->parent); + } else { + /* If the right child + * of the sibling is + * red, rotate around + * the sibling, then + * rotate around the + * new sibling of our + * current node + */ + rbtree_rotate_left(tree, sibling); + sibling = curr_node->parent->left; + rbtree_rotate_right(tree, sibling); + } + + /* It is now safe to color the + * parent black and to + * terminate the fix process. + */ + if (curr_node->parent->parent) + curr_node->parent->parent->color = curr_node->parent->color; + curr_node->parent->color = black; + /* In order to stop the while loop */ + curr_node = tree->root; + } + } + } + } + + /* The root can always be colored black */ + curr_node->color = black; +} + +/* Traverse a red-black tree */ + +void rbtree_traverse(rb_tree *tree, opr *op) +{ + rbnode_traverse(tree->root, op); +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.h new file mode 100644 index 00000000..415890e2 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rbt.h @@ -0,0 +1,316 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef RED_BLACK_TREE_H +#define RED_BLACK_TREE_H + +/* + * *************************************************************************** + * + * Container class for a red-black tree ...... + * + * A binary tree that satisfies the following properties: + * + * 1. Every node is either red or black + * 2. The root node is black + * 3. Every leaf (NIL) is black + * 4. If a node is red, both its children are black + * 5. For each node, all paths from the node to descendant leaf nodes + * contain the same number of black nodes + * + * Due to points 4 & 5, the depth of a red-black tree containing n nodes + * is bounded by 2*log2(n+1) (WC). + * + * + * The rb_tree template requires two additional parmeters: + * + * - The contained TYPE class represents the objects stored in the tree. + * It has to support the copy constructor and the assignment operator (opr) + * - cmp is a functor used to define the order of objects of class TYPE: + * This class has to support an operator() that recieves two objects from + * the TYPE class and returns a negative, 0, or a positive integer, + * depending on the comparison result. + * + * Dominique Heger, S. Rao + * + * *************************************************************************** + */ + +/* Color enumeration for nodes of red-black tree */ +/* ********************************************* */ + +#include "filelist.h" + +typedef struct ffsb_file *datatype; + +#define COMP_NODES(a, b) ((a)->num - (b)->num) + +typedef enum red_black_color {red, black} rb_color; + +/*! Representation of a node in a red-black tree */ +typedef struct red_black_node { + datatype object; /* the stored object */ + rb_color color; /* the color of the node */ + struct red_black_node *parent; /* points to the parent node */ + struct red_black_node *right; /* points to the right child */ + struct red_black_node *left; /* points to the left child */ +} rb_node; + +typedef int(cmp)(datatype, datatype); +typedef void(opr)(void *); +typedef void(destructor)(datatype); + +/* Construct of a red-black tree node + * - The object stored in the node + * - The color of the node + */ + +extern rb_node *rbnode_construct(datatype object, rb_color color); + +/* Recursive destructor for the entire sub-tree */ +/* ******************************************** */ + +extern void rbnode_destruct(rb_node *node, destructor d); + +/* Calculate the depth of the sub-tree spanned by the given node + * - The sub-tree root + * - The sub-tree depth + */ + +extern int rbnode_depth(rb_node *node); + +/* Get the leftmost node in the sub-tree spanned by the given node + * - The sub-tree root + * - The sub-tree minimum + */ + +extern rb_node *rbnode_minimum(rb_node *node); + +/* Get the rightmost node in the sub-tree spanned by the given node + * - The sub-tree root + * - The sub-tree maximum + */ + +extern rb_node *rbnode_maximum(rb_node *node); + +/* Replace the object */ +/* ****************** */ + +extern void rbnode_replace(rb_node *node, datatype object); + +/* Get the next node in the tree (according to the tree order) + * - The current node + * - The successor node, or NULL if node is the tree maximum + */ + +extern rb_node *rbnode_successor(rb_node *node); + +/* Get the previous node in the tree (according to the tree order) + * - The current node + * - The predecessor node, or NULL if node is the tree minimum + */ + +extern rb_node *rbnode_predecessor(rb_node *node); + +/* Duplicate the entire sub-tree rooted at the given node + * - The sub-tree root + * - A pointer to the duplicated sub-tree root + */ + +extern rb_node *rbnode_duplicate(rb_node *node); + +/* Traverse a red-black sub-tree + * - The sub-tree root + * - The operation to perform on each object in the sub-tree + */ +extern void rbnode_traverse(rb_node *node, opr *op); + +/* Representation of a red-black tree */ +/* ********************************** */ + +typedef struct red_black_tree { + rb_node *root; /* pointer to the tree root */ + int isize; /* number of objects stored */ + /* cmp * comp; */ /* compare function */ +} rb_tree; + +/* Initialize a red-black tree with a comparision function + * - The tree + * - The comparision function + */ + +void rbtree_init(rb_tree *tree); + +/* Construct a red-black tree with a comparison object + * - A pointer to the comparison object to be used by the tree + * - The newly constructed tree + */ + +rb_tree *rbtree_construct(void); + +/* Clean a red-black tree [takes O(n) operations] + * - The tree + */ + +extern void rbtree_clean(rb_tree *tree, destructor d); + +/* Destruct a red-black tree + * - The tree + */ + +extern void rbtree_destruct(rb_tree *tree, destructor d); + +/* Get the size of the tree [takes O(1) operations] + * - The tree + * - The number of objects stored in the tree + */ + +extern int rbtree_size(rb_tree *tree); + +/* Get the depth of the tree [takes O(n) operations] + * - The tree + * - The length of the longest path from the root to a leaf node + */ + +extern int rbtree_depth(rb_tree *tree); + +/* Check whether the tree contains an object [takes O(log n) operations] + * - The tree + * - The query object + * - (true) if an equal object is found in the tree, otherwise (false) + */ + +extern int rbtree_contains(rb_tree *tree, datatype object); + +/* Insert an object to the tree [takes O(log n) operations] + * - The tree + * - The object to be inserted + * - Return the inserted object node + */ + +extern rb_node *rbtree_insert(rb_tree *tree, datatype object); + +/* Insert a new object to the tree as the a successor of a given node + * - The tree + * - The new node + */ + +extern rb_node *insert_successor_at(rb_tree *tree, rb_node *at_node, + datatype object); + +/* Insert a new object to the tree as the a predecessor of a given node + * - The tree + * - The new node + */ + +extern rb_node *insert_predecessor_at(rb_tree *tree, rb_node *at_node, + datatype object); + +/* Remove an object from the tree [takes O(log n) operations] + * - The tree + * - The object to be removed + * - The object should be contained in the tree + */ + +extern void rbtree_remove(rb_tree *tree, datatype object, destructor d); + +/* Get a handle to the tree minimum [takes O(log n) operations] + * - The tree + * - Return the minimal object in the tree, or a NULL if the tree is empty + */ + +extern rb_node *rbtree_minimum(rb_tree *tree); + +/* Get a handle to the tree maximum [takes O(log n) operations] + * - The tree + * - Return the maximal object in the tree, or a NULL if the tree is empty + */ + +extern rb_node *rbtree_maximum(rb_tree *tree); + +/* Get the next node in the tree (according to the tree order) + * - [takes O(log n) operations at worst-case, but only O(1) amortized] + * - The tree + * - The current object + * - The successor node, or a NULL, if we are at the tree maximum + */ +extern rb_node *rbtree_successor(rb_tree *tree, rb_node *node); + +/* Get the previous node in the tree (according to the tree order) + * - [takes O(log n) operations at worst-case, but only O(1) amortized] + * - The tree + * - The current object + * - The predecessor node, or a NULL, if we are at the tree minimum + */ + +extern rb_node *rbtree_predecessor(rb_tree *tree, rb_node *node); + +/* Find a node that contains the given object + * - The tree + * - The desired object + * - Return a node that contains the given object, or NULL if no such object + * is found in the tree + */ + +extern rb_node *rbtree_find(rb_tree *tree, datatype object); + +/* Remove the object stored in the given tree node + * - The tree + * - The node storing the object to be removed from the tree + */ + +extern void rbtree_remove_at(rb_tree *tree, rb_node *node, destructor d); + +/* Left-rotate the sub-tree spanned by the given node + * - The tree + * - The sub-tree root + */ + +extern void rbtree_rotate_left(rb_tree *tree, rb_node *node); + +/* Right-rotate the sub-tree spanned by the given node + * - The tree + * - The sub-tree root + */ + +extern void rbtree_rotate_right(rb_tree *tree, rb_node *node); + +/* + * Fix the red-black tree properties after an insertion operation + * - The tree + * - The node that has just been inserted to the tree + * - The color of node must be red + */ + +extern void rbtree_insert_fixup(rb_tree *tree, rb_node *node); + +/* Fix the red-black tree properties after a removal operation + * - The tree + * - The child of the node that has just been removed from the tree + */ + +extern void rbtree_remove_fixup(rb_tree *tree, rb_node *node); + +/* Traverse a red-black tree + * - The tree + * - The operation to perform on every object of the tree (according to + * the tree order) + */ + +extern void rbtree_traverse(rb_tree *tree, opr *op); + +#endif diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/registration-description b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/registration-description new file mode 100644 index 00000000..fd181e20 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/registration-description @@ -0,0 +1,7 @@ +The Flexible Filesystem Benchmark (FFSB) is a filesystem performance measurement tool. It is a multi-threaded application (using pthreads), written entirely in C with cross-platform portability in mind. It differs from other filesystem benchmarks in that the user may supply a profile to create custom workloads, while most other filesystem benchmarks use a fixed set of workloads. + +It is currently known to support Linux, AIX, and Solaris, although almost all development and testing has occurred on Linux. We intend to add support for HP-UX, IRIX, and possibly others in the near future. + +FFSB is currently at version 5.0, and has been an internal tool at IBM for about four years. I has already been used to conduct a study of Linux Kernel 2.6 IO-schedulers, and a great deal of future filesystem performance work is planned with FFSB as the primary tool. + +In version 5.0, it supports six different basic operations, support for multiple groups of threads with different operation mixtures, support for operation across multiple filesystems, and support for filesystem aging prior to benchmarking. \ No newline at end of file diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rwlock.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rwlock.c new file mode 100644 index 00000000..56430c2b --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rwlock.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include + +/* #define RWDEBUG 1 */ +#include "config.h" +#include "rwlock.h" + +void init_rwlock(struct rwlock *rw) +{ + rw->n_readers = 0; + pthread_mutex_init(&rw->plock, NULL); + pthread_cond_init(&rw->pcond, NULL); +#ifdef RWDEBUG + rw->n_write_waiting = 0; + rw->n_read_waiting = 0; + rw->writer_tid = -1; +#endif +} + + +void rw_lock_read(struct rwlock *rw) +{ + pthread_mutex_lock(&rw->plock); +#ifdef RWDEBUG + rw->n_read_waiting++; +#endif + while (rw->n_readers < 0) + pthread_cond_wait(&rw->pcond, &rw->plock); + rw->n_readers++; +#ifdef RWDEBUG + rw->n_read_waiting--; +#endif + pthread_mutex_unlock(&rw->plock); +} + +void rw_lock_write(struct rwlock *rw) +{ + pthread_mutex_lock(&rw->plock); +#ifdef RWDEBUG + rw->n_write_waiting++; +#endif + while (rw->n_readers != 0) + pthread_cond_wait(&rw->pcond, &rw->plock); + rw->n_readers = -1; +#ifdef RWDEBUG + rw->n_write_waiting--; + rw->writer_tid = (int)pthread_self(); +#endif + pthread_mutex_unlock(&rw->plock); + +} + +void rw_unlock_read(struct rwlock *rw) +{ + pthread_mutex_lock(&rw->plock); + rw->n_readers -= 1 ; + pthread_cond_signal(&rw->pcond); + pthread_mutex_unlock(&rw->plock); +} + +void rw_unlock_write(struct rwlock *rw) +{ + pthread_mutex_lock(&rw->plock); + rw->n_readers = 0 ; + pthread_cond_broadcast(&rw->pcond); + pthread_mutex_unlock(&rw->plock); +} + +int rw_trylock_read(struct rwlock *rw) +{ + int ret = 1; + pthread_mutex_lock(&rw->plock); + if (rw->n_readers >= 0) { + rw->n_readers++; + ret = 0; + } + pthread_mutex_unlock(&rw->plock); + return ret; +} + +int rw_trylock_write(struct rwlock *rw) +{ + int ret = 1; + pthread_mutex_lock(&rw->plock); + if (rw->n_readers == 0) { + ret = 0; + rw->n_readers = -1; + } + pthread_mutex_unlock(&rw->plock); + return ret; +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rwlock.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rwlock.h new file mode 100644 index 00000000..4392b413 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/rwlock.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _RWLOCK_H +#define _RWLOCK_H + +#include + +/* #define RWDEBUG 1 */ + +/* n_readers >= 0 means 0 or more readers */ +/* n_readers < 0 means a writer */ +struct rwlock { + pthread_mutex_t plock; + int n_readers; + pthread_cond_t pcond; +#ifdef RWDEBUG + int writer_tid; + int n_read_waiting; + int n_write_waiting; +#endif +}; + +void init_rwlock(struct rwlock *rw); + +void rw_lock_read(struct rwlock *rw); +void rw_lock_write(struct rwlock *rw); + +void rw_unlock_read(struct rwlock *rw); +void rw_unlock_write(struct rwlock *rw); + +int rw_trylock_read(struct rwlock *rw); +int rw_trylock_write(struct rwlock *rw); + + + +#endif diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/stamp-h.in b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/stamp-h.in new file mode 100644 index 00000000..9788f702 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/stamp-h.in @@ -0,0 +1 @@ +timestamp diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/util.c b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/util.c new file mode 100644 index 00000000..df5d755f --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/util.c @@ -0,0 +1,351 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "config.h" +#include "fh.h" +#include "util.h" + +uint64_t ffsb_get_filesize(char *name) +{ +#ifndef HAVE_STAT64 + #define STAT(a, b) do { stat((a), (b)); } while (0) + struct stat filestat; +#else + #define STAT(a, b) do { stat64((a), (b)); } while (0) + struct stat64 filestat; +#endif + + + STAT(name, &filestat); + return (uint64_t)filestat.st_size; +#undef STAT +} + + +void *ffsb_malloc(size_t size) +{ + void *ptr = malloc((size)); + assert(ptr != NULL); + memset(ptr, 0, size); + return ptr; +} + +void *ffsb_realloc(void *ptr, size_t size) +{ + void *tmp ; + /* printf("ffsb_realloc: ptr = %p size = %ld\n",ptr,size); */ + + if (ptr == NULL) + return ffsb_malloc(size); + + tmp = realloc(ptr, size); + assert(ptr != NULL); + ptr = tmp; + return ptr; +} + +void *ffsb_align_4k(void *ptr) +{ + unsigned long mask = ~(0xfff); /* 12 zeros at the end */ + void *ret = (void *)((unsigned long)ptr & mask); + /* printf("align_4k got %p returning %p\n",ptr,ret); */ + return ret; +} + +char *ffsb_strdup(const char *str) +{ + int len = strlen(str); + char *dup = ffsb_malloc(len + 1); + /* !!! am I off by one here ?? */ + strncpy(dup, str, len+1); + return dup; +} + +size_t ffsb_strnlen(const char *str, size_t maxlen) +{ + size_t index = 0; + + while (index < maxlen) { + if (str[index] == '\0') + break; + index++; + } + return index; +} + +/* not perfect, in case we are somehow interrupted it's borked */ +void ffsb_sleep(unsigned secs) +{ + struct timeval tv = { 0 , 0 }; + tv.tv_sec = secs; + select(0, NULL, NULL, NULL, &tv); +} + + +char *ffsb_printsize(char *buf, double size, int bufsize) +{ + if (size >= 1024 * 1024 * 1024) + snprintf(buf, bufsize, "%.3gGB", size / (1024 * 1024 * 1024)); + else if (size >= 1024 * 1024) + snprintf(buf, bufsize, "%.3gMB", size / (1024 * 1024)); + else if (size >= 1024) + snprintf(buf, bufsize, "%.3gKB", size/1024); + else + snprintf(buf, bufsize, "%.3gB", size); + + return buf; +} + +void ffsb_mkdir(char *dirname) +{ + if (mkdir(dirname, S_IRWXU) < 0) { + fprintf(stderr, "Error creating %s\n", dirname); + perror("mkdir"); + exit(1); + } +} + +struct timeval tvsub(struct timeval t1, struct timeval t0) +{ + struct timeval tdiff; + tdiff.tv_sec = t1.tv_sec - t0.tv_sec; + tdiff.tv_usec = t1.tv_usec - t0.tv_usec; + if (tdiff.tv_usec < 0) + tdiff.tv_sec--, tdiff.tv_usec += 1000000; + return tdiff; +} + +struct timeval tvadd(struct timeval t1, struct timeval t0) +{ + struct timeval tdiff; + tdiff.tv_sec = t1.tv_sec + t0.tv_sec; + tdiff.tv_usec = t1.tv_usec + t0.tv_usec; + if (tdiff.tv_usec > 1000000) + tdiff.tv_sec++, tdiff.tv_usec -= 1000000; + return tdiff; +} + +double tvtodouble(struct timeval *t) +{ + return ((double)t->tv_sec*(1000000.0f) + (double)t->tv_usec) / + 1000000.0f; +} + +double cpu_so_far(void) +{ + struct rusage rusage; + + getrusage(RUSAGE_SELF, &rusage); + + return + ((double) rusage.ru_utime.tv_sec) + + (((double) rusage.ru_utime.tv_usec) / 1000000.0) + + ((double) rusage.ru_stime.tv_sec) + + (((double) rusage.ru_stime.tv_usec) / 1000000.0); +} + +double cpu_so_far_children(void) +{ + struct rusage rusage; + + getrusage(RUSAGE_CHILDREN, &rusage); + + return + ((double) rusage.ru_utime.tv_sec) + + (((double) rusage.ru_utime.tv_usec) / 1000000.0) + + ((double) rusage.ru_stime.tv_sec) + + (((double) rusage.ru_stime.tv_usec) / 1000000.0); +} + + +/* !!!! check portability */ +float getfsutil(char *dirname) +{ + struct statvfs64 fsdata; + + statvfs64(dirname, &fsdata); + +/* return (float)(fsdata.f_blocks-fsdata.f_bfree)/ */ +/* (float)(fsdata.f_blocks-fsdata.f_bfree+fsdata.f_bavail); */ + return (float) (((float)(fsdata.f_blocks - fsdata.f_bfree)) / + ((float)fsdata.f_blocks)); +} + +uint64_t getfsutil_size(char *dirname) +{ + struct statvfs64 fsdata; + statvfs64(dirname, &fsdata); + + return (fsdata.f_blocks - fsdata.f_bfree) * fsdata.f_bsize; +} + +int ffsb_system(char *command) +{ + int pid=0, status; + extern char **environ; + + if (command == NULL) + return 1; + pid = fork(); + if (pid == -1) + return -1; + if (pid == 0) { + char *argv[4]; + argv[0] = "sh"; + argv[1] = "-c"; + argv[2] = command; + argv[3] = 0; + execve("/bin/sh", argv, environ); + exit(127); + } + do { + if (waitpid(pid, &status, 0) == -1) { + if (errno != EINTR) + return -1; + } + else + return status; + } while (1); +} + +void ffsb_sync() +{ + struct timeval starttime, endtime, difftime; + printf("Syncing()..."); + fflush(stdout); + gettimeofday(&starttime, NULL); + sync(); + gettimeofday(&endtime, NULL); + timersub(&endtime, &starttime, &difftime); + printf("%ld sec\n", difftime.tv_sec); +} + +void ffsb_getrusage(struct rusage *ru_self, struct rusage *ru_children) +{ + int ret = 0; +/* printf("cpu_so_far is %lf\n",cpu_so_far()); */ +/* printf("cpu_so_far_children is %lf\n",cpu_so_far_children()); */ + ret = getrusage(RUSAGE_SELF, ru_self); + if (ret < 0) + perror("getrusage self"); + +/* printf("self returned %d\n",ret); */ + ret = getrusage(RUSAGE_CHILDREN, ru_children); + if (ret < 0) + perror("getrusage children"); +/* printf("children returned %d\n",ret); */ +} + +void ffsb_milli_sleep(unsigned time) +{ + struct timeval tv = { 0 , 0 }; + if (!time) + return; + tv.tv_usec = time * 1000; + select(0, NULL, NULL, NULL, &tv); +} + +void ffsb_micro_sleep(unsigned time) +{ + struct timeval tv = { 0 , 0 }; + if (!time) + return; + tv.tv_usec = time ; + select(0, NULL, NULL, NULL, &tv); +} + + +void ffsb_barrier_init(ffsb_barrier_t *fb, unsigned count) +{ + memset(fb, 0, sizeof(*fb)); + pthread_mutex_init(&fb->plock, NULL); + pthread_cond_init(&fb->pcond, NULL); + fb->required_count = count; +} + +void ffsb_barrier_wait(ffsb_barrier_t *fb) +{ + pthread_mutex_lock(&fb->plock); + + fb->current_count++; + + if (fb->current_count == fb->required_count) + pthread_cond_broadcast(&fb->pcond); + else + while (fb->current_count != fb->required_count) + pthread_cond_wait(&fb->pcond, &fb->plock); + + pthread_mutex_unlock(&fb->plock); +} + +void ffsb_unbuffer_stdout(void) +{ +#ifndef SETVBUF_REVERSED + setvbuf(stdout, NULL, _IONBF, 0); +#else + setvbuf(stdout, _IONBF, NULL, 0); +#endif +} + +void ffsb_bench_gettimeofday(void) +{ + unsigned long i = 0; + uint64_t total_usec; + uint64_t average = 0; + struct timeval starttime, endtime, junk, difftime; + gettimeofday(&starttime, NULL); + for (i = 0; i < 1000000; i++) + gettimeofday(&junk, NULL); + gettimeofday(&endtime, NULL); + timersub(&endtime, &starttime, &difftime); + total_usec = difftime.tv_sec * 1000000; + total_usec += difftime.tv_usec; + average = total_usec / 1000ull; + printf("average time for gettimeofday(): %llu nsec\n", average); +} + +void ffsb_bench_getpid(void) +{ + unsigned long i = 0; + uint64_t total_usec; + uint64_t average = 0; + struct timeval starttime, endtime, difftime; + gettimeofday(&starttime, NULL); + for (i = 0; i < 1000000; i++) + getpid(); + gettimeofday(&endtime, NULL); + timersub(&endtime, &starttime, &difftime); + total_usec = difftime.tv_sec * 1000000; + total_usec += difftime.tv_usec; + average = total_usec / 1000ull; + printf("average time for getpid(): %llu nsec\n", average); +} diff --git a/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/util.h b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/util.h new file mode 100644 index 00000000..c1f57989 --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/ffsb-6.0-rc2/util.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) International Business Machines Corp., 2001-2006 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _UTIL_H_ +#define _UTIL_H_ + +#include "config.h" + +#include +#include + +#ifdef HAVE_SYS_VFS_H +#include +#endif +#include +#include +#include +#include +#include +#include + + +void ffsb_sleep(unsigned secs); +void *ffsb_malloc(size_t size); +void *ffsb_realloc(void *ptr, size_t size); +char *ffsb_strdup(const char *str); +size_t ffsb_strnlen(const char *str, size_t maxlen); + +void ffsb_mkdir(char *dirname); +void ffsb_getrusage(struct rusage *ru_self, struct rusage *ru_children); +void ffsb_sync(void); +void *ffsb_align_4k(void *ptr); +char *ffsb_printsize(char *buf, double size, int bufsize); + +int ffsb_system(char *command); +void ffsb_milli_sleep(unsigned time); +void ffsb_micro_sleep(unsigned time); +void ffsb_unbuffer_stdout(void); +void ffsb_bench_gettimeofday(void); +void ffsb_bench_getpid(void); + +uint64_t ffsb_get_filesize(char *name); + +typedef struct { + unsigned required_count; + unsigned current_count; + pthread_mutex_t plock; + pthread_cond_t pcond; +} ffsb_barrier_t ; + +void ffsb_barrier_init(ffsb_barrier_t *fb, unsigned count); +void ffsb_barrier_wait(ffsb_barrier_t *fb); + +double cpu_so_far(void); +double time_so_far(void); +double cpu_so_far_children(void); +float getfsutil(char *dirname); +uint64_t getfsutil_size(char *dirname); + +struct timeval tvsub(struct timeval t1, struct timeval t0); +struct timeval tvadd(struct timeval t1, struct timeval t0); +double tvtodouble(struct timeval *t); + + +#define max(a, b) (((a) > (b)) ? (a) : (b)) + +#ifndef timersub +#define timersub(a, b, result) \ + do { \ + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + \ + if ((result)->tv_usec < 0) { \ + (result)->tv_sec--; \ + (result)->tv_usec += 1000000; \ + } \ + } while (0) +#endif /* timersub */ + +#endif /* _UTIL_H_ */ diff --git a/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh b/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh new file mode 100755 index 00000000..534d2b9b --- /dev/null +++ b/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh @@ -0,0 +1,179 @@ +#! /bin/bash + +################################################################################ +# # +# Copyright (c) 2009 FUJITSU LIMITED # +# # +# This program is free software; you can redistribute it and#or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, but # +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # +# for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +################################################################################ +# Name Of File: run_ext4_test.sh # +# # +# Description: This file runs the tests for ext4 filesystem's new features. # +# # +# Precaution: In order to avoid destroying the important data on the disk, # +# specify a free partition to be used for test please. # +# # +# Author: Li Zefan # +# # +# History: # +# # +# DATE NAME EMAIL DESC # +# # +# 09/10/08 Li Zefan Created this test # +# 08/25/09 Miao Xie Moved to LTP # +# # +################################################################################ + +source ext4_funcs.sh; + +export TCID="ext4_new_feature" +export TST_TOTAL=1 +export TST_COUNT=1 + +tst_kvercmp 2 6 31 +if [ $? -eq 0 ]; then + tst_brkm TCONF ignored "kernel is below 2.6.31" + exit 0 +fi + +if [ "$USER" != root ]; then + tst_brkm TCONF ignored "Test must be run as root" + exit 0 +fi + +EXT4_SUPPORT1=`grep -w ext4 /proc/filesystems | cut -f2` +EXT4_SUPPORT2=`grep -w ext4 /proc/modules | cut -f1` +if [ "$EXT4_SUPPORT1" != "ext4" ] && [ "$EXT4_SUPPORT2" != "ext4" ]; then + tst_brkm TCONF ignored "Ext4 is not supported" + exit 0 +fi + +if [ ! -f "ffsb" ]; then + tst_brkm TCONF ignored "ffsb does not exist.Please check whether ffsb was configed and compiled" + exit 0 +fi + +if [ ! -f "ext4-test-config" ]; then + tst_brkm TCONF ignored "Config file ext4-test-config does not exist. Please check whether the configure wan ran" + exit 0 +fi + +cd $LTPROOT/testcases/bin/ + +RET=0 + +echo "EXT4 NEW FEATURE TESTING"; +echo "TEST STARTED: Please avoid using system while this test executes"; + +echo " " +echo "Ext4 block allocation test" +if [ -f "ext4-alloc-test.sh" ]; then + ./ext4-alloc-test.sh ./ext4-test-config + if [ $? -ne 0 ]; then + RET=1 + fi +else + echo "Shell file is not installed..Please check Makefile..." + RET=1 +fi + +echo " " +echo "Ext4 journal checksum test" +if [ -f "ext4_journal_checksum.sh" ]; then + ./ext4_journal_checksum.sh ./ext4-test-config + if [ $? -ne 0 ]; then + RET=1 + fi +else + echo "Shell file is not installed..Please check Makefile..." + RET=1 +fi + +echo " " +echo "Ext4 subdir limit test" +if [ -f "ext4_subdir_limit_test.sh" ]; then + ./ext4_subdir_limit_test.sh ./ext4-test-config + if [ $? -ne 0 ]; then + RET=1 + fi +else + echo "Shell file is not installed..Please check Makefile..." + RET=1 +fi + +echo " " +echo "Ext4 nanosecond timestamp test" +if [ -f "ext4_nsec_timestamps_test.sh" ]; then + ./ext4_nsec_timestamps_test.sh ./ext4-test-config + if [ $? -ne 0 ]; then + RET=1 + fi +else + echo "Shell file is not installed..Please check Makefile..." + RET=1 +fi + +echo " " +echo "Ext4 persist prealloc test" +if [ -f "ext4_persist_prealloc_test.sh" ]; then + ./ext4_persist_prealloc_test.sh ./ext4-test-config + if [ $? -ne 0 ]; then + RET=1 + fi +else + echo "Shell file is not installed..Please check Makefile..." + RET=1 +fi + +echo " " +echo "Ext4 inode version test" +if [ -f "ext4_inode_version_test.sh" ]; then + ./ext4_inode_version_test.sh ./ext4-test-config + if [ $? -ne 0 ]; then + RET=1 + fi +else + echo "Shell file is not installed..Please check Makefile..." + RET=1 +fi + +echo " " +echo "Ext4 uninit groups test" +if [ -f "ext4_uninit_groups_test.sh" ]; then + ./ext4_uninit_groups_test.sh ./ext4-test-config + if [ $? -ne 0 ]; then + RET=1 + fi +else + echo "Shell file is not installed..Please check Makefile..." + RET=1 +fi + +echo " " +echo "Ext4 online defrag test" +echo "The output of defrag program is in the file"\ + "LTPROOT/output/ext4_online_defrag.txt" +if [ -f "ext4_online_defrag_test.sh" ]; then + ./ext4_online_defrag_test.sh ./ext4-test-config + if [ $? -ne 0 ]; then + RET=1 + fi +else + echo "Shell file is not installed..Please check Makefile..." + RET=1 +fi + +exit $RET diff --git a/testcases/kernel/fs/fs-bench/Makefile b/testcases/kernel/fs/fs-bench/Makefile dissimilarity index 98% index 66b82a8c..728cb700 100644 --- a/testcases/kernel/fs/fs-bench/Makefile +++ b/testcases/kernel/fs/fs-bench/Makefile @@ -1,25 +1,41 @@ -UTILS=boxmuler.o -EXECS=cr ra radc -SCRIPTS=modaltr.sh test.sh test2.sh -CFLAGS=-O3 -all: ${EXECS} - @echo done - -cr: create-files.o ${UTILS} - ${CC} ${UTILS} create-files.o -lm -o cr - -ra: random-access.o - ${CC} random-access.o -o ra - -radc: random-del-create.o ${UTILS} - ${CC} ${UTILS} random-del-create.o -lm -o radc - -install: - @set -e; for i in $(EXECS) $(SCRIPTS); do ln -f $$i ../../../bin/$$i ; done - -dist: - (make clean ; cd .. ; tar zcvf fs-bench.tar.gz fs-bench) - -clean: - rm ${EXECS} *.o - +# +# 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := modaltr.sh test.sh 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/modaltr.sh b/testcases/kernel/fs/fs-bench/modaltr.sh index 85d2c30b..36e6f0cb 100755 --- a/testcases/kernel/fs/fs-bench/modaltr.sh +++ b/testcases/kernel/fs/fs-bench/modaltr.sh @@ -43,7 +43,7 @@ LOG_DIR1=/tmp/log1 HOME_DIR=/home BLOCK_DIR=/dev/mtdblock export PATH=$PATH:/sbin - if [ $UID -ne 0 ]; + if [ $(id -ru) -ne 0 ]; then echo "must be root to run this" exit diff --git a/testcases/kernel/fs/fs-bench/random-access-del-create.c b/testcases/kernel/fs/fs-bench/random-access-del-create.c new file mode 100644 index 00000000..3322d929 --- /dev/null +++ b/testcases/kernel/fs/fs-bench/random-access-del-create.c @@ -0,0 +1,135 @@ +/* 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); + } +} + +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); +} + +#include +#include + +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++; +} diff --git a/testcases/kernel/fs/fs_bind/Makefile b/testcases/kernel/fs/fs_bind/Makefile dissimilarity index 99% index 34e7538e..dccb027f 100644 --- a/testcases/kernel/fs/fs_bind/Makefile +++ b/testcases/kernel/fs/fs_bind/Makefile @@ -1,11 +1,29 @@ -# Propagate make "commands" (TARGETS) to subdirs -TARGETS=all clean install uninstall -SUBDIRS=bin - -.PHONY: $(TARGETS) - -$(TARGETS):%: - @set -e ; \ - for dir in $(SUBDIRS); do \ - $(MAKE) -C $$dir $@ ; \ - done +# +# kernel/fs/fs_bind 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +RECURSIVE_TARGETS := all install uninstall + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/fs/fs_bind/bin/Makefile b/testcases/kernel/fs/fs_bind/bin/Makefile dissimilarity index 99% index 0fac9d60..b4b75b0a 100644 --- a/testcases/kernel/fs/fs_bind/bin/Makefile +++ b/testcases/kernel/fs/fs_bind/bin/Makefile @@ -1,28 +1,27 @@ -.PHONY: all clean install - -LTP_SRC_ROOT=../../../../.. -LTP_BIN=$(LTP_SRC_ROOT)/testcases/bin -#CFLAGS+= -I$(LTP_SRC_ROOT)/include -Wall -g -CFLAGS+= -Wall -g -#LIBS+= -L$(LTP_SRC_ROOT)/lib -lltp -LIBS+= - -all: smount nsclone - -install: all - #@ln -f nsclone $(LTP_BIN)/nsclone - #@ln -f smount $(LTP_BIN)/smount - @/bin/true - -uninstall: - #rm -f $(LTP_BIN)/nsclone $(LTP_BIN)/smount - @/bin/true - -nsclone: nsclone.c - $(CC) $(CFLAGS) $(LIBS) -o nsclone nsclone.c - -smount: smount.c - $(CC) $(CFLAGS) $(LIBS) -o smount smount.c - -clean: - rm -f smount nsclone +# +# testcases/kernel/fs/fs_bind/bin 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/fs_di/Makefile b/testcases/kernel/fs/fs_di/Makefile dissimilarity index 98% index 1cd2689e..2082a6e8 100644 --- a/testcases/kernel/fs/fs_di/Makefile +++ b/testcases/kernel/fs/fs_di/Makefile @@ -1,11 +1,31 @@ -CFLAGS+= -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) fs_di; do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +# +# kernel/fs/fs_bind 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + +INSTALL_TARGETS := fs_di + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/fs_di/fs_di b/testcases/kernel/fs/fs_di/fs_di index c032705b..c6447ef7 100755 --- a/testcases/kernel/fs/fs_di/fs_di +++ b/testcases/kernel/fs/fs_di/fs_di @@ -52,7 +52,7 @@ $trace_logic #----------------------------------------------------------------------- TC=${TC:=fs_di} TCbin=${TCbin:=`pwd`} -TCtmp=${TCtmp:=/tmp/$TC$$} +TCtmp=${TCtmp:=$TMPDIR/$TC$$} export PATH=$PATH:$TCbin:../../../bin export TCID=$TC export TST_TOTAL=1 @@ -201,10 +201,10 @@ $trace_logic end_testcase "Could not create testfile of size ${SIZE}Mb" fi RANDOM_DEPTH=$RANDOM - let "RANDOM_DEPTH %= 500" + : $(( RANDOM_DEPTH %= 500 )) RANDOM_LENGTH=$RANDOM - let "RANDOM_LENGTH %= 500" + : $(( RANDOM_LENGTH %= 500 )) RANDOM_LENGTH=$(( $RANDOM_LENGTH / 10 )) NameCount=0 diff --git a/testcases/kernel/fs/fs_inod/Makefile b/testcases/kernel/fs/fs_inod/Makefile dissimilarity index 98% index 7bfbbf0a..abc0079d 100644 --- a/testcases/kernel/fs/fs_inod/Makefile +++ b/testcases/kernel/fs/fs_inod/Makefile @@ -1,8 +1,31 @@ -TARGETS=fs_inod - -all: - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done - -clean: +# +# kernel/fs/fs_inod 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := fs_inod + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/fs_perms/Makefile b/testcases/kernel/fs/fs_perms/Makefile dissimilarity index 98% index 8ccf6ecd..48aa7d63 100644 --- a/testcases/kernel/fs/fs_perms/Makefile +++ b/testcases/kernel/fs/fs_perms/Makefile @@ -1,15 +1,29 @@ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -LDLIBS += -lltp -LDFLAGS += -L../../../../lib - -TARGETS = fs_perms testx - -all: fs_perms testx - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done - cp fs_perms_simpletest.sh ../../../bin/ - -clean: - rm -f *.o fs_perms testx +# +# kernel/fs/fs_perms 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := fs_perms_simpletest.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/fs_perms/fs_perms.c b/testcases/kernel/fs/fs_perms/fs_perms.c index 5e19ca5d..ad440289 100644 --- a/testcases/kernel/fs/fs_perms/fs_perms.c +++ b/testcases/kernel/fs/fs_perms/fs_perms.c @@ -45,11 +45,15 @@ int TST_TOTAL = 1; static int testsetup(mode_t mode, int cuserId, int cgroupId) { int ret; + char cmd_str[256]; + + sprintf(cmd_str, "cp %s/testx test.file", getcwd(NULL, 0)); + tst_tmpdir(); ret = unlink("test.file"); if (ret && errno != ENOENT) goto done; - ret = system("cp testx test.file"); + ret = system(cmd_str); if (ret) goto done; ret = chmod("test.file", mode); @@ -61,17 +65,23 @@ static int testsetup(mode_t mode, int cuserId, int cgroupId) return ret; } +void cleanup(void) +{ + tst_rmdir(); + tst_exit(); +} + static int testfperm(int userId, int groupId, char *fperm) { /* SET CURRENT USER/GROUP PERMISSIONS */ if (setegid(groupId)) { - tst_brkm(TBROK, NULL, "could not setegid to %d: %s", groupId, strerror(errno)); + tst_brkm(TBROK, cleanup, "could not setegid to %d: %s", groupId, strerror(errno)); seteuid(0); setegid(0); return -1; } if (seteuid(userId)) { - tst_brkm(TBROK, NULL, "could not seteuid to %d: %s", userId, strerror(errno)); + tst_brkm(TBROK, cleanup, "could not seteuid to %d: %s", userId, strerror(errno)); seteuid(0); setegid(0); return -1; @@ -130,13 +140,13 @@ int main(int argc, char *argv[]) result = testsetup(mode, cuserId, cgroupId); if (result) { - tst_brkm(TBROK, tst_exit, "testsetup() failed: %s", strerror(errno)); - return result; + tst_brkm(TBROK, cleanup, "testsetup() failed: %s", strerror(errno)); } result = testfperm(userId, groupId, fperm); unlink("test.file"); tst_resm(exresult == result ? TPASS : TFAIL, "%c a %03o file owned by (%d/%d) as user/group(%d/%d)", fperm[0], mode, cuserId, cgroupId, userId, groupId); - return result; + cleanup(); + return 0; } diff --git a/testcases/kernel/fs/fs_perms/fs_perms_simpletest.sh b/testcases/kernel/fs/fs_perms/fs_perms_simpletest.sh index 96369aea..5a8df8b5 100755 --- a/testcases/kernel/fs/fs_perms/fs_perms_simpletest.sh +++ b/testcases/kernel/fs/fs_perms/fs_perms_simpletest.sh @@ -8,7 +8,7 @@ test() res=${1} ./fs_perms ${arg} ${res} - if [ $? -ne ${res} ]; then + if [ $? -ne 0 ]; then Code=$((Code + 1)) fi } diff --git a/testcases/kernel/fs/fsstress/Makefile b/testcases/kernel/fs/fsstress/Makefile dissimilarity index 97% index 5a73ebc6..5949888f 100644 --- a/testcases/kernel/fs/fsstress/Makefile +++ b/testcases/kernel/fs/fsstress/Makefile @@ -1,15 +1,30 @@ -CFLAGS += -Wall -g -DNO_XFS -I. -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -LDFLAGS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f fsstress ../../../bin - -clean: - rm -f $(TARGETS) - - +# +# kernel/fs/fsstress 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -DNO_XFS -I$(abs_srcdir) \ + -D_LARGEFILE64_SOURCE -D_GNU_SOURCE + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/fsx-linux/Makefile b/testcases/kernel/fs/fsx-linux/Makefile dissimilarity index 97% index 214ac96b..f55ec53f 100644 --- a/testcases/kernel/fs/fsx-linux/Makefile +++ b/testcases/kernel/fs/fsx-linux/Makefile @@ -1,17 +1,34 @@ -CFLAGS += -w -O -LDFLAGS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f fsxtest02 ../../../bin - ln -f fsxtest ../../../bin - ln -f fsx-linux ../../../bin - -clean: - rm -f $(TARGETS) - - +# +# kernel/fs/fsx-linux testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -DNO_XFS -I$(abs_srcdir) \ + -D_LARGEFILE64_SOURCE -D_GNU_SOURCE + +WCFLAGS += -w + +INSTALL_TARGETS := fsxtest* + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/ftest/Makefile b/testcases/kernel/fs/ftest/Makefile dissimilarity index 98% index fe896cc2..91ba28d0 100644 --- a/testcases/kernel/fs/ftest/Makefile +++ b/testcases/kernel/fs/ftest/Makefile @@ -1,38 +1,31 @@ -# -# Copyright (c) International Business Machines Corp., 2001 -# Copyright (c) Cyril Hrubis chrubis@suse.cz 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -########################################################################### -# name of file : Makefile # -# description : make(1) description file for the send(2) tests. # -########################################################################### -CFLAGS+= -I../../../../include -W -Wall -g -LOADLIBES+= -L../../../../lib -lltp - -SRCS=$(wildcard ftest*.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -$(TARGETS): libftest.o - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) libftest.o +# +# kernel/fs/ftest 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +FILTER_OUT_MAKE_TARGETS := libftest + +include $(top_srcdir)/include/mk/generic_leaf_target.mk + +$(MAKE_TARGETS): %: %.o libftest.o diff --git a/testcases/kernel/fs/inode/Makefile b/testcases/kernel/fs/inode/Makefile dissimilarity index 98% index 8241d8f7..1c0c44b0 100644 --- a/testcases/kernel/fs/inode/Makefile +++ b/testcases/kernel/fs/inode/Makefile @@ -1,36 +1,29 @@ -# -# Copyright (c) International Business Machines Corp., 2001 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -########################################################################### -# name of file : Makefile # -########################################################################### -CFLAGS+= -I../../../../include -g -O -Wall -DLINUX -LOADLIBES+= -L../../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) - - +# +# kernel/fs/inode 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -DLINUX + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/lftest/Makefile b/testcases/kernel/fs/lftest/Makefile dissimilarity index 98% index 05817dc9..4c42caae 100644 --- a/testcases/kernel/fs/lftest/Makefile +++ b/testcases/kernel/fs/lftest/Makefile @@ -1,11 +1,29 @@ -CFLAGS+= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +# +# kernel/fs/lftest 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/linktest/Makefile b/testcases/kernel/fs/linktest/Makefile dissimilarity index 98% index e023d041..08495e5f 100644 --- a/testcases/kernel/fs/linktest/Makefile +++ b/testcases/kernel/fs/linktest/Makefile @@ -1,8 +1,29 @@ -TARGETS=linktest.pl - -all: - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done - -clean: +# +# kernel/fs/linktest 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := linktest.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/linktest/linktest.pl b/testcases/kernel/fs/linktest/linktest.pl deleted file mode 100755 index 34bb481c..00000000 --- a/testcases/kernel/fs/linktest/linktest.pl +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/perl - -# Copyright (c) International Business Machines Corp., 2000 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# -# FILE(s) : linktest.pl README -# DESCRIPTION : Regression test for max links per file -# USE : linktest.pl -# AUTHOR : Jeff Martin (martinjn@us.ibm.com) -# HISTORY : -# (05/07/01)v.99 Needed a quick script to test a hardlink limitation that was found. -# (28/07/08) Veerendra C -# Modified to return proper return code on failure/success. -# Also modified to return errors if unable to create dir/files - -$ret = 0; -if ( system("mkdir hlink") ) { - $ret = -1 ; -} - -if ( system("mkdir slink") ) { - $ret = -1 ; -} - -if ( system("touch hlink/hfile") ) { - $ret = -1 ; -} - -if ( system("touch slink/sfile") ) { - $ret = -1 ; -} - -if ( $ret == -1 ) { - printf ("Error %d: Not able to create dir/file's\n " , $ret); - exit -1; -} - -$scount=shift @ARGV; -chdir "slink"; -for($x=0;$x<$scount;$x++) { - $result=symlink("sfile","sfile$x"); - if(!$result) { - $serrors++; - } - } -chdir ".."; -$hcount=shift @ARGV; -for($x=0;$x<$hcount;$x++) { - $result=link("hlink/hfile","hlink/hfile$x"); - if(!$result) { - $herrors++; - } - } - -if($herrors) { - printf ("linker01 : FAIL Hard Link Errors = %d\n", $herrors); - $ret = -1 -} -else { - printf ("linker01 : HardLink Test PASS\n" ) -} -if($serrors) { - printf ("linker01 : FAIL Soft Link Errors = %d\n", $serrors); - $ret = -1 -} -else { - printf ("linker01 : SoftLink Test PASS\n" ); -} - -unlink ; -unlink ; -rmdir hlink; -rmdir slink; -exit $ret; diff --git a/testcases/kernel/fs/linktest/linktest.sh b/testcases/kernel/fs/linktest/linktest.sh new file mode 100755 index 00000000..718698ed --- /dev/null +++ b/testcases/kernel/fs/linktest/linktest.sh @@ -0,0 +1,91 @@ +#!/bin/sh + +# Copyright (c) International Business Machines Corp., 2000 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +# +# FILE(s) : linktest.sh README +# DESCRIPTION : Regression test for max links per file +# USE : linktest.sh +# AUTHOR : Garrett Cooper (yanegomi@gmail.com) +# HISTORY : +# A rewrite of testcases/kernel/fs/linktest.pl + +export TCID=linker01 +export TST_TOTAL=2 +export TST_COUNT=1 + +if [ $# -ne 2 ]; then + tst_res TBROK "" "usage: $0 {softlink count} {hardlink count}" + exit 1 +fi + +# TMPDIR not specified. +if [ "x$TMPDIR" = x -o ! -d "$TMPDIR" ] ; then + + if ! TMPDIR=$(mktemp -d) ; then + tst_res TBROK "" 'Failed to create $TMPDIR' + exit 1 + fi + # We created the directory, so we have the power to delete it as well. + trap "rm -Rf '$TMPDIR'" EXIT + +# Most likely runltp provided; don't delete $TMPDIR, but instead delete the +# files under it belonging to this process. +else + trap "rm -Rf '$TMPDIR/[hs]link.$$'" EXIT +fi + +cd "$TMPDIR" || tst_res TBROK "" "Failed to cd to $TMPDIR" + +mkdir hlink.$$ slink.$$ && touch hlink.$$/hfile slink.$$/sfile + +do_link() { + pfix=$1 + ln_opts=$2 + limit=$3 + prefix_msg=$4 + + lerrors=0 + + i=0 + + cd "${pfix}link.$$" + while [ $i -lt $limit ]; do + if ! ln ${ln_opts} "$PWD/${pfix}file" ${pfix}file${i}; then + : $(( lerrors += 1 )) + fi + : $(( i+= 1 )) + done + cd .. + + if [ $lerrors -eq 0 ]; then + RTYPE=TPASS + else + RTYPE=TFAIL + fi + + tst_res $RTYPE "" "$prefix_msg Link Errors: $lerrors" + + : $(( TST_COUNT += 1 )) + +} + +do_link s "-s" ${1} "Symbolic" +do_link h "" ${2} "Hard" + +rm -Rf hlink.$$ slink.$$ diff --git a/testcases/kernel/fs/mongo/test.sh b/testcases/kernel/fs/mongo/test.sh index fe756644..eccb0798 100755 --- a/testcases/kernel/fs/mongo/test.sh +++ b/testcases/kernel/fs/mongo/test.sh @@ -26,7 +26,7 @@ TEST_DIR=testdir #should be root to execute this script . - if [ $UID -ne 0 ]; then + if [ $(id -ru) -ne 0 ]; then echo "This script must be run as root" exit fi @@ -52,8 +52,7 @@ modprobe loop fi #run the mongo test on reiserfs file system type -function reiserfs - +reiserfs() { cat > fs.sh <> fs.sh < #include #include #include #include +#include "test.h" +#include "usctest.h" + +char *TCID = "openfile01"; /* Test program identifier. */ +int TST_TOTAL = 1; #define MAXFILES 32768 #define MAXTHREADS 10 - /* Control Structure */ struct cb { pthread_mutex_t m; - pthread_cond_t init_cv; - pthread_cond_t thr_cv; - int thr_sleeping; + pthread_cond_t init_cv; + pthread_cond_t thr_cv; + int thr_sleeping; } c; - /* Global Variables */ -int numthreads=10, numfiles=10; -int debug=0; -char * filename="FILETOOPEN"; +int numthreads = 10, numfiles = 10; +int debug = 0; +char * filename = "FILETOOPEN"; +void setup(void) +{ + tst_tmpdir(); +} -/* Procedures */ -void *threads(void* thread_id); +void cleanup(void) +{ + tst_rmdir(); + tst_exit(); +} +/* Procedures */ +void *threads(void* thread_id); /* ************************************************************************** - * MAIN PROCEDURE * - ************************************************************************** */ + * MAIN PROCEDURE * + ************************************************************************** */ int main(int argc, char *argv[]) { - int i,opt,badopts=0; - FILE *fd; - pthread_t th_id; - char msg[80]=""; - extern char *optarg; - - while((opt=getopt(argc, argv, "df:t:h")) != EOF) { - switch((char) opt) { - case 'd': - debug=1; - break; - case 'f': - numfiles=atoi(optarg); - if(numfiles <= 0) - badopts=1; - break; - case 't': - numthreads=atoi(optarg); - if(numthreads <= 0) - badopts=1; - break; - case 'h': - default: - printf("Usage: openfile [-d] -f FILES -t THREADS\n"); - _exit(1); - } - } - if(badopts) { - printf("Usage: openfile [-d] -f FILES -t THREADS\n"); - _exit(1); - } - - /* Check if numthreads is less than MAXFILES */ - if ( numfiles > MAXFILES ){ - sprintf(msg,"%s\nCannot use %d files", msg, numfiles); - sprintf(msg,"%s, used %d files instead\n", msg, MAXFILES); - numfiles = MAXFILES; - } - - /* Check if numthreads is less than MAXTHREADS */ - if ( numthreads > MAXTHREADS ){ - sprintf(msg,"%s\nCannot use %d threads", msg, numthreads); - sprintf(msg,"%s, used %d threads instead\n", msg, MAXTHREADS); - numthreads = MAXTHREADS; + int i, opt, badopts = 0; + FILE *fd; + pthread_t th_id; + char msg[80] = ""; + extern char *optarg; + + while ((opt = getopt(argc, argv, "df:t:h")) != EOF) { + switch ((char) opt) { + case 'd': + debug = 1; + break; + case 'f': + numfiles = atoi(optarg); + if (numfiles <= 0) + badopts = 1; + break; + case 't': + numthreads = atoi(optarg); + if (numthreads <= 0) + badopts = 1; + break; + case 'h': + default: + printf("Usage: openfile [-d] -f FILES -t THREADS\n"); + _exit(1); + } + } + if (badopts) { + printf("Usage: openfile [-d] -f FILES -t THREADS\n"); + _exit(1); + } + + setup(); + + /* Check if numthreads is less than MAXFILES */ + if (numfiles > MAXFILES) { + sprintf(msg, "%s\nCannot use %d files", msg, numfiles); + sprintf(msg, "%s, used %d files instead\n", msg, MAXFILES); + numfiles = MAXFILES; + } + + /* Check if numthreads is less than MAXTHREADS */ + if (numthreads > MAXTHREADS) { + sprintf(msg, "%s\nCannot use %d threads", msg, numthreads); + sprintf(msg, "%s, used %d threads instead\n", msg, MAXTHREADS); + numthreads = MAXTHREADS; } /* Create files */ - if ((fd=fopen(filename,"w")) == NULL){ - perror ("FAIL - Could not create file"); - _exit(1); + if ((fd = fopen(filename, "w")) == NULL) { + tst_resm(TFAIL, "Could not create file"); + cleanup(); } /* Initialize thread control variables, lock & condition */ @@ -126,120 +139,126 @@ int main(int argc, char *argv[]) c.thr_sleeping = 0; /* Grab mutex lock */ - if (pthread_mutex_lock(&c.m)){ - perror("FAIL - failed to grab mutex lock"); + if (pthread_mutex_lock(&c.m)) { + tst_resm(TFAIL, "failed to grab mutex lock"); fclose(fd); unlink(filename); - _exit(1); + cleanup(); } printf("Creating Reading Threads\n"); /* Create threads */ - for (i=0; i 0) { + close_files(fd_list, i-1); + } unlink(filename); - pthread_exit((void*)1); - } - } + pthread_exit((void*) 1); + } + } /* Grab mutex lock */ if (pthread_mutex_lock(&c.m)) { perror("FAIL - failed to grab mutex lock"); - fclose(fd); + close_files(fd_list, numfiles); unlink(filename); - pthread_exit((void*)1); + pthread_exit((void*) 1); } /* Check if you should wake up main thread */ - if (++c.thr_sleeping == numthreads) - if (pthread_cond_signal(&c.init_cv)){ + if (++c.thr_sleeping == numthreads) + if (pthread_cond_signal(&c.init_cv)) { perror("FAIL - failed to signal main thread"); - fclose(fd); + close_files(fd_list, numfiles); unlink(filename); - pthread_exit((void*)1); + pthread_exit((void*) 1); } /* Sleep until woken up */ - if (pthread_cond_wait(&c.thr_cv, &c.m)){ + if (pthread_cond_wait(&c.thr_cv, &c.m)) { perror("FAIL - failed to wake up correctly"); - fclose(fd); + close_files(fd_list, numfiles); unlink(filename); - pthread_exit((void*)1); + pthread_exit((void*) 1); } /* Release mutex lock */ - if (pthread_mutex_unlock(&c.m)){ + if (pthread_mutex_unlock(&c.m)) { perror("FAIL - failed to release mutex lock"); - fclose(fd); + close_files(fd_list, numfiles); unlink(filename); - pthread_exit((void*)1); + pthread_exit((void*) 1); } - /* Close file and exit */ - fclose(fd); + /* Close file handles and exit */ + close_files(fd_list, numfiles); unlink(filename); - pthread_exit((void*)0); + pthread_exit((void*) 0); } - diff --git a/testcases/kernel/fs/proc/Makefile b/testcases/kernel/fs/proc/Makefile index 7a2b2cfe..131c21e1 100644 --- a/testcases/kernel/fs/proc/Makefile +++ b/testcases/kernel/fs/proc/Makefile @@ -16,18 +16,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -include ../../../../config.mk +top_srcdir ?= ../../../.. -CFLAGS+= -I../../../../include -LDLIBS+= -L../../../../lib -lltp $(SELINUX_LIBS) +include $(top_srcdir)/include/mk/testcases.mk -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) +LDLIBS += $(SELINUX_LIBS) -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/proc/proc01.c b/testcases/kernel/fs/proc/proc01.c index 90a03098..06117b46 100644 --- a/testcases/kernel/fs/proc/proc01.c +++ b/testcases/kernel/fs/proc/proc01.c @@ -27,14 +27,14 @@ #include "config.h" -#include /* for errno */ -#include /* for NULL */ -#include /* for malloc() */ -#include /* for string function */ -#include /* for PATH_MAX */ -#include /* for opendir(), readdir(), closedir(), stat() */ -#include /* for [l]stat() */ -#include /* for opendir(), readdir(), closedir() */ +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -67,12 +67,12 @@ size_t buffsize = 1024; size_t total_read = 0; unsigned int total_obj = 0; -struct mapping -{ - char func[MAX_FUNC_NAME]; - char file[PATH_MAX]; - int err; +struct mapping { + char func[MAX_FUNC_NAME]; + char file[PATH_MAX]; + int err; }; + typedef struct mapping Mapping; /* Those are known failures for 2.6.18 baremetal kernel and Xen dom0 @@ -388,7 +388,7 @@ int main(int argc, char *argv[]) char *msg; int lc; - if ((msg = parse_opts(argc, argv, options, help)) != (char *)NULL) + if ((msg = parse_opts(argc, argv, options, help)) != NULL) tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); if (opt_buffsize) { @@ -414,7 +414,7 @@ int main(int argc, char *argv[]) TEST(readproc(procpath)); if (TEST_RETURN != 0) { - tst_resm(TFAIL, "readproc() failed with %d errors.", + tst_resm(TFAIL, "readproc() failed with %ld errors.", TEST_RETURN); } else { tst_resm(TPASS, "readproc() completed successfully, " diff --git a/testcases/kernel/fs/quota_remount/Makefile b/testcases/kernel/fs/quota_remount/Makefile dissimilarity index 99% index 4bb3bcca..a63b36f9 100644 --- a/testcases/kernel/fs/quota_remount/Makefile +++ b/testcases/kernel/fs/quota_remount/Makefile @@ -1,26 +1,25 @@ -################################################################################ -## ## -## Copyright (c) International Business Machines Corp., 2009 ## -## ## -## This program is free software; you can redistribute it and#or modify ## -## it under the terms of the GNU General Public License as published by ## -## the Free Software Foundation; either version 2 of the License, or ## -## (at your option) any later version. ## -## ## -## This program is distributed in the hope that it will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## -## for more details. ## -## ## -## You should have received a copy of the GNU General Public License ## -## along with this program; if not, write to the Free Software ## -## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -## ## -################################################################################ - -all: - -install: - @ln -f quota_remount_test01.sh ../../../bin/; - -clean: +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := quota_remount_test01.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/quota_remount/quota_remount_test01.sh b/testcases/kernel/fs/quota_remount/quota_remount_test01.sh index e4f6fe76..1092fa5c 100755 --- a/testcases/kernel/fs/quota_remount/quota_remount_test01.sh +++ b/testcases/kernel/fs/quota_remount/quota_remount_test01.sh @@ -41,7 +41,10 @@ export TCID=quota_remount_test01 export TST_TOTAL=1 export TST_COUNT=0 -TMPDIR=/tmp +if [ -z $TMPDIR ] +then + TMPDIR=/tmp +fi MNTDIR=$TMPDIR/mnt uname -r | { diff --git a/testcases/kernel/fs/racer/Makefile b/testcases/kernel/fs/racer/Makefile index b39782b0..81b88e40 100644 --- a/testcases/kernel/fs/racer/Makefile +++ b/testcases/kernel/fs/racer/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) International Business Machines Corp., 2008 +# 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 @@ -16,12 +16,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -########################################################################### +top_srcdir ?= ../../../.. -all: +include $(top_srcdir)/include/mk/testcases.mk -install: - cp -r *.sh ../../../bin/ - -clean: +INSTALL_TARGETS := *.sh +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/racer/fs_racer.sh b/testcases/kernel/fs/racer/fs_racer.sh index 36eee752..0754e401 100755 --- a/testcases/kernel/fs/racer/fs_racer.sh +++ b/testcases/kernel/fs/racer/fs_racer.sh @@ -29,7 +29,7 @@ MAX_FILES=20 CLEAR_SECS=30 -DIR="race" +DIR="$TMPDIR/race" execute_test() { diff --git a/testcases/kernel/fs/scsi/ltpscsi/Makefile b/testcases/kernel/fs/scsi/ltpscsi/Makefile index c635c67d..e404ce07 100644 --- a/testcases/kernel/fs/scsi/ltpscsi/Makefile +++ b/testcases/kernel/fs/scsi/ltpscsi/Makefile @@ -1,10 +1,5 @@ SHELL = /bin/sh -PREFIX=/usr/local -INSTDIR=$(DESTDIR)/$(PREFIX)/bin -MANDIR=$(DESTDIR)/$(PREFIX)/man - - EXECS = scsimain LARGE_FILE_FLAGS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 diff --git a/testcases/kernel/fs/stream/Makefile b/testcases/kernel/fs/stream/Makefile index c9a82838..23dd7e1a 100644 --- a/testcases/kernel/fs/stream/Makefile +++ b/testcases/kernel/fs/stream/Makefile @@ -16,22 +16,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -########################################################################### -# name of file : Makefile # -# description : make(1) description file for the send(2) tests. # -########################################################################### -CFLAGS+= -I../../../../include -Wall -g -LOADLIBES+= -L../../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/stream/stream03.c b/testcases/kernel/fs/stream/stream03.c index 3f165af1..65e11423 100644 --- a/testcases/kernel/fs/stream/stream03.c +++ b/testcases/kernel/fs/stream/stream03.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "test.h" #include "usctest.h" @@ -46,9 +47,7 @@ int local_flag; char progname[] = "stream03()" ; char tempfile1[40]=""; -long ftell(); -/*--------------------------------------------------------------------*/ int main(int ac, char *av[]) { FILE *stream; @@ -56,19 +55,18 @@ int main(int ac, char *av[]) char *junk="abcdefghijklmnopqrstuvwxyz"; long pos; off_t opos; - int lc; /* loop counter */ - char *msg; /* message returned from parse_opts */ - - /* - * parse standard options - */ - if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){ - tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg); - tst_exit(); - /*NOTREACHED*/ - } - - local_flag = PASSED; + int lc; + char *msg; + + /* + * parse standard options + */ + if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) { + tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg); + tst_exit(); + } + + local_flag = PASSED; tst_tmpdir(); for (lc = 0; TEST_LOOPING(lc); lc++) { @@ -76,74 +74,94 @@ int main(int ac, char *av[]) sprintf(tempfile1, "stream03.%d", getpid()); /*--------------------------------------------------------------------*/ //block0: - if((stream=fopen(tempfile1,"a+")) == NULL) { + + if ((stream=fopen(tempfile1, "a+")) == NULL) { tst_resm(TBROK,"fopen(%s) a+ failed: %s", tempfile1, strerror(errno)); tst_exit(); } + /* make sure offset of zero at start */ pos=ftell(stream); - if ( pos != 0 ) { + + if (pos != 0) { tst_resm(TFAIL,"file pointer descrepancy 1"); local_flag = FAILED; } + /* write something and check */ - if(fwrite(junk,sizeof(*junk),strlen(junk),stream) == 0) { + if (fwrite(junk, sizeof(*junk), strlen(junk), stream) == 0) { tst_resm(TFAIL,"fwrite failed: %s", strerror(errno)); tst_exit(); } + pos=ftell(stream); - if ((size_t)pos != strlen(junk) ) { - tst_resm(TFAIL, "strlen(junk)=%zi: file pointer descrepancy 2 (pos=%zi)", strlen(junk), pos); + + if (pos != strlen(junk)) { + tst_resm(TFAIL, "strlen(junk)=%zi: file pointer descrepancy 2 (pos=%li)", strlen(junk), pos); local_flag = FAILED; } + /* rewind and check */ rewind(stream); - pos=ftell(stream); - if ( pos != 0 ) { - tst_resm(TFAIL,0,"file pointer descrepancy 3 (pos=%zi, wanted pos=0)", pos); + pos = ftell(stream); + + if (pos != 0) { + tst_resm(TFAIL,"file pointer descrepancy 3 (pos=%li, wanted pos=0)", pos); local_flag = FAILED; } + /* seek from current position and then check */ - if (fseek(stream,strlen(junk),1) != 0) { - tst_resm(TFAIL,"fseek failed: %s", strerror(errno)); + if (fseek(stream,strlen(junk), 1) != 0) { + tst_resm(TFAIL, "fseek failed: %s", strerror(errno)); tst_exit(); } - pos=ftell(stream); - if ((size_t)pos != strlen(junk) ) { - tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 4 (pos=%zi)", strlen(junk), pos); + + pos = ftell(stream); + + if (pos != strlen(junk)) { + tst_resm(TFAIL, "strlen(junk)=%zi: file pointer descrepancy 4 (pos=%li)", strlen(junk), pos); local_flag = FAILED; } + /* seek from end of file and then check */ - if (fseek(stream,0,2) != 0) { - tst_resm(TFAIL,"fseek failed: %s", strerror(errno)); + if (fseek(stream, 0, 2) != 0) { + tst_resm(TFAIL, "fseek failed: %s", strerror(errno)); tst_exit(); } - pos=ftell(stream); - if ((size_t)pos != strlen(junk) ) { - tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 5 (pos=%zi)", strlen(junk), pos); + + pos = ftell(stream); + + if (pos != strlen(junk) ) { + tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 5 (pos=%li)", strlen(junk), pos); local_flag = FAILED; } + /* rewind with seek and then check */ - if (fseek(stream,0,0) != 0) { + if (fseek(stream, 0, 0) != 0) { tst_resm(TFAIL,"fseek failed: %s", strerror(errno)); tst_exit(); } - pos=ftell(stream); - if (pos != 0 ) { - tst_resm(TFAIL,"file pointer descrepancy 6 (pos=%zi, wanted pos=0)", pos); + + pos = ftell(stream); + + if (pos != 0) { + tst_resm(TFAIL,"file pointer descrepancy 6 (pos=%li, wanted pos=0)", pos); local_flag = FAILED; } /* read till EOF, do getc and then check ftell */ - while (fgets (buf, sizeof(buf), stream)); + while (fgets(buf, sizeof(buf), stream)); pos=ftell(stream); - (void) getc(stream); + getc(stream); pos=ftell(stream); - if ((size_t)pos != strlen(junk) ) { - tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 7 (pos=%zi)", strlen(junk), pos); + + if (pos != strlen(junk)) { + tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 7 (pos=%li)", strlen(junk), pos); local_flag = FAILED; } + fclose(stream); + if (local_flag == PASSED) { tst_resm(TPASS, "Test passed in block0."); } else { @@ -155,83 +173,103 @@ int main(int ac, char *av[]) unlink(tempfile1); /*--------------------------------------------------------------------*/ //block1: - if((stream=fopen(tempfile1,"a+")) == NULL) { + if ((stream = fopen(tempfile1, "a+")) == NULL) { tst_resm(TFAIL,"fopen(%s) a+ failed: %s", tempfile1, strerror(errno)); tst_exit(); } + /* make sure offset of zero at start */ - opos=ftello(stream); - if ( opos != 0 ) { - tst_resm(TFAIL,"file pointer descrepancy 1 (opos=%zi, wanted opos=0)", opos); + opos = ftello(stream); + + if (opos != 0) { + tst_resm(TFAIL,"file pointer descrepancy 1 (opos=%"PRId64", wanted opos=0)", (int64_t)opos); local_flag = FAILED; } + /* write something and check */ - if(fwrite(junk,sizeof(*junk),strlen(junk),stream) == 0) { - tst_resm(TFAIL,"fwrite failed: %s", strerror(errno)); + if (fwrite(junk, sizeof(*junk), strlen(junk), stream) == 0) { + tst_resm(TFAIL, "fwrite failed: %s", strerror(errno)); tst_exit(); } - opos=ftello(stream); - if ((size_t)opos != strlen(junk) ) { - tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 2 (opos=%zi)", strlen(junk), opos); + + opos = ftello(stream); + + if (opos != strlen(junk)) { + tst_resm(TFAIL, "strlen(junk)=%zi: file pointer descrepancy 2 (opos=%"PRId64")", strlen(junk), (int64_t)opos); local_flag = FAILED; } + /* rewind and check */ rewind(stream); - opos=ftello(stream); - if ( opos != 0 ) { - tst_resm(TFAIL,"file pointer descrepancy 3 (opos=%zi, wanted opos=0)", opos); + opos = ftello(stream); + + if (opos != 0) { + tst_resm(TFAIL,"file pointer descrepancy 3 (opos=%"PRId64", wanted opos=0)", (int64_t)opos); local_flag = FAILED; } + /* seek from current position and then check */ - if (fseeko(stream, (off_t)strlen(junk), 1) != 0) { + if (fseeko(stream, strlen(junk), 1) != 0) { tst_resm(TFAIL,"fseeko failed: %s", strerror(errno)); tst_exit(); } - opos=ftello(stream); - if ((size_t)opos != strlen(junk) ) { - tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 4 (opos=%zi)", strlen(junk), opos); + + opos = ftello(stream); + + if (opos != strlen(junk) ) { + tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 4 (opos=%"PRId64")", strlen(junk), (int64_t)opos); local_flag = FAILED; } + /* seek from end of file and then check */ - if (fseeko(stream, (off_t)0, 2) != 0) { + if (fseeko(stream, 0, 2) != 0) { tst_resm(TFAIL,"fseeko failed: %s", strerror(errno)); tst_exit(); } - opos=ftello(stream); - if ((size_t)opos != strlen(junk) ) { - tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 5 (opos=%zi)", strlen(junk), opos); + + opos = ftello(stream); + + if (opos != strlen(junk) ) { + tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 5 (opos=%"PRId64")", strlen(junk), (int64_t)opos); local_flag = FAILED; } + /* rewind with seek and then check */ - if (fseeko(stream, (off_t)0, 0) != 0) { + if (fseeko(stream, 0, 0) != 0) { tst_resm(TFAIL,"fseeko failed: %s", strerror(errno)); tst_exit(); } - opos=ftello(stream); - if (opos != 0 ) { - tst_resm(TFAIL,"file pointer descrepancy 6 (opos=%zi, wanted opos=0)", opos); + + opos = ftello(stream); + + if (opos != 0) { + tst_resm(TFAIL,"file pointer descrepancy 6 (opos=%"PRId64", wanted opos=0)", (int64_t)opos); local_flag = FAILED; } /* read till EOF, do getc and then check ftello */ - while (fgets (buf, sizeof(buf), stream)); + while (fgets(buf, sizeof(buf), stream)); + opos=ftello(stream); - (void) getc(stream); + getc(stream); opos=ftello(stream); - if ((size_t)opos != strlen(junk) ) { - tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 7 (opos=%zi)", strlen(junk), opos); + + if (opos != strlen(junk) ) { + tst_resm(TFAIL,"strlen(junk)=%zi: file pointer descrepancy 7 (opos=%li)", strlen(junk), opos); local_flag = FAILED; } + fclose(stream); + if (local_flag == PASSED) { tst_resm(TPASS, "Test passed in block1."); } else { tst_resm(TFAIL, "Test failed in block1."); } - /*--------------------------------------------------------------------*/ + unlink(tempfile1); - } /* end for */ + } + tst_rmdir(); tst_exit(); - return 0; } diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug02.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug02.sh index 08e93011..7f1c5b12 100755 --- a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug02.sh +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug02.sh @@ -15,8 +15,8 @@ fi # Includes: LHCS_PATH=${LHCS_PATH:-".."} -source $LHCS_PATH/include/testsuite.fns -source $LHCS_PATH/include/hotplug.fns +. $LHCS_PATH/include/testsuite.fns +. $LHCS_PATH/include/hotplug.fns echo "Name: $CASE" echo "Date: `date`" @@ -73,7 +73,7 @@ until [ $loop = 0 ]; do # Turn the CPU back online just to see what happens. online_cpu ${CPU_TO_TEST} - let "loop = loop - 1" + : $(( loop -= 1 )) done sleep 2 diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug03.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug03.sh index c550890d..97d52052 100755 --- a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug03.sh +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug03.sh @@ -15,8 +15,8 @@ fi # Includes: LHCS_PATH=${LHCS_PATH:-".."} -source $LHCS_PATH/include/testsuite.fns -source $LHCS_PATH/include/hotplug.fns +. $LHCS_PATH/include/testsuite.fns +. $LHCS_PATH/include/hotplug.fns echo "Name: $CASE" echo "Date: `date`" @@ -48,7 +48,7 @@ do_clean() # Turn off the CPUs that were off before the test start until [ $cpu = 0 ];do offline_cpu ${on[${cpu}]} - let "cpu = cpu - 1" + : $(( cpu -= 1 )) done } @@ -60,10 +60,10 @@ until [ $loop = 0 ]; do for i in $( get_all_cpus ); do online_cpu $1 if [ $? = 0 ]; then - let "cpu = cpu + 1" + : $(( cpu += 1 )) on[${cpu}]=$i fi - let "number_of_cpus = number_of_cpus + 1" + : $(( number_of_cpus += 1 )) done offline_cpu ${CPU_TO_TEST} @@ -76,11 +76,11 @@ until [ $loop = 0 ]; do # CPUs we have. This is to help ensure we've got enough processes # that at least one will migrate to the new CPU. Store the PIDs # so we can kill them later. - let "number_of_cpus = number_of_cpus * 2" + : $(( number_of_cpus *= 2 )) until [ $number_of_cpus = 0 ]; do $LHCS_PATH/tools/do_spin_loop > /dev/null 2>&1 & echo $! >> /var/run/hotplug4_$$.pid - let "number_of_cpus = number_of_cpus - 1" + : $(( number_of_cpus -= 1 )) done ps aux | head -n 1 @@ -111,7 +111,7 @@ until [ $loop = 0 ]; do do_clean - let "loop = loop -1" + : $(( loop -=1 )) done exit_clean diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug04.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug04.sh index b147286b..00a634bf 100755 --- a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug04.sh +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug04.sh @@ -9,8 +9,8 @@ loop=${HOTPLUG04_LOOPS:-1} # Includes: LHCS_PATH=${LHCS_PATH:-".."} -source $LHCS_PATH/include/testsuite.fns -source $LHCS_PATH/include/hotplug.fns +. $LHCS_PATH/include/testsuite.fns +. $LHCS_PATH/include/hotplug.fns echo "Name: $CASE" echo "Date: `date`" @@ -26,7 +26,7 @@ until [ $loop = 0 ]; do online_cpu $i RC=$? if [ $RC != 0 ]; then - let "cpu = cpu + 1" + : $(( cpu += 1 )) on[${cpu}]=$i echo "${on[${cpu}]}" fi @@ -51,7 +51,7 @@ until [ $loop = 0 ]; do # Online the ones that were on initially until [ $cpu = 0 ]; do online_cpu ${on[${cpu}]} - let "cpu = cpu - 1" + : $(( cpu -= 1 )) done # Return CPU 0 to its initial state @@ -61,7 +61,7 @@ until [ $loop = 0 ]; do offline_cpu 0 fi - let "loop = loop -1" + : $(( loop -=1 )) done exit_clean \ No newline at end of file diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug06.sar.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug06.sar.sh index d6f46018..aba658a1 100755 --- a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug06.sar.sh +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug06.sar.sh @@ -15,8 +15,8 @@ fi # Includes: LHCS_PATH=${LHCS_PATH:-".."} -source $LHCS_PATH/include/testsuite.fns -source $LHCS_PATH/include/hotplug.fns +. $LHCS_PATH/include/testsuite.fns +. $LHCS_PATH/include/hotplug.fns echo "Name: $CASE" echo "Date: `date`" @@ -81,7 +81,7 @@ until [ $loop = 0 ]; do # Check that SAR registered the change in CPU online/offline states NEW_NUMBER_CPU_OFF=`cat /tmp/log_$$ | grep ${time} | grep -i nan | wc -l` - let "NUMBER_CPU_OFF = NUMBER_CPU_OFF - 1" + : $(( NUMBER_CPU_OFF -= 1 )) if [ $NUMBER_CPU_OFF = $NEW_NUMBER_CPU_OFF ]; then echo "$CASE PASS: CPU was found after turned on." else diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug06.top.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug06.top.sh index a9bf17ef..f9efe2ad 100755 --- a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug06.top.sh +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug06.top.sh @@ -15,8 +15,8 @@ fi # Includes: LHCS_PATH=${LHCS_PATH:-".."} -source $LHCS_PATH/include/testsuite.fns -source $LHCS_PATH/include/hotplug.fns +. $LHCS_PATH/include/testsuite.fns +. $LHCS_PATH/include/hotplug.fns echo "Name: $CASE" echo "Date: `date`" @@ -76,7 +76,7 @@ until [ $loop = 0 ]; do exit_clean -1 fi - let "loop = loop - 1" + : $(( loop -= 1 )) done diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug07.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug07.sh index d57c561c..8f5ca440 100755 --- a/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug07.sh +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/hotplug07.sh @@ -11,8 +11,8 @@ loop_one=${HOTPLUG07_LOOPS:-1} # Includes: LHCS_PATH=${LHCS_PATH:-".."} -source $LHCS_PATH/include/testsuite.fns -source $LHCS_PATH/include/hotplug.fns +. $LHCS_PATH/include/testsuite.fns +. $LHCS_PATH/include/hotplug.fns echo "Name: HotPlug Test - Test Case 7" echo "Date: `date`" @@ -89,7 +89,7 @@ do RC=$? echo "Onlining cpu${CPU_TO_TEST}: Return Code = ${RC}" - let "loop_one = loop_one - 1" + : $(( loop_one -= 1 )) done diff --git a/testcases/kernel/include/Makefile b/testcases/kernel/include/Makefile dissimilarity index 98% index b58a043b..c5b990b2 100644 --- a/testcases/kernel/include/Makefile +++ b/testcases/kernel/include/Makefile @@ -1,19 +1,34 @@ -all uclinux: ../../../include/linux_syscall_numbers.h - -../../../include/linux_syscall_numbers.h: linux_syscall_numbers.h - ln -sf ../testcases/kernel/include/linux_syscall_numbers.h ../../../include/ - -clean distclean: - rm -f linux_syscall_numbers.h - rm -f ../../../include/linux_syscall_numbers.h - -install uclinux_install: - @true - -linux_syscall_numbers.h: *.in regen.sh - $(MAKE) regen - -regen: - ./regen.sh - -.PHONY: all clean distclean install regen +# +# kernel test suite include 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_DIR := $(includedir) + +MAKE_TARGETS := linux_syscall_numbers.h + +linux_syscall_numbers.h: $(wildcard $(srcdir)/*.sh) + @set -e; $(SHELL) $(abs_srcdir)/regen.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/include/ia64.in b/testcases/kernel/include/ia64.in index 7c614380..92994ccb 100644 --- a/testcases/kernel/include/ia64.in +++ b/testcases/kernel/include/ia64.in @@ -30,6 +30,7 @@ symlinkat 1290 readlinkat 1291 fchmodat 1292 faccessat 1293 +ppoll 1295 splice 1297 tee 1301 vmsplice 1302 diff --git a/testcases/kernel/include/order b/testcases/kernel/include/order index 8c1a4897..3e2bd96f 100644 --- a/testcases/kernel/include/order +++ b/testcases/kernel/include/order @@ -2,7 +2,6 @@ arm hppa i386 ia64 -microblaze powerpc64 powerpc s390x diff --git a/testcases/kernel/include/powerpc.in b/testcases/kernel/include/powerpc.in index fc14765a..0c09dd57 100644 --- a/testcases/kernel/include/powerpc.in +++ b/testcases/kernel/include/powerpc.in @@ -3,6 +3,9 @@ timer_settime 241 timer_delete 244 clock_settime 245 clock_gettime 246 +get_mempolicy 269 +set_mempolicy 270 +ppoll 281 splice 283 tee 284 vmsplice 285 diff --git a/testcases/kernel/include/powerpc64.in b/testcases/kernel/include/powerpc64.in index 9e1300fc..6f124ef5 100644 --- a/testcases/kernel/include/powerpc64.in +++ b/testcases/kernel/include/powerpc64.in @@ -3,6 +3,9 @@ timer_settime 241 timer_delete 244 clock_settime 245 clock_gettime 246 +get_mempolicy 269 +set_mempolicy 270 +ppoll 281 splice 283 tee 284 vmsplice 285 diff --git a/testcases/kernel/include/regen.sh b/testcases/kernel/include/regen.sh index 0ea9bbc0..4baffebd 100755 --- a/testcases/kernel/include/regen.sh +++ b/testcases/kernel/include/regen.sh @@ -2,6 +2,8 @@ output="linux_syscall_numbers.h" +srcdir=${0%/*} + rm -f ${output} cat << EOF > ${output} @@ -37,7 +39,7 @@ static void cleanup(void); }) EOF -for arch in `cat order` ; do +for arch in $(cat ${srcdir}/order) ; do echo -n "Generating data for arch $arch ... " echo "" >> ${output} @@ -55,7 +57,7 @@ for arch in `cat order` ; do # define $nr $* # endif EOF - done < ${arch}.in + done < ${srcdir}/${arch}.in echo "#endif" >> ${output} echo "" >> ${output} @@ -65,7 +67,7 @@ done echo -n "Generating stub list ... " echo "" >> ${output} echo "/* Common stubs */" >> ${output} -for nr in $(awk '{print $1}' *.in | sort -u) ; do +for nr in $(awk '{print $1}' ${srcdir}/*.in | sort -u) ; do nr="__NR_$nr" cat <<-EOF >> ${output} # ifndef $nr diff --git a/testcases/kernel/include/s390.in b/testcases/kernel/include/s390.in index 560563a1..8a079e34 100644 --- a/testcases/kernel/include/s390.in +++ b/testcases/kernel/include/s390.in @@ -1,3 +1,5 @@ +get_mempolicy 269 +set_mempolicy 270 openat 288 mkdirat (__NR_openat + 1) mknodat (__NR_openat + 2) @@ -12,6 +14,7 @@ symlinkat (__NR_openat + 9) readlinkat (__NR_openat + 10) fchmodat (__NR_openat + 11) faccessat (__NR_openat + 12) +ppoll 302 splice 306 tee 308 vmsplice 309 diff --git a/testcases/kernel/include/sh.in b/testcases/kernel/include/sh.in index 7b4acd91..63670001 100644 --- a/testcases/kernel/include/sh.in +++ b/testcases/kernel/include/sh.in @@ -27,6 +27,7 @@ symlinkat (__NR_openat + 9) readlinkat (__NR_openat + 10) fchmodat (__NR_openat + 11) faccessat (__NR_openat + 12) +ppoll 309 splice 313 tee 315 vmsplice 316 diff --git a/testcases/kernel/include/sparc.in b/testcases/kernel/include/sparc.in index a5676598..713b475d 100644 --- a/testcases/kernel/include/sparc.in +++ b/testcases/kernel/include/sparc.in @@ -2,6 +2,7 @@ vmsplice 25 splice 232 tee 280 openat 284 +ppoll 298 mkdirat (__NR_openat + 1) mknodat (__NR_openat + 2) fchownat (__NR_openat + 3) diff --git a/testcases/kernel/include/sparc64.in b/testcases/kernel/include/sparc64.in index 954931c2..8d947656 100644 --- a/testcases/kernel/include/sparc64.in +++ b/testcases/kernel/include/sparc64.in @@ -2,6 +2,7 @@ vmsplice 25 splice 232 tee 280 openat 284 +ppoll 298 mkdirat (__NR_openat + 1) mknodat (__NR_openat + 2) fchownat (__NR_openat + 3) diff --git a/testcases/kernel/include/x86_64.in b/testcases/kernel/include/x86_64.in index 22eb2cf4..4e1bacaa 100644 --- a/testcases/kernel/include/x86_64.in +++ b/testcases/kernel/include/x86_64.in @@ -30,6 +30,7 @@ symlinkat 266 readlinkat 267 fchmodat 268 faccessat 269 +ppoll 271 splice 275 tee 276 vmsplice 278 diff --git a/testcases/kernel/io/Makefile b/testcases/kernel/io/Makefile dissimilarity index 98% index e3c394fd..196be9f9 100644 --- a/testcases/kernel/io/Makefile +++ b/testcases/kernel/io/Makefile @@ -1,10 +1,29 @@ -SUBDIRS = direct_io disktest stress_cd stress_floppy writetest aio - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# kernel/io test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +FILTER_OUT_DIRS := $(if $(AIO_LIBS),,aio ltp-aiodio) + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/io/aio/Makefile b/testcases/kernel/io/aio/Makefile dissimilarity index 99% index 4b2c3d7f..a1718b1d 100644 --- a/testcases/kernel/io/aio/Makefile +++ b/testcases/kernel/io/aio/Makefile @@ -1,13 +1,22 @@ -SUBDIRS = `ls */Makefile | sed "s/Makefile//g"` - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - mkdir -p bin - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - rm -rf bin/ - @set -e; for i in $(SUBDIRS) ; do $(MAKE) -C $$i clean ; done - +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/io/aio/aio01/Makefile b/testcases/kernel/io/aio/aio01/Makefile index 23b3f0f2..8f57f9b9 100644 --- a/testcases/kernel/io/aio/aio01/Makefile +++ b/testcases/kernel/io/aio/aio01/Makefile @@ -20,20 +20,11 @@ # name of file : Makefile # # description : make(1) description file # ########################################################################### -include ../../../../../config.mk -CFLAGS+= -I../../../../../include -Wall -LOADLIBES+= $(AIO_LIBS) -L../../../../../lib -lltp +top_srcdir ?= ../../../../.. -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +LDLIBS += $(AIO_LIBS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/io/aio/aio02/Makefile b/testcases/kernel/io/aio/aio02/Makefile dissimilarity index 98% index 6ab7d461..e897d841 100644 --- a/testcases/kernel/io/aio/aio02/Makefile +++ b/testcases/kernel/io/aio/aio02/Makefile @@ -1,20 +1,38 @@ -include ../../../../../config.mk -# foo. -TEST_SRCS:=$(shell find cases/ -name \*.c | sort -n -t/ -k2) -PROGS:=$(patsubst %.c,%,$(TEST_SRCS)) -HARNESS_SRCS:=main.c -# io_queue.c - -CFLAGS+=-Wall -g -O -I../../../../../include -Wall -LDFLAGS+=-L../../../../../lib -lltp $(AIO_LIBS) -#-lpthread -lrt -all: $(PROGS) - -$(PROGS): %: %.c $(HARNESS_SRCS) Makefile - $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c $(LDFLAGS) - -clean: - rm -f $(PROGS) *.o runtests.out rofile wofile rwfile - -install: - +# +# kernel/io/aio/aio2 testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +# Needed for common.h... +CPPFLAGS += -D_GNU_SOURCE + +INSTALL_TARGETS := runfstests.sh + +LDLIBS += $(AIO_LIBS) + +FILTER_OUT_MAKE_TARGETS := main + +include $(top_srcdir)/include/mk/generic_leaf_target.mk + +$(MAKE_TARGETS): %: %.o main.o diff --git a/testcases/kernel/io/aio/aio02/aio_tio.c b/testcases/kernel/io/aio/aio02/aio_tio.c new file mode 100644 index 00000000..e0bb3961 --- /dev/null +++ b/testcases/kernel/io/aio/aio02/aio_tio.c @@ -0,0 +1,279 @@ +/************************************************************************************* +* +* Copyright (c) International Business Machines Corp., 2003 +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +* the GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, +* +* FILE : aio_tio +* USAGE : runfstest case/aio_tio +* +* DESCRIPTION : This program will test Asynchronous I/O for 2.5 Kernel infrastructure +* REQUIREMENTS: +* 1) libaio-0.3.92 or up for 2.5 kernal +* 2) glibc 2.1.91 or up +* HISTORY : +* 11/03/2003 Kai Zhao (ltcd3@cn.ibm.com) +* +* CODE COVERAGE: +* 68.3% - fs/aio.c +* +************************************************************************************/ + +#include "config.h" +#include "common.h" +#include "test.h" +#include +#include + +#if HAVE_LIBAIO_H + +#define AIO_MAXIO 32 +#define AIO_BLKSIZE (64*1024) + +static int alignment = 512; +static int wait_count = 0; + +/* + * write work done + */ +static void work_done(io_context_t ctx, struct iocb *iocb, long res, long res2) +{ + + if (res2 != 0) { + io_error("aio write", res2); + } + + if (res != iocb->u.c.nbytes) { + fprintf(stderr, "write missed bytes expect %lu got %ld\n", + iocb->u.c.nbytes, res2); + exit(1); + } + wait_count --; +} + +/* + * io_wait_run() - wait for an io_event and then call the callback. + */ +int io_wait_run(io_context_t ctx, struct timespec *to) +{ + struct io_event events[AIO_MAXIO]; + struct io_event *ep; + int ret, n; + + /* + * get up to aio_maxio events at a time. + */ + ret = n = io_getevents(ctx, 1, AIO_MAXIO, events, to); + + /* + * Call the callback functions for each event. + */ + for (ep = events ; n-- > 0 ; ep++) { + io_callback_t cb = (io_callback_t)ep->data ; struct iocb *iocb = ep->obj ; cb(ctx, iocb, ep->res, ep->res2); + } + return ret; +} + + +int io_tio(char *pathname, int flag, int n, int operation) +{ + int res, fd = 0, i = 0; + void * bufptr = NULL; + off_t offset = 0; + struct timespec timeout; + + io_context_t myctx; + struct iocb iocb_array[AIO_MAXIO]; + struct iocb *iocbps[AIO_MAXIO]; + + fd = open (pathname, flag, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fd <= 0) { + printf("open for %s failed: %s\n", pathname, strerror(errno)); + return -1; + } + + res = io_queue_init(n, &myctx); + //printf (" res = %d \n", res); + + for (i = 0 ; i < AIO_MAXIO ; i ++) { + + switch (operation) { + case IO_CMD_FSYNC : + case IO_CMD_FDSYNC : + case IO_CMD_PWRITE : + if (posix_memalign (&bufptr, alignment, AIO_BLKSIZE)) { + perror (" posix_memalign failed "); + return -1; + } + memset (bufptr, 0, AIO_BLKSIZE); + + io_prep_pwrite (&iocb_array[i], fd, bufptr , + AIO_BLKSIZE, offset); + io_set_callback(&iocb_array[i], work_done); + iocbps[i] = &iocb_array[i]; + offset += AIO_BLKSIZE; + + break; + case IO_CMD_PREAD : + if (posix_memalign (&bufptr, alignment, AIO_BLKSIZE)) { + perror (" posix_memalign failed "); + return -1; + } + memset (bufptr, 0, AIO_BLKSIZE); + + io_prep_pread (&iocb_array[i], fd, bufptr , + AIO_BLKSIZE, offset); + io_set_callback(&iocb_array[i], work_done); + iocbps[i] = &iocb_array[i]; + offset += AIO_BLKSIZE; + break; + case IO_CMD_POLL : + case IO_CMD_NOOP : + break; + default: + tst_resm (TFAIL, + "Command failed; opcode returned: %d\n", + operation); + return -1; + break; + } + } + + do { + res = io_submit(myctx, AIO_MAXIO, iocbps); + } while (res == -EAGAIN); + if (res < 0) { + io_error("io_submit tio", res); + } + + /* + * We have submitted all the i/o requests. Wait for at least one to complete + * and call the callbacks. + */ + wait_count = AIO_MAXIO; + + timeout.tv_sec = 30; + timeout.tv_nsec = 0; + + switch (operation) { + case IO_CMD_PREAD : + case IO_CMD_PWRITE : + { + while (wait_count) { + res = io_wait_run(myctx, &timeout); + if (res < 0) + io_error("io_wait_run", res); + } + } + break; + case IO_CMD_FSYNC : + for (i = 0 ; i < AIO_MAXIO ; i ++) { + res = io_fsync(myctx, iocbps[i], work_done, fd); + if (res < 0) { + io_error("io_fsync write", res); + } + } + break; + case IO_CMD_FDSYNC : + for (i = 0 ; i < AIO_MAXIO ; i ++) { + res = io_fdsync(myctx, iocbps[i], work_done, fd); + if (res < 0) { + io_error("io_fsync write", res); + } + } + break; + } + + + close (fd); + + for (i = 0 ; i < AIO_MAXIO ; i ++) { + if (iocb_array[i].u.c.buf != NULL) { + free (iocb_array[i].u.c.buf); + } + } + + io_queue_release (myctx); + + return 0; +} + +int test_main(void) +{ + int status = 0 ; + + tst_resm(TINFO, "Running test 1\n"); + status = io_tio("testdir/file1", + O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE, + AIO_MAXIO, IO_CMD_PWRITE); + if (status) { + return status; + } + + tst_resm(TINFO, "Running test 2\n"); + status = io_tio("testdir/file1", O_RDONLY | O_DIRECT | O_LARGEFILE, + AIO_MAXIO, IO_CMD_PREAD); + if (status) { + return status; + } + + tst_resm(TINFO, "Running test 3\n"); + status = io_tio("testdir/file1", O_TRUNC | O_RDWR, + AIO_MAXIO, IO_CMD_PWRITE); + if (status) { + return status; + } + + tst_resm(TINFO, "Running test 4\n"); + status = io_tio("testdir/file1", O_RDWR, + AIO_MAXIO, IO_CMD_PREAD); + if (status) { + return status; + } + + tst_resm(TINFO, "Running test 5\n"); + status = io_tio("testdir/file1", O_TRUNC | O_WRONLY, + AIO_MAXIO, IO_CMD_PWRITE); + if (status) { + return status; + } + + tst_resm(TINFO, "Running test 6 \n"); + status = io_tio("testdir/file1", O_RDONLY, + AIO_MAXIO, IO_CMD_PREAD); + if (status) { + return status; + } + + tst_resm(TINFO, "Running test 7 \n"); + status = io_tio("testdir/file2", + O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE, + AIO_MAXIO, IO_CMD_FSYNC); + if (status) { + return status; + } + + tst_resm(TINFO, "Running test 8 \n"); + status = io_tio("testdir/file2", + O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE, + AIO_MAXIO, IO_CMD_FDSYNC); + if (status) { + return status; + } + + return status; +} + +#endif diff --git a/testcases/kernel/io/aio/aio02/cases/aio_tio.c b/testcases/kernel/io/aio/aio02/cases/aio_tio.c deleted file mode 100644 index 39862582..00000000 --- a/testcases/kernel/io/aio/aio02/cases/aio_tio.c +++ /dev/null @@ -1,281 +0,0 @@ -/************************************************************************************* -* -* Copyright (c) International Business Machines Corp., 2003 -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -* the GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, -* -* FILE : aio_tio -* USAGE : runfstest case/aio_tio -* -* DESCRIPTION : This program will test Asynchronous I/O for 2.5 Kernel infrastructure -* REQUIREMENTS: -* 1) libaio-0.3.92 or up for 2.5 kernal -* 2) glibc 2.1.91 or up -* HISTORY : -* 11/03/2003 Kai Zhao (ltcd3@cn.ibm.com) -* -* CODE COVERAGE: -* 68.3% - fs/aio.c -* -************************************************************************************/ - -#include "common.h" -#define AIO_MAXIO 32 -#define AIO_BLKSIZE (64*1024) -static int alignment = 512; -static int wait_count = 0; - - -/* - * write work done - * - */ -static void work_done(io_context_t ctx, struct iocb *iocb, long res, long res2) -{ - - if (res2 != 0) { - io_error("aio write", res2); - } - - if (res != iocb->u.c.nbytes) { - fprintf(stderr, "write missed bytes expect %lu got %ld\n", - iocb->u.c.nbytes, res2); - exit(1); - } - wait_count --; -} - -/* - * io_wait_run() - wait for an io_event and then call the callback. - */ -int io_wait_run(io_context_t ctx, struct timespec *to) -{ - struct io_event events[AIO_MAXIO]; - struct io_event *ep; - int ret, n; - - /* - * get up to aio_maxio events at a time. - */ - ret = n = io_getevents( ctx, 1, AIO_MAXIO, events, to ); - - /* - * Call the callback functions for each event. - */ - for ( ep = events ; n-- > 0 ; ep++ ) { - io_callback_t cb = ( io_callback_t)ep->data ; struct iocb *iocb = ep->obj ; cb(ctx, iocb, ep->res, ep->res2); - } - return ret; -} - - -int io_tio(char *pathname , int flag , int n , int operation) -{ - int res , fd = 0 , i = 0; - void * bufptr = NULL; - off_t offset = 0; - struct timespec timeout; - - io_context_t myctx; - struct iocb iocb_array[AIO_MAXIO]; - struct iocb *iocbps[AIO_MAXIO]; - - fd = open ( pathname , flag, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if ( fd <= 0 ) { - perror ( " open : file " ); - return -1; - } - - res = io_queue_init(n, &myctx); - //printf ( " res = %d \n", res); - - for ( i = 0 ; i < AIO_MAXIO ; i ++ ) { - - switch (operation) { - case IO_CMD_FSYNC : - case IO_CMD_FDSYNC : - case IO_CMD_PWRITE : - { - if ( posix_memalign ( &bufptr , alignment , AIO_BLKSIZE )) { - perror ( " posix_memalign failed " ); - return -1; - } - memset ( bufptr , 0 , AIO_BLKSIZE ); - - io_prep_pwrite ( &iocb_array[i] , fd , bufptr , AIO_BLKSIZE , offset ); - io_set_callback( &iocb_array[i] , work_done ); - iocbps[i] = &iocb_array[i]; - offset += AIO_BLKSIZE; - } - break; - case IO_CMD_PREAD : - { - if ( posix_memalign ( &bufptr , alignment , AIO_BLKSIZE )) { - perror ( " posix_memalign failed " ); - return -1; - } - memset ( bufptr , 0 , AIO_BLKSIZE ); - - io_prep_pread ( &iocb_array[i] , fd , bufptr , AIO_BLKSIZE , offset ); - io_set_callback( &iocb_array[i] , work_done ); - iocbps[i] = &iocb_array[i]; - offset += AIO_BLKSIZE; - } - break; - case IO_CMD_POLL : - { - - } - break; - case IO_CMD_NOOP : - { - - } - break; - default: - { - fprintf ( stderr , "CMD Failed \n" ); - return -1; - } - break; - } - } - - do { - res = io_submit(myctx , AIO_MAXIO , iocbps); - } while (res == -EAGAIN); - if (res < 0 ) { - io_error("io_submit tio", res); - } - - /* - * We have submitted all the i/o requests. Wait for at least one to complete - * and call the callbacks. - */ - wait_count = AIO_MAXIO; - - timeout.tv_sec = 30; - timeout.tv_nsec = 0; - - switch ( operation ) { - case IO_CMD_PREAD : - case IO_CMD_PWRITE : - { - while ( wait_count ) { - res = io_wait_run( myctx , &timeout ); - if ( res < 0 ) - io_error("io_wait_run", res); - } - } - break; - case IO_CMD_FSYNC : - { - for ( i = 0 ; i < AIO_MAXIO ; i ++ ) { - res = io_fsync( myctx , iocbps[i] , work_done , fd); - if ( res < 0 ) { - io_error("io_fsync write", res); - } - } - } - break; - case IO_CMD_FDSYNC : - { - for ( i = 0 ; i < AIO_MAXIO ; i ++ ) { - res = io_fdsync( myctx , iocbps[i] , work_done , fd); - if ( res < 0 ) { - io_error("io_fsync write", res); - } - } - } - break; - default : - { - - } - break; - } - - - close ( fd ); - - for ( i = 0 ; i < AIO_MAXIO ; i ++ ) { - if ( iocb_array[i].u.c.buf != NULL ) { - free ( iocb_array[i].u.c.buf ); - } - } - - io_queue_release ( myctx ); - - return 0; -} - -int test_main(void) -{ - int status = 0 ; - //char *filepath = "testdir/file1"; - - printf("running test 1 \n"); - status = io_tio( "testdir/file1" , O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE , AIO_MAXIO , IO_CMD_PWRITE); - if ( status ) { - return status; - } - - printf("running test 2 \n"); - status = io_tio( "testdir/file1" , O_RDONLY | O_DIRECT | O_LARGEFILE , AIO_MAXIO , IO_CMD_PREAD); - if ( status ) { - return status; - } - - printf("running test 3 \n"); - status = io_tio( "testdir/file1" , O_TRUNC | O_RDWR , AIO_MAXIO , IO_CMD_PWRITE ); - if ( status ) { - return status; - } - - printf("running test 4 \n"); - status = io_tio( "testdir/file1" , O_RDWR , AIO_MAXIO , IO_CMD_PREAD ); - if ( status ) { - return status; - } - - printf("running test 5 \n"); - status = io_tio( "testdir/file1" , O_TRUNC | O_WRONLY , AIO_MAXIO , IO_CMD_PWRITE ); - if ( status ) { - return status; - } - - printf("running test 6 \n"); - status = io_tio( "testdir/file1" , O_RDONLY , AIO_MAXIO , IO_CMD_PREAD ); - if ( status ) { - return status; - } - - printf("running test 7 \n"); - status = io_tio( "testdir/file2" , O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE , - AIO_MAXIO , IO_CMD_FSYNC); - if ( status ) { - return status; - } - - printf("running test 8 \n"); - status = io_tio( "testdir/file2" , O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE , - AIO_MAXIO , IO_CMD_FDSYNC); - if ( status ) { - return status; - } - - return status; -} - diff --git a/testcases/kernel/io/aio/aio02/cases/common.h b/testcases/kernel/io/aio/aio02/cases/common.h index 2f586f6b..fd8d9210 100644 --- a/testcases/kernel/io/aio/aio02/cases/common.h +++ b/testcases/kernel/io/aio/aio02/cases/common.h @@ -2,13 +2,19 @@ #include #include #include +#include #include #include #include #include +#if HAVE_LIBAIO_H #include +#endif #include #include +#include +#include +#include /* Fatal error handler */ static void io_error(const char *func, int rc) diff --git a/testcases/kernel/io/aio/aio02/common.h b/testcases/kernel/io/aio/aio02/common.h new file mode 100644 index 00000000..6962e901 --- /dev/null +++ b/testcases/kernel/io/aio/aio02/common.h @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#include +#include +#include +#if HAVE_LIBAIO_H +#include +#endif +#include +#include +#include +#include +#include + +/* Fatal error handler */ +static void io_error(const char *func, int rc) +{ + if (rc == -ENOSYS) + fprintf(stderr, "AIO not in this kernel\n"); + else if (rc < 0) + fprintf(stderr, "%s: %s\n", func, strerror(-rc)); + else + fprintf(stderr, "%s: error %d\n", func, rc); + + exit(1); +} diff --git a/testcases/kernel/io/aio/aio02/main.c b/testcases/kernel/io/aio/aio02/main.c index 5dae3e82..80d375bc 100644 --- a/testcases/kernel/io/aio/aio02/main.c +++ b/testcases/kernel/io/aio/aio02/main.c @@ -1,4 +1,3 @@ -#define _GNU_SOURCE #include #include #include @@ -8,35 +7,30 @@ #include #include #include "test.h" +#include "usctest.h" #include "config.h" -#ifdef HAVE_LIBAIO_H +#define TEST_NAME "aio_tio" -#include +char *TCID = "aio02/" TEST_NAME; +int TST_TOTAL = 0; -char test_name[] = TEST_NAME; +#if HAVE_LIBAIO_H + +#include -#include TEST_NAME +int test_main(void); int main(void) { - int res; - - res = test_main(); - printf("test %s completed %s.\n", test_name, - res ? "FAILED" : "PASSED" - ); - fflush(stdout); - return res ? 1 : 0; + test_main(); + tst_exit(); } #else -char *TCID = "aio02/" TEST_NAME; -int TST_TOTAL=0; - int main(void) { - tst_brkm(TCONF, tst_exit, "libaio missing"); - return 0; + tst_brkm(TCONF, tst_exit, "libaio missing"); + /* NOTREACHED */ + return 0; } - #endif diff --git a/testcases/kernel/io/direct_io/Makefile b/testcases/kernel/io/direct_io/Makefile dissimilarity index 99% index 8c6598ac..af6f308e 100644 --- a/testcases/kernel/io/direct_io/Makefile +++ b/testcases/kernel/io/direct_io/Makefile @@ -1,58 +1,33 @@ -# -# Makefile for diotests -# -# History: -# 04/10/2002 nsharoff nsharoff@us.ibm.com -# - - -CFLAGS+= -O -Wall -DSHARED_OFILE -D_GNU_SOURCE -I../../../../include -L../../../../lib -LOADLIBES+= -lltp - -SRCS= diotest1.c diotest2.c diotest3.c diotest4.c diotest5.c \ - diotest6.c dma_thread_diotest7.c - -BINS= diotest1 diotest2 diotest3 diotest4 diotest5 \ - diotest6 dma_thread_diotest7 - -all: diotest_routines.o bins - -bins: $& $(BINS) - -diotest_routines.o: diotest_routines.c - $(CC) -c diotest_routines.c $(CFLAGS) - -diotest1: diotest1.c diotest_routines.o - $(CC) -o diotest1 diotest_routines.o diotest1.c $(CFLAGS) $(LDFLAGS) $(LOADLIBES) - rm -f diotest1.o - -diotest2: diotest2.c diotest_routines.o - $(CC) -o diotest2 diotest_routines.o diotest2.c $(CFLAGS) $(LDFLAGS) $(LOADLIBES) - rm -f diotest2.o - -diotest3: diotest3.c diotest_routines.o - $(CC) -o diotest3 diotest_routines.o diotest3.c $(CFLAGS) $(LDFLAGS) $(LOADLIBES) - rm -f diotest3.o - -diotest4: diotest4.c diotest_routines.o - $(CC) -o diotest4 diotest_routines.o diotest4.c $(CFLAGS) $(LDFLAGS) $(LOADLIBES) - rm -f diotest4.o - -diotest5: diotest5.c diotest_routines.o - $(CC) -o diotest5 diotest_routines.o diotest5.c $(CFLAGS) $(LDFLAGS) $(LOADLIBES) - rm -f diotest5.o - -diotest6: diotest6.c diotest_routines.o - $(CC) -o diotest6 diotest_routines.o diotest6.c $(CFLAGS) $(LDFLAGS) $(LOADLIBES) - rm -f diotest6.o - -dma_thread_diotest7: dma_thread_diotest7.c - $(CC) -g -o dma_thread_diotest7 dma_thread_diotest7.c -lpthread - -clean: - rm -f $(BINS) diotest_routines.o - -install: - ln -f $(BINS) ../../../bin - ln -f test_dma_thread_diotest7.sh ../../../bin/ - +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CFLAGS += -DSHARED_OFILE -D_GNU_SOURCE + +LDLIBS += -lpthread + +FILTER_OUT_MAKE_TARGETS := diotest_routines + +INSTALL_TARGETS := test_dma_thread_diotest7.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk + +$(MAKE_TARGETS): %: %.o diotest_routines.o diff --git a/testcases/kernel/io/direct_io/test_dma_thread_diotest7.sh b/testcases/kernel/io/direct_io/test_dma_thread_diotest7.sh index 6f897101..858a7c70 100755 --- a/testcases/kernel/io/direct_io/test_dma_thread_diotest7.sh +++ b/testcases/kernel/io/direct_io/test_dma_thread_diotest7.sh @@ -20,6 +20,10 @@ ## ## ################################################################################ +export TCID=dma_thread_diotest7 +export TST_TOTAL=3 +export TST_COUNT=3 + tst_resm TINFO "Generating Test Files" ./dma_thread_diotest7 diff --git a/testcases/kernel/io/disktest/Makefile b/testcases/kernel/io/disktest/Makefile index b47417b9..171b033b 100644 --- a/testcases/kernel/io/disktest/Makefile +++ b/testcases/kernel/io/disktest/Makefile @@ -23,8 +23,24 @@ # Project Website: TBD # # -# $Id: Makefile,v 1.11 2008/02/14 08:22:22 subrata_modak Exp $ +# $Id: Makefile,v 1.12 2009/10/09 17:55:48 yaberauneya Exp $ # $Log: Makefile,v $ +# Revision 1.12 2009/10/09 17:55:48 yaberauneya +# 1. Please see README.mk-devel for a full description of the changes +# from a Make perspective. +# 2. Several files were changed to accomodate correct installation +# practices, most notably ones in testcases/network/{ipv6,tcp_cmds}, +# testcases/kernel/sched/hyperthreading/ht_enabled/..., and some items +# in tools/..., and also to avoid collisions as far as installed +# testcases (scripts, compiled C apps) were concerned. +# 3. Several apps weren't autoconf safe and some autoconf tests and +# conditional statements have been placed in sourcecode and in Makefiles +# to either a) prevent the tests from being built / installed or b) turn +# the tests into dummy apps which print out TCONF messages due to +# lack-of-build support. +# +# Signed-off-by: Garrett Cooper +# # Revision 1.11 2008/02/14 08:22:22 subrata_modak # Disktest application update to version 1.4.2, by, Brent Yardley # @@ -157,56 +173,45 @@ # Made signal handler one function. code cleanup. # -# -D "_LARGE_FILES" is used in AIX to support 64bit functions and data types -# -D"_LARGEFILE64_SOURCE" -D"_FILE_OFFSET_BITS=64" is used in Linux to support 64bit functions and data types. -D"_GNU_SOURCE" is to support Linux O_DIRECT -# These are typically taken from rpm, but, if not, defined here. -bindir=/usr/bin -libdir=/usr/lib -sysconfdir=/etc -mandir=/usr/share/man +# 1. -D_LARGE_FILES is used in AIX to support 64bit functions and data types. +# 2. For Linux: +# i. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 is used in to support +# 64-bit functions and data types. +# ii. -D_GNU_SOURCE is to support Linux O_DIRECT. +# +# i. and ii. are typically taken from rpm, but, if not, are defined here. +# + +top_srcdir ?= ../../../.. -VER=`grep VER_STR main.h | awk -F\" '{print $$2}'` -GBLHDRS=main.h globals.h defs.h -ALLHDRS=$(wildcard *.h) -SRCS=$(wildcard *.c) -OBJS=$(SRCS:.c=.o) +include $(top_srcdir)/include/mk/env_pre.mk -CFLAGS += -g -Wall -O -D"LINUX" -D"_THREAD_SAFE" -D"_GNU_SOURCE" -D"_LARGE_FILES" -D"_LARGEFILE64_SOURCE" -D"_FILE_OFFSET_BITS=64" $(RPM_OPT_FLAGS) +VER := `grep VER_STR $(abs_srcdir)/main.h | awk -F\" '{print $$2}'` -all: $(OBJS) disktest +CPPFLAGS += -g -Wall -O -DLINUX -D_THREAD_SAFE -D_GNU_SOURCE -D_LARGE_FILES -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(RPM_OPT_FLAGS) -disktest: $(OBJS) $(SRCS) $(ALLHDRS) - $(CC) $(CFLAGS) -o disktest $(OBJS) $(LDFLAGS) -lpthread +DISTRO_FILES := Makefile* *.[ch] LICENSE README CHANGELOG -main.o: main.c $(ALLHDRS) -sfunc.o: sfunc.c sfunc.h $(GBLHDRS) -parse.o: parse.c parse.h sfunc.h $(GBLHDRS) -childmain.o: childmain.c childmain.h sfunc.h parse.h threading.h $(GBLHDRS) -threading.o: threading.c threading.h childmain.h sfunc.h $(GBLHDRS) -globals.o: globals.c threading.h $(GBLHDRS) -usage.o: usage.c usage.h -Getopt.o: Getopt.c Getopt.h -io.o: io.c io.h $(GBLHDRS) -dump.o: dump.c dump.h $(GBLHDRS) -timer.o: timer.c timer.h $(GBLHDRS) -stats.o: stats.c stats.h $(GBLHDRS) -signals.o: signals.c signals.h threading.h $(GBLHDRS) +LDLIBS += -lpthread -install: disktest - ln -f disktest ../../../bin +MAKE_TARGETS := disktest -clean: - rm -f disktest $(OBJS) +OBJS := $(patsubst $(abs_srcdir)/%.c,%.o,$(wildcard $(abs_srcdir)/*.c)) + +disktest-$(VER): + mkdir -p "$@" + +disktest: $(OBJS) + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION) all-clean: clean - rm -f *~ *tar* *zip* + $(RM) -rf *~ *tar* *zip* disktest-$(VER) -distro: all-clean +distro: all-clean | disktest-$(VER) mkdir -p disktest-$(VER)/man1 - cp ./Makefile* ./*.[ch] ./LICENSE ./README ./CHANGELOG disktest-$(VER) - cp ./man1/disktest.1 disktest-$(VER)/man1 - chmod 444 disktest-$(VER)/man1/disktest.1 + cp $(addprefix $(abs_srcdir)/,$(DISTRO_FILES)) disktest-$(VER)/. + install -m 00444 $(abs_srcdir)/man1/disktest.1 disktest-$(VER)/man1 gzip disktest-$(VER)/man1/disktest.1 - tar cvf ./disktest-$(VER).tar disktest-$(VER) - rm -rf disktest-$(VER) - gzip ./disktest-$(VER).tar + tar -cvzf disktest-$(VER).tar.gz disktest-$(VER) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/io/ltp-aiodio/Makefile b/testcases/kernel/io/ltp-aiodio/Makefile dissimilarity index 99% index 1e3bf79c..4d68c6d7 100644 --- a/testcases/kernel/io/ltp-aiodio/Makefile +++ b/testcases/kernel/io/ltp-aiodio/Makefile @@ -1,44 +1,30 @@ -CFLAGS+= -Wall -O -g -DAIO -I../../../../include -LDLIBS+= -L../../../../lib -laio -lltp - -TARGETS=ltp-diorh aiocp aiodio_append aiodio_sparse dio_append dio_sparse dio_truncate dirty read_checkzero aio-stress -SRCS=$(wildcard *.c) -OBJS=$(patsubst %.c,%.o,$(SRCS)) - -all: $(TARGETS) - -ltp-diorh: ltp-diorh.o - $(CC) -o $@ $^ -I. $(CFLAGS) $(LDLIBS) - -aiocp: aiocp.o - $(CC) -o $@ $^ -I. $(CFLAGS) $(LDLIBS) - -aiodio_append: aiodio_append.o - $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS) - -aiodio_sparse: aiodio_sparse.o - $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS) - -dio_append: dio_append.o - $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS) - -dio_sparse: dio_sparse.o - $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS) - -dio_truncate: dio_truncate.o - $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS) - -dirty: dirty.o - $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS) - -read_checkzero: read_checkzero.o - $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS) - -aio-stress: aio-stress.o - $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS) -lpthread - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(OBJS) $(TARGETS) +# +# kernel/io/ltp-aiodio 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. +# +# Garrett Cooper, July 2009 + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -DAIO -D_GNU_SOURCE + +LDLIBS += -lpthread $(AIO_LIBS) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/io/ltp-aiodio/aio-stress.c b/testcases/kernel/io/ltp-aiodio/aio-stress.c index cc91e6d8..037fcafd 100644 --- a/testcases/kernel/io/ltp-aiodio/aio-stress.c +++ b/testcases/kernel/io/ltp-aiodio/aio-stress.c @@ -66,10 +66,6 @@ #define IO_PENDING 1 #define RUN_FOREVER -1 -#ifndef O_DIRECT -#define O_DIRECT 040000 /* direct disk access hint */ -#endif - enum { WRITE, READ, diff --git a/testcases/kernel/io/ltp-aiodio/aiocp.c b/testcases/kernel/io/ltp-aiodio/aiocp.c index 3ab4752c..0a54e654 100644 --- a/testcases/kernel/io/ltp-aiodio/aiocp.c +++ b/testcases/kernel/io/ltp-aiodio/aiocp.c @@ -23,7 +23,6 @@ #define _GNU_SOURCE - #include #include #include @@ -33,6 +32,9 @@ #include #include #include +#include "config.h" + +#if HAVE_LIBAIO_H #include @@ -510,3 +512,13 @@ int main(int argc, char *const *argv) * rrrwwwwwwwrrrrwwrrrrrrrrrrrrwrwrrrrwwwwwwwwwwwwwwrwrrrrwwwwrwrrrrwrwwwrrrwww * rwwrrrrrrrwrrrrrrrrrrrrwwwwrrrwwwrwrrwwwwwwwwwwwwwwwwwwwwwrrrrrrrwwwwwwwrw */ + +#else + +int +main(void) { + fprintf(stderr, "System doesn't have libaio support.\n"); + return 1; +} + +#endif diff --git a/testcases/kernel/io/stress_cd/Makefile b/testcases/kernel/io/stress_cd/Makefile dissimilarity index 97% index 9caf72c3..af1e5619 100644 --- a/testcases/kernel/io/stress_cd/Makefile +++ b/testcases/kernel/io/stress_cd/Makefile @@ -1,14 +1,25 @@ -CFLAGS += -Wall -O -g -LDLIBS := -lpthread - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f $(TARGETS) ../../../bin - -clean: - rm -f $(TARGETS) - +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/io/stress_floppy/Makefile b/testcases/kernel/io/stress_floppy/Makefile dissimilarity index 97% index 8b940a12..0a590b33 100644 --- a/testcases/kernel/io/stress_floppy/Makefile +++ b/testcases/kernel/io/stress_floppy/Makefile @@ -1,13 +1,36 @@ -all: - -install: generate - ln -f stress_floppy ../../../bin - ln -f *_file ../../../bin - cp -rf dumpdir ../../../bin - - -generate: - ./generate.sh - -clean: - rm -rf 10*K_file dumpdir +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CLEAN_TARGETS := 10*K_file dumpdir + +INSTALL_DEPS := dumpdir + +MAKE_TARGETS := + +# dumpdir's a directory. +RM += -r + +dumpdir: + @mkdir -p "$@" + @$(SHELL) "$(abs_srcdir)/generate.sh" + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/io/stress_floppy/generate.sh b/testcases/kernel/io/stress_floppy/generate.sh dissimilarity index 93% index 1fce03fd..f89ce131 100755 --- a/testcases/kernel/io/stress_floppy/generate.sh +++ b/testcases/kernel/io/stress_floppy/generate.sh @@ -1,35 +1,26 @@ -#!/bin/sh - -COUNT=0 -FILE=1K_file -for the_file in `echo 10K_file 100K_file 1000K_file` -do - if [ -e $the_file ]; then continue; fi - echo "Creating $the_file" - while [ $COUNT -le 10 ] - do - cat $FILE >> $the_file - COUNT=$(( $COUNT + 1 )) - done - COUNT=0 - FILE=$the_file -done - -if [ ! -d dumpdir ]; then - mkdir dumpdir -fi - -`diff --brief 1K_file dumpdir/1K_file > /dev/null 2>&1` -if [ $? ]; then - cp 1K_file dumpdir -fi - -`diff --brief 10K_file dumpdir/10K_file > /dev/null 2>&1` -if [ $? ]; then - cp 10K_file dumpdir -fi - -`diff --brief 100K_file dumpdir/100K_file > /dev/null 2>&1` -if [ $? ]; then - cp 100K_file dumpdir -fi +#!/bin/sh + +COUNT=0 + +FILE=1K_file + +for i in 10K_file 100K_file 1000K_file; do + + [ -e "$i" ] && continue + + echo "Creating \`$i'" + + COUNT=0 + + while [ $COUNT -le 10 ]; do + cat "$FILE" >> "$i" + COUNT=$(( $COUNT + 1 )) + done + + FILE=$i + +done + +for i in 1K_file 10K_file 100K_file 1000K_file; do + diff --brief $i "dumpdir/$i" > /dev/null 2>&1 || cp "$i" dumpdir +done diff --git a/testcases/kernel/io/writetest/Makefile b/testcases/kernel/io/writetest/Makefile dissimilarity index 98% index eda9d63d..87166a30 100644 --- a/testcases/kernel/io/writetest/Makefile +++ b/testcases/kernel/io/writetest/Makefile @@ -1,12 +1,27 @@ -CFLAGS+=-Wall -O2 -g `getconf LFS_CFLAGS` -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE - -all: writetest - -writetest: writetest.c - $(CC) $(CFLAGS) $(LDFLAGS) writetest.c -o writetest - -install: - ln -f writetest ../../../bin - -clean: - $(RM) -f writetest +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CFLAGS += `getconf LFS_CFLAGS` -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE + +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/io/writetest/writetest.c b/testcases/kernel/io/writetest/writetest.c index b3749bc9..0c7c6ec7 100644 --- a/testcases/kernel/io/writetest/writetest.c +++ b/testcases/kernel/io/writetest/writetest.c @@ -43,6 +43,8 @@ #include #include +#include "test.h" + #define BLOCKSIZE (1024*1024) #define FILE_OUT "fileout" #define FILE_MODE 0644 @@ -52,22 +54,8 @@ int Verbosity = 0; int DefaultSeed = 0; char Filename[MAX_FILENAME_LEN] = FILE_OUT; off_t NumBlocks = 1; -const char *ProgramName = "writetest"; - - -inline void verbose(int level, const char *fmt, ...) - __attribute__((format (printf, 2, 3))); - -inline void verbose(int level, const char *fmt, ...) -{ - va_list ap; - if( Verbosity >= level ) { - va_start(ap, fmt); - vprintf(fmt, ap); - fflush(stdout); - va_end(ap); - } -} +char *TCID = "writetest"; +int TST_TOTAL = 2; void buf_init(void ) { @@ -95,12 +83,13 @@ int write_file(off_t num_blocks, const char *filename) fd = open(filename, O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE, FILE_MODE); if( fd < 0 ) { - perror(ProgramName); + perror(TCID); return(-1); } for(block=0; block 2) + tst_resm(TINFO, "Block: %lld/%lld (%3lld%%)\r", (long long int)block, (long long int)num_blocks, (long long int)(block*100/num_blocks)); buf_fill(buf); rv = write(fd, buf, BLOCKSIZE); if( rv != BLOCKSIZE ) { @@ -108,8 +97,8 @@ int write_file(off_t num_blocks, const char *filename) break; } } - verbose(3, "Block: %lld/%lld (%3lld%%)\r", (long long int)block, (long long int)num_blocks, (long long int)(block*100/num_blocks)); - verbose(3, "\n"); + if (Verbosity > 2) + tst_resm(TINFO, "Block: %lld/%lld (%3lld%%)\r", (long long int)block, (long long int)num_blocks, (long long int)(block*100/num_blocks)); close(fd); return(ret); } @@ -124,13 +113,14 @@ int verify_file(off_t num_blocks, const char *filename) fd = open(filename, O_RDONLY); if( fd < 0 ) { - perror(ProgramName); + perror(TCID); return(-1); } for(block=0; block 2) + tst_resm(TINFO, "Block: %lld/%lld (%3lld%%)\r", (long long int)block, (long long int)num_blocks, (long long int)(block*100/num_blocks)); buf_fill(buf_actual); rv = read(fd, buf_read, BLOCKSIZE); if( rv != BLOCKSIZE ) { @@ -142,22 +132,22 @@ int verify_file(off_t num_blocks, const char *filename) ba = buf_actual[n] & 0xff; br = buf_read[n] & 0xff; if( ba != br ) { - verbose(1, "Mismatch: block=%lld +%d bytes offset=%lld read: %02xh actual: %02xh\n", + if (Verbosity > 2) + tst_resm(TINFO, "Mismatch: block=%lld +%d bytes offset=%lld read: %02xh actual: %02xh\n", (long long int)block, n, (long long int)((block*BLOCKSIZE)+n), br, ba); ret++; } } } close(fd); - - verbose(3, "Block: %lld/%lld (%3lld%%)\r", (long long int)block, (long long int)num_blocks, (long long int)(block*100/num_blocks)); - verbose(3, "\n"); + if (Verbosity > 2) + tst_resm(TINFO, "Block: %lld/%lld (%3lld%%)\r", (long long int)block, (long long int)num_blocks, (long long int)(block*100/num_blocks)); return(ret); } void usage(void) { - printf("%s [-v] [-b blocks] [-s seed] [-o filename]\n", ProgramName); + printf("%s [-v] [-b blocks] [-s seed] [-o filename]\n", TCID); printf( "\n" " -v - increase verbosity level\n" @@ -170,8 +160,8 @@ void usage(void) void parse_args(int argc, char **argv) { int c; - ProgramName = argv[0]; - + TCID = argv[0]; + while(1) { int option_index = 0; static struct option long_options[] = { @@ -206,39 +196,49 @@ void parse_args(int argc, char **argv) } } +void setup() +{ + tst_tmpdir(); + +} + +void cleanup(void) +{ + tst_rmdir(); + tst_exit(); +} + int main(int argc, char *argv[]) { int rv; - int status = 0; + + setup(); DefaultSeed = time(NULL); parse_args(argc, argv); - verbose(2, "Blocks: %lld\n", (long long int)NumBlocks); - verbose(2, "Seed: %d\n", DefaultSeed); - verbose(2, "Output file: '%s'\n", Filename); + tst_resm(TINFO, "Blocks: %lld\n", (long long int)NumBlocks); + tst_resm(TINFO, "Seed: %d\n", DefaultSeed); + tst_resm(TINFO, "Output file: '%s'\n", Filename); - verbose(1, "Writing %lld blocks of %d bytes to '%s'\n", (long long int)NumBlocks, BLOCKSIZE, Filename); + tst_resm(TINFO, "Writing %lld blocks of %d bytes to '%s'\n", (long long int)NumBlocks, BLOCKSIZE, Filename); buf_init(); rv = write_file(NumBlocks, Filename); if( rv == 0 ) { - verbose(1, "Write: Success\n"); + tst_resm(TPASS, "Write: Success"); } else { - verbose(1, "Write: Failure\n"); - status = rv; + tst_resm(TFAIL, "Write: Failure"); } - verbose(1, "Verifing %lld blocks in '%s'\n", (long long int)NumBlocks, Filename); + tst_resm(TINFO, "Verifying %lld blocks in '%s'\n", (long long int)NumBlocks, Filename); buf_init(); rv = verify_file(NumBlocks, Filename); if( rv == 0 ) { - verbose(1, "Verify: Success\n"); + tst_resm(TPASS ,"Verify: Success\n"); } else { - verbose(1, "Verify: Failure\n"); - status = rv; - } - if( rv > 0 ) { - verbose(1, "Total mismatches: %d bytes\n", rv); + tst_resm(TFAIL, "Verify: Failure"); + tst_resm(TINFO, "Total mismatches: %d bytes\n", rv); } - return status; + cleanup(); + return 0; } diff --git a/testcases/kernel/ipc/Makefile b/testcases/kernel/ipc/Makefile dissimilarity index 98% index 5d7c05d9..10ae0e9b 100644 --- a/testcases/kernel/ipc/Makefile +++ b/testcases/kernel/ipc/Makefile @@ -1,10 +1,27 @@ -SUBDIRS = semaphore pipeio ipc_stress - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# kernel/ipc test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/ipc/ipc_stress/Makefile b/testcases/kernel/ipc/ipc_stress/Makefile dissimilarity index 98% index 99205329..c7a2a15b 100644 --- a/testcases/kernel/ipc/ipc_stress/Makefile +++ b/testcases/kernel/ipc/ipc_stress/Makefile @@ -1,14 +1,32 @@ -CFLAGS += -O -g -D_LINUX_ -Wall -LOADLIBES += -lpthread - -SRCS=$(wildcard *.c) - -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - cp run_semaphore_test_01.sh ../../../bin/run_semaphore_test_01.sh -clean: - rm -f $(TARGETS) +# +# testcases/kernel/ipc/ipc_stress 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -D_LINUX_ +LDLIBS += -lpthread + +INSTALL_TARGETS := run_semaphore_test_01.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/ipc/pipeio/Makefile b/testcases/kernel/ipc/pipeio/Makefile index d2a1d5f4..8e79d6bf 100644 --- a/testcases/kernel/ipc/pipeio/Makefile +++ b/testcases/kernel/ipc/pipeio/Makefile @@ -20,17 +20,11 @@ # name of file : Makefile # # description : make(1) description file for the send(2) tests. # ########################################################################### -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -LDLIBS += -L../../../../lib -lltp -lrt -lpthread -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) +top_srcdir ?= ../../../.. -all: $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; +LDLIBS += -lpthread -lrt -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/ipc/semaphore/Makefile b/testcases/kernel/ipc/semaphore/Makefile dissimilarity index 98% index 0063c490..7ee6189c 100644 --- a/testcases/kernel/ipc/semaphore/Makefile +++ b/testcases/kernel/ipc/semaphore/Makefile @@ -1,14 +1,30 @@ -CFLAGS += -Wall -I ../../../../include -I ../include -LDLIBS := -L ../../../../lib -lpthread -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - - -install: - set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# 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. +# +# Garrett 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/mem/Makefile b/testcases/kernel/mem/Makefile dissimilarity index 98% index 097874e5..ae4bd584 100644 --- a/testcases/kernel/mem/Makefile +++ b/testcases/kernel/mem/Makefile @@ -1,10 +1,44 @@ -SUBDIRS = hugetlb mem mmapstress mtest01 mtest05 mtest06 mtest07 page shmt vmtests - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# kernel/mem test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +LIBDIR := libmm +FILTER_OUT_DIRS := $(LIBDIR) +LIB := $(LIBDIR)/libmm.a + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all + +trunk-all: $(LIB) + +trunk-clean:: | lib-clean + +lib-clean:: $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/mem/Makefile.inc b/testcases/kernel/mem/Makefile.inc new file mode 100644 index 00000000..3f51e7a2 --- /dev/null +++ b/testcases/kernel/mem/Makefile.inc @@ -0,0 +1,39 @@ +# +# kernel/mem 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. +# +# Garrett Cooper, July 2009 +# + +# DO NOT USE THIS FILE FOR mem / libmm!!! + +LDLIBS += -lmm +LIBDIR := ../libmm +LIB := $(LIBDIR)/libmm.a + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all + +all: | $(LIB) + +LDFLAGS += -L$(LIBDIR) + +# vim: syntax=make diff --git a/testcases/kernel/mem/hugetlb/Makefile b/testcases/kernel/mem/hugetlb/Makefile index ca604d3c..756d6b88 100644 --- a/testcases/kernel/mem/hugetlb/Makefile +++ b/testcases/kernel/mem/hugetlb/Makefile @@ -16,26 +16,26 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -######################################################################### -# name of file : Makefile # -# description : make(1) description file # -######################################################################### -CFLAGS+=-I../../../../../include -g -Wall -LOADLIBES+=-L../../../../lib -lltp -TESTS=hugeshmget hugeshmat hugeshmdt hugeshmctl hugemmap - -all: $& $(TESTS) - @set -e; for i in lib $(TESTS); do \ - $(MAKE) -C $$i all; \ - done - -clean: - @set -e; for i in lib $(TESTS); do \ - $(MAKE) -C $$i clean; \ - done - -install: - @set -e; for i in lib $(TESTS); do \ - $(MAKE) -C $$i install; \ - done +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/env_pre.mk + +LDLIBS += -lmm +LIBDIR := lib +LIB := $(LIBDIR)/libipc_hugetlb.a +FILTER_OUT_DIRS := $(LIBDIR) + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all + +trunk-all: $(LIB) + +trunk-clean:: | lib-clean + +lib-clean:: $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/mem/hugetlb/Makefile.inc b/testcases/kernel/mem/hugetlb/Makefile.inc new file mode 100644 index 00000000..0e39f3e0 --- /dev/null +++ b/testcases/kernel/mem/hugetlb/Makefile.inc @@ -0,0 +1,46 @@ +# +# kernel/mem/hugetlb 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. +# +# Garrett Cooper, July 2009 +# + +# DO NOT USE THIS FILE FOR hugetlb / lib!!! +LIBIPCDIR := ../lib +LIBIPC := $(LIBIPCDIR)/libipc_hugetlb.a +LIBMMDIR := ../../libmm +LIBMM := $(LIBMMDIR)/libmm.a + +$(LIBIPCDIR) $(LIBMMDIR): %: + mkdir -p "$@" + +$(LIBMM): $(LIBMMDIR) + $(MAKE) -C "$^" -f "$(abs_srcdir)/$^/Makefile" all + +$(LIBIPC): $(LIBIPCDIR) + $(MAKE) -C "$^" -f "$(abs_srcdir)/$^/Makefile" all + +CPPFLAGS += -I$(abs_srcdir)/$(LIBMMDIR) -I$(abs_srcdir)/$(LIBIPCDIR) + +LDFLAGS += -L$(abs_builddir)/$(LIBMMDIR) -L$(abs_builddir)/$(LIBIPCDIR) + +LDLIBS += -lmm -lipc_hugetlb + +all: | $(LIBMM) $(LIBIPC) + +# vim: syntax=make diff --git a/testcases/kernel/mem/hugetlb/hugemmap/Makefile b/testcases/kernel/mem/hugetlb/hugemmap/Makefile dissimilarity index 98% index 034491b3..a1ba46e5 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/Makefile +++ b/testcases/kernel/mem/hugetlb/hugemmap/Makefile @@ -1,13 +1,27 @@ -CFLAGS += -I../../../../../include -g -Wall -LOADLIBES += -L../../../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/mem/hugetlb/hugemmap testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c index 892d24b9..a07b9aa0 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c @@ -55,7 +55,7 @@ #include "usctest.h" #define PAGE_SIZE ((1UL) << 12) /* Normal page size */ -#define HIGH_ADDR (void *)(0x10000000000) +#define HIGH_ADDR (void *)(0x1000000000000) char* TEMPFILE="mmapfile"; @@ -130,6 +130,7 @@ main(int ac, char **av) continue; } else { tst_resm(TPASS, "Normal mmap() into high region failed correctly"); + break; } close(fildes); diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/Makefile b/testcases/kernel/mem/hugetlb/hugeshmat/Makefile dissimilarity index 98% index f3cc1b15..a1ba46e5 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/Makefile +++ b/testcases/kernel/mem/hugetlb/hugeshmat/Makefile @@ -1,13 +1,27 @@ -CFLAGS += -I../lib -I../../../../../include -g -Wall -LOADLIBES += -L../../../../../lib -lltp -L../lib -lipc - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/mem/hugetlb/hugemmap testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/Makefile b/testcases/kernel/mem/hugetlb/hugeshmctl/Makefile dissimilarity index 98% index f3cc1b15..2f5b1609 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/Makefile +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/Makefile @@ -1,13 +1,27 @@ -CFLAGS += -I../lib -I../../../../../include -g -Wall -LOADLIBES += -L../../../../../lib -lltp -L../lib -lipc - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/mem/hugetlb/hugeshmctl testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/hugetlb/hugeshmdt/Makefile b/testcases/kernel/mem/hugetlb/hugeshmdt/Makefile dissimilarity index 98% index f3cc1b15..cea6939c 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmdt/Makefile +++ b/testcases/kernel/mem/hugetlb/hugeshmdt/Makefile @@ -1,13 +1,27 @@ -CFLAGS += -I../lib -I../../../../../include -g -Wall -LOADLIBES += -L../../../../../lib -lltp -L../lib -lipc - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/mem/hugetlb/hugeshmdt testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/Makefile b/testcases/kernel/mem/hugetlb/hugeshmget/Makefile dissimilarity index 99% index f3cc1b15..54b57091 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/Makefile +++ b/testcases/kernel/mem/hugetlb/hugeshmget/Makefile @@ -1,13 +1,23 @@ -CFLAGS += -I../lib -I../../../../../include -g -Wall -LOADLIBES += -L../../../../../lib -lltp -L../lib -lipc - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/hugetlb/lib/Makefile b/testcases/kernel/mem/hugetlb/lib/Makefile index eafa10b8..edfb7ffa 100644 --- a/testcases/kernel/mem/hugetlb/lib/Makefile +++ b/testcases/kernel/mem/hugetlb/lib/Makefile @@ -16,27 +16,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -######################################################################### -# name of file : Makefile # -# description : make(1) description file to build a library for the # -# common routines in the ipc(2) tests. # -######################################################################### -SRCS=libipc.c -OBJS=$(SRCS:.c=.o) -MAINS=libipc.a -CFLAGS+=-I../../../../../include -g -Wall -CFLAGS+=-D_USC_LIB_ +top_srcdir ?= ../../../../.. -all: libipc.a +include $(top_srcdir)/include/mk/env_pre.mk -libipc.a: $(OBJS) - $(AR) -rc $@ $(OBJS) - -$(OBJS): - $(CC) -c $(SRCS) $(CFLAGS) - -install: - -clean: - /bin/rm -rf $(OBJS) libipc.a +LIB := libipc_hugetlb.a +include $(top_srcdir)/include/mk/lib.mk diff --git a/testcases/kernel/mem/libmm/Makefile b/testcases/kernel/mem/libmm/Makefile index 28ad780f..2849686f 100644 --- a/testcases/kernel/mem/libmm/Makefile +++ b/testcases/kernel/mem/libmm/Makefile @@ -16,22 +16,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -########################################################################### -# name of file : Makefile # -# description : make(1) description file for the send(2) tests. # -########################################################################### -CFLAGS+= -I../../../../include -Wall -LOADLIBES+= -L../../../../lib -lltp -lmm +top_srcdir ?= ../../../.. -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/env_pre.mk +LIB := libmm.a +include $(top_srcdir)/include/mk/lib.mk diff --git a/testcases/kernel/mem/libmm/mm_core_apis.c b/testcases/kernel/mem/libmm/mm_core_apis.c index 3f04547c..0bf14c59 100644 --- a/testcases/kernel/mem/libmm/mm_core_apis.c +++ b/testcases/kernel/mem/libmm/mm_core_apis.c @@ -41,10 +41,12 @@ #include #include #include -#include #include "test.h" #include "usctest.h" +#if HAVE_MM_H +#include + #if !defined(TRUE) && !defined(FALSE) #define TRUE 1 #define FALSE 0 @@ -402,3 +404,9 @@ main(int argc, /* argument count */ } exit(ret); } +#else +int main(void) { + tst_resm(TCONF, "System doesn't have libmm support\n"); + tst_exit(); +} +#endif diff --git a/testcases/kernel/mem/mem/Makefile b/testcases/kernel/mem/mem/Makefile index e92d4a30..d3eb6efc 100644 --- a/testcases/kernel/mem/mem/Makefile +++ b/testcases/kernel/mem/mem/Makefile @@ -16,22 +16,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -########################################################################### -# name of file : Makefile # -# description : make(1) description file for the send(2) tests. # -########################################################################### -CFLAGS+= -Wall -I../../../../include -LOADLIBES+= -L../../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) - +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/mmapstress/Makefile b/testcases/kernel/mem/mmapstress/Makefile index 46d66ea5..e2ab4b27 100644 --- a/testcases/kernel/mem/mmapstress/Makefile +++ b/testcases/kernel/mem/mmapstress/Makefile @@ -16,23 +16,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -########################################################################### -# name of file : Makefile # -########################################################################### -CFLAGS+= -I../../../../include -O -g -Wall -#LARGEFILE support -#CFLAGS+= -I../../../../include -O -g -Wall -DLARGE_FILE -LOADLIBES+= -L../../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) - +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/mmapstress/mmapstress02.c b/testcases/kernel/mem/mmapstress/mmapstress02.c index a0f0693a..f801a2ee 100644 --- a/testcases/kernel/mem/mmapstress/mmapstress02.c +++ b/testcases/kernel/mem/mmapstress/mmapstress02.c @@ -101,7 +101,7 @@ main(int argc, char *argv[]) { return 1; } (void)time(&t); - if (!(fd = mkstemp(tmpname))) { + if ((fd = mkstemp(tmpname)) == -1) { ERROR("mkstemp failed"); anyfail(); } @@ -114,10 +114,6 @@ main(int argc, char *argv[]) { CATCH_SIG(SIGINT); CATCH_SIG(SIGQUIT); CATCH_SIG(SIGTERM); - if ((fd = open(tmpname, O_CREAT|O_RDWR, 0777)) == -1) { - ERROR("couldn't open temporary file"); - anyfail(); - } if (sbrk(2*pagesize - ((ulong)sbrk(0) & (pagesize-1))) == (char *)-1) { CLEANERROR("couldn't round up brk"); anyfail(); diff --git a/testcases/kernel/mem/mmapstress/mmapstress05.c b/testcases/kernel/mem/mmapstress/mmapstress05.c index 91558349..4d25b8d6 100644 --- a/testcases/kernel/mem/mmapstress/mmapstress05.c +++ b/testcases/kernel/mem/mmapstress/mmapstress05.c @@ -133,7 +133,7 @@ main(int argc, char *argv[]) -- sreeni */ - if (!(fd = mkstemp(tmpname))) { + if ((fd = mkstemp(tmpname))==-1) { ERROR("mkstemp failed"); anyfail(); } @@ -146,10 +146,6 @@ main(int argc, char *argv[]) CATCH_SIG(SIGINT); CATCH_SIG(SIGQUIT); CATCH_SIG(SIGTERM); - if ((fd = open(tmpname, O_RDWR|O_CREAT, 0777)) == -1) { - ERROR("open failed"); - anyfail(); - } for (i = 0; i < pagesize; i++) buf[i] = 'a'; if (write(fd, buf, pagesize) != pagesize) { diff --git a/testcases/kernel/mem/mtest01/Makefile b/testcases/kernel/mem/mtest01/Makefile dissimilarity index 98% index 87a1d558..5333ddc3 100644 --- a/testcases/kernel/mem/mtest01/Makefile +++ b/testcases/kernel/mem/mtest01/Makefile @@ -1,13 +1,27 @@ -CFLAGS += -Wall -I../../../../include -LOADLIBES+= -L../../../../lib -lltp - -SRCS:=$(wildcard *.c) -TARGETS:=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/mem/mtest01 testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/mtest05/Makefile b/testcases/kernel/mem/mtest05/Makefile dissimilarity index 98% index acae09b8..a44bc94c 100644 --- a/testcases/kernel/mem/mtest05/Makefile +++ b/testcases/kernel/mem/mtest05/Makefile @@ -1,14 +1,30 @@ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -LDLIBS += -lpthread -L../../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/mem/mtest05 testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/mtest06/Makefile b/testcases/kernel/mem/mtest06/Makefile dissimilarity index 98% index acae09b8..8c633ed1 100644 --- a/testcases/kernel/mem/mtest06/Makefile +++ b/testcases/kernel/mem/mtest06/Makefile @@ -1,14 +1,30 @@ -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -LDLIBS += -lpthread -L../../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/mem/mtest06 testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/mtest06/mmap1.c b/testcases/kernel/mem/mtest06/mmap1.c index ac638326..47ab49a2 100644 --- a/testcases/kernel/mem/mtest06/mmap1.c +++ b/testcases/kernel/mem/mtest06/mmap1.c @@ -92,7 +92,6 @@ /* read must be a success between map and unmap of the region. */ /* */ /******************************************************************************/ -/* Include Files. */ #include #include #include @@ -114,7 +113,6 @@ #include "test.h" #include "usctest.h" -/* Defines */ #define M_SUCCESS 0 /* exit code - on success, clone functions */ #define MWU_FAIL 1 /* error code - map_write_unmap() on error */ #define RM_FAIL 1 /* error code - read_mem() on error */ @@ -137,7 +135,6 @@ -/* Global Variables */ int verbose_print = FALSE;/* when called with -v print more info */ caddr_t *map_address; /* address of the file mapped. */ sigjmp_buf jmpbuf; /* argument to sigsetjmp and siglongjmp */ @@ -532,7 +529,7 @@ main(int argc, /* number of input parameters. */ if (verbose_print) tst_resm(TINFO, "Input parameters are: " "File size: %d; " - "Scheduled to run: %ld hours; " + "Scheduled to run: %lf hours; " "Number of mmap/write/read: %d", file_size, exec_time, num_iter); set_timer(exec_time); diff --git a/testcases/kernel/mem/mtest07/Makefile b/testcases/kernel/mem/mtest07/Makefile dissimilarity index 98% index c4ab9539..c4113051 100644 --- a/testcases/kernel/mem/mtest07/Makefile +++ b/testcases/kernel/mem/mtest07/Makefile @@ -1,13 +1,30 @@ -CFLAGS += -Wall -g -LDLIBS := -lpthread -lm - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/mem/mtest07 testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lm -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/page/Makefile b/testcases/kernel/mem/page/Makefile dissimilarity index 98% index 8241d8f7..dfa79e70 100644 --- a/testcases/kernel/mem/page/Makefile +++ b/testcases/kernel/mem/page/Makefile @@ -1,36 +1,30 @@ -# -# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -########################################################################### -# name of file : Makefile # -########################################################################### -CFLAGS+= -I../../../../include -g -O -Wall -DLINUX -LOADLIBES+= -L../../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) - - +# +# kernel/mem/page testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +CPPFLAGS += -DLINUX + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/shmt/Makefile b/testcases/kernel/mem/shmt/Makefile dissimilarity index 98% index 1f34d6da..f61d4633 100644 --- a/testcases/kernel/mem/shmt/Makefile +++ b/testcases/kernel/mem/shmt/Makefile @@ -1,34 +1,27 @@ -# -# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -########################################################################### -# name of file : Makefile # -########################################################################### -CFLAGS+= -I../../../../include -Wall -LOADLIBES+= -L../../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +# +# kernel/mem/shmt testcase Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/shmt/shmt05.c b/testcases/kernel/mem/shmt/shmt05.c index edb2a773..7b209f9c 100644 --- a/testcases/kernel/mem/shmt/shmt05.c +++ b/testcases/kernel/mem/shmt/shmt05.c @@ -57,7 +57,7 @@ key_t key[2]; int rm_shm(int); -int main() +int main(void) { int shmid, shmid1; char *cp, *cp1; @@ -97,7 +97,7 @@ int main() if (cp1 != (char *)-1) { perror("shmat"); tst_resm(TFAIL, - "Error: shmat: shmid1 = %d, addr= %#x, errno = %d\n", + "Error: shmat: shmid1 = %d, addr= %p, errno = %d\n", shmid1, cp1, errno); } else{ diff --git a/testcases/kernel/mem/shmt/shmt09.c b/testcases/kernel/mem/shmt/shmt09.c index e12a4d88..38bf2cd8 100644 --- a/testcases/kernel/mem/shmt/shmt09.c +++ b/testcases/kernel/mem/shmt/shmt09.c @@ -125,8 +125,8 @@ int main() c2 = (char *)shmat(shmid, vp, 0); if (c2 != (char *)-1) { tst_resm(TFAIL, - "ERROR: shmat: succeeded!: shmid = %d, shmaddr = 0x%08x, " - "att_addr = 0x%08x\n", shmid, c2, vp); + "ERROR: shmat: succeeded!: shmid = %d, shmaddr = %p, " + "att_addr = %p", shmid, c2, vp); rm_shm(shmid); tst_exit(); } @@ -173,7 +173,7 @@ int main() #else if ((vp = sbrk(INCREMENT)) != (void *)-1) { tst_resm(TFAIL, - "Error: sbrk succeeded! ret = 0x%08x, curbrk = 0x%08x, ", + "Error: sbrk succeeded! ret = %p, curbrk = %p, ", vp, sbrk(0)); rm_shm(shmid); tst_exit(); diff --git a/testcases/kernel/mem/vmtests/Makefile b/testcases/kernel/mem/vmtests/Makefile index 50d2d770..e2ab4b27 100644 --- a/testcases/kernel/mem/vmtests/Makefile +++ b/testcases/kernel/mem/vmtests/Makefile @@ -16,21 +16,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -########################################################################### -# name of file : Makefile # -########################################################################### -CFLAGS+= -I../../../../include -Wall -LDLIBS+= -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) - -.PHONY: all clean install +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/mem/vmtests/data_space.c b/testcases/kernel/mem/vmtests/data_space.c index a738c095..9d446866 100644 --- a/testcases/kernel/mem/vmtests/data_space.c +++ b/testcases/kernel/mem/vmtests/data_space.c @@ -89,7 +89,7 @@ int usage(prog) char *prog; { tst_resm(TCONF,"Usage: %s ",prog); - tst_resm(TCONF,"DEFAULTS: 10 1024*1024 4096 25", prog); + tst_resm(TCONF,"DEFAULTS: 10 1024*1024 4096 25"); tst_exit(); return 0; } @@ -323,7 +323,7 @@ int dotest(testers, me) { if (memcmp(buf, zero_buf, csize)) { - tst_resm(TFAIL, "\t%s[%d] bad verify @ %d (0x%x) for val %d count %d, should be 0x%x.\n", + tst_resm(TFAIL, "\t%s[%d] bad verify @ %d (%p) for val %d count %d, should be 0x%x.\n", prog, me, chunk, buf, val, count, val - 1); tst_resm(TINFO, "\tPrev "); dumpbuf(buf-csize); dumpbuf(buf); @@ -338,7 +338,7 @@ int dotest(testers, me) ++collide; if (memcmp(buf, val_buf, csize)) { - tst_resm(TFAIL, "\t%s[%d] bad verify @ %d (0x%x) for val %d count %d.\n", + tst_resm(TFAIL, "\t%s[%d] bad verify @ %d (%p) for val %d count %d.\n", prog, me, chunk, buf, val, count); tst_resm(TINFO, "\tPrev "); dumpbuf(buf-csize); dumpbuf(buf); diff --git a/testcases/kernel/mem/vmtests/stack_space.c b/testcases/kernel/mem/vmtests/stack_space.c index 91c08c8e..c5d15b45 100644 --- a/testcases/kernel/mem/vmtests/stack_space.c +++ b/testcases/kernel/mem/vmtests/stack_space.c @@ -78,7 +78,7 @@ char *prog; /* invoked name */ int usage(char* prog) { tst_resm(TCONF,"Usage: %s ",prog); - tst_resm(TCONF,"DEFAULTS: 20 1024 50", prog); + tst_resm(TCONF,"DEFAULTS: 20 1024 50"); tst_exit(); return 0; } @@ -275,7 +275,7 @@ int dotest(int testers, int me) if ((bits[chunk/8] & (1<<(chunk%8))) == 0) { if (memcmp(buf, zero_buf, csize)) { - tst_resm(TFAIL,"%s[%d] bad verify @ %d (0x%x) for val %d count %d, should be 0.\n", + tst_resm(TFAIL,"%s[%d] bad verify @ %d (%p) for val %d count %d, should be 0.\n", prog, me, chunk, buf, val, count); tst_resm(TINFO,"Prev "); dumpbuf(buf-csize); dumpbuf(buf); @@ -288,7 +288,7 @@ int dotest(int testers, int me) } else { ++collide; if (memcmp(buf, val_buf, csize)) { - tst_resm(TFAIL,"%s[%d] bad verify @ %d (0x%x) for val %d count %d.\n", + tst_resm(TFAIL,"%s[%d] bad verify @ %d (%p) for val %d count %d.\n", prog, me, chunk, buf, val, count); tst_resm(TINFO,"Prev "); dumpbuf(buf-csize); dumpbuf(buf); diff --git a/testcases/kernel/module/Makefile b/testcases/kernel/module/Makefile dissimilarity index 98% index 80bb3304..4e03b7a5 100644 --- a/testcases/kernel/module/Makefile +++ b/testcases/kernel/module/Makefile @@ -1,11 +1,30 @@ -SUBDIRS = delete_module - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - +# +# kernel/module test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +# Only delete_module works at this time... +SUBDIRS := delete_module + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/module/delete_module/Makefile b/testcases/kernel/module/delete_module/Makefile index e651cb50..abd796ba 100644 --- a/testcases/kernel/module/delete_module/Makefile +++ b/testcases/kernel/module/delete_module/Makefile @@ -14,40 +14,40 @@ # Temple Place - Suite 330, Boston MA 02111-1307, USA. # ########################################################################### -# name of file : Makefile # -# description : make file for the delete_module(2) testcases # +# name of file : Makefile # +# description : make file for the delete_module(2) testcases # ########################################################################### -EXTRA_CFLAGS+= -I../../../../include -Wall -MODCFLAGS+= /lib/modules/`uname -r`/build -LOADLIBES+= -L../../../../lib -lltp +top_srcdir ?= ../../../.. -obj-m := dummy_del_mod.o dummy_del_mod_dep.o -TARGETS=delete_module01 delete_module02 delete_module03 -MODULES=dummy_del_mod.ko dummy_del_mod_dep.ko +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - make -C $(MODCFLAGS) SUBDIRS=`pwd` modules -# chmod 755 $(OBJS) +CFLAGS += -D_GNU_SOURCE -delete_module01: delete_module01.c - $(CC) $(EXTRA_CFLAGS) delete_module01.c $(LOADLIBES) -o $@ +LOCALVERSION ?= $(shell uname -r) -delete_module02: delete_module02.c - $(CC) $(EXTRA_CFLAGS) delete_module02.c $(LOADLIBES) -o $@ +MODULEDIR := $(DESTDIR)/lib/modules/$(LOCALVERSION)/build -delete_module03: delete_module03.c - $(CC) $(EXTRA_CFLAGS) delete_module03.c $(LOADLIBES) -o $@ +# KBuild make variables... +MODCFLAGS += $(MODULEDIR) -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - @set -e; for i in $(MODULES); do cp -f $$i /tmp/$$i ; done +export EXTRA_CFLAGS := $(CFLAGS) +export EXTRA_CPPFLAGS := $(CPPFLAGS) +export EXTRA_LDFLAGS := $(LDFLAGS) -clean: - rm -f $(TARGETS) - rm -rf .tmp_versions - rm -f /tmp/dummy*.ko - rm -f .dummy* - rm -f *.o - rm -f *.ko - rm -f *.mod.c +obj-m := dummy_del_mod.o dummy_del_mod_dep.o +MODULES := dummy_del_mod.ko dummy_del_mod_dep.ko + +# New make infra variables... +CLEAN_TARGETS := .dummy* *.mod.c .tmp_version *.ko +INSTALL_TARGETS := $(MODULES) +MAKE_TARGETS := delete_module01 delete_module02 delete_module03 + +include $(top_srcdir)/include/mk/generic_leaf_target.mk + +$(MAKE_TARGETS): | make-module + +# KBuild will gripe because we redefine CFLAGS if KBUILD_NOPEDANTIC isn't set. +.PHONY: make-module +make-module: + make -C $(MODULEDIR) KBUILD_NOPEDANTIC=1 SUBDIRS=$(abs_srcdir) modules diff --git a/testcases/kernel/module/delete_module/delete_module01.c b/testcases/kernel/module/delete_module/delete_module01.c index 62dfc9d0..7b5da562 100644 --- a/testcases/kernel/module/delete_module/delete_module01.c +++ b/testcases/kernel/module/delete_module/delete_module01.c @@ -32,7 +32,7 @@ * * DESCRIPTION * This is a Phase I test for the delete_module(2) system call. - * It is intended to provide a limited exposure of the system call. + * It is intended to provide limited exposure of the system call. * * Setup: * Setup signal handling. @@ -44,8 +44,8 @@ * Loop if the proper options are given. * Create module entry * Execute system call - * Check return code, if system call failed (return=-1) - * Issue FAIL message with errno. + * Check return code, if system call failed (return=-1), + * issue a FAIL message with the errno. * Otherwise, Issue PASS message. * * Cleanup: @@ -54,128 +54,132 @@ * USAGE: * delete_module01 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t] * where, -c n : Run n copies concurrently. - * -e : Turn on errno logging. - * -f : Turn off functional testing - * -h : Show help screen - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -p : Pause for SIGUSR1 before starting - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. + * -e : Turn on errno logging. + * -f : Turn off functional testing + * -h : Show help screen + * -i n : Execute test n times. + * -I x : Execute test for x seconds. + * -p : Pause for SIGUSR1 before + * starting test. + * -P x : Pause for x seconds between + * iterations. + * -t : Turn on syscall timing. * ****************************************************************/ + +#include #include -//#include #include "test.h" #include "usctest.h" -extern int Tst_count; /* Test Case counter for tst_* routines */ +extern int Tst_count; /* TC counter for tst_* routines */ static void setup(void); static void cleanup(void); char *TCID = "delete_module01"; /* Test program identifier. */ -int TST_TOTAL=1; /* Total number of test cases. */ -//static char modname[20]; /* Name of the module */ - +int TST_TOTAL = 1; /* Total number of test cases. */ int main(int argc, char **argv) { - int lc; /* loop counter */ - char *msg; /* message returned from parse_opts */ - char cmd[PATH_MAX]; - char *module_name = "dummy_del_mod"; - - /* parse standard options */ - if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) != - (char *)NULL) { - tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); - } - - /* perform global setup for test */ - setup(); - - /* check looping state if -i option is given */ - for (lc = 0; TEST_LOOPING(lc); lc++) { - - /* reset Tst_count in case we are looping */ - Tst_count = 0; - - // Execute system call - sprintf(cmd, "/sbin/insmod /tmp/%s.ko", module_name); - - // Insmod the module - if ( (system( cmd )) != 0 ) { - tst_resm(TBROK, "Failed to load %s module", module_name); - printf("system() failed; cannot test init_module: errno=%i\n", - errno); - goto EXIT; - } - - /* Test the system call */ - TEST(delete_module(module_name)); - - /* check return code */ - if (TEST_RETURN == -1) { - tst_resm(TFAIL, "delete_module() failed to remove" - " module entry for %s, errno=%d : %s", - module_name, TEST_ERRNO, strerror(TEST_ERRNO)); - } else { - tst_resm(TPASS, "delete_module() successful, returned" - " %d", TEST_RETURN); - } - } - - /* perform global cleanup and exit */ + int lc; /* loop counter */ + char *msg; /* message returned from parse_opts */ + char cmd[PATH_MAX]; + char *module_name = "dummy_del_mod"; + + /* parse standard options */ + if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) != + (char *) NULL) { + tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); + } + + /* perform global setup for test */ + setup(); + + /* check looping state if -i option is given */ + for (lc = 0; TEST_LOOPING(lc); lc++) { + + /* reset Tst_count in case we are looping */ + Tst_count = 0; + + /* Execute system call */ + sprintf(cmd, "/sbin/insmod %s/%s.ko", dirname(argv[0]), + module_name); + + /* Insmod the module */ + if ( (system( cmd )) != 0 ) { + tst_resm(TBROK, "Failed to load %s module", + module_name); + printf("system() failed; cannot test init_module: " + "errno=%i\n", errno); + goto EXIT; + } + + /* Test the system call */ + TEST(delete_module(module_name)); + + /* check return code */ + if (TEST_RETURN == -1) { + tst_resm(TFAIL, "delete_module() failed to remove" + " module entry for %s, errno=%d : %s", + module_name, TEST_ERRNO, + strerror(TEST_ERRNO)); + } else { + tst_resm(TPASS, "delete_module() successful, returned" + " %d", TEST_RETURN); + } + + } + + /* perform global cleanup and exit */ EXIT: - cleanup(); - - /*NOTREACHED*/ - return 0; + cleanup(); + /*NOTREACHED*/ + return 0; -} /* End main */ +} /* End main */ /* setup() - performs all ONE TIME setup for this test */ void setup(void) { - /* capture signals */ - tst_sig(FORK, DEF_HANDLER, cleanup); - - /* Check whether we are root */ - if (geteuid() != 0) { - tst_brkm(TBROK, tst_exit, "Must be root for this test!"); - /*NOTREACHED*/ - } - - //if (tst_kvercmp(2,5,48) >= 0) - //tst_brkm(TCONF, tst_exit, "This test will not work on " - //"kernels after 2.5.48"); - - /* Pause if that option was specified - * TEST_PAUSE contains the code to fork the test with the -c option. - */ - TEST_PAUSE; + /* capture signals */ + tst_sig(FORK, DEF_HANDLER, cleanup); + + /* Check whether we are root */ + if (geteuid() != 0) { + tst_brkm(TBROK, tst_exit, "Must be root for this test!"); + /*NOTREACHED*/ + } + + /* + * if (tst_kvercmp(2,5,48) >= 0) + * tst_brkm(TCONF, tst_exit, "This test will not work on " + * "kernels after 2.5.48"); + */ + /* Pause if that option was specified + * TEST_PAUSE contains the code to fork the test with the -c option. + */ + TEST_PAUSE; } /* * cleanup() - * performs all ONE TIME cleanup for this test at - * completion or premature exit + * performs all ONE TIME cleanup for this test at + * completion or premature exit */ void cleanup(void) { - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ - TEST_CLEANUP; - - /* exit with return code appropriate for results */ - tst_exit(); - /*NOTREACHED*/ + /* + * print timing stats if that option was specified. + * print errno log if that option was specified. + */ + TEST_CLEANUP; + + /* exit with return code appropriate for results */ + tst_exit(); + /*NOTREACHED*/ } - diff --git a/testcases/kernel/module/delete_module/delete_module02.c b/testcases/kernel/module/delete_module/delete_module02.c index 5fd5c7c4..5de7cd76 100644 --- a/testcases/kernel/module/delete_module/delete_module02.c +++ b/testcases/kernel/module/delete_module/delete_module02.c @@ -32,8 +32,8 @@ * * DESCRIPTION * Verify that, - * 1. delete_module(2) returns -1 and sets errno to ENOENT for non-existing - * module entry. + * 1. delete_module(2) returns -1 and sets errno to ENOENT for nonexistent + * module entry. * 2. delete_module(2) returns -1 and sets errno to EINVAL, if module * name parameter is null terminated (zero length) string. * 3. delete_module(2) returns -1 and sets errno to EFAULT, if @@ -68,14 +68,16 @@ * USAGE: * delete_module02 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t] * where, -c n : Run n copies concurrently. - * -e : Turn on errno logging. - * -f : Turn off functional testing - * -h : Show help screen - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -p : Pause for SIGUSR1 before starting - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. + * -e : Turn on errno logging. + * -f : Turn off functional testing + * -h : Show help screen + * -i n : Execute test n times. + * -I x : Execute test for x seconds. + * -p : Pause for SIGUSR1 before + * starting test. + * -P x : Pause for x seconds between + * iterations. + * -t : Turn on syscall timing. * ****************************************************************/ @@ -84,38 +86,43 @@ #include #include #include -//#include +#if HAVE_LINUX_MODULE_H +#include +#else +/* As per http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/include/linux/moduleparam.h?a=ppc#L17 ... */ +#define MODULE_NAME_LEN ( 64 - sizeof(unsigned long) ) +#endif #include #include "test.h" #include "usctest.h" -#ifndef PAGE_SIZE -#define PAGE_SIZE sysconf(_SC_PAGE_SIZE) -#endif - extern int Tst_count; #define NULLMODNAME "" #define BASEMODNAME "dummy" -#define LONGMODNAMECHAR 'm' /* Arbitrarily selected */ -#define MODNAMEMAX (PAGE_SIZE + 1) +#define LONGMODNAMECHAR 'm' /* Arbitrarily selected */ #define EXP_RET_VAL -1 -struct test_case_t { /* test case structure */ - char *modname; - int experrno; /* expected errno */ - char *desc; - int (*setup)(void); /* Individual setup routine */ - void (*cleanup)(void); /* Individual cleanup routine */ +/* Test case structure */ +struct test_case_t { + char *modname; + /* Expected errno. */ + int experrno; + char *desc; + /* Individual setup routine. */ + int (*setup)(void); + /* Individual cleanup routine */ + void (*cleanup)(void); }; char *TCID = "delete_module02"; -static int exp_enos[] = {EPERM, EINVAL, ENOENT, EFAULT, ENAMETOOLONG, 0}; +static int exp_enos[] = { EPERM, EINVAL, ENOENT, EFAULT, ENAMETOOLONG, 0 }; static char nobody_uid[] = "nobody"; struct passwd *ltpuser; -static char longmodname[MODNAMEMAX]; +static char longmodname[MODULE_NAME_LEN]; static int testno; -static char modname[20]; /* Name of the module */ +/* Name of the module */ +static char modname[20]; char * bad_addr = 0; @@ -124,17 +131,20 @@ static void cleanup(void); static int setup1(void); static void cleanup1(void); +struct test_case_t; + static struct test_case_t tdat[] = { { modname, ENOENT, - "non-existing module", NULL, NULL}, + "nonexistent module", NULL, NULL}, { NULLMODNAME, ENOENT, - "null terminated module name", NULL, NULL}, - { (char *) -1, EFAULT, "module name outside program's " - "accessible address space", NULL, NULL}, + "null terminated module name", NULL, NULL}, + { (char *) -1, EFAULT, + "module name outside program's " + "accessible address space", NULL, NULL}, { longmodname, ENOENT, - "long module name", NULL, NULL}, + "long module name", NULL, NULL}, { modname, EPERM, - "non-superuser", setup1, cleanup1}, + "non-superuser", setup1, cleanup1}, }; int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]); @@ -142,145 +152,146 @@ int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]); int main(int argc, char **argv) { - int lc; /* loop counter */ - char *msg; /* message returned from parse_opts */ - - /* parse standard options */ - if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) != - (char *)NULL) { - tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); - } - - setup(); - - /* check looping state if -i option is given */ - for (lc = 0; TEST_LOOPING(lc); lc++) { - /* reset Tst_count in case we are looping */ - Tst_count = 0; - - for (testno = 0; testno < TST_TOTAL; ++testno) { - if( (tdat[testno].setup) && (tdat[testno].setup()) ) { - /* setup() failed, skip this test */ - continue; - } - - /* Test the system call */ - TEST(delete_module(tdat[testno].modname)); - TEST_ERROR_LOG(TEST_ERRNO); - printf("TEST_RETURN is %d, TEST_ERRNO is %d\n", TEST_RETURN, TEST_ERRNO); - if ( (TEST_RETURN == EXP_RET_VAL) && - (TEST_ERRNO == tdat[testno].experrno) ) { - tst_resm(TPASS, "Expected results for %s, " - "errno: %d", tdat[testno].desc, - TEST_ERRNO); - } else { - tst_resm(TFAIL, "Unexpected results for %s ; " - "returned %d (expected %d), errno %d " - "(expected %d)", tdat[testno].desc, - TEST_RETURN, EXP_RET_VAL, - TEST_ERRNO, tdat[testno].experrno); - } - if(tdat[testno].cleanup) { - tdat[testno].cleanup(); - } - } - } - cleanup(); - - /*NOTREACHED*/ - return 0; + int lc; /* loop counter */ + char *msg; /* message returned from parse_opts */ + + /* parse standard options */ + if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) != + (char *)NULL) { + tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); + } + + setup(); + + /* check looping state if -i option is given */ + for (lc = 0; TEST_LOOPING(lc); lc++) { + /* reset Tst_count in case we are looping */ + Tst_count = 0; + + for (testno = 0; testno < TST_TOTAL; ++testno) { + if( (tdat[testno].setup) && (tdat[testno].setup()) ) { + /* setup() failed, skip this test */ + continue; + } + /* Test the system call */ + TEST(delete_module(tdat[testno].modname)); + TEST_ERROR_LOG(TEST_ERRNO); + printf("TEST_RETURN is %d, TEST_ERRNO is %d\n", + TEST_RETURN, TEST_ERRNO); + if ( (TEST_RETURN == EXP_RET_VAL) && + (TEST_ERRNO == tdat[testno].experrno) ) { + tst_resm(TPASS, "Expected results for %s, " + "errno: %d", tdat[testno].desc, + TEST_ERRNO); + } else { + tst_resm(TFAIL, "Unexpected results for %s ; " + "returned %d (expected %d), " + "errno %d (expected %d)", + tdat[testno].desc, + TEST_RETURN, EXP_RET_VAL, + TEST_ERRNO, + tdat[testno].experrno); + } + if(tdat[testno].cleanup) { + tdat[testno].cleanup(); + } + } + } + cleanup(); + + /*NOTREACHED*/ + return 0; } int setup1(void) { - /* Change effective user id to nodody */ - if (seteuid(ltpuser->pw_uid) == -1) { - tst_resm(TBROK, "seteuid failed to set the effective" - " uid to %d", ltpuser->pw_uid); - return 1; - } - return 0; + /* Change effective user id to nodody */ + if (seteuid(ltpuser->pw_uid) == -1) { + tst_resm(TBROK, "seteuid failed to set the effective" + " uid to %d", ltpuser->pw_uid); + return 1; + } + return 0; } void cleanup1(void) { - /* Change effective user id to root */ - if (seteuid(0) == -1) { - tst_brkm(TBROK, tst_exit, "seteuid failed to set the effective" - " uid to root"); - } + /* Change effective user id to root */ + if (seteuid(0) == -1) { + tst_brkm(TBROK, tst_exit, "seteuid failed to set the effective" + " uid to root"); + } } /* * setup() - * performs all ONE TIME setup for this test + * performs all ONE TIME setup for this test */ void setup(void) { - /* capture signals */ - tst_sig(NOFORK, DEF_HANDLER, cleanup); - - /* Check whether it is root */ - if (geteuid() != 0) { - tst_brkm(TBROK, tst_exit, "Must be root for this test!"); - /*NOTREACHED*/ - } - - /*if (tst_kvercmp(2,5,48) >= 0) - tst_brkm(TCONF, tst_exit, "This test will not work on " - "kernels after 2.5.48"); - */ - - /* Check for nobody_uid user id */ - if( (ltpuser = getpwnam(nobody_uid)) == NULL) { - tst_brkm(TBROK, tst_exit, "Required user %s doesn't exists", - nobody_uid); - /*NOTREACHED*/ - } - - /* Initialize longmodname to LONGMODNAMECHAR character */ - memset(longmodname, LONGMODNAMECHAR, MODNAMEMAX - 1); - - /* set the expected errnos... */ - TEST_EXP_ENOS(exp_enos); - - /* Pause if that option was specified - * TEST_PAUSE contains the code to fork the test with the -c option. - */ - TEST_PAUSE; - - /* Get unique module name for each child process */ - if( sprintf(modname, "%s_%d",BASEMODNAME, getpid()) <= 0) { - tst_brkm(TBROK, tst_exit, "Failed to initialize module name"); - } - bad_addr = mmap(0, 1, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); + /* capture signals */ + tst_sig(NOFORK, DEF_HANDLER, cleanup); + + /* Check whether it is root */ + if (geteuid() != 0) { + tst_brkm(TBROK, tst_exit, "Must be root for this test!"); + /*NOTREACHED*/ + } + + /*if (tst_kvercmp(2,5,48) >= 0) + tst_brkm(TCONF, tst_exit, "This test will not work on " + "kernels after 2.5.48"); + */ + + /* Check for nobody_uid user id */ + if( (ltpuser = getpwnam(nobody_uid)) == NULL) { + tst_brkm(TBROK, tst_exit, "Required user %s doesn't exists", + nobody_uid); + /*NOTREACHED*/ + } + + /* Initialize longmodname to LONGMODNAMECHAR character */ + memset(longmodname, LONGMODNAMECHAR, MODULE_NAME_LEN - 1); + + /* set the expected errnos... */ + TEST_EXP_ENOS(exp_enos); + + /* Pause if that option was specified + * TEST_PAUSE contains the code to fork the test with the -c option. + */ + TEST_PAUSE; + + /* Get unique module name for each child process */ + if( sprintf(modname, "%s_%d", BASEMODNAME, getpid()) <= 0) { + tst_brkm(TBROK, tst_exit, "Failed to initialize module name"); + } + bad_addr = mmap(0, 1, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); if (bad_addr == MAP_FAILED) { - tst_brkm(TBROK, cleanup, "mmap failed"); - } - tdat[2].modname = bad_addr; + tst_brkm(TBROK, cleanup, "mmap failed"); + } + tdat[2].modname = bad_addr; } /* * cleanup() - * performs all ONE TIME cleanup for this test at - * completion or premature exit + * performs all ONE TIME cleanup for this test at + * completion or premature exit */ void cleanup(void) { - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ - TEST_CLEANUP; - - /* exit with return code appropriate for results */ - tst_exit(); - /*NOTREACHED*/ + /* + * print timing stats if that option was specified. + * print errno log if that option was specified. + */ + TEST_CLEANUP; + + /* exit with return code appropriate for results */ + tst_exit(); + /*NOTREACHED*/ } - diff --git a/testcases/kernel/module/delete_module/delete_module03.c b/testcases/kernel/module/delete_module/delete_module03.c dissimilarity index 60% index b35730e7..e498010b 100644 --- a/testcases/kernel/module/delete_module/delete_module03.c +++ b/testcases/kernel/module/delete_module/delete_module03.c @@ -1,238 +1,242 @@ -/* - * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - */ -/********************************************************** - * - * TEST IDENTIFIER : delete_module03 - * - * EXECUTED BY : root / superuser - * - * TEST TITLE : Checking error conditions for delete_module(2) - * - * TEST CASE TOTAL : 1 - * - * AUTHOR : Madhu T L - * - * SIGNALS - * Uses SIGUSR1 to pause before test if option set. - * (See the parse_opts(3) man page). - * - * DESCRIPTION - * Verify that, delete_module(2) returns -1 and sets errno to EBUSY, if - * tried to remove a module in-use. - * - * Setup: - * Setup signal handling. - * Test caller is super user - * Set expected errnos for logging - * Pause for SIGUSR1 if option specified. - * Insert loadable modules - * - * Test: - * Loop if the proper options are given. - * Execute system call - * Check return code and error number, if matching, - * Issue PASS message - * Otherwise, - * Issue FAIL message - * - * Cleanup: - * Print errno log and/or timing stats if options given - * - * USAGE: - * delete_module03 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t] - * where, -c n : Run n copies concurrently. (no effect) - * -e : Turn on errno logging. - * -f : Turn off functional testing - * -h : Show help screen - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -p : Pause for SIGUSR1 before starting - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - * RESTRICTIONS - * -c option has no effect for this testcase, even if used allows only - * one instance to run at a time. - * - * CHANGELOG - * - * 11/22/02 - Added "--force" to insmod options and redirected output to /dev/null. - * This was done to allow kernel mismatches, b/c it doesn't matter in - * this case. - * Robbie Williamson - * - ****************************************************************/ - -#include -#include -//#include -#include "test.h" -#include "usctest.h" - -extern int Tst_count; - -#define DUMMY_MOD "dummy_del_mod" -#define DUMMY_MOD_DEP "dummy_del_mod_dep" -#define EXP_RET_VAL -1 -#define EXP_ERRNO EWOULDBLOCK -//#define EXP_ERRNO EBUSY - -char *TCID = "delete_module03"; -//static int exp_enos[] = {EBUSY, 0}; -static int exp_enos[] = {EWOULDBLOCK, 0}; -int TST_TOTAL = 1; - -static int setup(void); -static void cleanup(void); - -int -main(int argc, char **argv) -{ - int lc; /* loop counter */ - char *msg; /* message returned from parse_opts */ - char cmd[50]; - - /* parse standard options */ - if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) != - (char *)NULL) { - tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); - } - - if(STD_COPIES != 1) { - tst_resm(TINFO, "-c option has no effect for this testcase - " - "doesn't allow running more than one instance " - "at a time"); - STD_COPIES = 1; - } - - /* Load first kernel module */ - if( sprintf(cmd, "/sbin/insmod /tmp/%s.ko", DUMMY_MOD) <= 0) { - tst_resm(TBROK, "sprintf failed"); - return 1; - } - if( (system(cmd)) != 0 ) { - tst_resm(TBROK, "Failed to load %s module", DUMMY_MOD); - return 1; - } - - /* Load dependant kernel module */ - if( sprintf(cmd, "/sbin/insmod /tmp/%s.ko", DUMMY_MOD_DEP) <= 0) { - tst_resm(TBROK, "sprintf failed"); - goto END; - } - if( (system(cmd)) != 0 ) { - tst_resm(TBROK, "Failed to load %s module", DUMMY_MOD_DEP); - goto END; - } - - tst_tmpdir(); - if(setup() != 0) { - return 1; - } - - /* check looping state if -i option is given */ - for (lc = 0; TEST_LOOPING(lc); lc++) { - /* reset Tst_count in case we are looping */ - Tst_count = 0; - - /* Test the system call */ - TEST(delete_module(DUMMY_MOD)); - - TEST_ERROR_LOG(TEST_ERRNO); - if ( (TEST_RETURN == (int) EXP_RET_VAL ) && - (TEST_ERRNO == EXP_ERRNO) ) { - tst_resm(TPASS, "Expected failure for module in-use, " - "errno: %d", TEST_ERRNO); - } else { - tst_resm(TFAIL, "Unexpected results for module in-use; " - "returned %d (expected %d), errno %d " - "(expected %d)", TEST_RETURN, EXP_RET_VAL, - TEST_ERRNO, EXP_ERRNO); - } - } - cleanup(); -END: - if(system("rmmod "DUMMY_MOD) != 0) { - tst_resm(TBROK, "Failed to unload %s module", DUMMY_MOD); - return 1; - } - - /*NOTREACHED*/ - return 0; -} - -/* - * setup() - * performs all ONE TIME setup for this test - */ -int -setup(void) -{ - /* capture signals */ - tst_sig(FORK, DEF_HANDLER, cleanup); - - /* Check whether it is root */ - if (geteuid() != 0) { - tst_resm(TBROK, "Must be root for this test!"); - return 1; - } - - /* - if (tst_kvercmp(2,5,48) >= 0) - tst_brkm(TCONF, tst_exit, "This test will not work on " - "kernels after 2.5.48"); - */ - - /* set the expected errnos... */ - TEST_EXP_ENOS(exp_enos); - - /* Pause if that option was specified - * TEST_PAUSE contains the code to fork the test with the -c option. - */ - TEST_PAUSE; - return 0; - -} - -/* - * cleanup() - * performs all ONE TIME cleanup for this test at - * completion or premature exit - */ -void -cleanup(void) -{ - /* Unload dependent kernel module */ - if(system("rmmod "DUMMY_MOD_DEP) != 0) { - tst_resm(TBROK, "Failed to unload %s module", - DUMMY_MOD_DEP); - } - /* Unload first kernel module */ - if(system("rmmod "DUMMY_MOD) != 0) { - tst_resm(TBROK, "Failed to unload %s module", - DUMMY_MOD); - } - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ - TEST_CLEANUP; - tst_rmdir(); - /* exit with return code appropriate for results */ - tst_exit(); - /*NOTREACHED*/ -} +/* + * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write the Free Software Foundation, Inc., 59 + * Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + */ +/********************************************************** + * + * TEST IDENTIFIER : delete_module03 + * + * EXECUTED BY : root / superuser + * + * TEST TITLE : Checking error conditions for delete_module(2) + * + * TEST CASE TOTAL : 1 + * + * AUTHOR : Madhu T L + * + * SIGNALS + * Uses SIGUSR1 to pause before test if option set. + * (See the parse_opts(3) man page). + * + * DESCRIPTION + * Verify that, delete_module(2) returns -1 and sets errno to EBUSY, if + * tried to remove a module in-use. + * + * Setup: + * Setup signal handling. + * Test caller is super user + * Set expected errnos for logging + * Pause for SIGUSR1 if option specified. + * Insert loadable modules + * + * Test: + * Loop if the proper options are given. + * Execute system call + * Check return code and error number, if matching, + * Issue PASS message + * Otherwise, + * Issue FAIL message + * + * Cleanup: + * Print errno log and/or timing stats if options given + * + * USAGE: + * delete_module03 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t] + * where, -c n : Run n copies concurrently. (no + * effect) + * -e : Turn on errno logging. + * -f : Turn off functional testing + * -h : Show help screen + * -i n : Execute test n times. + * -I x : Execute test for x seconds. + * -p : Pause for SIGUSR1 before + * starting + * -P x : Pause for x seconds between + * iterations. + * -t : Turn on syscall timing. + * + * RESTRICTIONS + * -c option has no effect for this testcase, even if used allows + * only one instance to run at a time. + * + * CHANGELOG + * + * 11/22/02 - Added "--force" to insmod options and redirected output to + * /dev/null. This was done to allow kernel mismatches, b/c it + * doesn't matter in this case. + * Robbie Williamson + * + ****************************************************************/ + +#include +#include +#include +#include "test.h" +#include "usctest.h" + +extern int Tst_count; + +#define DUMMY_MOD "dummy_del_mod" +#define DUMMY_MOD_DEP "dummy_del_mod_dep" +#define EXP_RET_VAL -1 +#define EXP_ERRNO EWOULDBLOCK +/*#define EXP_ERRNO EBUSY */ + +char *TCID = "delete_module03"; +/*static int exp_enos[] = {EBUSY, 0}; */ +static int exp_enos[] = {EWOULDBLOCK, 0}; +int TST_TOTAL = 1; + +static int setup(void); +static void cleanup(void); + +int +main(int argc, char **argv) +{ + int lc; /* loop counter */ + char *msg; /* message returned from parse_opts */ + char cmd[50]; + + /* parse standard options */ + if ((msg = parse_opts(argc, argv, (option_t*) NULL, NULL)) != + (char *) NULL) { + tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); + } + + if(STD_COPIES != 1) { + tst_resm(TINFO, "-c option has no effect for this testcase - " + "doesn't allow running more than one instance " + "at a time"); + STD_COPIES = 1; + } + + /* Load first kernel module */ + if( sprintf(cmd, "/sbin/insmod %s/%s.ko", dirname(argv[0]), + DUMMY_MOD) <= 0) { + tst_resm(TBROK, "sprintf failed"); + return 1; + } + if( (system(cmd)) != 0 ) { + tst_resm(TBROK, "Failed to load %s module", DUMMY_MOD); + return 1; + } + + /* Load dependant kernel module */ + if( sprintf(cmd, "/sbin/insmod %s/%s.ko", dirname(argv[0]), + DUMMY_MOD_DEP) <= 0) { + tst_resm(TBROK, "sprintf failed"); + goto END; + } + if( (system(cmd)) != 0 ) { + tst_resm(TBROK, "Failed to load %s module", DUMMY_MOD_DEP); + goto END; + } + + tst_tmpdir(); + if(setup() != 0) { + return 1; + } + + /* check looping state if -i option is given */ + for (lc = 0; TEST_LOOPING(lc); lc++) { + /* reset Tst_count in case we are looping */ + Tst_count = 0; + + /* Test the system call */ + TEST(delete_module(DUMMY_MOD)); + + TEST_ERROR_LOG(TEST_ERRNO); + if ( (TEST_RETURN == (int) EXP_RET_VAL ) && + (TEST_ERRNO == EXP_ERRNO) ) { + tst_resm(TPASS, "Expected failure for module in-use, " + "errno: %d", TEST_ERRNO); + } else { + tst_resm(TFAIL, "Unexpected results for module in-use; " + "returned %d (expected %d), errno %d " + "(expected %d)", TEST_RETURN, + EXP_RET_VAL, TEST_ERRNO, EXP_ERRNO); + } + } + cleanup(); +END: + if(system("rmmod "DUMMY_MOD) != 0) { + tst_resm(TBROK, "Failed to unload %s module", DUMMY_MOD); + return 1; + } + + /*NOTREACHED*/ + return 0; +} + +/* + * setup() + * performs all ONE TIME setup for this test + */ +int +setup(void) +{ + /* capture signals */ + tst_sig(FORK, DEF_HANDLER, cleanup); + + /* Check whether it is root */ + if (geteuid() != 0) { + tst_resm(TBROK, "Must be root for this test!"); + return 1; + } + + /* + if (tst_kvercmp(2,5,48) >= 0) + tst_brkm(TCONF, tst_exit, "This test will not work on " + "kernels after 2.5.48"); + */ + + /* set the expected errnos... */ + TEST_EXP_ENOS(exp_enos); + + /* Pause if that option was specified + * TEST_PAUSE contains the code to fork the test with the -c option. + */ + TEST_PAUSE; + return 0; + +} + +/* + * cleanup() + * performs all ONE TIME cleanup for this test at + * completion or premature exit + */ +void +cleanup(void) +{ + /* Unload dependent kernel module */ + if(system("rmmod "DUMMY_MOD_DEP) != 0) { + tst_resm(TBROK, "Failed to unload %s module", DUMMY_MOD_DEP); + } + /* Unload first kernel module */ + if(system("rmmod "DUMMY_MOD) != 0) { + tst_resm(TBROK, "Failed to unload %s module", + DUMMY_MOD); + } + /* + * print timing stats if that option was specified. + * print errno log if that option was specified. + */ + TEST_CLEANUP; + tst_rmdir(); + /* exit with return code appropriate for results */ + tst_exit(); + /*NOTREACHED*/ +} diff --git a/testcases/kernel/module/delete_module/dummy_del_mod.c b/testcases/kernel/module/delete_module/dummy_del_mod.c index 5328834d..ce5f993d 100644 --- a/testcases/kernel/module/delete_module/dummy_del_mod.c +++ b/testcases/kernel/module/delete_module/dummy_del_mod.c @@ -20,7 +20,10 @@ * setup. *************************************************************************/ +#ifndef MODULE #define MODULE +#endif + /* #define __KERNEL__ Commented this line out b/c it causes errors with * module.h when it calls /usr/include/linux/version.h * -11/22/02 Robbie Williamson diff --git a/testcases/kernel/module/delete_module/dummy_del_mod_dep.c b/testcases/kernel/module/delete_module/dummy_del_mod_dep.c index 8d25509d..b6595acd 100644 --- a/testcases/kernel/module/delete_module/dummy_del_mod_dep.c +++ b/testcases/kernel/module/delete_module/dummy_del_mod_dep.c @@ -21,7 +21,9 @@ * (calls function of dummy_del_mod during initialization). *************************************************************************/ +#ifndef MODULE #define MODULE +#endif /* #define __KERNEL__ Commented this line out b/c it causes errors with * module.h when it calls /usr/include/linux/version.h * -11/22/02 Robbie Williamson diff --git a/testcases/kernel/numa/Makefile b/testcases/kernel/numa/Makefile index a903d63f..f5e1881f 100644 --- a/testcases/kernel/numa/Makefile +++ b/testcases/kernel/numa/Makefile @@ -16,25 +16,14 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../include -Wall -DNUMA_VERSION1_COMPATIBILITY +top_srcdir := ../../.. -LDLIBS += -L../../../lib -lltp +include $(top_srcdir)/include/mk/testcases.mk -ifeq ($(HAS_NUMA),yes) #its a numa machine -LDLIBS += -L../../../lib -lnuma -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) -else #its not a numa machine -SRCS = support_numa.c -TARGETS = $(patsubst %.c,%,$(SRCS)) -endif +CPPFLAGS += -D_GNU_SOURCE -DNUMA_VERSION1_COMPATIBILITY -all: $(TARGETS) +LDLIBS += $(NUMA_LIBS) +INSTALL_TARGETS := numa01.sh -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../bin/$$i ; done - chmod 755 numa01.sh; cp numa01.sh ../../bin/. - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/numa/numa_node_size.c b/testcases/kernel/numa/numa_node_size.c index a47742fa..e9b16bbe 100644 --- a/testcases/kernel/numa/numa_node_size.c +++ b/testcases/kernel/numa/numa_node_size.c @@ -31,48 +31,56 @@ /* */ /******************************************************************************/ -#define _GNU_SOURCE #include #include -#include "numa.h" +#if HAS_NUMA_H +#include +#endif + int numa_exit_on_error = 0; char *fmt_mem(unsigned long long mem, char *buf) { if (mem == -1L) - sprintf(buf, ""); + sprintf(buf, ""); else - sprintf(buf, "%Lu MB", mem >> 20); + sprintf(buf, "%Lu MB", mem >> 20); return buf; } void hardware(void) { +#if HAS_NUMA_H int i; int maxnode = numa_max_node(); printf("available: %d nodes (0-%d)\n", 1+maxnode, maxnode); for (i = 0; i <= maxnode; i++) { - char buf[64]; - long fr; - unsigned long sz = numa_node_size(i, &fr); - printf("node %d cpus:", i); - printf("node %d size: %s\n", i, fmt_mem(sz, buf)); - printf("node %d free: %s\n", i, fmt_mem(fr, buf)); + char buf[64]; + long fr; + unsigned long sz = numa_node_size(i, &fr); + printf("node %d cpus:", i); + printf("node %d size: %s\n", i, fmt_mem(sz, buf)); + printf("node %d free: %s\n", i, fmt_mem(fr, buf)); } +#endif } int main() { - nodemask_t nodemask; - void hardware(); - if (numa_available() < 0) - { - printf("This system does not support NUMA policy"); - numa_error("numa_available"); - numa_exit_on_error = 1; - exit(numa_exit_on_error); - } - nodemask_zero(&nodemask); - nodemask_set(&nodemask,1); - numa_bind(&nodemask); - hardware(); - return numa_exit_on_error; +#if HAS_NUMA_H + nodemask_t nodemask; + void hardware(); + if (numa_available() < 0) + { + printf("This system does not support NUMA policy\n"); + numa_error("numa_available"); + numa_exit_on_error = 1; + exit(numa_exit_on_error); + } + nodemask_zero(&nodemask); + nodemask_set(&nodemask,1); + numa_bind(&nodemask); + hardware(); + return numa_exit_on_error; +#else + printf("NUMA is not available\n"); + return 1; +#endif } - diff --git a/testcases/kernel/performance_counters/Makefile b/testcases/kernel/performance_counters/Makefile dissimilarity index 98% index f9724d03..9c72fa3b 100644 --- a/testcases/kernel/performance_counters/Makefile +++ b/testcases/kernel/performance_counters/Makefile @@ -1,31 +1,27 @@ -# -# Copyright (c) International Business Machines Corp., 2009 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# - -CFLAGS += -I../../../include -Wall -LDLIBS += -L../../../lib -lltp - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +# +# kernel/performance_counters 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/performance_counters/performance_counter01.c b/testcases/kernel/performance_counters/performance_counter01.c index 841a98f2..7f0118b9 100644 --- a/testcases/kernel/performance_counters/performance_counter01.c +++ b/testcases/kernel/performance_counters/performance_counter01.c @@ -50,7 +50,7 @@ extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ char *TCID = "performance_counter01"; /* test program identifier. */ int TST_TOTAL = 1; -#define cleanup tst_exit /* for now... */ +static void cleanup(void) { /* Stub function. */ } int perf_counter_open(int hw_event_type, unsigned int hw_event_period, @@ -71,7 +71,8 @@ enum hw_event_types { PERF_COUNT_BRANCH_MISSES, }; -int main(void) { +int +main(void) { unsigned long long count1, count2; int fd1, fd2, ret; fd1 = perf_counter_open(PERF_COUNT_INSTRUCTIONS, 0, 0, 0, -1); diff --git a/testcases/kernel/performance_counters/performance_counter02.c b/testcases/kernel/performance_counters/performance_counter02.c index 9c14b7f5..37e62f09 100644 --- a/testcases/kernel/performance_counters/performance_counter02.c +++ b/testcases/kernel/performance_counters/performance_counter02.c @@ -62,6 +62,8 @@ it print out the values of each counter. #include #include #include +#include "config.h" +#include #include #include #include @@ -82,7 +84,7 @@ extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ char *TCID = "performance_counter02"; /* test program identifier. */ int TST_TOTAL = 1; /* total number of tests in this file. */ -#define cleanup tst_exit /* for now... */ +static void cleanup(void) { /* Stub function. */ } typedef unsigned int u32; typedef unsigned long long u64; @@ -141,6 +143,7 @@ void do_work(void) asm volatile("" : : "g" (i)); } +int main(int ac, char **av) { int tsk0; @@ -238,5 +241,5 @@ main(int ac, char **av) } fprintf(stderr, "test passed\n"); - exit(0); + tst_exit(); } diff --git a/testcases/kernel/power_management/Makefile b/testcases/kernel/power_management/Makefile index 71ae13db..5e79074b 100644 --- a/testcases/kernel/power_management/Makefile +++ b/testcases/kernel/power_management/Makefile @@ -18,40 +18,14 @@ ## ## ################################################################################ -SUBDIRS := +top_srcdir ?= ../../.. -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done; - $(MAKE) check_kv_arch ; - $(MAKE) get_sched_values ; +include $(top_srcdir)/include/mk/testcases.mk -check_kv_arch: check_kv_arch.c - $(CC) -o $@ $< ../../../lib/tst_kvercmp.c -I../../../include -get_sched_values: get_sched_values.c - $(CC) -o $@ $< ../../../lib/tst_kvercmp.c -I../../../include +$(eval $(call generate_vpath_rule,c,$(srcdir):$(top_srcdir)/lib)) -install: - @set -e; ln -f check_kv_arch ../../bin/check_kv_arch; \ - ln -f get_sched_values ../../bin/get_sched_values; \ - ln -f change_freq.sh ../../bin/change_freq.sh; \ - ln -f change_govr.sh ../../bin/change_govr.sh; \ - ln -f check_cpufreq_sysfs_files.sh ../../bin/check_cpufreq_sysfs_files.sh; \ - ln -f check_config.sh ../../bin/check_config.sh; \ - ln -f pwkm_load_unload.sh ../../bin/pwkm_load_unload.sh; \ - ln -f pm_include.sh ../../bin/pm_include.sh; \ - ln -f runpwtests.sh ../../bin/runpwtests.sh; \ - ln -f test_sched_mc.sh ../../bin/test_sched_mc.sh; \ - ln -f test_sched_mc.sh ../../bin/test_sched_smt.sh; \ - ln -f test_sched_mc.sh ../../bin/test_timer_migration.sh; \ - ln -f config_cpu_freq ../../bin/config_cpu_freq; \ - ln -f config_cpu_idle ../../bin/config_cpu_idle; \ - ln -f config_sched_mc ../../bin/config_sched_mc; - ln -f check_cpuidle_sysfs_files.sh ../../bin/check_cpuidle_sysfs_files.sh; - ln -f cpu_consolidation.py ../../bin/cpu_consolidation.py - ln -f sched_domain.py ../../bin/sched_domain.py - ln -f ilb_test.py ../../bin/ilb_test.py - chmod ugo+x *.sh -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done - rm -f check_kv_arch - rm -f get_sched_values +INSTALL_TARGETS := lib/*.py *.py *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/power_management/cpu_consolidation.py b/testcases/kernel/power_management/cpu_consolidation.py index 7ca86469..c23a751f 100755 --- a/testcases/kernel/power_management/cpu_consolidation.py +++ b/testcases/kernel/power_management/cpu_consolidation.py @@ -6,7 +6,7 @@ import os import sys import time -LIB_DIR = "%s/testcases/kernel/power_management/lib" % os.environ['LTPROOT'] +LIB_DIR = "%s/lib" % os.path.dirname(__file__) sys.path.append(LIB_DIR) from optparse import OptionParser from sched_mc import * @@ -34,40 +34,37 @@ def main(argv=None): default="ebizzy", help="Workload can be ebizzy/kernbench") parser.add_option("-s", "--stress", dest="stress", default="partial", help="Load on system is full/partial [i.e 50%]/thread") + parser.add_option("-p", "--performance", dest="perf_test", + default=False, action="store_true", help="Enable performance test") (options, args) = parser.parse_args() try: count_num_cpu() count_num_sockets() - # User would set option -v / -vc / -vt to test cpu consolidation - # gets disabled when sched_mc &(/) sched_smt is disabled when - # workload is already running in the system + if is_hyper_threaded(): + generate_sibling_list() + + # User should set option -v to test cpu consolidation + # resets when sched_mc &(/) sched_smt is disabled when + # workload is already running in the system + if options.vary_mc_smt: # Since same code is used for testing package consolidation and core # consolidation is_multi_socket & is_hyper_threaded check is done - if is_multi_socket(): - if options.mc_value: - set_sched_mc_power(options.mc_value) - mc_value=int(options.mc_value) - else: - set_sched_mc_power(1) - mc_value=int(options.mc_value) - if is_hyper_threaded(): - if options.smt_value: - set_sched_smt_power(options.smt_value) - smt_value=int(options.smt_value) - else: - set_sched_smt_power(1) - smt_value=1 + if is_multi_socket() and is_multi_core() and options.mc_value: + set_sched_mc_power(options.mc_value) + + if is_hyper_threaded() and options.smt_value: + set_sched_smt_power(options.smt_value) #Generate arguments for trigger workload, run workload in background map_cpuid_pkgid() background="yes" duration=360 pinned="no" - if int(options.mc_value) < 2: - trigger_ebizzy (smt_value, "partial", duration, background, pinned) + if int(options.mc_value) < 2 and int(options.smt_value) < 2: + trigger_ebizzy (options.smt_value, "partial", duration, background, pinned) work_ld="ebizzy" #Wait for 120 seconds and then validate cpu consolidation works #When sched_mc & sched_smt is set @@ -76,27 +73,36 @@ def main(argv=None): else: #Wait for 120 seconds and then validate cpu consolidation works #When sched_mc & sched_smt is set - trigger_kernbench (smt_value, "partial", background, pinned) + trigger_kernbench (options.smt_value, "partial", background, pinned, "no") work_ld="kernbench" import time - time.sleep(240) + time.sleep(300) generate_report() - status = validate_cpu_consolidation(work_ld, mc_value, smt_value) + status = validate_cpu_consolidation("partial", work_ld, options.mc_value, options.smt_value) if status == 0: print "INFO: Consolidation worked sched_smt &(/) sched_mc is set" #Disable sched_smt & sched_mc interface values - if (options.vary_mc_smt and options.mc_value) and is_multi_socket(): + if options.vary_mc_smt and options.mc_value > 0: set_sched_mc_power(0) - #Reset sched_smt bcoz when sched_smt is set process still - #continue to consolidate - if is_hyper_threaded(): - set_sched_smt_power(0) - if (options.vary_mc_smt and options.smt_value) and is_hyper_threaded(): + mc_value = options.mc_value + else: + mc_value = 0 + if options.vary_mc_smt and options.smt_value > 0 and is_hyper_threaded(): set_sched_smt_power(0) - time.sleep(120) + smt_value = options.smt_value + else: + smt_value = 0 + + if work_ld == "kernbench": + time.sleep(240) + else: + time.sleep(120) + generate_report() - status = validate_cpu_consolidation(options.work_ld,options.mc_value, options.smt_value) + status = validate_cpu_consolidation("partial", work_ld, mc_value, smt_value) + if background == "yes": + stop_wkld(work_ld) #CPU consolidation should fail as sched_mc &(/) sched_smt is disabled if status == 1: return(0) @@ -113,16 +119,20 @@ sched_smt was enabled. This is pre-requisite to proceed" set_sched_mc_power(options.mc_value) if is_hyper_threaded(): set_sched_smt_power(options.smt_value) - #Commented after observing changes in behaviour in 2.6.31-rc7 - #stress="thread" map_cpuid_pkgid() print "INFO: Created table mapping cpu to package" background="no" duration=60 pinned ="no" - trigger_workld( options.smt_value, options.work_ld, options.stress, duration, background, pinned) + + if options.perf_test: + perf_test="yes" + else: + perf_test="no" + + trigger_workld( options.smt_value, options.work_ld, options.stress, duration, background, pinned, perf_test) generate_report() - status = validate_cpu_consolidation(options.work_ld,options.mc_value, options.smt_value) + status = validate_cpu_consolidation(options.stress, options.work_ld,options.mc_value, options.smt_value) reset_schedmc() if is_hyper_threaded(): reset_schedsmt() diff --git a/testcases/kernel/power_management/ilb_test.py b/testcases/kernel/power_management/ilb_test.py index 97989295..220c6717 100755 --- a/testcases/kernel/power_management/ilb_test.py +++ b/testcases/kernel/power_management/ilb_test.py @@ -5,7 +5,7 @@ import os import sys -LIB_DIR = "%s/testcases/kernel/power_management/lib" % os.environ['LTPROOT'] +LIB_DIR = "%s/lib" % os.path.dirname(__file__) sys.path.append(LIB_DIR) from optparse import OptionParser from sched_mc import * @@ -27,7 +27,7 @@ def main(argv=None): parser.add_option("-t", "--smt_level", dest="smt_level", default=0, help="Sched smt power saving value 0/1/2") parser.add_option("-w", "--workload", dest="work_ld", - default="kernbench", help="Workload can be ebizzy/kernbench") + default="ebizzy", help="Workload can be ebizzy/kernbench") (options, args) = parser.parse_args() try: @@ -40,10 +40,10 @@ def main(argv=None): map_cpuid_pkgid() print "INFO: Created table mapping cpu to package" background="no" - duration=60 + duration=120 pinned="yes" - trigger_workld(options.smt_level,options.work_ld, "single_job", duration, background, pinned) + trigger_workld(options.smt_level,options.work_ld, "single_job", duration, background, pinned, "no") generate_loc_intr_report() status = validate_ilb(options.mc_level, options.smt_level) reset_schedmc() diff --git a/testcases/kernel/power_management/lib/sched_mc.py b/testcases/kernel/power_management/lib/sched_mc.py index 9e2c872e..8242427a 100755 --- a/testcases/kernel/power_management/lib/sched_mc.py +++ b/testcases/kernel/power_management/lib/sched_mc.py @@ -22,6 +22,7 @@ socket_count = 0 cpu1_max_intr = 0 cpu2_max_intr = 0 intr_stat_timer_0 = [] +siblings_list = [] def clear_dmesg(): ''' @@ -96,6 +97,36 @@ def is_hyper_threaded(): print "Failed to check if system is hyper-threaded" sys.exit(1) +def is_multi_core(): + ''' Return true if system has sockets has multiple cores + ''' + + try: + file_cpuinfo = open("/proc/cpuinfo", 'r') + for line in file_cpuinfo: + if line.startswith('siblings'): + siblings = line.split(":") + if line.startswith('cpu cores'): + cpu_cores = line.split(":") + break + + if int( siblings[1] ) == int( cpu_cores[1] ): + if int( cpu_cores[1] ) > 1: + multi_core = 1 + else: + multi_core = 0 + else: + num_of_cpus = int(siblings[1]) / int(cpu_cores[1]) + if num_of_cpus > 1: + multi_core = 1 + else: + multi_core = 0 + file_cpuinfo.close() + return multi_core + except Exception: + print "Failed to check if system is multi core system" + sys.exit(1) + def get_hyper_thread_count(): ''' Return number of threads in CPU. For eg for x3950 this function would return 2. In future if 4 threads are supported in CPU, this @@ -153,6 +184,40 @@ def map_cpuid_pkgid(): sys.exit(1) +def generate_sibling_list(): + ''' Routine to generate siblings list + ''' + try: + for i in range(0, cpu_count): + siblings_file = '/sys/devices/system/cpu/cpu%s' % i + siblings_file += '/topology/thread_siblings_list' + threads_sibs = open(siblings_file).read().rstrip() + thread_ids = threads_sibs.split("-") + + if not thread_ids in siblings_list: + siblings_list.append(thread_ids) + except Exception, details: + print "Exception in generate_siblings_list", details + sys.exit(1) + +def get_siblings(cpu_id): + ''' Return siblings of cpu_id + ''' + try: + cpus = "" + for i in range(0, len(siblings_list)): + for cpu in siblings_list[i]: + if cpu_id == cpu: + for j in siblings_list[i]: + # Exclude cpu_id in the list of siblings + if j != cpu_id: + cpus += j + return cpus + return cpus + except Exception, details: + print "Exception in get_siblings", details + sys.exit(1) + def get_proc_data(stats_list): ''' Read /proc/stat info and store in dictionary ''' @@ -168,18 +233,18 @@ def get_proc_data(stats_list): sys.exit(1) def get_proc_loc_count(loc_stats): - ''' Read /proc/stat info and store in dictionary + ''' Read /proc/interrupts info and store in list ''' try: file_procstat = open("/proc/interrupts", 'r') for line in file_procstat: - if line.startswith('LOC:'): + if line.startswith(' LOC:') or line.startswith('LOC:'): data = line.split() for i in range(0, cpu_count): # To skip LOC loc_stats.append(data[i+1]) - print data[i+1] - file_procstat.close() + file_procstat.close() + return except Exception, details: print "Could not read interrupt statistics", details sys.exit(1) @@ -192,6 +257,8 @@ def set_sched_mc_power(sched_mc_level): os.system('echo %s > \ /sys/devices/system/cpu/sched_mc_power_savings 2>/dev/null' % sched_mc_level) + + get_proc_data(stats_start) except OSError, e: print "Could not set sched_mc_power_savings to", sched_mc_level, e sys.exit(1) @@ -203,6 +270,8 @@ def set_sched_smt_power(sched_smt_level): os.system('echo %s > \ /sys/devices/system/cpu/sched_smt_power_savings 2>/dev/null' % sched_smt_level) + + get_proc_data(stats_start) except OSError, e: print "Could not set sched_smt_power_savings to", sched_smt_level, e sys.exit(1) @@ -218,21 +287,36 @@ def set_timer_migration_interface(value): print "Could not set timer_migration to ", value, e sys.exit(1) -def trigger_ebizzy (sched_smt, stress, duration, background, pinned): - ''' Triggers ebizzy workload for sched_mc=1 - testing +def get_job_count(stress, workload, sched_smt): + ''' Returns number of jobs/threads to be triggered ''' + try: if stress == "thread": threads = get_hyper_thread_count() if stress == "partial": threads = cpu_count / socket_count + if is_hyper_threaded(): + if workload == "ebizzy" and int(sched_smt) ==0: + threads = threads / get_hyper_thread_count() + if workload == "kernbench" and int(sched_smt) < 2: + threads = threads / get_hyper_thread_count() if stress == "full": - threads = cpu_count + threads = cpu_count if stress == "single_job": threads = 1 duration = 180 + return threads + except Exception, details: + print "get job count failed ", details + sys.exit(1) +def trigger_ebizzy (sched_smt, stress, duration, background, pinned): + ''' Triggers ebizzy workload for sched_mc=1 + testing + ''' + try: + threads = get_job_count(stress, "ebizzy", sched_smt) olddir = os.getcwd() path = '%s/utils/benchmark' % os.environ['LTPROOT'] os.chdir(path) @@ -282,23 +366,14 @@ def trigger_ebizzy (sched_smt, stress, duration, background, pinned): print "Ebizzy workload trigger failed ", details sys.exit(1) -def trigger_kernbench (sched_smt, stress, background, pinned): +def trigger_kernbench (sched_smt, stress, background, pinned, perf_test): ''' Trigger load on system like kernbench. Copys existing copy of LTP into as LTP2 and then builds it with make -j ''' olddir = os.getcwd() try: - if stress == "thread": - threads = 2 - if stress == "partial": - threads = cpu_count / socket_count - if is_hyper_threaded() and int(sched_smt) !=2: - threads = threads / get_hyper_thread_count() - if stress == "full": - threads = cpu_count - if stress == "single_job": - threads = 1 + threads = get_job_count(stress, "kernbench", sched_smt) dst_path = "/root" olddir = os.getcwd() @@ -335,24 +410,35 @@ def trigger_kernbench (sched_smt, stress, background, pinned): get_proc_loc_count(intr_start) if pinned == "yes": os.system ( 'taskset -c %s %s/kernbench -o %s -M -H -n 1 \ - >/dev/null 2>&1' % (cpu_count-1, benchmark_path, threads)) + >/dev/null 2>&1 &' % (cpu_count-1, benchmark_path, threads)) + + # We have to delete import in future + import time + time.sleep(240) + stop_wkld("kernbench") else: if background == "yes": os.system ( '%s/kernbench -o %s -M -H -n 1 >/dev/null 2>&1 &' \ % (benchmark_path, threads)) else: - os.system ( '%s/kernbench -o %s -M -H -n 1 >/dev/null 2>&1' \ - % (benchmark_path, threads)) + if perf_test == "yes": + os.system ( '%s/kernbench -o %s -M -H -n 1 >/dev/null 2>&1' \ + % (benchmark_path, threads)) + else: + os.system ( '%s/kernbench -o %s -M -H -n 1 >/dev/null 2>&1 &' \ + % (benchmark_path, threads)) + # We have to delete import in future + import time + time.sleep(240) + stop_wkld("kernbench") print "INFO: Workload kernbench triggerd" os.chdir(olddir) - #get_proc_data(stats_stop) - #get_proc_loc_count(intr_stop) except Exception, details: print "Workload kernbench trigger failed ", details sys.exit(1) -def trigger_workld(sched_smt, workload, stress, duration, background, pinned): +def trigger_workld(sched_smt, workload, stress, duration, background, pinned, perf_test): ''' Triggers workload passed as argument. Number of threads triggered is based on stress value. ''' @@ -360,7 +446,7 @@ def trigger_workld(sched_smt, workload, stress, duration, background, pinned): if workload == "ebizzy": trigger_ebizzy (sched_smt, stress, duration, background, pinned) if workload == "kernbench": - trigger_kernbench (sched_smt, stress, background, pinned) + trigger_kernbench (sched_smt, stress, background, pinned, perf_test) except Exception, details: print "INFO: Trigger workload failed", details sys.exit(1) @@ -434,7 +520,7 @@ def generate_report(): print >> keyvalfile, "package-%s=%3.4f" % \ (pkg, (float(total_idle)*100/total)) except Exception, details: - print "Generating reportfile failed: ", details + print "Generating utilization report failed: ", details sys.exit(1) #Add record delimiter '\n' before closing these files @@ -454,20 +540,18 @@ def generate_loc_intr_report(): get_proc_loc_count(intr_stop) - print "Before substracting" - for i in range(0, cpu_count): - print "CPU",i, intr_start[i], intr_stop[i] - reportfile = open('/procstat/cpu-loc_interrupts', 'a') - print >> reportfile, "==============================================" - print >> reportfile, " Local timer interrupt stats " - print >> reportfile, "==============================================" + reportfile = open('/procstat/cpu-loc_interrupts', 'a') + print >> reportfile, "==============================================" + print >> reportfile, " Local timer interrupt stats " + print >> reportfile, "==============================================" + for i in range(0, cpu_count): intr_stop[i] = int(intr_stop[i]) - int(intr_start[i]) print >> reportfile, "CPU%s: %s" %(i, intr_stop[i]) print >> reportfile reportfile.close() except Exception, details: - print "Generating reportfile failed: ", details + print "Generating interrupt report failed: ", details sys.exit(1) def record_loc_intr_count(): @@ -542,25 +626,24 @@ def validate_cpugrp_map(cpu_group, sched_mc_level, sched_smt_level): modi_cpu_grp.remove(core_cpus[i]) if len(modi_cpu_grp) == 0: return 0 - else: + #This code has to be deleted + #else: # If sched_smt == 0 then its oky if threads run # in different cores of same package - if sched_smt_level == 1: - sys.exit(1) - else: - if len(cpu_group) == 2 and \ - len(modi_cpu_grp) < len(cpu_group): - print "INFO:CPUs utilized not in a core" - return 1 - print "INFO: CPUs utilized is not in same package or core" - return(1) + #if sched_smt_level > 0 : + #return 1 else: for pkg in sorted(cpu_map.keys()): pkg_cpus = cpu_map[pkg] - if pkg_cpus == cpu_group: - return(0) - - return(1) + if len(cpu_group) == len(pkg_cpus): + if pkg_cpus == cpu_group: + return(0) + else: + if int(cpus_utilized[0]) in cpu_map[pkg] or int(cpus_utilized[1]) in cpu_map[pkg]: + return(0) + + return(1) + except Exception, details: print "Exception in validate_cpugrp_map: ", details sys.exit(1) @@ -605,36 +688,70 @@ def verify_sched_domain_dmesg(sched_mc_level, sched_smt_level): print "Reading dmesg failed", details sys.exit(1) -def validate_cpu_consolidation(work_ld, sched_mc_level, sched_smt_level): +def get_cpu_utilization(cpu): + ''' Return cpu utilization of cpu_id + ''' + try: + for l in sorted(stats_percentage.keys()): + if cpu == stats_percentage[l][0]: + return stats_percentage[l][1] + return -1 + except Exception, details: + print "Exception in get_cpu_utilization", details + sys.exit(1) + +def validate_cpu_consolidation(stress, work_ld, sched_mc_level, sched_smt_level): ''' Verify if cpu's on which threads executed belong to same package ''' cpus_utilized = list() + threads = get_job_count(stress, work_ld, sched_smt_level) try: for l in sorted(stats_percentage.keys()): #modify threshold + cpu_id = stats_percentage[l][0].split("cpu") + if cpu_id[1] == '': + continue + if int(cpu_id[1]) in cpus_utilized: + continue if is_hyper_threaded(): - if stats_percentage[l][1] > 25 and work_ld == "kernbench": - cpu_id = stats_percentage[l][0].split("cpu") - if cpu_id[1] != '': + if work_ld == "kernbench" and sched_smt_level < sched_mc_level: + siblings = get_siblings(cpu_id[1]) + if siblings != "": + sib_list = siblings.split() + utilization = int(stats_percentage[l][1]) + for i in range(0, len(sib_list)): + utilization += int(get_cpu_utilization("cpu%s" %sib_list[i])) + else: + utilization = stats_percentage[l][1] + if utilization > 40: cpus_utilized.append(int(cpu_id[1])) + if siblings != "": + for i in range(0, len(sib_list)): + cpus_utilized.append(int(sib_list[i])) else: - if stats_percentage[l][1] > 70: - cpu_id = stats_percentage[l][0].split("cpu") - if cpu_id[1] != '': - cpus_utilized.append(int(cpu_id[1])) + # This threshold wuld be modified based on results + if stats_percentage[l][1] > 40: + cpus_utilized.append(int(cpu_id[1])) else: - if stats_percentage[l][1] > 70: - cpu_id = stats_percentage[l][0].split("cpu") - if cpu_id[1] != '': + if work_ld == "kernbench" : + if stats_percentage[l][1] > 50: cpus_utilized.append(int(cpu_id[1])) - cpus_utilized.sort() + else: + if stats_percentage[l][1] > 70: + cpus_utilized.append(int(cpu_id[1])) + cpus_utilized.sort() print "INFO: CPU's utilized ", cpus_utilized + # If length of CPU's utilized is not = number of jobs exit with 1 + if len(cpus_utilized) < threads: + return 1 + status = validate_cpugrp_map(cpus_utilized, sched_mc_level, \ sched_smt_level) if status == 1: print "INFO: CPUs utilized is not in same package or core" + return(status) except Exception, details: print "Exception in validate_cpu_consolidation: ", details @@ -645,7 +762,8 @@ def get_cpuid_max_intr_count(): try: highest = 0 second_highest = 0 - global cpu1_max_intr, cpu2_max_intr + cpus_utilized = [] + #Skipping CPU0 as it is generally high for i in range(1, cpu_count): if int(intr_stop[i]) > int(highest): @@ -658,15 +776,19 @@ def get_cpuid_max_intr_count(): if int(intr_stop[i]) > int(second_highest): second_highest = int(intr_stop[i]) cpu2_max_intr = i + cpus_utilized.append(cpu1_max_intr) + cpus_utilized.append(cpu2_max_intr) + for i in range(1, cpu_count): if i != cpu1_max_intr and i != cpu2_max_intr: diff = second_highest - intr_stop[i] ''' Threshold of difference has to be manipulated ''' if diff < 10000: print "INFO: Diff in interrupt count is below threshold" - return 1 + cpus_utilized = [] + return cpus_utilized print "INFO: Interrupt count in other CPU's low as expected" - return 0 + return cpus_utilized except Exception, details: print "Exception in get_cpuid_max_intr_count: ", details sys.exit(1) @@ -675,14 +797,12 @@ def validate_ilb (sched_mc_level, sched_smt_level): ''' Validate if ilb is running in same package where work load is running ''' try: - status = get_cpuid_max_intr_count() - if status == 1: + cpus_utilized = get_cpuid_max_intr_count() + if not cpus_utilized: return 1 - for pkg in sorted(cpu_map.keys()): - if cpu1_max_intr in cpu_map[pkg] and cpu2_max_intr in cpu_map[pkg]: - return 0 - print "INFO: CPUs with higher interrupt count is not in same package" - return 1 + + status = validate_cpugrp_map(cpus_utilized, sched_mc_level, sched_smt_level) + return status except Exception, details: print "Exception in validate_ilb: ", details sys.exit(1) @@ -706,3 +826,14 @@ def reset_schedsmt(): except OSError, e: print "Could not set sched_smt_power_savings to 0", e sys.exit(1) + +def stop_wkld(work_ld): + ''' Kill workload triggered in background + ''' + try: + os.system('pkill %s 2>/dev/null' %work_ld) + if work_ld == "kernbench": + os.system('pkill make 2>/dev/null') + except OSError, e: + print "Exception in stop_wkld", e + sys.exit(1) diff --git a/testcases/kernel/power_management/pm_include.sh b/testcases/kernel/power_management/pm_include.sh index 4e598ae0..7e1dd3ca 100755 --- a/testcases/kernel/power_management/pm_include.sh +++ b/testcases/kernel/power_management/pm_include.sh @@ -71,7 +71,7 @@ get_supporting_govr() { is_hyper_threaded() { siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'` cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'` - [ $siblings > $cpu_cores ]; return $? + [ $siblings -gt $cpu_cores ]; return $? } check_input() { @@ -148,8 +148,8 @@ get_valid_input() { analyze_result_hyperthreaded() { sched_mc=$1 - pass_count=$3 - sched_smt=$4 + pass_count=$2 + sched_smt=$3 case "$sched_mc" in 0) @@ -165,7 +165,7 @@ $sched_mc & sched_smt=$sched_smt" fi ;; *) - if [ $pass_count -lt 5 ]; then + if [ $pass_count -lt 5 ]; then tst_resm TFAIL "cpu consolidation for sched_mc=\ $sched_mc & sched_smt=$sched_smt" else @@ -190,10 +190,16 @@ $sched_mc & sched_smt=$sched_smt" analyze_package_consolidation_result() { sched_mc=$1 - pass_count=$3 - sched_smt=$4 + pass_count=$2 + + if [ $# -gt 2 ] + then + sched_smt=$3 + else + sched_smt=-1 + fi - if [ $hyper_threaded -eq $YES -a $sched_smt ]; then + if [ $hyper_threaded -eq $YES -a $sched_smt -gt -1 ]; then analyze_result_hyperthreaded $sched_mc $pass_count $sched_smt else case "$sched_mc" in @@ -209,10 +215,10 @@ $sched_mc" *) if [ $pass_count -lt 5 ]; then tst_resm TFAIL "Consolidation at package level failed for \ -sched_mc=$sched_mc & sched_smt=$sched_smt" +sched_mc=$sched_mc" else tst_resm TPASS "Consolidation at package level passed for \ -sched_mc=$sched_mc & sched_smt=$sched_smt" +sched_mc=$sched_mc" fi ;; esac @@ -221,7 +227,7 @@ sched_mc=$sched_mc & sched_smt=$sched_smt" analyze_core_consolidation_result() { sched_smt=$1 - pass_count=$3 + pass_count=$2 case "$sched_smt" in 0) diff --git a/testcases/kernel/power_management/pwkm_load_unload.sh b/testcases/kernel/power_management/pwkm_load_unload.sh index 368fc7b9..9bcbd568 100755 --- a/testcases/kernel/power_management/pwkm_load_unload.sh +++ b/testcases/kernel/power_management/pwkm_load_unload.sh @@ -3,7 +3,7 @@ #Loading modules RC=0 loaded_governor=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` -for module in cpufreq_conservative cpufreq_powersave cpufreq_userspace +for module in `modprobe -l | grep cpufreq_ | cut -f8 -d"/" | cut -f1 -d"."` do #echo -n "Loading $module ... " if [ $module != "cpufreq_$loaded_governor" ]; @@ -15,7 +15,7 @@ do fi fi done -for module in cpufreq_conservative cpufreq_powersave cpufreq_userspace +for module in `modprobe -l | grep cpufreq_ | cut -f8 -d"/" | cut -f1 -d"."` do #echo -n "Unloading $module ... " if [ $module != "cpufreq_$loaded_governor" ]; diff --git a/testcases/kernel/power_management/runpwtests.sh b/testcases/kernel/power_management/runpwtests.sh index 30e2963d..7153d176 100755 --- a/testcases/kernel/power_management/runpwtests.sh +++ b/testcases/kernel/power_management/runpwtests.sh @@ -169,22 +169,24 @@ if [ $? -ne 0 ] ; then tst_resm TCONF "Python is not installed, CPU Consoldation\ test cannot run" else - get_sched_values sched_mc; max_sched_mc=$? - echo "max sched mc $max_sched_mc" - for sched_mc in `seq 0 $max_sched_mc`; do - : $(( TST_COUNT+=1)) - sched_domain.py -c $sched_mc; RC=$? - analyze_sched_domain_result $sched_mc $RC - if [ $hyper_threaded -eq $YES ]; then - get_sched_values sched_smt; max_sched_smt=$? - for sched_smt in `seq 0 $max_sched_smt`; do - # Testcase to validate sched_domain tree - : $(( TST_COUNT+=1)) - sched_domain.py -c $sched_mc -t $sched_smt; RC=$? - analyze_sched_domain_result $sched_mc $RC $sched_smt ; - done - fi - done + if [ -f /sys/devices/system/cpu/sched_mc_power_savings ] ; then + get_sched_values sched_mc; max_sched_mc=$? + echo "max sched mc $max_sched_mc" + for sched_mc in `seq 0 $max_sched_mc`; do + : $(( TST_COUNT+=1)) + sched_domain.py -c $sched_mc; RC=$? + analyze_sched_domain_result $sched_mc $RC + if [ $hyper_threaded -eq $YES -a -f /sys/devices/system/cpu/sched_smt_power_savings ]; then + get_sched_values sched_smt; max_sched_smt=$? + for sched_smt in `seq 0 $max_sched_smt`; do + # Testcase to validate sched_domain tree + : $(( TST_COUNT+=1)) + sched_domain.py -c $sched_mc -t $sched_smt; RC=$? + analyze_sched_domain_result $sched_mc $RC $sched_smt ; + done + fi + done + fi fi : $(( TST_COUNT+=1)) @@ -210,7 +212,7 @@ fi if [ $# -gt 0 -a "$1" = "-exclusive" ]; then # Test CPU consolidation if [ $multi_socket -eq $YES -a $multi_core -eq $YES ]; then - for sched_mc in `seq 0 $max_sched_mc`; do + for sched_mc in `seq 0 $max_sched_mc`; do : $(( TST_COUNT += 1 )) sched_mc_pass_cnt=0 if [ $sched_mc -eq 2 ]; then @@ -243,111 +245,108 @@ if [ $# -gt 0 -a "$1" = "-exclusive" ]; then done fi - if [ $hyper_threaded -eq $YES -a $multi_socket -eq $YES ]; then - #Testcase to validate consolidation at core level - work_load="ebizzy" - sched_smt_pass_cnt=0 - : $(( TST_COUNT += 1 )) - stress="thread" - for repeat_test in `seq 1 10`; do - if cpu_consolidation.py -c $sched_mc -t $sched_smt -w $work_load -s $stress; then - : $(( sched_smt_pass_cnt += 1 )) - fi - done - analyze_core_consolidation_result $sched_smt $work_load $sched_smt_pass_cnt - # Vary only sched_smt from 1 to 0 when workload is running and ensure that - # tasks do not consolidate to single core when sched_smt is set to 0 - : $(( TST_COUNT += 1 )) - if cpu_consolidation.py -vt; then - tst_resm TPASS "CPU consolidation test by varying sched_smt" - else - tst_resm TFAIL "CPU consolidation test by varying sched_smt" - fi + if [ $hyper_threaded -eq $YES -a $multi_socket -eq $YES -a $multi_core -eq $NO ]; then + #Testcase to validate consolidation at core level + for sched_smt in `seq 0 $max_sched_smt`; do + if [ $sched_smt -eq 2 ]; then + work_load="kernbench" + else + work_load="ebizzy" + fi + sched_smt_pass_cnt=0 + : $(( TST_COUNT += 1 )) + stress="thread" + for repeat_test in `seq 1 10`; do + if cpu_consolidation.py -t $sched_smt -w $work_load -s $stress; then + : $(( sched_smt_pass_cnt += 1 )) + fi + done + analyze_core_consolidation_result $sched_smt $sched_smt_pass_cnt + done fi # Verify threads consolidation stops when sched_mc &(/) sched_smt is disabled if [ $multi_socket -eq $YES -a $multi_core -eq $YES ]; then - : $(( TST_COUNT += 1 )) - # Vary sched_mc from 1 to 0 when workload is running and ensure that - # tasks do not consolidate to single package when sched_mc is set to 0 - if cpu_consolidation.py -v -c 1; then - tst_resm TPASS "CPU consolidation test by varying sched_mc 1 to 0" - else - tst_resm TFAIL "CPU consolidation test by varying sched_mc 1 to 0" - fi - - # Vary sched_mc from 2 to 0 when workload is running and ensure that - # tasks do not consolidate to single package when sched_mc is set to 0 - : $(( TST_COUNT += 1 )) - if cpu_consolidation.py -v -c 2; then - tst_resm TPASS "CPU consolidation test by varying sched_mc 2 to 0" - else - tst_resm TFAIL "CPU consolidation test by varying sched_mc 2 to 0" - fi - - if [ $hyper_threaded -eq $YES ]; then - # Vary sched_mc & sched_smt from 1 to 0 & 2 to 0 when workload is running and ensure that - # tasks do not consolidate to single package when sched_mc is set to 0 - : $(( TST_COUNT += 1 )) - if cpu_consolidation.py -v -c 1 -t 1; then - tst_resm TPASS "CPU consolidation test by varying sched_mc \ -& sched_smt from 1 to 0" - else - tst_resm TFAIL "CPU consolidation test by varying sched_mc \ -& sched_smt from 1 to 0" - fi - + for sched_mc in `seq 1 $max_sched_mc`; do : $(( TST_COUNT += 1 )) - if cpu_consolidation.py -v -c 2 -t 2; then - tst_resm TPASS "CPU consolidation test by varying sched_mc \ - & sched_smt from 2 to 0" - else - tst_resm TFAIL "CPU consolidation test by varying sched_mc \ - & sched_smt from 2 to 0" + + # Vary sched_mc from 1/2 to 0 when workload is running and ensure that + # tasks do not consolidate to single package when sched_mc is set to 0 + if cpu_consolidation.py -v -c $sched_mc; then + tst_resm TPASS "CPU consolidation test by varying sched_mc $sched_mc to 0" + else + tst_resm TFAIL "CPU consolidation test by varying sched_mc $sched_mc to 0" + fi + + if [ $hyper_threaded -eq $YES ]; then + for sched_smt in `seq 1 $max_sched_smt`; do + if [ $sched_smt -eq $sched_mc ]; then + # Vary sched_mc & sched_smt from 1 to 0 & 2 to 0 when workload is running and ensure that + # tasks do not consolidate to single package when sched_mc is set to 0 + : $(( TST_COUNT += 1 )) + if cpu_consolidation.py -v -c $sched_mc -t $sched_smt; then + tst_resm TPASS "CPU consolidation test by varying sched_mc \ +& sched_smt from $sched_mc to 0" + else + tst_resm TFAIL "CPU consolidation test by varying sched_mc \ +& sched_smt from $sched_mc to 0" + fi + fi + done fi - fi + done fi - # Verify threads consolidation stops when is disabled in HT systems + # Verify threads consolidation stops when sched_smt is disabled in HT systems if [ $hyper_threaded -eq $YES -a $multi_socket -eq $YES ]; then # Vary only sched_smt from 1 to 0 when workload is running and ensure that # tasks do not consolidate to single core when sched_smt is set to 0 : $(( TST_COUNT += 1 )) if cpu_consolidation.py -v -t 1; then - tst_resm TPASS "CPU consolidation test by varying sched_smt 1 to 0" + tst_resm TPASS "CPU consolidation test by varying sched_smt from 1 to 0" else - tst_resm TFAIL "CPU consolidation test by varying sched_smt 1 to 0" + tst_resm TFAIL "CPU consolidation test by varying sched_smt from 1 to 0" fi + + # Vary only sched_smt from 2 to 0 when workload is running and ensure that + # tasks do not consolidate to single core when sched_smt is set to 0 + : $(( TST_COUNT += 1 )) + if cpu_consolidation.py -v -t 2; then + tst_resm TPASS "CPU consolidation test by varying sched_smt 2 to 0" + else + tst_resm TFAIL "CPU consolidation test by varying sched_smt 2 to 0" + fi + fi # Verify ILB runs in same package as workload if [ $multi_socket -eq $YES -a $multi_core -eq $YES ]; then - for sched_mc in `seq 0 $max_sched_mc`; do + for sched_mc in `seq 1 $max_sched_mc`; do : $(( TST_COUNT += 1 )) - ilb_test.py -c $sched_mc; RC=$? + if [ $sched_mc -eq 2 ]; then + work_load="kernbench" + else + work_load="ebizzy" + fi + + ilb_test.py -c $sched_mc -w $work_load; RC=$? if [ $RC -eq 0 ]; then tst_resm TPASS "ILB & workload in same package for sched_mc=$sched_mc" else - if [ $sched_mc -eq 0 ]; then - tst_resm TPASS "ILB & workload is not in same package when sched_mc=0" - else - tst_resm TFAIL "ILB did not run in same package" - fi + tst_resm TFAIL "ILB & workload did not run in same package for sched_mc=$sched_mc\ +. Ensure CONFIG_NO_HZ is set" fi if [ $hyper_threaded -eq $YES ]; then - for sched_smt in `seq 0 $max_sched_smt`; do + for sched_smt in `seq 1 $max_sched_smt`; do : $(( TST_COUNT += 1 )) - ilb_test.py -c $sched_mc -t sched_smt; RC=$? + ilb_test.py -c $sched_mc -t sched_smt -w $work_load; RC=$? if [ $RC -eq 0 ]; then - tst_resm TPASS "ILB & workload in same package for sched_mc=$sched_mc" + tst_resm TPASS "ILB & workload in same package for sched_mc=$sched_mc \ +& sched_smt=$sched_smt" else - if [ $sched_mc -eq 0 -a $sched_smt -eq 0 ]; then - tst_resm TPASS "ILB & workload is not in same package when\ -sched_mc & sched_smt is 0" - else - tst_resm TFAIL "ILB did not run in same package" - fi + tst_resm TFAIL "ILB & workload did not execute in same package for \ +sched_mc=$sched_mc & sched_smt=$sched_smt. Ensure CONFIG_NO_HZ is set" fi done fi diff --git a/testcases/kernel/power_management/sched_domain.py b/testcases/kernel/power_management/sched_domain.py index 086606ae..808e16f5 100755 --- a/testcases/kernel/power_management/sched_domain.py +++ b/testcases/kernel/power_management/sched_domain.py @@ -5,7 +5,7 @@ import os import sys -LIB_DIR = "%s/testcases/kernel/power_management/lib" % os.environ['LTPROOT'] +LIB_DIR = "%s/lib" % os.path.dirname(__file__) sys.path.append(LIB_DIR) from sched_mc import * from optparse import OptionParser diff --git a/testcases/kernel/pty/Makefile b/testcases/kernel/pty/Makefile dissimilarity index 98% index 64ad66aa..8ab09bf5 100644 --- a/testcases/kernel/pty/Makefile +++ b/testcases/kernel/pty/Makefile @@ -1,24 +1,29 @@ - -CFLAGS+= -O -Wall -g -D_GNU_SOURCE -I../../../include -LDLIBS+= -L../../../lib -lltp - -BIN= hangup01 ptem01 pty01 - -all: $(BIN) - -clean: FRC - rm -f $(BIN) - -install: FRC - @set -e; for i in $(BIN); do ln -f $$i ../../bin/$$i ; done - -hangup01: hangup01.c - $(CC) $(CFLAGS) -o hangup01 hangup01.c $(LDFLAGS) $(LDLIBS) - -ptem01: ptem01.c - $(CC) $(CFLAGS) -o ptem01 ptem01.c $(LDFLAGS) $(LDLIBS) - -pty01: pty01.c - $(CC) $(CFLAGS) -o pty01 pty01.c $(LDFLAGS) $(LDLIBS) - -FRC: +# +# kernel/pty 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -D_GNU_SOURCE + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile dissimilarity index 98% index 62a916c3..6245ed0c 100644 --- a/testcases/kernel/sched/Makefile +++ b/testcases/kernel/sched/Makefile @@ -1,12 +1,27 @@ -SUBDIRS = cfs-scheduler clisrv hyperthreading nptl process_stress pthreads sched_stress tool - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - - +# +# kernel/sched test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/sched/cfs-scheduler/Makefile b/testcases/kernel/sched/cfs-scheduler/Makefile index 678cf7c2..aa3bf845 100644 --- a/testcases/kernel/sched/cfs-scheduler/Makefile +++ b/testcases/kernel/sched/cfs-scheduler/Makefile @@ -16,16 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -lpthread +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/env_pre.mk -all: $(TARGETS) +LDLIBS += -lpthread -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/sched/clisrv/Makefile b/testcases/kernel/sched/clisrv/Makefile dissimilarity index 99% index 15cccda8..0c293d3a 100644 --- a/testcases/kernel/sched/clisrv/Makefile +++ b/testcases/kernel/sched/clisrv/Makefile @@ -1,21 +1,36 @@ -CFLAGS+= -Wall -O -D_LINUX -CFILES=pthcli.c pthserv.c readline.c writen.c -OFILES=$(CFILES:.c=.o) -LOADLIBES+= -lpthread -TESTS = pthcli pthserv - -all: $(TESTS) - -pthcli: pthcli.o readline.o writen.o - $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LOADLIBES) - -pthserv: pthserv.o readline.o writen.o - $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LOADLIBES) - -install: - @set -e; for i in $(TESTS) ; do ln -f $$i ../../../bin/$$i ; done ; - ln -f run_sched_cliserv.sh ../../../bin/ - ln -f data ../../../bin/ - -clean: - rm -fr $(OFILES) $(TESTS) +# +# kernel/sched/cliserv test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -D_LINUX +LDLIBS += -lpthread + +INSTALL_TARGETS := data run_sched_cliserv.sh + +MAKE_TARGETS := pthcli pthserv + +$(MAKE_TARGETS): %: %.o readline.o writen.o + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/sched/hyperthreading/Makefile b/testcases/kernel/sched/hyperthreading/Makefile dissimilarity index 98% index 2e0d64a7..44d94f26 100644 --- a/testcases/kernel/sched/hyperthreading/Makefile +++ b/testcases/kernel/sched/hyperthreading/Makefile @@ -1,10 +1,27 @@ -SUBDIRS = ht_enabled ht_affinity ht_interrupt - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# kernel/sched/hyperthreading test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/HTaffinity.c b/testcases/kernel/sched/hyperthreading/ht_affinity/HTaffinity.c deleted file mode 100644 index fa2d2547..00000000 --- a/testcases/kernel/sched/hyperthreading/ht_affinity/HTaffinity.c +++ /dev/null @@ -1,268 +0,0 @@ -/*************************************************************************** - HTaffinity.c - description - ------------------- - email : sonic,zhang@intel.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ -#include "HTutils.h" -#include -#include -#include -#include -#include -#include -#include -#include "test.h" - -char *TCID = "smt_smp_affinity"; -int TST_TOTAL = 3; - -/************************************************************************************ -int set_affinity(pid_t pid, unsigned int len, unsigned long *mask_ptr) -pid - pid of the process whose affinity is desired to be set. -mask_ptr - pointer to the new cpu_affinity_mask. -len - length in bytes of the bitmask pointed to by user_mask_ptr. - -int get_affinity(pid_t pid, unsigned int len, unsigned long *mask_ptr) -pid - pid of the process whose affinity is being read. -mask_ptr pointer to store the current affinity information. -len - length in bytes of the bitmask pointed to by user_mask_ptr. -************************************************************************************/ - -//Any application program can invoke these system call using sched_setaffinity() and sched_getaffinity(), -//with the syntax mentioned in the previous section, after declaring the interface as: - -#define sched_setaffinity(pid, cpusetsize, mask) syscall(__NR_sched_setaffinity, pid, cpusetsize, mask) -#define sched_getaffinity(pid, cpusetsize, mask) syscall(__NR_sched_getaffinity, pid, cpusetsize, mask) - -#define AFFINITY_NAME "affinity" -#define PROCFS_PATH "/proc/" - -int HT_SetAffinity() -{ - unsigned int mask; - pid_t pid; - int result=1; - int cpu_count, i, j, k, cpuid; - - pid=getpid(); - - tst_resm(TINFO, "Set affinity through system call"); - - cpu_count=get_cpu_count(); - if(cpu_count==0) - { - return 0; - } - else if(cpu_count>32) - cpu_count=32; - - for(i=0, mask=0x1;i /dev/null"); - exit(0); - } - } - - sleep(1); - - if(get_current_cpu(pid)!=i) - break; - } - - if(j<10) - { - tst_resm(TINFO, "...Error"); - result=0; - } - else - tst_resm(TINFO, "...OK"); - - } - - for(i=0, mask=0x3;i /dev/null"); - exit(0); - } - } - - sleep(1); - - cpuid=get_current_cpu(pid); - if(cpuid!=i&&cpuid!=i+1) - break; - } - - if(j<10) - { - tst_resm(TINFO, "...Error"); - result=0; - } - else - tst_resm(TINFO, "...OK"); - - } - - if(result) - return 1; - else - return 0; -} - -unsigned long get_porc_affinity(pid_t pid) -{ - FILE *pfile; - - sprintf(buf, "%s%d/%s%c", PROCFS_PATH, pid, AFFINITY_NAME, 0); - - if((pfile=fopen(buf, "r"))==NULL) - return 0; - - if(fgets(buf, 255, pfile)==NULL) - { - fclose(pfile); - return 0; - } - - fclose(pfile); - - return atol(buf); -} - -int HT_GetAffinity() -{ - unsigned int mask[2], mask1[2]; - pid_t pid; - - mask[0] = 0x1; - pid = getpid(); - - tst_resm(TINFO, "Get affinity through system call"); - - sched_setaffinity(pid, sizeof(mask), mask); - - sleep(1); - - sched_getaffinity(pid, sizeof(mask), mask1); - - if (mask[0] == 0x1 && mask[0] == mask1[0]) - { - mask[0] = 0x2; - sched_setaffinity(pid, sizeof(mask), mask); - - sleep(1); - - sched_getaffinity(pid, sizeof(mask), mask1); - - if (mask[0] == 0x2 && mask[0] == mask1[0]) - return 1; - else - return 0; - } - else - return 0; -} - -int HT_InheritAffinity() -{ - unsigned int mask[2]; - pid_t pid; - int status; - mask[0] = 0x2; - pid = getpid(); - - sched_setaffinity(pid, sizeof(mask), mask); - - sleep(1); - pid = fork(); - if (pid == 0) - { - sleep(1); - sched_getaffinity(pid, sizeof(mask), mask); - if (mask[0] == 0x2) - exit(0); - - else - exit(1); - } else if (pid < 0) { - tst_resm(TINFO, "Inherit affinity:fork failed!"); - return 0; - } - waitpid(pid, &status, 0); - - if (WEXITSTATUS(status) == 0) { - tst_resm(TINFO, "Inherited affinity from parent process"); - return 1; - } - else - return 0; -} - -// return 0 means Pass, return 1 means Fail -int main(int argc, char *argv[]) -{ - -#ifndef __i386__ - tst_brkm(TCONF, NULL, "This test suite can only execute on i386 architecture."); -#else - if (!check_ht_capability()) - { - - if(HT_GetAffinity()) - tst_resm(TPASS, "System call getaffinity() is OK."); - else - tst_resm(TFAIL, "System call getaffinity() is error."); - - printf("\n"); - - if(HT_InheritAffinity()) - tst_resm(TPASS, "Inheritance of affinity is OK."); - else - tst_resm(TFAIL, "Inheritance of affinity is error."); - - printf("\n"); - - if(HT_SetAffinity()) - tst_resm(TPASS, "System call setaffinity() is OK."); - else - tst_resm(TFAIL, "System call setaffinity() is error."); - } - else - { - tst_brkm(TCONF, NULL, "HT is not enabled or not supported."); - } -#endif - - return 0; -} diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/HTutils.c b/testcases/kernel/sched/hyperthreading/ht_affinity/HTutils.c deleted file mode 100644 index 8c2a850f..00000000 --- a/testcases/kernel/sched/hyperthreading/ht_affinity/HTutils.c +++ /dev/null @@ -1,127 +0,0 @@ - -#include "HTutils.h" - -#include -#include -#include -#include -#include - -#define PROC_PATH "/proc" -#define BUFF_SIZE 8192 -#define PROCESSOR_STR "processor" - -#define MAX_CPU_NUM 128 - -char buffer[BUFF_SIZE]; - -inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) -{ -#ifndef __i386__ - return; -#else - __asm__("cpuid" - : "=a" (*eax), - "=b" (*ebx), - "=c" (*ecx), - "=d" (*edx) - : "0" (op)); -#endif -} - -int is_ht_cpu() -{ - /*Number of logic processor in a physical processor*/ - int smp_num_siblings = -1; - /*ht flag*/ - int ht = -1; - int eax,ebx,ecx,edx; - cpuid(1,&eax,&ebx,&ecx,&edx); - smp_num_siblings = (ebx&0xff0000) >> 16; - ht = (edx&0x10000000) >> 28; - - if (ht == 1 && smp_num_siblings >= 2) { - /*printf("The processor in this system supports HT\n");*/ - return 1; - } else { - /*printf("The processor in this system does not support - * HT\n");*/ - return 0; - } -} - -/* return 0 means Pass, - return 1 means ht is not enabled,*/ -int check_ht_capability() -{ - int result; - if (is_ht_cpu()) - result = 0; /*HT is enabled by default in this system.*/ - else - result = 1; /*HT is not enabled by default in this system.*/ - - return result; -} - - - - -#define PROCFS_PATH "/proc/" -#define CPUINFO_PATH "/proc/cpuinfo" -#define CPU_NAME "processor" -#define STAT_NAME "stat" - -char buf[256]; - -int get_cpu_count() -{ - FILE *pfile; - int count; - - pfile = fopen(CPUINFO_PATH, "r"); - if (pfile == NULL) - return 0; - - count=0; - - while (fgets(buf, 255, pfile) != NULL) { - if (strncmp(buf, CPU_NAME, strlen(CPU_NAME)) == 0) - count++; - } - - fclose(pfile); - - return count; -} - -int get_current_cpu(pid_t pid) -{ - int cpu=-1; - int da; - char str[100]; - char ch; - - FILE *pfile; - - sprintf(buf, "%s%d/%s%c", PROCFS_PATH, pid, STAT_NAME, 0); - - pfile = fopen(buf, "r"); - if (pfile == NULL) - return -1; - - if (fscanf(pfile, "%d %s %c %d %d %d %d %d %d %d %d %d %d %d %d %d %d\ - %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", - &da, str, &ch, &da, &da, &da, &da, &da, &da, &da,\ - &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ - &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ - &da, &da, &da, &da, &da, &da, &da, &da, &cpu)<=0) - { - fclose(pfile); - return -1; - } - - fclose(pfile); - - return cpu; -} - diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/Makefile b/testcases/kernel/sched/hyperthreading/ht_affinity/Makefile dissimilarity index 99% index 2bb09d86..e6c1abf8 100644 --- a/testcases/kernel/sched/hyperthreading/ht_affinity/Makefile +++ b/testcases/kernel/sched/hyperthreading/ht_affinity/Makefile @@ -1,20 +1,33 @@ -# Check that the definitions below are correct for your system - -CFLAGS += -I../../../../../include -Wall -LOADLIBES += -L../../../../../lib -lltp -TARGETS := ht_affinity - -all: $(TARGETS) - -#ht_affinity: HTaffinity.o HTutils.o -# gcc -o ht_affinity HTaffinity.o HTutils.o $(CFLAGS) $(LOADLIBES) -ht_affinity: - ${CC} -o ht_affinity HTaffinity.c HTutils.c $(CFLAGS) $(LOADLIBES) - -install: - @chmod 755 smt_smp_affinity.sh - @ln -f smt_smp_affinity.sh ../../../../bin/ - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +# +# sched/hyperthreading/ht_affinity 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := smt_smp_affinity.sh + +MAKE_TARGETS := ht_affinity + +$(MAKE_TARGETS): $(patsubst $(abs_srcdir)/%.c,%.o,$(wildcard $(abs_srcdir)/*.c)) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c new file mode 100644 index 00000000..e9319402 --- /dev/null +++ b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c @@ -0,0 +1,268 @@ +/*************************************************************************** + HTaffinity.c - description + ------------------- + email : sonic,zhang@intel.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include "ht_utils.h" +#include +#include +#include +#include +#include +#include +#include +#include "test.h" + +char *TCID = "smt_smp_affinity"; +int TST_TOTAL = 3; + +/************************************************************************************ +int set_affinity(pid_t pid, unsigned int len, unsigned long *mask_ptr) +pid - pid of the process whose affinity is desired to be set. +mask_ptr - pointer to the new cpu_affinity_mask. +len - length in bytes of the bitmask pointed to by user_mask_ptr. + +int get_affinity(pid_t pid, unsigned int len, unsigned long *mask_ptr) +pid - pid of the process whose affinity is being read. +mask_ptr pointer to store the current affinity information. +len - length in bytes of the bitmask pointed to by user_mask_ptr. +************************************************************************************/ + +//Any application program can invoke these system call using sched_setaffinity() and sched_getaffinity(), +//with the syntax mentioned in the previous section, after declaring the interface as: + +#define sched_setaffinity(pid, cpusetsize, mask) syscall(__NR_sched_setaffinity, pid, cpusetsize, mask) +#define sched_getaffinity(pid, cpusetsize, mask) syscall(__NR_sched_getaffinity, pid, cpusetsize, mask) + +#define AFFINITY_NAME "affinity" +#define PROCFS_PATH "/proc/" + +int HT_SetAffinity() +{ + unsigned int mask; + pid_t pid; + int result=1; + int cpu_count, i, j, k, cpuid; + + pid=getpid(); + + tst_resm(TINFO, "Set affinity through system call"); + + cpu_count=get_cpu_count(); + if(cpu_count==0) + { + return 0; + } + else if(cpu_count>32) + cpu_count=32; + + for(i=0, mask=0x1;i /dev/null"); + exit(0); + } + } + + sleep(1); + + if(get_current_cpu(pid)!=i) + break; + } + + if(j<10) + { + tst_resm(TINFO, "...Error"); + result=0; + } + else + tst_resm(TINFO, "...OK"); + + } + + for(i=0, mask=0x3;i /dev/null"); + exit(0); + } + } + + sleep(1); + + cpuid=get_current_cpu(pid); + if(cpuid!=i&&cpuid!=i+1) + break; + } + + if(j<10) + { + tst_resm(TINFO, "...Error"); + result=0; + } + else + tst_resm(TINFO, "...OK"); + + } + + if(result) + return 1; + else + return 0; +} + +unsigned long get_porc_affinity(pid_t pid) +{ + FILE *pfile; + + sprintf(buf, "%s%d/%s%c", PROCFS_PATH, pid, AFFINITY_NAME, 0); + + if((pfile=fopen(buf, "r"))==NULL) + return 0; + + if(fgets(buf, 255, pfile)==NULL) + { + fclose(pfile); + return 0; + } + + fclose(pfile); + + return atol(buf); +} + +int HT_GetAffinity() +{ + unsigned int mask[2], mask1[2]; + pid_t pid; + + mask[0] = 0x1; + pid = getpid(); + + tst_resm(TINFO, "Get affinity through system call"); + + sched_setaffinity(pid, sizeof(mask), mask); + + sleep(1); + + sched_getaffinity(pid, sizeof(mask), mask1); + + if (mask[0] == 0x1 && mask[0] == mask1[0]) + { + mask[0] = 0x2; + sched_setaffinity(pid, sizeof(mask), mask); + + sleep(1); + + sched_getaffinity(pid, sizeof(mask), mask1); + + if (mask[0] == 0x2 && mask[0] == mask1[0]) + return 1; + else + return 0; + } + else + return 0; +} + +int HT_InheritAffinity() +{ + unsigned int mask[2]; + pid_t pid; + int status; + mask[0] = 0x2; + pid = getpid(); + + sched_setaffinity(pid, sizeof(mask), mask); + + sleep(1); + pid = fork(); + if (pid == 0) + { + sleep(1); + sched_getaffinity(pid, sizeof(mask), mask); + if (mask[0] == 0x2) + exit(0); + + else + exit(1); + } else if (pid < 0) { + tst_resm(TINFO, "Inherit affinity:fork failed!"); + return 0; + } + waitpid(pid, &status, 0); + + if (WEXITSTATUS(status) == 0) { + tst_resm(TINFO, "Inherited affinity from parent process"); + return 1; + } + else + return 0; +} + +// return 0 means Pass, return 1 means Fail +int main(int argc, char *argv[]) +{ + +#ifndef __i386__ + tst_brkm(TCONF, NULL, "This test suite can only execute on i386 architecture."); +#else + if (!check_ht_capability()) + { + + if(HT_GetAffinity()) + tst_resm(TPASS, "System call getaffinity() is OK."); + else + tst_resm(TFAIL, "System call getaffinity() is error."); + + printf("\n"); + + if(HT_InheritAffinity()) + tst_resm(TPASS, "Inheritance of affinity is OK."); + else + tst_resm(TFAIL, "Inheritance of affinity is error."); + + printf("\n"); + + if(HT_SetAffinity()) + tst_resm(TPASS, "System call setaffinity() is OK."); + else + tst_resm(TFAIL, "System call setaffinity() is error."); + } + else + { + tst_brkm(TCONF, NULL, "HT is not enabled or not supported."); + } +#endif + + return 0; +} diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c new file mode 100644 index 00000000..0e581d8f --- /dev/null +++ b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c @@ -0,0 +1,127 @@ + +#include "ht_utils.h" + +#include +#include +#include +#include +#include + +#define PROC_PATH "/proc" +#define BUFF_SIZE 8192 +#define PROCESSOR_STR "processor" + +#define MAX_CPU_NUM 128 + +char buffer[BUFF_SIZE]; + +inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) +{ +#ifndef __i386__ + return; +#else + __asm__("cpuid" + : "=a" (*eax), + "=b" (*ebx), + "=c" (*ecx), + "=d" (*edx) + : "0" (op)); +#endif +} + +int is_ht_cpu() +{ + /*Number of logic processor in a physical processor*/ + int smp_num_siblings = -1; + /*ht flag*/ + int ht = -1; + int eax,ebx,ecx,edx; + cpuid(1,&eax,&ebx,&ecx,&edx); + smp_num_siblings = (ebx&0xff0000) >> 16; + ht = (edx&0x10000000) >> 28; + + if (ht == 1 && smp_num_siblings >= 2) { + /*printf("The processor in this system supports HT\n");*/ + return 1; + } else { + /*printf("The processor in this system does not support + * HT\n");*/ + return 0; + } +} + +/* return 0 means Pass, + return 1 means ht is not enabled,*/ +int check_ht_capability() +{ + int result; + if (is_ht_cpu()) + result = 0; /*HT is enabled by default in this system.*/ + else + result = 1; /*HT is not enabled by default in this system.*/ + + return result; +} + + + + +#define PROCFS_PATH "/proc/" +#define CPUINFO_PATH "/proc/cpuinfo" +#define CPU_NAME "processor" +#define STAT_NAME "stat" + +char buf[256]; + +int get_cpu_count() +{ + FILE *pfile; + int count; + + pfile = fopen(CPUINFO_PATH, "r"); + if (pfile == NULL) + return 0; + + count=0; + + while (fgets(buf, 255, pfile) != NULL) { + if (strncmp(buf, CPU_NAME, strlen(CPU_NAME)) == 0) + count++; + } + + fclose(pfile); + + return count; +} + +int get_current_cpu(pid_t pid) +{ + int cpu=-1; + int da; + char str[100]; + char ch; + + FILE *pfile; + + sprintf(buf, "%s%d/%s%c", PROCFS_PATH, pid, STAT_NAME, 0); + + pfile = fopen(buf, "r"); + if (pfile == NULL) + return -1; + + if (fscanf(pfile, "%d %s %c %d %d %d %d %d %d %d %d %d %d %d %d %d %d\ + %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", + &da, str, &ch, &da, &da, &da, &da, &da, &da, &da,\ + &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ + &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ + &da, &da, &da, &da, &da, &da, &da, &da, &cpu)<=0) + { + fclose(pfile); + return -1; + } + + fclose(pfile); + + return cpu; +} + diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/HTutils.h b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h similarity index 100% rename from testcases/kernel/sched/hyperthreading/ht_affinity/HTutils.h rename to testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/HTenabled.c b/testcases/kernel/sched/hyperthreading/ht_enabled/HTenabled.c deleted file mode 100644 index 8cbb13c1..00000000 --- a/testcases/kernel/sched/hyperthreading/ht_enabled/HTenabled.c +++ /dev/null @@ -1,31 +0,0 @@ -/*************************************************************************** - HTenabled.c - description - ------------------- - email : sonic,zhang@intel.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "test.h" -#include "HTutils.h" - -char *TCID = "smt_smp_enabled"; -int TST_TOTAL = 1; - -int main(int argc, char *argv[]) -{ - int ret_val = 1; -#ifndef __i386__ - tst_brkm(TCONF, NULL, "This test suite can only execute on i386 architecture."); -#else - ret_val = check_ht_capability(); -#endif - return ret_val; -} diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/HTutils.c b/testcases/kernel/sched/hyperthreading/ht_enabled/HTutils.c deleted file mode 100644 index b1859619..00000000 --- a/testcases/kernel/sched/hyperthreading/ht_enabled/HTutils.c +++ /dev/null @@ -1,131 +0,0 @@ - -#include "HTutils.h" - -#include -#include -#include -#include -#include - -#define PROC_PATH "/proc" -#define BUFF_SIZE 8192 -#define PROCESSOR_STR "processor" -#define PACKAGE_STR "cpu_package" -#define HT_FLAG "ht" -#define FLAG_STR "flags" - -#define MAX_CPU_NUM 128 - -char buffer[BUFF_SIZE]; - -inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) -{ -#ifndef __i386__ - return; -#else - __asm__("cpuid" - : "=a" (*eax), - "=b" (*ebx), - "=c" (*ecx), - "=d" (*edx) - : "0" (op)); -#endif -} - -int is_ht_cpu() -{ - /*Number of logic processor in a physical processor*/ - int smp_num_siblings = -1; - /*ht flag*/ - int ht = -1; - int eax,ebx,ecx,edx; - cpuid(1,&eax,&ebx,&ecx,&edx); - smp_num_siblings = (ebx&0xff0000) >> 16; - ht = (edx&0x10000000) >> 28; - - if (ht == 1 && smp_num_siblings >= 2) { - /*printf("The processor in this system supports HT\n");*/ - return 1; - } else { - /*printf("The processor in this system does not support - * HT\n");*/ - return 0; - } -} - -/*return 0 means Pass, -return 1 means ht is not enabled*/ -int check_ht_capability() -{ - int result; - if (is_ht_cpu()) { - result = 0; - /*HT is enabled by default in this system.*/ - } else { - result = 1; - /*HT is not enabled by default in this system.*/ - } - return result; -} - - - - -#define PROCFS_PATH "/proc/" -#define CPUINFO_PATH "/proc/cpuinfo" -#define CPU_NAME "processor" -#define STAT_NAME "stat" - -char buf[256]; - -int get_cpu_count() -{ - FILE *pfile; - int count; - - pfile = fopen(CPUINFO_PATH, "r"); - if (pfile == NULL) - return 0; - - count=0; - - while (fgets(buf, 255, pfile) != NULL) { - if (strncmp(buf, CPU_NAME, strlen(CPU_NAME)) == 0) - count++; - } - - fclose(pfile); - - return count; -} - -int get_current_cpu(pid_t pid) -{ - int cpu=-1; - int da; - char str[100]; - char ch; - - FILE *pfile; - - sprintf(buf, "%s%d/%s%c", PROCFS_PATH, pid, STAT_NAME, 0); - - if((pfile=fopen(buf, "r"))==NULL) - return -1; - - if (fscanf(pfile, "%d %s %c %d %d %d %d %d %d %d %d %d %d %d %d %d\ - %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", - &da, str, &ch, &da, &da, &da, &da, &da, &da, &da,\ - &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ - &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ - &da, &da, &da, &da, &da, &da, &da, &da, &cpu)<=0) - { - fclose(pfile); - return -1; - } - - fclose(pfile); - - return cpu; -} - diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/Makefile b/testcases/kernel/sched/hyperthreading/ht_enabled/Makefile dissimilarity index 98% index 460e5308..76be88fd 100644 --- a/testcases/kernel/sched/hyperthreading/ht_enabled/Makefile +++ b/testcases/kernel/sched/hyperthreading/ht_enabled/Makefile @@ -1,20 +1,33 @@ -# Check that the definitions below are correct for your system - -CFLAGS += -I../../../../../include -Wall -LOADLIBES+= -L../../../../../lib -lltp -TARGETS := ht_enabled - -all: $(TARGETS) - -ht_enabled: - ${CC} -o ht_enabled HTenabled.c HTutils.c $(CFLAGS) $(LOADLIBES) - -install: - @chmod 755 smt_smp_enabled.sh - @ln -f smt_smp_enabled.sh ../../../../bin/ - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) - - +# +# sched/hyperthreading/ht_enabled 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := smt_smp_enabled.sh + +MAKE_TARGETS := ht_enabled + +$(MAKE_TARGETS): $(patsubst $(abs_srcdir)/%.c,%.o,$(wildcard $(abs_srcdir)/*.c)) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_enabled.c b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_enabled.c new file mode 100644 index 00000000..2099dc9c --- /dev/null +++ b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_enabled.c @@ -0,0 +1,31 @@ +/*************************************************************************** + HTenabled.c - description + ------------------- + email : sonic,zhang@intel.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "test.h" +#include "ht_utils.h" + +char *TCID = "smt_smp_enabled"; +int TST_TOTAL = 1; + +int main(int argc, char *argv[]) +{ + int ret_val = 1; +#ifndef __i386__ + tst_brkm(TCONF, NULL, "This test suite can only execute on i386 architecture."); +#else + ret_val = check_ht_capability(); +#endif + return ret_val; +} diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c new file mode 100644 index 00000000..3b2cae8c --- /dev/null +++ b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c @@ -0,0 +1,131 @@ + +#include "ht_utils.h" + +#include +#include +#include +#include +#include + +#define PROC_PATH "/proc" +#define BUFF_SIZE 8192 +#define PROCESSOR_STR "processor" +#define PACKAGE_STR "cpu_package" +#define HT_FLAG "ht" +#define FLAG_STR "flags" + +#define MAX_CPU_NUM 128 + +char buffer[BUFF_SIZE]; + +inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) +{ +#ifndef __i386__ + return; +#else + __asm__("cpuid" + : "=a" (*eax), + "=b" (*ebx), + "=c" (*ecx), + "=d" (*edx) + : "0" (op)); +#endif +} + +int is_ht_cpu() +{ + /*Number of logic processor in a physical processor*/ + int smp_num_siblings = -1; + /*ht flag*/ + int ht = -1; + int eax,ebx,ecx,edx; + cpuid(1,&eax,&ebx,&ecx,&edx); + smp_num_siblings = (ebx&0xff0000) >> 16; + ht = (edx&0x10000000) >> 28; + + if (ht == 1 && smp_num_siblings >= 2) { + /*printf("The processor in this system supports HT\n");*/ + return 1; + } else { + /*printf("The processor in this system does not support + * HT\n");*/ + return 0; + } +} + +/*return 0 means Pass, +return 1 means ht is not enabled*/ +int check_ht_capability() +{ + int result; + if (is_ht_cpu()) { + result = 0; + /*HT is enabled by default in this system.*/ + } else { + result = 1; + /*HT is not enabled by default in this system.*/ + } + return result; +} + + + + +#define PROCFS_PATH "/proc/" +#define CPUINFO_PATH "/proc/cpuinfo" +#define CPU_NAME "processor" +#define STAT_NAME "stat" + +char buf[256]; + +int get_cpu_count() +{ + FILE *pfile; + int count; + + pfile = fopen(CPUINFO_PATH, "r"); + if (pfile == NULL) + return 0; + + count=0; + + while (fgets(buf, 255, pfile) != NULL) { + if (strncmp(buf, CPU_NAME, strlen(CPU_NAME)) == 0) + count++; + } + + fclose(pfile); + + return count; +} + +int get_current_cpu(pid_t pid) +{ + int cpu=-1; + int da; + char str[100]; + char ch; + + FILE *pfile; + + sprintf(buf, "%s%d/%s%c", PROCFS_PATH, pid, STAT_NAME, 0); + + if((pfile=fopen(buf, "r"))==NULL) + return -1; + + if (fscanf(pfile, "%d %s %c %d %d %d %d %d %d %d %d %d %d %d %d %d\ + %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", + &da, str, &ch, &da, &da, &da, &da, &da, &da, &da,\ + &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ + &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ + &da, &da, &da, &da, &da, &da, &da, &da, &cpu)<=0) + { + fclose(pfile); + return -1; + } + + fclose(pfile); + + return cpu; +} + diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/HTutils.h b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h similarity index 100% rename from testcases/kernel/sched/hyperthreading/ht_enabled/HTutils.h rename to testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/HTinterrupt.c b/testcases/kernel/sched/hyperthreading/ht_interrupt/HTinterrupt.c deleted file mode 100644 index a09fffd0..00000000 --- a/testcases/kernel/sched/hyperthreading/ht_interrupt/HTinterrupt.c +++ /dev/null @@ -1,134 +0,0 @@ -/*************************************************************************** - HTinterrupt.c - description - ------------------- - email : sonic,zhang@intel.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ -#include "HTutils.h" -#include -#include -#include -#include -#include "test.h" - -char *TCID = "ht_interrupt"; -int TST_TOTAL = 1; - -#define INTERRUPT_NAME "/proc/interrupts" - -int HT_InterruptDistribution() -{ - FILE *pFile; - int ci[32],cj[32]; - int cpucount, i; - int cmax, cmin, d; - - tst_resm(TINFO, "Get interrupts distribution with HT."); - - if((cpucount=get_cpu_count())<=0) - { - return 0; - } - - if((pFile=fopen(INTERRUPT_NAME, "r"))==NULL) - { - return 0; - } - - fgets(buf, 255, pFile); - fscanf(pFile, "%s %d %d %d %d %d %d %d %d \ -%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \ -%d %d %d %d %d %d %d %d", buf, ci, ci+1, ci+2, ci+3, -ci+4, ci+5, ci+6, ci+7, ci+8, ci+9, ci+10, ci+11, -ci+12, ci+13, ci+14, ci+15, ci+16, ci+17, ci+18, ci+19, -ci+20, ci+21, ci+22, ci+23, ci+24, ci+25, ci+26, ci+27, -ci+28, ci+29, ci+30, ci+31); - - fclose(pFile); - - for(i=0;i<10;i++) - { - sleep(1); - printf("."); - } - - if((pFile=fopen(INTERRUPT_NAME, "r"))==NULL) - { - return 0; - } - - fgets(buf, 255, pFile); - fscanf(pFile, "%s %d %d %d %d %d %d %d %d \ -%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \ -%d %d %d %d %d %d %d %d", buf, cj, cj+1, cj+2, cj+3, -cj+4, cj+5, cj+6, cj+7, cj+8, cj+9, cj+10, cj+11, -cj+12, cj+13, cj+14, cj+15, cj+16, cj+17, cj+18, cj+19, -cj+20, cj+21, cj+22, cj+23, cj+24, cj+25, cj+26, cj+27, -cj+28, cj+29, cj+30, cj+31); - - fclose(pFile); - - printf("\n\n"); - printf("Timer interrupt counts per CPU:\n"); - d=cj[0]-ci[0]; - printf("%d ", d); - cmax=cmin=d; - for(i=1;id) - cmin=d; - } - - printf("\n\n"); - printf("max value: %d\n", cmax); - printf("min value: %d\n", cmin); - printf("\n"); - - if(cmin==0 || cmax/cmin>10) - { - return 0; - } - else - { - return 1; - } -} - -// return 0 means Pass, return 1 means Fail. -int main(int argc, char *argv[]) -{ - tst_resm(TINFO, "Begin: HyperThreading Interrupt"); - -#ifndef __i386__ - tst_brkm(TCONF, NULL, "This test suite can only execute on i386 architecture."); -#else - if (!check_ht_capability()) - { - if(HT_InterruptDistribution()) - tst_resm(TPASS, "Interrupt distribution is balanceable."); - else - tst_resm(TFAIL, "Interrupt distribution is not balanceable."); - } - else - { - tst_brkm(TCONF, NULL, "HT is not enabled or not supported."); - } -#endif - - tst_resm(TINFO, "End: HyperThreading Interrupt"); - - return 0; -} - diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/HTutils.c b/testcases/kernel/sched/hyperthreading/ht_interrupt/HTutils.c deleted file mode 100644 index 9d6e1c0a..00000000 --- a/testcases/kernel/sched/hyperthreading/ht_interrupt/HTutils.c +++ /dev/null @@ -1,259 +0,0 @@ - -#include "HTutils.h" - -#include -#include -#include -#include -#include - -#define PROC_PATH "/proc" -#define BUFF_SIZE 8192 -#define PROCESSOR_STR "processor" -#define PACKAGE_STR "cpu_package" -#define HT_FLAG "ht" -#define FLAG_STR "flags" - -#define MAX_CPU_NUM 128 - -char buffer[BUFF_SIZE]; - -int is_cmdline_para(const char *para) -{ - FILE *fp; - - if((fp=fopen("/proc/cmdline","r"))!=NULL && para!=NULL) - { - while(fgets(buffer, BUFF_SIZE-1, fp) != NULL) - { - if(strstr(buffer, para) != NULL) - { - fclose(fp); - return 1; - } - } - fclose(fp); - } - - return 0; -} - -int is_ht_kernel() -{ - FILE *fp; - - if((fp=fopen("/proc/cpuinfo","r"))!=NULL) - { - while(fgets(buffer, BUFF_SIZE-1, fp) != NULL) - { - if(strncmp(buffer, PACKAGE_STR, strlen(PACKAGE_STR)) == 0) - { - fclose(fp); - return 1; - } - } - fclose(fp); - } - - return 0; -} - -inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) -{ -#ifndef __i386__ - return; -#else - __asm__("cpuid" - : "=a" (*eax), - "=b" (*ebx), - "=c" (*ecx), - "=d" (*edx) - : "0" (op)); -#endif -} - -int is_ht_cpu() -{ - /*Number of logic processor in a physical processor*/ - int smp_num_siblings = -1; - /*ht flag*/ - int ht = -1; - int eax,ebx,ecx,edx; - cpuid(1,&eax,&ebx,&ecx,&edx); - smp_num_siblings = (ebx&0xff0000) >> 16; - ht = (edx&0x10000000) >> 28; - - if(ht==1 && smp_num_siblings==2){ -// printf("The processor in this system supports HT\n"); - return 1; - }else{ -// printf("The processor in this system does not support HT\n"); - return 0; - } -} - - -int is_ht_enabled() -{ - int cpu_map[MAX_CPU_NUM]; - /*A bit-map shows whether a 'logic' processor has ht flag */ - int ht_cpu[MAX_CPU_NUM]; - int logic_cpu_num = 0; - int package = -1; - int cpu_id = -1; - char* ht_flag = NULL; - int i = 0; - int j = 0; - int k = 0; - - FILE *fp; - char *proc_cpuinfo = (char*)alloca (strlen (PROC_PATH) + sizeof("/cpuinfo")); - strcat (strcpy (proc_cpuinfo, PROC_PATH), "/cpuinfo"); - - if ((fp = fopen(proc_cpuinfo, "r")) != NULL) { - while (fgets(buffer, BUFF_SIZE-1, fp) != NULL) { - if (strncmp (buffer, PROCESSOR_STR, strlen(PROCESSOR_STR)) == 0) { - sscanf(buffer, PROCESSOR_STR "\t: %d", &cpu_id); - ht_cpu[cpu_id] =0; - while (fgets(buffer, BUFF_SIZE-1, fp) != NULL) { - if (strncmp(buffer, PACKAGE_STR, strlen(PACKAGE_STR)) == 0) { - sscanf(buffer, PACKAGE_STR "\t: %d", &package); - cpu_map[cpu_id] = package; - printf("cpu_map[%d]=%d\n",cpu_id,package); - } - if (strncmp(buffer, FLAG_STR, strlen(FLAG_STR)) == 0) { - ht_flag = buffer; - while(*ht_flag != '\0'){ - /*printf("ht_flag=%s",ht_flag);*/ - if(strncmp(ht_flag,HT_FLAG,strlen(HT_FLAG))==0){ - ht_cpu[cpu_id] = 1; - break; - } - ht_flag++; - } - printf("ht_cpu[%d]=%d\n",cpu_id,ht_cpu[cpu_id]); - logic_cpu_num += 1; - break; - } - } - } - } - }else - return 0; - - fclose(fp); - - for(i =0; i < logic_cpu_num; i++){ - if(ht_cpu[i] == 1){ - for(j = i + 1; j < logic_cpu_num; j++){ - if(cpu_map[i]==cpu_map[j]){ - for(k = j +1; k < logic_cpu_num; k++){ - if(cpu_map[j]==cpu_map[k]){ - /* Not proper HT support, with 3 logic processor in 1 cpu package*/ - return 0; - } - } - if(ht_cpu[j] ==1){ - return 1; - }else - return 0; - } - } - /* in this case, processor[i] has ht flag, but is not ht enabled*/ - if(j == logic_cpu_num){ - return 0; - } - } - } - if(i == logic_cpu_num){ - return 0; - } - return 0; -} - -// return 0 means Pass, -// return 1 means ht is not enabled, -// return 2 means CPU is not support ht, -// return 3 mean kernel is not support ht. -int check_ht_capability() -{ - int result; - - if(is_ht_kernel()) - { - if(is_ht_cpu()) - { - if(is_ht_enabled()) - result = 0; //HT is enabled by default in this system. - else - result = 1; //HT is not enabled by default in this system. - } - else - result = 2; //This processor does not support HT. - } - else - result = 3; //HT feature is not included in this Linux Kernel. - - return result; -} - - - - -#define PROCFS_PATH "/proc/" -#define CPUINFO_PATH "/proc/cpuinfo" -#define CPU_NAME "processor" -#define STAT_NAME "stat" - -char buf[256]; - -int get_cpu_count() -{ - FILE *pfile; - int count; - - if((pfile=fopen(CPUINFO_PATH, "r"))==NULL) - return 0; - - count=0; - - while(fgets(buf, 255, pfile)!=NULL) - { - if(strncmp(buf, CPU_NAME, strlen(CPU_NAME))==0) - count++; - } - - fclose(pfile); - - return count; -} - -int get_current_cpu(pid_t pid) -{ - int cpu=-1; - int da; - char str[100]; - char ch; - - FILE *pfile; - - sprintf(buf, "%s%d/%s%c", PROCFS_PATH, pid, STAT_NAME, 0); - - if((pfile=fopen(buf, "r"))==NULL) - return -1; - - if(fscanf(pfile, "%d %s %c %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", - &da, str, &ch, &da, &da, &da, &da, &da, &da, &da,\ - &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ - &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ - &da, &da, &da, &da, &da, &da, &da, &da, &cpu)<=0) - { - fclose(pfile); - return -1; - } - - fclose(pfile); - - return cpu; -} - diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile b/testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile dissimilarity index 98% index f3faa8dc..bc84e51d 100644 --- a/testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile +++ b/testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile @@ -1,18 +1,31 @@ -# Check that the definitions below are correct for your system - -CFLAGS+= -I../../../../../include -Wall -LOADLIBES+= -L../../../../../lib -lltp -TARGETS = ht_interrupt - -all: $(TARGETS) - -ht_interrupt: - ${CC} -o ht_interrupt HTinterrupt.c HTutils.c $(CFLAGS) $(LOADLIBES) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) - - +# +# sched/hyperthreading/ht_interrupt testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +MAKE_TARGETS := ht_interrupt + +$(MAKE_TARGETS): $(patsubst $(abs_srcdir)/%.c,%.o,$(wildcard $(abs_srcdir)/*.c)) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c new file mode 100644 index 00000000..c0063067 --- /dev/null +++ b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c @@ -0,0 +1,134 @@ +/*************************************************************************** + HTinterrupt.c - description + ------------------- + email : sonic,zhang@intel.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include "ht_utils.h" +#include +#include +#include +#include +#include "test.h" + +char *TCID = "ht_interrupt"; +int TST_TOTAL = 1; + +#define INTERRUPT_NAME "/proc/interrupts" + +int HT_InterruptDistribution() +{ + FILE *pFile; + int ci[32],cj[32]; + int cpucount, i; + int cmax, cmin, d; + + tst_resm(TINFO, "Get interrupts distribution with HT."); + + if((cpucount=get_cpu_count())<=0) + { + return 0; + } + + if((pFile=fopen(INTERRUPT_NAME, "r"))==NULL) + { + return 0; + } + + fgets(buf, 255, pFile); + fscanf(pFile, "%s %d %d %d %d %d %d %d %d \ +%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \ +%d %d %d %d %d %d %d %d", buf, ci, ci+1, ci+2, ci+3, +ci+4, ci+5, ci+6, ci+7, ci+8, ci+9, ci+10, ci+11, +ci+12, ci+13, ci+14, ci+15, ci+16, ci+17, ci+18, ci+19, +ci+20, ci+21, ci+22, ci+23, ci+24, ci+25, ci+26, ci+27, +ci+28, ci+29, ci+30, ci+31); + + fclose(pFile); + + for(i=0;i<10;i++) + { + sleep(1); + printf("."); + } + + if((pFile=fopen(INTERRUPT_NAME, "r"))==NULL) + { + return 0; + } + + fgets(buf, 255, pFile); + fscanf(pFile, "%s %d %d %d %d %d %d %d %d \ +%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \ +%d %d %d %d %d %d %d %d", buf, cj, cj+1, cj+2, cj+3, +cj+4, cj+5, cj+6, cj+7, cj+8, cj+9, cj+10, cj+11, +cj+12, cj+13, cj+14, cj+15, cj+16, cj+17, cj+18, cj+19, +cj+20, cj+21, cj+22, cj+23, cj+24, cj+25, cj+26, cj+27, +cj+28, cj+29, cj+30, cj+31); + + fclose(pFile); + + printf("\n\n"); + printf("Timer interrupt counts per CPU:\n"); + d=cj[0]-ci[0]; + printf("%d ", d); + cmax=cmin=d; + for(i=1;id) + cmin=d; + } + + printf("\n\n"); + printf("max value: %d\n", cmax); + printf("min value: %d\n", cmin); + printf("\n"); + + if(cmin==0 || cmax/cmin>10) + { + return 0; + } + else + { + return 1; + } +} + +// return 0 means Pass, return 1 means Fail. +int main(int argc, char *argv[]) +{ + tst_resm(TINFO, "Begin: HyperThreading Interrupt"); + +#ifndef __i386__ + tst_brkm(TCONF, NULL, "This test suite can only execute on i386 architecture."); +#else + if (!check_ht_capability()) + { + if(HT_InterruptDistribution()) + tst_resm(TPASS, "Interrupt distribution is balanceable."); + else + tst_resm(TFAIL, "Interrupt distribution is not balanceable."); + } + else + { + tst_brkm(TCONF, NULL, "HT is not enabled or not supported."); + } +#endif + + tst_resm(TINFO, "End: HyperThreading Interrupt"); + + return 0; +} + diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c new file mode 100644 index 00000000..eb8a6d07 --- /dev/null +++ b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c @@ -0,0 +1,259 @@ + +#include "ht_utils.h" + +#include +#include +#include +#include +#include + +#define PROC_PATH "/proc" +#define BUFF_SIZE 8192 +#define PROCESSOR_STR "processor" +#define PACKAGE_STR "cpu_package" +#define HT_FLAG "ht" +#define FLAG_STR "flags" + +#define MAX_CPU_NUM 128 + +char buffer[BUFF_SIZE]; + +int is_cmdline_para(const char *para) +{ + FILE *fp; + + if((fp=fopen("/proc/cmdline","r"))!=NULL && para!=NULL) + { + while(fgets(buffer, BUFF_SIZE-1, fp) != NULL) + { + if(strstr(buffer, para) != NULL) + { + fclose(fp); + return 1; + } + } + fclose(fp); + } + + return 0; +} + +int is_ht_kernel() +{ + FILE *fp; + + if((fp=fopen("/proc/cpuinfo","r"))!=NULL) + { + while(fgets(buffer, BUFF_SIZE-1, fp) != NULL) + { + if(strncmp(buffer, PACKAGE_STR, strlen(PACKAGE_STR)) == 0) + { + fclose(fp); + return 1; + } + } + fclose(fp); + } + + return 0; +} + +inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) +{ +#ifndef __i386__ + return; +#else + __asm__("cpuid" + : "=a" (*eax), + "=b" (*ebx), + "=c" (*ecx), + "=d" (*edx) + : "0" (op)); +#endif +} + +int is_ht_cpu() +{ + /*Number of logic processor in a physical processor*/ + int smp_num_siblings = -1; + /*ht flag*/ + int ht = -1; + int eax,ebx,ecx,edx; + cpuid(1,&eax,&ebx,&ecx,&edx); + smp_num_siblings = (ebx&0xff0000) >> 16; + ht = (edx&0x10000000) >> 28; + + if(ht==1 && smp_num_siblings==2){ +// printf("The processor in this system supports HT\n"); + return 1; + }else{ +// printf("The processor in this system does not support HT\n"); + return 0; + } +} + + +int is_ht_enabled() +{ + int cpu_map[MAX_CPU_NUM]; + /*A bit-map shows whether a 'logic' processor has ht flag */ + int ht_cpu[MAX_CPU_NUM]; + int logic_cpu_num = 0; + int package = -1; + int cpu_id = -1; + char* ht_flag = NULL; + int i = 0; + int j = 0; + int k = 0; + + FILE *fp; + char *proc_cpuinfo = (char*)alloca (strlen (PROC_PATH) + sizeof("/cpuinfo")); + strcat (strcpy (proc_cpuinfo, PROC_PATH), "/cpuinfo"); + + if ((fp = fopen(proc_cpuinfo, "r")) != NULL) { + while (fgets(buffer, BUFF_SIZE-1, fp) != NULL) { + if (strncmp (buffer, PROCESSOR_STR, strlen(PROCESSOR_STR)) == 0) { + sscanf(buffer, PROCESSOR_STR "\t: %d", &cpu_id); + ht_cpu[cpu_id] =0; + while (fgets(buffer, BUFF_SIZE-1, fp) != NULL) { + if (strncmp(buffer, PACKAGE_STR, strlen(PACKAGE_STR)) == 0) { + sscanf(buffer, PACKAGE_STR "\t: %d", &package); + cpu_map[cpu_id] = package; + printf("cpu_map[%d]=%d\n",cpu_id,package); + } + if (strncmp(buffer, FLAG_STR, strlen(FLAG_STR)) == 0) { + ht_flag = buffer; + while(*ht_flag != '\0'){ + /*printf("ht_flag=%s",ht_flag);*/ + if(strncmp(ht_flag,HT_FLAG,strlen(HT_FLAG))==0){ + ht_cpu[cpu_id] = 1; + break; + } + ht_flag++; + } + printf("ht_cpu[%d]=%d\n",cpu_id,ht_cpu[cpu_id]); + logic_cpu_num += 1; + break; + } + } + } + } + }else + return 0; + + fclose(fp); + + for(i =0; i < logic_cpu_num; i++){ + if(ht_cpu[i] == 1){ + for(j = i + 1; j < logic_cpu_num; j++){ + if(cpu_map[i]==cpu_map[j]){ + for(k = j +1; k < logic_cpu_num; k++){ + if(cpu_map[j]==cpu_map[k]){ + /* Not proper HT support, with 3 logic processor in 1 cpu package*/ + return 0; + } + } + if(ht_cpu[j] ==1){ + return 1; + }else + return 0; + } + } + /* in this case, processor[i] has ht flag, but is not ht enabled*/ + if(j == logic_cpu_num){ + return 0; + } + } + } + if(i == logic_cpu_num){ + return 0; + } + return 0; +} + +// return 0 means Pass, +// return 1 means ht is not enabled, +// return 2 means CPU is not support ht, +// return 3 mean kernel is not support ht. +int check_ht_capability() +{ + int result; + + if(is_ht_kernel()) + { + if(is_ht_cpu()) + { + if(is_ht_enabled()) + result = 0; //HT is enabled by default in this system. + else + result = 1; //HT is not enabled by default in this system. + } + else + result = 2; //This processor does not support HT. + } + else + result = 3; //HT feature is not included in this Linux Kernel. + + return result; +} + + + + +#define PROCFS_PATH "/proc/" +#define CPUINFO_PATH "/proc/cpuinfo" +#define CPU_NAME "processor" +#define STAT_NAME "stat" + +char buf[256]; + +int get_cpu_count() +{ + FILE *pfile; + int count; + + if((pfile=fopen(CPUINFO_PATH, "r"))==NULL) + return 0; + + count=0; + + while(fgets(buf, 255, pfile)!=NULL) + { + if(strncmp(buf, CPU_NAME, strlen(CPU_NAME))==0) + count++; + } + + fclose(pfile); + + return count; +} + +int get_current_cpu(pid_t pid) +{ + int cpu=-1; + int da; + char str[100]; + char ch; + + FILE *pfile; + + sprintf(buf, "%s%d/%s%c", PROCFS_PATH, pid, STAT_NAME, 0); + + if((pfile=fopen(buf, "r"))==NULL) + return -1; + + if(fscanf(pfile, "%d %s %c %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", + &da, str, &ch, &da, &da, &da, &da, &da, &da, &da,\ + &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ + &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,\ + &da, &da, &da, &da, &da, &da, &da, &da, &cpu)<=0) + { + fclose(pfile); + return -1; + } + + fclose(pfile); + + return cpu; +} + diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/HTutils.h b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h similarity index 100% rename from testcases/kernel/sched/hyperthreading/ht_interrupt/HTutils.h rename to testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h diff --git a/testcases/kernel/sched/nptl/Makefile b/testcases/kernel/sched/nptl/Makefile index 26ecce8a..eca7f597 100644 --- a/testcases/kernel/sched/nptl/Makefile +++ b/testcases/kernel/sched/nptl/Makefile @@ -16,27 +16,17 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -########################################################################### -# name of file : Makefile # -########################################################################### -NPTL:=$(shell getconf GNU_LIBPTHREAD_VERSION 2>/dev/null| grep NPTL; echo $?) -ifeq ($(NPTL),) -CFLAGS+= -I../../../../include -g -Wall -else -CFLAGS+= -I../../../../include -g -Wall -DUSING_NPTL -endif - -LOADLIBES+= -L../../../../lib -lltp -lpthread +top_srcdir ?= ../../../.. -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +# XXX (garrcoop): Integrate in autoconf check for nptl. +HAS_NPTL ?= $(shell getconf GNU_LIBPTHREAD_VERSION 2>/dev/null| grep -q NPTL && echo yes) -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +ifeq ($(HAS_NPTL),yes) +CPPFLAGS += -DUSING_NPTL +endif +LDLIBS += -lpthread +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/sched/nptl/nptl01.c b/testcases/kernel/sched/nptl/nptl01.c index 8d337b4c..487c0d1c 100644 --- a/testcases/kernel/sched/nptl/nptl01.c +++ b/testcases/kernel/sched/nptl/nptl01.c @@ -35,6 +35,7 @@ * by the test hanging and not completing execution. * ****************************************************************/ +#define _GNU_SOURCE #include #include #include diff --git a/testcases/kernel/sched/process_stress/Makefile b/testcases/kernel/sched/process_stress/Makefile dissimilarity index 98% index b9264b34..8719939b 100644 --- a/testcases/kernel/sched/process_stress/Makefile +++ b/testcases/kernel/sched/process_stress/Makefile @@ -1,12 +1,29 @@ -CFLAGS += -O -w -g -D_LINUX - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/sched/process_test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -D_LINUX + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/sched/pthreads/Makefile b/testcases/kernel/sched/pthreads/Makefile dissimilarity index 98% index 748c5e67..c9932c7c 100644 --- a/testcases/kernel/sched/pthreads/Makefile +++ b/testcases/kernel/sched/pthreads/Makefile @@ -1,14 +1,29 @@ -CPPFLAGS += -I../../../../include -CFLAGS += -Wall -LDLIBS += -lpthread -L../../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/sched/pthreads 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/sched/sched_stress/Makefile b/testcases/kernel/sched/sched_stress/Makefile dissimilarity index 95% index 72739223..140b6305 100644 --- a/testcases/kernel/sched/sched_stress/Makefile +++ b/testcases/kernel/sched/sched_stress/Makefile @@ -1,19 +1,42 @@ -CFLAGS += -Wall - -SRCS=$(wildcard *_tc*.c) -TARGETS=sched_driver sched_tc0 sched_tc1 sched_tc2 sched_tc3 sched_tc4 sched_tc5 sched_tc6 - -all: $(TARGETS) sched_datafile - -sched_datafile: - ../../../../tools/make-file.sh sched_datafile 1200010 - -sched.o: sched.h sched.c - -$(TARGETS): sched.o - -install: - @set -e; for i in $(TARGETS) sched_datafile ; do ln -f $$i ../../../bin/$$i ; done ; - ln -f sched_stress.sh ../../../bin/sched_stress.sh -clean: - rm -f $(TARGETS) sched.o sched_datafile +# +# kernel/sched/sched_stress 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := sched_stress.sh + +LDLIBS += -lpthread + +MAKE_TARGETS := $(filter-out sched,$(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*.c))) + +RM += -r + +$(filter-out sched_datafile,$(MAKE_TARGETS)): %: %.o sched.o + +MAKE_TARGETS += sched_datafile + +sched_datafile: + "$(top_srcdir)/tools/make-file.sh" "$@" 1200010 + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/sched/tool/Makefile b/testcases/kernel/sched/tool/Makefile dissimilarity index 98% index 46c3e993..76936baf 100644 --- a/testcases/kernel/sched/tool/Makefile +++ b/testcases/kernel/sched/tool/Makefile @@ -1,13 +1,29 @@ -CFLAGS += -Wall -O -g -LDLIBS := -lpthread - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) +# +# kernel/sched/tool 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/Makefile b/testcases/kernel/security/Makefile dissimilarity index 98% index 3a26b223..6a85eb2e 100644 --- a/testcases/kernel/security/Makefile +++ b/testcases/kernel/security/Makefile @@ -1,12 +1,40 @@ -SUBDIRS = mmc_security filecaps integrity cap_bound p9auth - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - - +# +# kernel/security test suite Makefile +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +# For broken compilers and toolchains, like Montavista, that improperly detect +# system headers when running autoconf -_-... bleh. +ifeq ($(strip $(CAP_LIBS)),) +FILTER_OUT_DIRS := cap_bound filecaps +endif + +# selinux-testsuite doesn't compile cleanly, so let the user manually compile +# the testcases for it. +FILTER_OUT_DIRS += selinux-testsuite + +OPT_CFLAGS += -O +DEBUG_LDFLAGS += -s + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/security/cap_bound/Makefile b/testcases/kernel/security/cap_bound/Makefile index 5d0ae8b7..65f813bc 100644 --- a/testcases/kernel/security/cap_bound/Makefile +++ b/testcases/kernel/security/cap_bound/Makefile @@ -18,41 +18,12 @@ ## ## ################################################################################ -HAVE_LIBCAP := $(shell sh check_for_libcap.sh yesno) +top_srcdir ?= ../../../.. -SCRIPTS = run_capbounds.sh -TARGETS = checkforlibcap +include $(top_srcdir)/include/mk/testcases.mk -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -lcap +INSTALL_TARGETS := run_capbounds.sh -ifeq ($(HAVE_LIBCAP),yes) -SRCS = $(wildcard *.c) -TARGETS+= $(patsubst %.c,%,$(SRCS)) -endif +LDLIBS += $(CAP_LIBS) -all: $(TARGETS) - -ifeq ($(HAVE_LIBCAP),yes) -checkforlibcap: - echo "#!/bin/sh" > $@ - echo true >> $@ - chmod a+rx $@ -else - @echo "libcap is not installed. Please install libcap from"; \ - echo "ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/libcap2."; \ - echo "You must use libcap-2.11 or newer."; \ - echo "Then make clean in ltp or ltp/testcases/kernel/security/filecaps, and recompile ltp." -checkforlibcap: - echo "#!/bin/sh" > $@ - echo false >> $@ - chmod a+rx $@ -endif - - -INSTALLTARGETS = $(TARGETS) $(SCRIPTS) checkforlibcap -install: $(INSTALLTARGETS) - @set -e; for i in $(INSTALLTARGETS); do ln -f $$i ../../../bin/$$i ; chmod +x ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *.o checkforlibcap +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/cap_bound/cap_bounds_r.c b/testcases/kernel/security/cap_bound/cap_bounds_r.c index 09cd5905..917d889b 100644 --- a/testcases/kernel/security/cap_bound/cap_bounds_r.c +++ b/testcases/kernel/security/cap_bound/cap_bounds_r.c @@ -25,7 +25,10 @@ */ #include +#include "config.h" +#if HAVE_SYS_CAPABILITY_H #include +#endif #include #include @@ -51,6 +54,7 @@ int errno; int main(int argc, char *argv[]) { +#if HAVE_SYS_CAPABILITY_H int ret = 1; int i; @@ -82,5 +86,8 @@ int main(int argc, char *argv[]) tst_exit(); } tst_resm(TPASS, "CAP_BSET_READ tests passed\n"); +#else + tst_resm(TCONF, "System doesn't have POSIX capabilities."); +#endif tst_exit(); } diff --git a/testcases/kernel/security/cap_bound/cap_bounds_rw.c b/testcases/kernel/security/cap_bound/cap_bounds_rw.c index 164175d7..9129c4e3 100644 --- a/testcases/kernel/security/cap_bound/cap_bounds_rw.c +++ b/testcases/kernel/security/cap_bound/cap_bounds_rw.c @@ -24,7 +24,10 @@ */ #include +#include "config.h" +#if HAVE_SYS_CAPABILITY_H #include +#endif #include #include diff --git a/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c b/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c index 6b7eddfb..894e0a53 100644 --- a/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c +++ b/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c @@ -27,25 +27,13 @@ */ #include +#include "config.h" +#if HAVE_SYS_CAPABILITY_H #include +#endif #include #include -#ifndef CAP_LAST_CAP -#warning out-of-date capability.h does not define CAP_LAST_CAP -#define CAP_LAST_CAP 28 /* be ultra-conservative */ -#endif - -#ifndef CAP_BSET_READ -#warning CAP_BSET_READ not defined -#define CAP_BSET_READ 23 -#endif - -#ifndef CAP_BSET_DROP -#warning CAP_BSET_DROP not defined -#define CAP_BSET_DROP 24 -#endif - char *TCID = "cap_bounds_r"; int TST_TOTAL=2; @@ -53,6 +41,7 @@ int errno; int main(int argc, char *argv[]) { +#if HAVE_SYS_CAPABILITY_H int ret = 1; cap_value_t v[1]; cap_flag_value_t f; @@ -60,7 +49,12 @@ int main(int argc, char *argv[]) /* We pick a random capability... let's use CAP_SYS_ADMIN */ /* make sure we have the capability now */ +#if HAVE_DECL_CAP_BSET_READ ret = prctl(CAP_BSET_READ, CAP_SYS_ADMIN); +#else + errno = ENOSYS; + ret = -1; +#endif if (ret != 1) { tst_resm(TBROK, "Not starting with CAP_SYS_ADMIN\n"); tst_exit(); @@ -72,23 +66,47 @@ int main(int argc, char *argv[]) tst_resm(TBROK, "Failed to create cap_sys_admin+i cap_t (errno %d)\n", errno); tst_exit(); } +#if HAVE_DECL_CAP_SET_PROC ret = cap_set_proc(cur); +#else + errno = ENOSYS; + ret = -1; +#endif if (ret) { tst_resm(TBROK, "Failed to cap_set_proc with cap_sys_admin+i (ret %d errno %d)\n", ret, errno); tst_exit(); } +#if HAVE_DECL_CAP_FREE cap_free(cur); +#endif +#if HAVE_DECL_CAP_GET_FLAG +#if HAVE_DECL_CAP_GET_PROC cur = cap_get_proc(); ret = cap_get_flag(cur, CAP_SYS_ADMIN, CAP_INHERITABLE, &f); +#else + errno = ENOSYS; + ret = -1; +#endif +#else + errno = ENOSYS; + ret = -1; +#endif if (ret || f != CAP_SET) { tst_resm(TBROK, "Failed to add CAP_SYS_ADMIN to pI\n"); tst_exit(); } +#if HAVE_DECL_CAP_FREE cap_free(cur); +#endif /* drop the capability from bounding set */ +#if HAVE_DECL_CAP_BSET_DROP ret = prctl(CAP_BSET_DROP, CAP_SYS_ADMIN); +#else + errno = ENOSYS; + ret = -1; +#endif if (ret) { tst_resm(TFAIL, "Failed to drop CAP_SYS_ADMIN from bounding set.\n"); tst_resm(TINFO, "(ret=%d, errno %d)\n", ret, errno); @@ -96,8 +114,18 @@ int main(int argc, char *argv[]) } /* test 1: is CAP_SYS_ADMIN still in pI? */ +#if HAVE_DECL_CAP_GET_FLAG +#if HAVE_DECL_CAP_GET_PROC cur = cap_get_proc(); ret = cap_get_flag(cur, CAP_SYS_ADMIN, CAP_INHERITABLE, &f); +#else + errno = ENOSYS; + ret = -1; +#endif +#else + errno = ENOSYS; + ret = -1; +#endif if (ret || f != CAP_SET) { tst_resm(TFAIL, "CAP_SYS_ADMIN not in pI after dropping from bounding set\n"); tst_exit(); @@ -116,16 +144,24 @@ int main(int argc, char *argv[]) tst_resm(TFAIL, "Failed to drop CAP_SYS_ADMIN from pI\n"); tst_exit(); } +#if HAVE_DECL_CAP_FREE cap_free(tmpcap); - +#endif /* test 2: can we put it back in pI? */ +#if HAVE_DECL_CAP_SET_PROC ret = cap_set_proc(cur); +#endif if (ret == 0) { /* success means pI was not bounded by X */ tst_resm(TFAIL, "Managed to put CAP_SYS_ADMIN back into pI though not in X\n"); tst_exit(); } +#if HAVE_DECL_CAP_FREE cap_free(cur); +#endif tst_resm(TPASS, "Couldn't put CAP_SYS_ADMIN back into pI when not in bounding set\n"); +#else + tst_resm(TCONF, "System doesn't have POSIX capabilities."); +#endif tst_exit(); } diff --git a/testcases/kernel/security/cap_bound/check_pe.c b/testcases/kernel/security/cap_bound/check_pe.c index 060d58d8..2e0451a3 100644 --- a/testcases/kernel/security/cap_bound/check_pe.c +++ b/testcases/kernel/security/cap_bound/check_pe.c @@ -28,7 +28,10 @@ */ #include +#include "config.h" +#if HAVE_SYS_CAPABILITY_H #include +#endif #include #include @@ -39,6 +42,7 @@ int errno; int main(int argc, char *argv[]) { +#if HAVE_SYS_CAPABILITY_H int ret = 1; cap_flag_value_t f; cap_t cur; @@ -54,14 +58,26 @@ int main(int argc, char *argv[]) tst_exit(); } +#if HAVE_DECL_CAP_GET_FLAG +#if HAVE_DECL_CAP_GET_PROC cur = cap_get_proc(); ret = cap_get_flag(cur, CAP_SYS_ADMIN, CAP_EFFECTIVE, &f); +#else + ret = -1; + errno = ENOSYS; +#endif +#else + ret = -1; + errno = ENOSYS; +#endif if (ret) { tst_resm(TBROK, "cap_get_flag failed (errno %d)\n", errno); tst_exit(); } - + +#if HAVE_DECL_CAP_FREE cap_free(cur); +#endif if (n == 1) { if (f == CAP_SET) { tst_resm(TPASS, "cap is in pE\n"); @@ -75,6 +91,8 @@ int main(int argc, char *argv[]) tst_exit(); } tst_resm(TFAIL, "Cap is in pE\n"); +#else + tst_resm(TCONF, "System doesn't have POSIX capabilities."); +#endif tst_exit(); - } diff --git a/testcases/kernel/security/cap_bound/dummy.c b/testcases/kernel/security/cap_bound/dummy.c index cfb8a4d1..ad650070 100644 --- a/testcases/kernel/security/cap_bound/dummy.c +++ b/testcases/kernel/security/cap_bound/dummy.c @@ -1,9 +1,35 @@ +#include +#include "config.h" + +#if HAVE_SYS_CAPABILITY_H #include +#endif + +#define END \ + printf("System doesn't support POSIX capabilities.\n"); \ + return 1 int main() { +#if HAVE_SYS_CAPABILITY_H cap_t cur; +#if HAVE_DECL_CAP_SET_PROC +#if HAVE_DECL_CAP_FROM_TEXT cur = cap_from_text("all=eip"); cap_set_proc(cur); +#else + END; +#endif +#else + END; +#endif +#if HAVE_DECL_CAP_FREE cap_free(cur); +#else + END; +#endif +#else + END; +#endif + return 0; } diff --git a/testcases/kernel/security/cap_bound/exec_with_inh.c b/testcases/kernel/security/cap_bound/exec_with_inh.c index a415cfaa..21c60fdc 100644 --- a/testcases/kernel/security/cap_bound/exec_with_inh.c +++ b/testcases/kernel/security/cap_bound/exec_with_inh.c @@ -27,25 +27,13 @@ */ #include +#include "config.h" +#if HAVE_SYS_CAPABILITY_H #include +#endif #include #include -#ifndef CAP_LAST_CAP -#warning out-of-date capability.h does not define CAP_LAST_CAP -#define CAP_LAST_CAP 28 /* be ultra-conservative */ -#endif - -#ifndef CAP_BSET_READ -#warning CAP_BSET_READ not defined -#define CAP_BSET_READ 23 -#endif - -#ifndef CAP_BSET_DROP -#warning CAP_BSET_DROP not defined -#define CAP_BSET_DROP 24 -#endif - char *TCID = "exec_with_inh"; int TST_TOTAL=1; @@ -53,33 +41,60 @@ int errno; int main(int argc, char *argv[]) { +#if HAVE_SYS_CAPABILITY_H int ret = 1; cap_flag_value_t f; - cap_t cur; + cap_t cur = 0; /* Make sure CAP_SYS_ADMIN is in pI */ +#if HAVE_DECL_CAP_FROM_TEXT cur = cap_from_text("all=eip"); +#endif if (!cur) { tst_resm(TBROK, "Failed to create cap_sys_admin+i cap_t (errno %d)\n", errno); tst_exit(); } +#if HAVE_DECL_CAP_SET_PROC ret = cap_set_proc(cur); +#else + ret = -1; + errno = ENOSYS; +#endif if (ret) { tst_resm(TBROK, "Failed to cap_set_proc with cap_sys_admin+i (ret %d errno %d)\n", ret, errno); tst_exit(); } +#if HAVE_DECL_CAP_FREE cap_free(cur); +#endif +#if HAVE_DECL_CAP_GET_FLAG +#if HAVE_DECL_CAP_GET_PROC cur = cap_get_proc(); ret = cap_get_flag(cur, CAP_SYS_ADMIN, CAP_INHERITABLE, &f); +#else + ret = -1; + errno = ENOSYS; +#endif +#else + ret = -1; + errno = ENOSYS; +#endif if (ret || f != CAP_SET) { tst_resm(TBROK, "Failed to add CAP_SYS_ADMIN to pI\n"); tst_exit(); } +#if HAVE_DECL_CAP_FREE cap_free(cur); +#endif /* drop the capability from bounding set */ +#if HAVE_DECL_CAP_BSET_DROP ret = prctl(CAP_BSET_DROP, CAP_SYS_ADMIN); +#else + errno = ENOSYS; + ret = -1; +#endif if (ret) { tst_resm(TFAIL, "Failed to drop CAP_SYS_ADMIN from bounding set.\n"); tst_resm(TINFO, "(ret=%d, errno %d)\n", ret, errno); @@ -89,5 +104,8 @@ int main(int argc, char *argv[]) /* execute "check_pe 1" */ execl("check_pe", "check_pe", "1", NULL); tst_resm(TBROK, "Failed to execute check_pe (errno %d)\n", errno); +#else + tst_resm(TCONF, "System doesn't have POSIX capabilities."); +#endif tst_exit(); } diff --git a/testcases/kernel/security/cap_bound/exec_without_inh.c b/testcases/kernel/security/cap_bound/exec_without_inh.c index b1a01afc..f28cb7fa 100644 --- a/testcases/kernel/security/cap_bound/exec_without_inh.c +++ b/testcases/kernel/security/cap_bound/exec_without_inh.c @@ -27,25 +27,13 @@ */ #include +#include "config.h" +#if HAVE_SYS_CAPABILITY_H #include +#endif #include #include -#ifndef CAP_LAST_CAP -#warning out-of-date capability.h does not define CAP_LAST_CAP -#define CAP_LAST_CAP 28 /* be ultra-conservative */ -#endif - -#ifndef CAP_BSET_READ -#warning CAP_BSET_READ not defined -#define CAP_BSET_READ 23 -#endif - -#ifndef CAP_BSET_DROP -#warning CAP_BSET_DROP not defined -#define CAP_BSET_DROP 24 -#endif - char *TCID = "exec_without_inh"; int TST_TOTAL=1; @@ -53,28 +41,56 @@ int errno; int main(int argc, char *argv[]) { +#if HAVE_SYS_CAPABILITY_H int ret = 1; cap_flag_value_t f; cap_value_t v[1]; cap_t cur; /* Make sure CAP_SYS_ADMIN is not in pI */ +#if HAVE_DECL_CAP_GET_FLAG +#if HAVE_DECL_CAP_GET_PROC cur = cap_get_proc(); ret = cap_get_flag(cur, CAP_SYS_ADMIN, CAP_INHERITABLE, &f); +#else + ret = -1; + errno = ENOSYS; +#endif +#else + ret = -1; + errno = ENOSYS; +#endif if (f == CAP_SET) { v[0] = CAP_SYS_ADMIN; +#if HAVE_DECL_CAP_SET_FLAG ret = cap_set_flag(cur, CAP_INHERITABLE, 1, v, CAP_CLEAR); +#else + ret = -1; + errno = ENOSYS; +#endif +#if HAVE_DECL_CAP_SET_PROC if (!ret) ret = cap_set_proc(cur); +#else + ret = -1; + errno = ENOSYS; +#endif if (ret) { tst_resm(TBROK, "Failed to drop cap_sys_admin from pI\n"); tst_exit(); } } +#if HAVE_DECL_CAP_FREE cap_free(cur); +#endif /* drop the capability from bounding set */ +#if HAVE_DECL_CAP_BSET_DROP ret = prctl(CAP_BSET_DROP, CAP_SYS_ADMIN); +#else + errno = ENOSYS; + ret = -1; +#endif if (ret) { tst_resm(TFAIL, "Failed to drop CAP_SYS_ADMIN from bounding set.\n"); tst_resm(TINFO, "(ret=%d, errno %d)\n", ret, errno); @@ -84,5 +100,8 @@ int main(int argc, char *argv[]) /* execute "check_pe 0" */ execl("check_pe", "check_pe", "0", NULL); tst_resm(TBROK, "Failed to execute check_pe (errno %d)\n", errno); +#else + tst_resm(TCONF, "System doesn't have POSIX capabilities."); +#endif tst_exit(); } diff --git a/testcases/kernel/security/filecaps/Makefile b/testcases/kernel/security/filecaps/Makefile index ab8a0e6d..acad4414 100644 --- a/testcases/kernel/security/filecaps/Makefile +++ b/testcases/kernel/security/filecaps/Makefile @@ -18,45 +18,14 @@ ## ## ################################################################################ -HAVE_LIBCAP := $(shell sh checkforlibcap.sh yesno) +top_srcdir ?= ../../../.. -SCRIPTS = filecapstest.sh checkforlibcap.sh checkforfilecaps.sh -TARGETS = checkforlibcap +include $(top_srcdir)/include/mk/testcases.mk -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -lcap +INSTALL_TARGETS := filecapstest.sh -ifeq ($(HAVE_LIBCAP),yes) -SRCS = $(wildcard *.c) -TARGETS+= $(patsubst %.c,%,$(SRCS)) -endif +CPPFLAGS += -D_GNU_SOURCE +DEBUG_CPPFLAGS += -DDEBUG=1 +LDLIBS += $(CAP_LIBS) -all: $(TARGETS) -ifeq ($(HAVE_LIBCAP),yes) -checkforlibcap: - echo "#!/bin/sh" > $@ - echo true >> $@ - chmod a+rx $@ -else - @echo "setcap or xattr headers not installed. Please install libcap from"; \ - echo "ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/libcap2."; \ - echo "You must use libcap-2.11 or newer."; \ - echo "Then make clean in ltp or ltp/testcases/kernel/security/filecaps, and recompile ltp." -checkforlibcap: - echo "#!/bin/sh" > $@ - echo false >> $@ - chmod a+rx $@ -endif - -numcaps.h: makenumcapsh.c - $(CC) -o makenumcapsh makenumcapsh.c - ./makenumcapsh > numcaps.h - -verify_caps_exec: verify_caps_exec.c numcaps.h - -INSTALLTARGETS = $(TARGETS) $(SCRIPTS) checkforlibcap -install: $(INSTALLTARGETS) - @set -e; for i in $(INSTALLTARGETS); do ln -f $$i ../../../bin/$$i ; chmod +x ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *.o caps_fifo checkforlibcap numcaps.h makenumcapsh +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/filecaps/check_simple_capset.c b/testcases/kernel/security/filecaps/check_simple_capset.c index 74f7b1ab..7851e012 100644 --- a/testcases/kernel/security/filecaps/check_simple_capset.c +++ b/testcases/kernel/security/filecaps/check_simple_capset.c @@ -20,20 +20,35 @@ #include +#include "config.h" +#if HAVE_SYS_CAPABILITY_H #include +#endif int main() { +#if HAVE_SYS_CAPABILITY_H cap_t caps, caps2; int ret; +#if HAVE_DECL_CAP_FROM_TEXT && HAVE_DECL_CAP_SET_PROC && HAVE_DECL_CAP_COMPARE caps = cap_from_text("cap_setpcap+ep"); caps2 = cap_from_text("cap_setpcap+ep"); ret = cap_set_proc(caps); ret = cap_compare(caps, caps2); - printf("Caps were %s the same\n", ret ? "not" : ""); +#else + printf("System doesn't support full POSIX capabilities.\n"); + return 1; +#endif + printf("Caps were %sthe same\n", ret ? "not " : ""); +#if HAVE_DECL_CAP_FREE cap_free(caps); cap_free(caps2); +#endif return ret; +#else + printf("System doesn't support POSIX capabilities.\n"); + return 1; +#endif } diff --git a/testcases/kernel/security/filecaps/check_xattr.c b/testcases/kernel/security/filecaps/check_xattr.c deleted file mode 100644 index 96ebc663..00000000 --- a/testcases/kernel/security/filecaps/check_xattr.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include - -int main() -{ - printf("Hello, world\n"); - return 0; -} diff --git a/testcases/kernel/security/filecaps/checkforfilecaps.sh b/testcases/kernel/security/filecaps/checkforfilecaps.sh index 20f97f53..757d409b 100755 --- a/testcases/kernel/security/filecaps/checkforfilecaps.sh +++ b/testcases/kernel/security/filecaps/checkforfilecaps.sh @@ -19,9 +19,7 @@ ## ## ################################################################################ -check_simple_capset -ret=$? -if [ $ret -ne 0 ]; then +if ! check_simple_capset; then echo Posix capabilities not compiled into the kernel. Please echo modprobe capability or recompile your kernel with echo CONFIG_SECURITY_CAPABILITIES=y. diff --git a/testcases/kernel/security/filecaps/inh_capped.c b/testcases/kernel/security/filecaps/inh_capped.c index ec6c299c..513fcb9b 100644 --- a/testcases/kernel/security/filecaps/inh_capped.c +++ b/testcases/kernel/security/filecaps/inh_capped.c @@ -24,28 +24,31 @@ * Uses no command line arguments. */ -#define _GNU_SOURCE #include +#include "config.h" +#if HAVE_SYS_CAPABILITY_H #include +#endif #include char *TCID = "filecaps"; int TST_TOTAL=1; -#define DEBUG 1 - void debug_print_caps(char *when) { #ifdef DEBUG char buf[2000]; tst_resm(TINFO, "%s", when); +#if HAVE_DECL_SET_CAP_TO_TEXT snprintf(buf, 2000, "%s", cap_to_text(cap_get_proc(), NULL)); +#endif tst_resm(TINFO, "%s", buf); #endif } int set_caps_from_text(char *capstr) { +#if HAVE_SYS_CAPABILITY_H && HAVE_DECL_SET_CAP_SET_PROC && HAVE_DECL_SET_CAP_FREE cap_t caps = cap_from_text(capstr); int ret; @@ -56,10 +59,14 @@ int set_caps_from_text(char *capstr) ret = cap_set_proc(caps); cap_free(caps); return ret; +#else + return -1; +#endif } int main() { +#if HAVE_SYS_CAPABILITY_H && HAVE_DECL_SET_CAPS_FROM_TEXT int ret; debug_print_caps("start"); @@ -109,5 +116,8 @@ int main() tst_resm(TFAIL, "succeeded raising capsysadmin in pI " "without having setpcap"); +#else + tst_resm(TCONF, "System doesn't have POSIX capabilities support."); +#endif tst_exit(); } diff --git a/testcases/kernel/security/filecaps/makenumcapsh.c b/testcases/kernel/security/filecaps/makenumcapsh.c deleted file mode 100644 index 6676176c..00000000 --- a/testcases/kernel/security/filecaps/makenumcapsh.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include -#include - -#ifndef PR_CAPBSET_READ -#define PR_CAPBSET_READ 23 -#endif - -int main(int argc, char *argv[]) -{ - int i, ret = 0; - - for (i=0; ret != -1; i++) { - ret = prctl(PR_CAPBSET_READ, i); - if (ret == -1) - break; - } - printf("#define NUM_CAPS %d\n", i); - return 0; -} diff --git a/testcases/kernel/security/filecaps/print_caps.c b/testcases/kernel/security/filecaps/print_caps.c index 9bfbcd65..188856ec 100644 --- a/testcases/kernel/security/filecaps/print_caps.c +++ b/testcases/kernel/security/filecaps/print_caps.c @@ -26,16 +26,21 @@ #include #include #include -#include #include #include #include #include +#include "config.h" + +#if HAVE_SYS_CAPABILITY_H +#include +#endif #define FIFOFILE "caps_fifo" int main(int argc, char *argv[]) { +#if HAVE_SYS_CAPABILITY_H && HAVE_DECL_CAP_FREE && HAVE_DECL_CAP_GET_PROC && HAVE_DECL_CAP_TO_TEXT cap_t cap = cap_get_proc(); int fd; int seqno = 0; @@ -60,6 +65,7 @@ int main(int argc, char *argv[]) close(fd); cap_free(cap); - +#else return 0; +#endif } diff --git a/testcases/kernel/security/filecaps/verify_caps_exec.c b/testcases/kernel/security/filecaps/verify_caps_exec.c index 397c8440..16fcc0f3 100644 --- a/testcases/kernel/security/filecaps/verify_caps_exec.c +++ b/testcases/kernel/security/filecaps/verify_caps_exec.c @@ -27,7 +27,6 @@ * make sure we get the rights */ -#define _GNU_SOURCE #include #include #include @@ -37,12 +36,13 @@ #include #include #include +#include "config.h" +#if HAVE_SYS_CAPABILITY_H #include +#endif #include #include -#include "numcaps.h" - #define TSTPATH "./print_caps" char *TCID = "filecaps"; int TST_TOTAL=1; @@ -62,15 +62,18 @@ void usage(char *me) void print_my_caps() { +#if HAVE_SYS_CAPABILITY_H && HAVE_DECL_CAP_FREE && HAVE_DECL_CAP_GET_PROC && HAVE_DECL_CAP_TO_TEXT cap_t cap = cap_get_proc(); char *txt = cap_to_text(cap, NULL); tst_resm(TINFO, "\ncaps are %s\n", txt); cap_free(cap); cap_free(txt); +#endif } int drop_root(int keep_perms) { +#if HAVE_SYS_CAPABILITY_H && HAVE_DECL_CAP_FREE && HAVE_DECL_CAP_FROM_TEXT && HAVE_DECL_CAP_SET_PROC int ret; if (keep_perms) @@ -86,12 +89,15 @@ int drop_root(int keep_perms) cap_set_proc(cap); cap_free(cap); } - - return 1; +#else + tst_resm(TCONF, "System doesn't have full POSIX capabilities support.\n"); +#endif + tst_exit(); } int perms_test(void) { +#if HAVE_SYS_CAPABILITY_H && HAVE_DECL_CAP_FREE && HAVE_DECL_CAP_SET_FILE int ret; cap_t cap; @@ -112,6 +118,9 @@ int perms_test(void) cap_free(cap); return ret; +#else + return -1; +#endif } #define FIFOFILE "caps_fifo" @@ -151,8 +160,10 @@ void read_from_fifo(char *buf) close(fd); } +#if HAVE_SYS_CAPABILITY_H && HAVE_DECL_CAP_COMPARE && HAVE_DECL_CAP_FREE && HAVE_DECL_CAP_TO_TEXT int fork_drop_and_exec(int keepperms, cap_t expected_caps) { + int pid; int ret = 0; char buf[200], *p; @@ -208,9 +219,12 @@ int fork_drop_and_exec(int keepperms, cap_t expected_caps) } return ret; } +#endif int caps_actually_set_test(void) { + +#if HAVE_SYS_CAPABILITY_H && HAVE_DECL_PR_CAPBSET_READ int whichcap, finalret = 0, ret; cap_t fcap, pcap, cap_fullpi; cap_value_t capvalue[1]; @@ -225,8 +239,20 @@ int caps_actually_set_test(void) create_fifo(); + int num_caps; + + for (num_caps=0; ; num_caps++) { + ret = prctl(PR_CAPBSET_READ, num_caps); + /* + * Break from the loop in this manner to avoid incrementing, + * then having to decrement value. + */ + if (ret == -1) + break; + } + /* first, try each bit in fP (forced) with fE on and off. */ - for (whichcap=0; whichcap < NUM_CAPS; whichcap++) { + for (whichcap=0; whichcap < num_caps; whichcap++) { /* * fP=whichcap, fE=fI=0 * pP'=whichcap, pI'=pE'=0 @@ -271,7 +297,7 @@ int caps_actually_set_test(void) cap_free(pcap); cap_free(fcap); cap_fullpi = cap_init(); - for (i=0; i #include #include +#include "config.h" +#include "test.h" +#if HAVE_OPENSSL_SHA_H #include +#endif #define MAX_EVENT_SIZE 500 #define EVENT_HEADER_SIZE 32 #define MAX_EVENT_DATA_SIZE (MAX_EVENT_SIZE - EVENT_HEADER_SIZE) #define NUM_PCRS 8 /* PCR registers 0-7 in boot aggregate */ -static void *display_sha1_digest(char *pcr) +char *TCID = "ima_boot_aggregate"; +int TST_TOTAL = 1; + +static void display_sha1_digest(unsigned char *pcr) { int i; @@ -39,8 +46,10 @@ static void *display_sha1_digest(char *pcr) printf("\n"); } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { +#if HAVE_OPENSSL_SHA_H unsigned char boot_aggregate[SHA_DIGEST_LENGTH]; struct { struct { @@ -74,7 +83,7 @@ int main(int argc, char *argv[]) memset(&pcr[i].digest, 0, SHA_DIGEST_LENGTH); /* Extend the pseudo PCRs with the event digest */ - while (fread(&event, sizeof event.header, 1, fp)) { + while (fread(&event, sizeof(event.header), 1, fp)) { if (debug) { printf("%03u ", event.header.pcr); display_sha1_digest(event.header.digest); @@ -105,6 +114,8 @@ int main(int argc, char *argv[]) printf("boot_aggregate:"); display_sha1_digest(boot_aggregate); - - return 0; +#else + tst_resm(TCONF, "System doesn't have openssl/sha.h"); +#endif + tst_exit(); } diff --git a/testcases/kernel/security/integrity/ima/src/ima_measure.c b/testcases/kernel/security/integrity/ima/src/ima_measure.c index 00251445..dd6b1d0d 100644 --- a/testcases/kernel/security/integrity/ima/src/ima_measure.c +++ b/testcases/kernel/security/integrity/ima/src/ima_measure.c @@ -22,18 +22,23 @@ #include #include #include +//#include "config.h" +#include "test.h" +#if HAVE_OPENSSL_SHA_H #include +#endif #define TCG_EVENT_NAME_LEN_MAX 255 -static int verbose = 0; -static int validate = 0; -static int verify = 0; +char *TCID = "ima_measure"; +int TST_TOTAL = 1; #define print_info(format, arg...) \ if (verbose) \ printf(format, ##arg) +#if HAVE_OPENSSL_SHA_H + static u_int8_t zero[SHA_DIGEST_LENGTH]; static u_int8_t fox[SHA_DIGEST_LENGTH]; @@ -90,6 +95,8 @@ static int verify_template_hash(struct event *template) return 0; } +#endif + /* * ima_measurements.c - calculate the SHA1 aggregate-pcr value based * on the IMA runtime binary measurements. @@ -120,13 +127,19 @@ static int verify_template_hash(struct event *template) * Return code: if verification enabled, returns number of verification * errors. */ -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { + +#if HAVE_OPENSSL_SHA_H FILE *fp; struct event template; u_int8_t pcr[SHA_DIGEST_LENGTH]; int i, count = 0, len; - int failed_count = 0; /* number of template verifications failed */ + + int verbose = 0; + int validate = 0; + int verify = 0; if (argc < 2) { printf("format: %s binary_runtime_measurements" \ @@ -191,12 +204,17 @@ int main(int argc, char *argv[]) print_info(" %s\n", template.ima_data.filename); if (verify) - failed_count += verify_template_hash(&template); + if (verify_template_hash(&template) != 0) { + tst_resm(TFAIL, "Hash failed"); + } } fclose(fp); verbose=1; print_info("PCRAggr (re-calculated):"); display_sha1_digest(pcr); - return failed_count; +#else + tst_resm(TCONF, "System doesn't have openssl/sha.h"); +#endif + tst_exit(); } diff --git a/testcases/kernel/security/integrity/ima/src/ima_mmap.c b/testcases/kernel/security/integrity/ima/src/ima_mmap.c index fb89a098..4907a341 100644 --- a/testcases/kernel/security/integrity/ima/src/ima_mmap.c +++ b/testcases/kernel/security/integrity/ima/src/ima_mmap.c @@ -16,16 +16,20 @@ */ #include #include +#include #include #include #include +#include "test.h" + +char *TCID = "ima_mmap"; +int TST_TOTAL = 1; int main(int argc, char *argv[]) { int fd; void *file; char *filename; - int rc; if (argc != 2) printf("%s: filename\n", argv[1]); @@ -48,6 +52,5 @@ int main(int argc, char *argv[]) perror("unmap"); return(-1); } - - return 0; + tst_exit(); } diff --git a/testcases/kernel/security/integrity/ima/tests/Makefile b/testcases/kernel/security/integrity/ima/tests/Makefile dissimilarity index 97% index f3fbc7bc..18038af9 100644 --- a/testcases/kernel/security/integrity/ima/tests/Makefile +++ b/testcases/kernel/security/integrity/ima/tests/Makefile @@ -1,6 +1,29 @@ -all: -install: - chmod 755 *.sh; cp *.sh ../../../../../bin/ - -clean: - +# +# testcases/kernel/security/integrity/ima/tests 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh b/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh index 3f186f08..13042401 100755 --- a/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh +++ b/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh @@ -37,15 +37,10 @@ init() export TST_COUNT=0 RC=0 - # check that sha1sum is installed - which sha1sum >/dev/null 2>&1 || RC=$? - if [ $RC -ne 0 ]; then - tst_brkm TBROK NULL "$TCID: sha1sum not found" - return $RC - fi + exists sha1sum # verify using default policy - if [ ! -f $IMA_DIR/policy ]; then + if [ ! -f "$IMA_DIR/policy" ]; then tst_res TINFO $LTPTMP/imalog.$$ \ "$TCID: not using default policy" fi @@ -66,7 +61,7 @@ test01() `date` - this is a test file EOF if [ $RC -ne 0 ]; then - tst_brkm TBROK $LTPTMP/imalog.$$ \ + tst_res TBROK $LTPTMP/imalog.$$ "" \ "$TCID: Unable to create test file" return $RC fi @@ -74,7 +69,7 @@ test01() # Calculating the sha1sum of $LTPTMP/test.txt should add # the measurement to the measurement list. # (Assumes SHA1 IMA measurements.) - hash=`cat $LTPIMA/test.txt | sha1sum | sed 's/ -//'` + hash=$(sha1sum < "$LTPIMA/test.txt" | sed 's/ -//') # Check if the file is measured # (i.e. contained in the ascii measurement list.) @@ -178,9 +173,10 @@ test03() # RC=0 EXIT_VAL=0 -. `dirname $0`\/ima_setup.sh -setup || exit $RC -init + +. $(dirname "$0")/ima_setup.sh +setup || exit $? +init || exit $? test01 || EXIT_VAL=$RC test02 || EXIT_VAL=$RC test03 || EXIT_VAL=$RC diff --git a/testcases/kernel/security/integrity/ima/tests/ima_policy.sh b/testcases/kernel/security/integrity/ima/tests/ima_policy.sh index 180e3ee6..f0ece9a6 100755 --- a/testcases/kernel/security/integrity/ima/tests/ima_policy.sh +++ b/testcases/kernel/security/integrity/ima/tests/ima_policy.sh @@ -163,10 +163,9 @@ test03() RC=0 # Return value from setup, init, and test functions. EXIT_VAL=0 -. `dirname $0`\/ima_setup.sh -setup || exit $RC - -init || exit $RC +. $(dirname "$0")/ima_setup.sh +setup || exit $? +init || exit $? test01 || EXIT_VAL=$RC test02 || EXIT_VAL=$RC test03 || EXIT_VAL=$RC diff --git a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh index c37d98c3..9bc4bf68 100755 --- a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh +++ b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh @@ -30,33 +30,49 @@ ################################################################################ mount_sysfs() { - SYSFS=`mount | grep sysfs` || RC=$? - if [ $RC -eq 1 ]; then + + SYSFS=$(mount 2>/dev/null | awk '$5 == "sysfs" { print $3 }') + if [ "x$SYSFS" = x ] ; then + SYSFS=/sys - mkdir -p $SYSFS - `mount -t sysfs sysfs $SYSFS` - RC=$? - return $RC - else - SYSFS=`echo $SYSFS | sed 's/sysfs on //' | sed 's/ type .*//'` + + test -d $SYSFS || mkdir -p $SYSFS 2>/dev/null + if [ $? -ne 0 ] ; then + tst_resm TBROK "Failed to mkdir $SYSFS" + return 1 + fi + if ! mount -t sysfs sysfs $SYSFS 2>/dev/null ; then + tst_resm TBROK "Failed to mount $SYSFS" + return 1 + fi + fi + return 0 } mount_securityfs() { - SECURITYFS=`mount | grep securityfs` || RC=$? - if [ $RC -eq 1 ]; then - SECURITYFS=$SYSFS/kernel/security - `mkdir -p $SECURITYFS` - `mount -t securityfs securityfs $SECURITYFS` - RC=$? - return $RC - else - SECURITYFS=`echo $SECURITYFS | sed 's/securityfs on //' \ - | sed 's/ type .*//'` + + SECURITYFS=$(mount 2>/dev/null | awk '$5 == "securityfs" { print $3 }') + if [ "x$SECURITYFS" = x ] ; then + + SECURITYFS="$SYSFS/kernel/security" + + test -d $SECURITYFS || mkdir -p $SECURITYFS 2>/dev/null + if [ $? -ne 0 ] ; then + tst_resm TBROK "Failed to mkdir $SECURITYFS" + return 1 + fi + if ! mount -t securityfs securityfs $SECURITYFS 2>/dev/null ; then + tst_resm TBROK "Failed to mount $SECURITYFS" + return 1 + fi + fi + return 0 + } setup() @@ -65,62 +81,55 @@ setup() export TCID="setup" export TST_COUNT=0 + LTPBIN= + LTPIMA= + trap "cleanup" 0 - if [ -z $TMP ]; then + if [ -z "$TMPDIR" ]; then LTPTMP=/tmp else - LTPTMP=${TMP} + LTPTMP=${TMPDIR} fi - if [ -z $LTPBIN ]; then + if [ -z "$LTPBIN" ]; then LTPBIN=../../../../../bin PATH=$PATH:$LTPBIN fi # Must be root - userid=`id -u` - if [ $userid -ne 0 ]; then - tst_brkm TBROK $LTPTMP/imalog.$$ \ - "$TCID: Must be root to execute test" + if ! is_root; then + tst_resm TCONF "You must be root to execute this test" return 1 fi - if [ -z $TMP ]; then - LTPTMP=/tmp - else - LTPTMP=${TMP} - fi - # create the temporary directory used by this testcase LTPIMA=$LTPTMP/ima umask 077 mkdir $LTPIMA > /dev/null 2>&1 || RC=$? if [ $RC -ne 0 ]; then - tst_brk TBROK "$TCID: Unable to create temporary directory" + tst_resm TBROK "Unable to create temporary directory" return $RC fi # mount sysfs if it is not already mounted mount_sysfs || RC=$? if [ $RC -ne 0 ]; then - tst_brkm TBROK $LTPTMP/imalog.$$ "$TCID: cannot mount sysfs" + tst_resm TBROK "Cannot mount sysfs" return $RC fi # mount securityfs if it is not already mounted mount_securityfs || RC=$? if [ $RC -ne 0 ]; then - tst_brkm TBROK $LTPTMP/imalog.$$ "$TCID: cannot mount securityfs" + tst_resm TBROK "Cannot mount securityfs" return $RC fi - SECURITYFS=`echo $SECURITYFS | sed 's/securityfs on //' \ - | sed 's/ type .*//'` + mount # IMA must be configured in the kernel IMA_DIR=$SECURITYFS/ima - if [ ! -d $IMA_DIR ]; then - tst_brkm TBROK $LTPTMP/imalog.$$\ - "INIT: IMA not enabled in kernel" + if [ ! -d "$IMA_DIR" ]; then + tst_resm TCONF "IMA not enabled in kernel" RC=1 fi return $RC @@ -135,6 +144,8 @@ setup() cleanup() { tst_resm TINFO "CLEAN: removing $LTPIMA" - rm -rf $LTPIMA || RC $? + rm -rf "$LTPIMA" || RC=$? return $RC } + +. cmdlib.sh diff --git a/testcases/kernel/security/integrity/ima/tests/ima_tpm.sh b/testcases/kernel/security/integrity/ima/tests/ima_tpm.sh index 398d0818..39978267 100755 --- a/testcases/kernel/security/integrity/ima/tests/ima_tpm.sh +++ b/testcases/kernel/security/integrity/ima/tests/ima_tpm.sh @@ -37,20 +37,8 @@ init() RC=0 # verify ima_boot_aggregate is available - which ima_boot_aggregate >/dev/null 2>&1 || RC=$? - if [ $RC -ne 0 ]; then - tst_res TINFO $LTPTMP/imalog.$$ \ - "$TCID: ima_tpm.sh test requires openssl-devel, skipping" - return $RC - fi + exists ima_boot_aggregate ima_measure - # verify ima_measure is available - which ima_measure > /dev/null 2>&1 || RC=$? - if [ $RC -ne 0 ]; then - tst_res TINFO $LTPTMP/imalog.$$ \ - "$TCID: ima_tpm.sh test requires openssl-devel, skipping" - fi - return $RC } # Function: test01 @@ -69,7 +57,7 @@ test01() # verify TPM is available and enabled. tpm_bios=$SECURITYFS/tpm0/binary_bios_measurements - if [ ! -f $tpm_bios ]; then + if [ ! -f "$tpm_bios" ]; then tst_res TINFO $LTPTMP/imalog.$$ \ "$TCID: no TPM, TPM not builtin kernel, or TPM not enabled" @@ -84,7 +72,7 @@ test01() else boot_aggregate=`ima_boot_aggregate $tpm_bios` boot_aggr=`expr substr $boot_aggregate 16 40` - [ ${ima_aggr} = ${boot_aggr} ] || RC=$? + [ "x${ima_aggr}" = "x${boot_aggr}" ] || RC=$? if [ $RC -eq 0 ]; then tst_res TPASS $LTPTMP/imalog.$$ \ "$TCID: bios aggregate matches IMA boot aggregate." @@ -103,7 +91,7 @@ test01() validate_pcr() { ima_measurements=$SECURITYFS/ima/binary_runtime_measurements - aggregate_pcr=`ima_measure $ima_measurements --validate` + aggregate_pcr=$(ima_measure $ima_measurements --validate) dev_pcrs=$1 RC=0 @@ -127,7 +115,7 @@ test02() TST_COUNT=2 RC=0 -# Would be nice to know where the PCRs are located. Is this safe? + # Would be nice to know where the PCRs are located. Is this safe? PCRS_PATH=`find /$SYSFS/devices/ | grep pcrs` || RC=$? if [ $RC -eq 0 ]; then validate_pcr $PCRS_PATH || RC=$? @@ -177,11 +165,9 @@ test03() RC=0 # Return value from setup, and test functions. EXIT_VAL=0 -# set the testcases/bin directory -. `dirname $0`\/ima_setup.sh -setup || exit $RC - -init || exit $RC +. $(dirname "$0")/ima_setup.sh +setup || exit $? +init || exit $? test01 || EXIT_VAL=$RC test02 || EXIT_VAL=$RC test03 || EXIT_VAL=$RC diff --git a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh index f7353842..4bbbc2a4 100755 --- a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh +++ b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh @@ -196,9 +196,9 @@ test03() RC=0 # Return value from setup, init, and test functions. EXIT_VAL=0 -. `dirname $0`\/ima_setup.sh -setup || exit $RC -init || exit $RC +. $(dirname "$0")/ima_setup.sh +setup || exit $? +init || exit $? test01 || EXIT_VAL=$RC test02 || EXIT_VAL=$RC test03 || EXIT_VAL=$RC diff --git a/testcases/kernel/security/mmc_security/Makefile b/testcases/kernel/security/mmc_security/Makefile dissimilarity index 98% index 307232ec..72d5fcec 100644 --- a/testcases/kernel/security/mmc_security/Makefile +++ b/testcases/kernel/security/mmc_security/Makefile @@ -1,8 +1,29 @@ -SCRIPTS=ask_password.sh assign_password.sh change_password.sh force_erase.sh remove_password.sh - -all: - -install: - @set -e; for i in $(SCRIPTS) ; do ln -f $$i ../../../bin/$$i ; done - -clean: +# +# kernel/security/mmc_security test suite Makefile +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/p9auth/Makefile b/testcases/kernel/security/p9auth/Makefile index 1c03e5b3..0f2251ab 100644 --- a/testcases/kernel/security/p9auth/Makefile +++ b/testcases/kernel/security/p9auth/Makefile @@ -18,23 +18,10 @@ ## ## ################################################################################ -HAVE_P9AUTH := $(shell sh checkp9auth.sh yesno) +top_srcdir ?= ../../../.. -SCRIPTS = runp9auth.sh checkp9auth.sh p9priv.sh p9unpriv.sh +include $(top_srcdir)/include/mk/testcases.mk -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -lcap +INSTALL_TARGETS := *.sh -ifeq ($(HAVE_P9AUTH),yes) -SRCS = $(wildcard *.c) -TARGETS+= $(patsubst %.c,%,$(SRCS)) -endif - -all: $(TARGETS) - -INSTALLTARGETS = $(TARGETS) $(SCRIPTS) -install: $(INSTALLTARGETS) - @set -e; for i in $(INSTALLTARGETS); do ln -f $$i ../../../bin/$$i ; chmod +x ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *.o unhex +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/p9auth/checkp9auth.sh b/testcases/kernel/security/p9auth/checkp9auth.sh deleted file mode 100755 index 43654278..00000000 --- a/testcases/kernel/security/p9auth/checkp9auth.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -################################################################################ -## ## -## Copyright (c) International Business Machines Corp., 2009 ## -## ## -## This program is free software; you can redistribute it and#or modify ## -## it under the terms of the GNU General Public License as published by ## -## the Free Software Foundation; either version 2 of the License, or ## -## (at your option) any later version. ## -## ## -## This program is distributed in the hope that it will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## -## for more details. ## -## ## -## You should have received a copy of the GNU General Public License ## -## along with this program; if not, write to the Free Software ## -## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -## ## -################################################################################ - -yesno=0 -if [ "$1" = "yesno" ]; then - yesno=1 -fi - -# check for openssl -OPENSSL=`which openssl` -if [ $? -ne 0 ]; then - if [ $yesno -eq 1 ]; then echo - echo "no" - else - echo "Openssl not installed. Skipping p9auth tests." - fi - exit 1 -fi -# and make sure openssl understands -hmac -echo -n "501@0" > plain -$OPENSSL sha1 -hmac ab plain > hexed -if [ $? -ne 0 ]; then - if [ $yesno -eq 1 ]; then echo - echo "no" - else - echo "Openssl too old (no -hmac). Skipping p9auth tests." - fi - exit 1 -fi - -majfile=/sys/module/p9auth/parameters/cap_major -minfile=/sys/module/p9auth/parameters/cap_minor -if [ ! -f "$majfile" ]; then - if [ $yesno -eq 1 ]; then echo - echo "no" - else - echo "p9auth not detected. Skipping p9auth tests." - fi - exit 1 -fi - -if [ ! -c "/dev/caphash" ]; then - rm -f /dev/caphash - maj=`cat $majfile` - mknod /dev/caphash c $maj 0 -fi - -if [ ! -c "/dev/capuse" ]; then - rm -f /dev/capuse - min=`cat $minfile` - mknod /dev/capuse c $maj 1 -fi -chmod ugo+w /dev/capuse - -if [ $yesno -eq 1 ]; then - echo "yes" -else - echo "p9auth ready for testing" -fi -exit 0 diff --git a/testcases/kernel/security/selinux-testsuite/Makefile b/testcases/kernel/security/selinux-testsuite/Makefile dissimilarity index 98% index 02a964e1..1e715daf 100644 --- a/testcases/kernel/security/selinux-testsuite/Makefile +++ b/testcases/kernel/security/selinux-testsuite/Makefile @@ -1,12 +1,27 @@ -SUBDIRS = tests - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - mkdir -p ../../../bin - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - +# +# kernel/security/selinux-testsuite test suite Makefile +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/policy/Makefile b/testcases/kernel/security/selinux-testsuite/policy/Makefile dissimilarity index 93% index 3af77318..dd81e21c 100644 --- a/testcases/kernel/security/selinux-testsuite/policy/Makefile +++ b/testcases/kernel/security/selinux-testsuite/policy/Makefile @@ -1,18 +1,52 @@ -include /etc/selinux/config -SELINUX_SRC=/etc/selinux/$(SELINUXTYPE)/src/policy - -# for Fedora Core 2 -# SELINUX_SRC=/etc/security/selinux/src/policy - -load: - @if [ -d $(SELINUX_SRC) ]; then \ - cp test_* $(SELINUX_SRC)/domains/misc/; \ - $(MAKE) -C $(SELINUX_SRC) -W users load; \ - else \ - echo "ERROR: You must have selinux-policy-targeted-sources installed."; \ - fi - -cleanup: - rm -f $(SELINUX_SRC)/domains/misc/test_* - $(MAKE) -C $(SELINUX_SRC) -W users load - +# +# kernel/security/selinux-testsuite/policy 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. +# +# Garrett Cooper, August 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(DESTDIR)/etc/selinux/config + +SELINUX_SRC ?= $(DESTDIR)/etc/selinux/$(SELINUXTYPE)/src/policy + +# cleanup and load remain for backwards compatibility... +.PHONY: all clean cleanup install load + +all: load + +clean: | cleanup + +cleanup: + $(RM) -f $(SELINUX_SRC)/domains/misc/test_* + @if [ -d "$(SELINUX_SRC)" ]; then \ + $(MAKE) -C $(SELINUX_SRC) -W users load; \ + fi + +install: all + +load: + @if [ -d "$(SELINUX_SRC)" ]; then \ + cp -p $(abs_srcdir)/test_* "$(SELINUX_SRC)/domains/misc/"; \ + $(MAKE) -C "$(SELINUX_SRC)" -W users $@; \ + else \ + echo "ERROR: You must have selinux-policy-targeted-sources " \ + "installed."; \ + fi diff --git a/testcases/kernel/security/selinux-testsuite/refpolicy/Makefile b/testcases/kernel/security/selinux-testsuite/refpolicy/Makefile dissimilarity index 92% index dec5f1f4..2a4fa8e2 100644 --- a/testcases/kernel/security/selinux-testsuite/refpolicy/Makefile +++ b/testcases/kernel/security/selinux-testsuite/refpolicy/Makefile @@ -1,41 +1,73 @@ -REDHAT_RELEASE=$(shell rpm -q redhat-release) -REDHAT_VERS=$(shell echo $(REDHAT_RELEASE) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g") -POLICYDEVEL = /usr/share/selinux/devel -SEMODULE = /usr/sbin/semodule -CHECKPOLICY = /usr/bin/checkpolicy -VERS := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ') - -TARGETS=test_global.te test_capable_file.te test_capable_net.te \ -test_capable_sys.te test_dyntrace.te test_dyntrans.te test_entrypoint.te \ -test_execshare.te test_exectrace.te test_execute_no_trans.te \ -test_fdreceive.te test_file.te test_inherit.te test_ioctl.te test_ipc.te \ -test_link.te test_mkdir.te test_open.te test_ptrace.te test_readlink.te \ -test_relabel.te test_rename.te test_rxdir.te test_setattr.te test_setnice.te \ -test_sigkill.te test_stat.te test_sysctl.te test_task_create.te \ -test_task_getpgid.te test_task_getsched.te test_task_getsid.te \ -test_task_setpgid.te test_task_setsched.te test_transition.te test_wait.te - - -ifeq ($(VERS),24) -TARGETS+= test_bounds.te -endif - -load: -ifeq (redhat-release-, $(findstring redhat-release-, $(REDHAT_RELEASE))) - $(MAKE) -C redhat/$(REDHAT_VERS) -else - @if [ -d $(POLICYDEVEL) ]; then \ - set -e; rm -f test_policy.te; for i in $(TARGETS); do cat $$i >> test_policy.te; done; \ - cp test_policy.* $(POLICYDEVEL); \ - $(MAKE) -C $(POLICYDEVEL) clean test_policy.pp; \ - $(SEMODULE) -i $(POLICYDEVEL)/test_policy.pp; \ - else \ - echo "ERROR: You must have selinux-policy-devel installed."; \ - fi -endif - -cleanup: - $(SEMODULE) -r test_policy - rm -f $(POLICYDEVEL)/test_policy.* - rm -f test_policy.te - +# +# kernel/security/selinux-testsuite/refpolicy 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. +# +# Garrett Cooper, August 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +REDHAT_RELEASE ?= $(shell rpm -q redhat-release) +REDHAT_VERS ?= $(shell echo $(REDHAT_RELEASE) | cut -f3 -d- | sed -e "s/[^0-9]*//g") +POLICYDEVEL ?= $(DESTDIR)/usr/share/selinux/devel +SEMODULE ?= $(DESTDIR)/usr/sbin/semodule +CHECKPOLICY ?= $(DESTDIR)/usr/bin/checkpolicy +CHECKPOLICY_VERS ?= $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ') + +CLEAN_TARGETS := test_policy.te + +INSTALL_TARGETS := *.te + +ifeq ($(CHECKPOLICY_VERS),24) +INSTALL_TARGETS := $(filter-out %/test_bounds.te,$(INSTALL_TARGETS)) +endif + +TE_SRCDIR := $(abs_srcdir) + +ifeq (redhat-release-, $(findstring redhat-release-, $(REDHAT_RELEASE))) +ifneq ($(wildcard $(abs_srcdir)/redhat/$(REDHAT_VER)),) +TE_SRCDIR := $(abs_srcdir)/redhat/$(REDHAT_VER) +endif +endif + +.PHONY: all clean cleanup install load + +all: load + +clean: cleanup + +cleanup: + -$(SEMODULE) -r test_policy + $(RM) -f $(POLICYDEVEL)/test_policy.* $(builddir)/test_policy.te + +install: all + +# load remains for backwards compatibility... +load: $(builddir)/test_policy.te + @if [ -d "$(POLICYDEVEL)" ]; then \ + cp -p $(builddir)/test_policy.* $(INSTALL_TARGETS) $(POLICY_DEVEL); \ + $(MAKE) -C $(POLICYDEVEL) clean test_policy.pp; \ + $(SEMODULE) -i $(POLICYDEVEL)/test_policy.pp; \ + else \ + echo "ERROR: You must have selinux-policy-devel installed."; \ + fi + +$(builddir)/test_policy.te: + (cd "$(TE_SRCDIR)" && cat $(INSTALL_TARGETS)) > "$@"; diff --git a/testcases/kernel/security/selinux-testsuite/tests/Makefile b/testcases/kernel/security/selinux-testsuite/tests/Makefile dissimilarity index 96% index 775ae4fb..fe9ace76 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/Makefile @@ -1,29 +1,34 @@ -REDHAT_RELEASE=$(shell rpm -q redhat-release) - -SUBDIRS=domain_trans entrypoint execshare exectrace execute_no_trans fdreceive inherit link mkdir msg open ptrace readlink relabel rename rxdir sem setattr setnice shm sigkill stat sysctl task_create task_setnice task_setscheduler task_getscheduler task_getsid task_getpgid task_setpgid wait file ioctl capable_file capable_net capable_sys dyntrace dyntrans bounds - -ifeq (redhat-release-4, $(findstring redhat-release-4, $(REDHAT_RELEASE))) - SUBDIRS=domain_trans entrypoint execshare exectrace execute_no_trans fdreceive inherit link mkdir msg open ptrace readlink relabel rename rxdir sem setattr setnice shm sigkill stat sysctl task_create task_setnice task_setscheduler task_getscheduler task_getsid task_getpgid task_setpgid wait file ioctl capable_file capable_net capable_sys -endif - -ifeq (redhat-release-5, $(findstring redhat-release-5, $(REDHAT_RELEASE))) - SUBDIRS=domain_trans entrypoint execshare exectrace execute_no_trans fdreceive inherit link mkdir msg open ptrace readlink relabel rename rxdir sem setattr setnice shm sigkill stat sysctl task_create task_setnice task_setscheduler task_getscheduler task_getsid task_getpgid task_setpgid wait file ioctl capable_file capable_net capable_sys dyntrace dyntrans -endif - -all: - @set -e; for i in $(SUBDIRS); do \ - $(MAKE) -C $$i all; \ - chcon -R -t test_file_t . ; \ - done - -install: all - mkdir -p ../../../../bin ; - @set -e; for i in $(SUBDIRS); do \ - $(MAKE) -C $$i install; \ - done - -clean: - @set -e; for i in $(SUBDIRS); do \ - $(MAKE) -C $$i clean; \ - done - +# +# kernel/security/selinux-testsuite/tests 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. +# +# Garrett Cooper, August 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +RECURSIVE_TARGETS := install + +include $(top_srcdir)/include/mk/generic_trunk_target.mk + +all: + @set -e; for i in $(SUBDIRS); do \ + $(MAKE) -C $$i $@; \ + done diff --git a/testcases/kernel/security/selinux-testsuite/tests/Makefile.inc b/testcases/kernel/security/selinux-testsuite/tests/Makefile.inc new file mode 100644 index 00000000..29653c8c --- /dev/null +++ b/testcases/kernel/security/selinux-testsuite/tests/Makefile.inc @@ -0,0 +1,35 @@ +# +# kernel/security/selinux-testsuite include 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. +# +# Garrett Cooper, August 2009 +# + +CURDIR_DIRNAME := $(lastword $(subst /, ,$(abs_srcdir))) + +LDLIBS += -lselinux -lpthread + +# This is a soft error because it won't work if you're not root and doing a +# cross-compilation based install. +define INSTALL_POST + -chcon -t test_file_t $@ +endef + +INSTALL_TARGETS := selinux_$(CURDIR_DIRNAME)*.sh + +# vim: syntax=make diff --git a/testcases/kernel/security/selinux-testsuite/tests/bounds/Makefile b/testcases/kernel/security/selinux-testsuite/tests/bounds/Makefile dissimilarity index 98% index d5c5e530..f0f0abef 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/bounds/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/bounds/Makefile @@ -1,11 +1,30 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) -LDLIBS += -lselinux -lpthread - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_bounds.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) \ No newline at end of file +# +# kernel/security/selinux-testsuite/tests/bounds test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lselinux -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/capable_file/Makefile b/testcases/kernel/security/selinux-testsuite/tests/capable_file/Makefile dissimilarity index 98% index 22bc9f1f..4d4dea24 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/capable_file/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/capable_file/Makefile @@ -1,11 +1,30 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_capable_file.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) - +# +# kernel/security/selinux-testsuite/tests/capable_file test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lselinux -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/capable_net/Makefile b/testcases/kernel/security/selinux-testsuite/tests/capable_net/Makefile dissimilarity index 98% index 3ce5965f..26e443e3 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/capable_net/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/capable_net/Makefile @@ -1,10 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_capable_net.sh ../../../../../bin/ -clean: - rm -f $(TARGETS) - +# +# kernel/security/selinux-testsuite/tests/capable_net test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/capable_sys/Makefile b/testcases/kernel/security/selinux-testsuite/tests/capable_sys/Makefile dissimilarity index 99% index 2223cb25..2567c927 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/capable_sys/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/capable_sys/Makefile @@ -1,9 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_capable_sys.sh ../../../../../bin/ -clean: - rm -f $(TARGETS) - +# +# kernel/security/selinux-testsuite/tests/capable_sys test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/domain_trans/Makefile b/testcases/kernel/security/selinux-testsuite/tests/domain_trans/Makefile dissimilarity index 100% index 00b3e386..5a483de7 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/domain_trans/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/domain_trans/Makefile @@ -1,4 +1,27 @@ -all: -install: - ln -f selinux_domain_trans.sh ../../../../../bin/ -clean: +# +# kernel/security/selinux-testsuite/tests/domain_trans test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/dyntrace/Makefile b/testcases/kernel/security/selinux-testsuite/tests/dyntrace/Makefile dissimilarity index 98% index 49132b41..f88ae4c4 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/dyntrace/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/dyntrace/Makefile @@ -1,11 +1,30 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) -LDLIBS += -lselinux - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_dyntrace.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/dyntrace test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lselinux + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/dyntrans/Makefile b/testcases/kernel/security/selinux-testsuite/tests/dyntrans/Makefile dissimilarity index 98% index 42ae8725..11b3f51e 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/dyntrans/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/dyntrans/Makefile @@ -1,11 +1,30 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) -LDLIBS += -lselinux - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_dyntrans.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/dyntrans test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lselinux + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/entrypoint/Makefile b/testcases/kernel/security/selinux-testsuite/tests/entrypoint/Makefile dissimilarity index 100% index 1af4688c..0d7d99c2 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/entrypoint/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/entrypoint/Makefile @@ -1,4 +1,27 @@ -all: -install: - ln -f selinux_entrypoint.sh ../../../../../bin/ -clean: +# +# kernel/security/selinux-testsuite/tests/entrypoint test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/execshare/Makefile b/testcases/kernel/security/selinux-testsuite/tests/execshare/Makefile dissimilarity index 98% index 499ca081..b55e86be 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/execshare/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/execshare/Makefile @@ -1,12 +1,30 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) -LDLIBS += -lselinux - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i ; done - ln -f selinux_execshare.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) - +# +# kernel/security/selinux-testsuite/tests/execshare test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lselinux + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/exectrace/Makefile b/testcases/kernel/security/selinux-testsuite/tests/exectrace/Makefile dissimilarity index 98% index 8e2243ae..077b6f06 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/exectrace/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/exectrace/Makefile @@ -1,12 +1,30 @@ -TARGETS=selinux_exectrace_parent selinux_exectrace_child -LDLIBS += -lselinux - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_exectrace.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) - +# +# kernel/security/selinux-testsuite/tests/exectrace test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lselinux + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/Makefile b/testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/Makefile dissimilarity index 100% index 6fb9b964..444f9268 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/Makefile @@ -1,4 +1,27 @@ -all: -install: - ln -f selinux_execute_no_trans.sh ../../../../../bin/ -clean: +# +# kernel/security/selinux-testsuite/tests/execute_no_trans test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/fdreceive/Makefile b/testcases/kernel/security/selinux-testsuite/tests/fdreceive/Makefile dissimilarity index 98% index a6972549..6f7f1f24 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/fdreceive/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/fdreceive/Makefile @@ -1,10 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_fdreceive.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/fdreceive test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/file/Makefile b/testcases/kernel/security/selinux-testsuite/tests/file/Makefile dissimilarity index 98% index 6e281e7c..6c49acb4 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/file/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/file/Makefile @@ -1,11 +1,30 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) -LDLIBS += -lselinux - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_file.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/file test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lselinux + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/inherit/Makefile b/testcases/kernel/security/selinux-testsuite/tests/inherit/Makefile dissimilarity index 98% index d30e3d3b..ebca3061 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/inherit/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/inherit/Makefile @@ -1,14 +1,32 @@ -TARGETS=selinux_inherit_child selinux_inherit_parent - -LDFLAGS +=-static - -LDLIBS += -lselinux - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_inherit.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/inherit test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc + +LDFLAGS += -static + +LDLIBS += -lselinux + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/ioctl/Makefile b/testcases/kernel/security/selinux-testsuite/tests/ioctl/Makefile dissimilarity index 98% index 02fd5adf..280b5da4 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/ioctl/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/ioctl/Makefile @@ -1,10 +1,27 @@ -TARGETS=selinux_ioctl selinux_noioctl - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_ioctl.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/ioctl test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/link/Makefile b/testcases/kernel/security/selinux-testsuite/tests/link/Makefile dissimilarity index 100% index 1bb44eef..5385193a 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/link/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/link/Makefile @@ -1,4 +1,27 @@ -all: -install: - ln -f selinux_link.sh ../../../../../bin/ -clean: +# +# kernel/security/selinux-testsuite/tests/link test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/mkdir/Makefile b/testcases/kernel/security/selinux-testsuite/tests/mkdir/Makefile dissimilarity index 100% index 195c1339..c439bf5b 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/mkdir/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/mkdir/Makefile @@ -1,4 +1,27 @@ -all: -install: - ln -f selinux_mkdir.sh ../../../../../bin/ -clean: +# +# kernel/security/selinux-testsuite/tests/mkdir test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/msg/Makefile b/testcases/kernel/security/selinux-testsuite/tests/msg/Makefile dissimilarity index 98% index 6d499e24..595dc2df 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/msg/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/msg/Makefile @@ -1,10 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_msg.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/msg test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/open/Makefile b/testcases/kernel/security/selinux-testsuite/tests/open/Makefile dissimilarity index 98% index d94d57a1..5a193bd5 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/open/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/open/Makefile @@ -1,10 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_open.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/open test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/ptrace/Makefile b/testcases/kernel/security/selinux-testsuite/tests/ptrace/Makefile dissimilarity index 98% index d63938fb..ea4f92ba 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/ptrace/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/ptrace/Makefile @@ -1,11 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_ptrace.sh ../../../../../bin/ - ln -f selinux_ptrace_wait.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/ptrace test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/readlink/Makefile b/testcases/kernel/security/selinux-testsuite/tests/readlink/Makefile dissimilarity index 98% index 643c43c1..fda99206 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/readlink/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/readlink/Makefile @@ -1,5 +1,27 @@ -all: -install: - ln -f selinux_readlink.sh ../../../../../bin/ - -clean: +# +# kernel/security/selinux-testsuite/tests/readlink test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/relabel/Makefile b/testcases/kernel/security/selinux-testsuite/tests/relabel/Makefile dissimilarity index 98% index 30e81b97..24eae542 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/relabel/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/relabel/Makefile @@ -1,5 +1,27 @@ -all: -install: - ln -f selinux_relabel.sh ../../../../../bin/ - -clean: +# +# kernel/security/selinux-testsuite/tests/relabel test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/rename/Makefile b/testcases/kernel/security/selinux-testsuite/tests/rename/Makefile dissimilarity index 98% index 417e80ff..a4cf2289 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/rename/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/rename/Makefile @@ -1,5 +1,27 @@ -all: -install: - ln -f selinux_rename.sh ../../../../../bin/ - -clean: +# +# kernel/security/selinux-testsuite/tests/rename test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/rxdir/Makefile b/testcases/kernel/security/selinux-testsuite/tests/rxdir/Makefile dissimilarity index 98% index 1d0f29e4..4dbb5b4c 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/rxdir/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/rxdir/Makefile @@ -1,5 +1,27 @@ -all: -install: - ln -f selinux_rxdir.sh ../../../../../bin/ - -clean: +# +# kernel/security/selinux-testsuite/tests/rxdir test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/sem/Makefile b/testcases/kernel/security/selinux-testsuite/tests/sem/Makefile dissimilarity index 98% index b1960c1b..c6b2a834 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/sem/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/sem/Makefile @@ -1,10 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_sem.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/sem test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/setattr/Makefile b/testcases/kernel/security/selinux-testsuite/tests/setattr/Makefile dissimilarity index 97% index ae97ffef..6dc0bbcf 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/setattr/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/setattr/Makefile @@ -1,6 +1,27 @@ -all: - -install: - ln -f selinux_setattr.sh ../../../../../bin/ - -clean: +# +# kernel/security/selinux-testsuite/tests/setattr test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/setnice/Makefile b/testcases/kernel/security/selinux-testsuite/tests/setnice/Makefile dissimilarity index 98% index 87890e32..453ccdd8 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/setnice/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/setnice/Makefile @@ -1,11 +1,30 @@ -TARGETS=selinux_setnice_parent selinux_setnice_child - -LDLIBS += -lselinux - -all: $(TARGETS) -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_setnice.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/setattr test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS := -lselinux + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/shm/Makefile b/testcases/kernel/security/selinux-testsuite/tests/shm/Makefile dissimilarity index 98% index 086233d7..428e8464 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/shm/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/shm/Makefile @@ -1,10 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_shm.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/shm test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/sigkill/Makefile b/testcases/kernel/security/selinux-testsuite/tests/sigkill/Makefile dissimilarity index 98% index 7d899462..00141072 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/sigkill/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/sigkill/Makefile @@ -1,10 +1,27 @@ -TARGETS=selinux_sigkill_server - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_sigkill.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/sigkill test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/stat/Makefile b/testcases/kernel/security/selinux-testsuite/tests/stat/Makefile dissimilarity index 96% index a08fe0ac..04e40c7e 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/stat/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/stat/Makefile @@ -1,6 +1,27 @@ -all: -install: - ln -f selinux_stat.sh ../../../../../bin/ - -clean: - +# +# kernel/security/selinux-testsuite/tests/stat test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/sysctl/Makefile b/testcases/kernel/security/selinux-testsuite/tests/sysctl/Makefile dissimilarity index 98% index c25ebb10..1a0b7126 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/sysctl/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/sysctl/Makefile @@ -1,5 +1,27 @@ -all: -install: - ln -f selinux_sysctl.sh ../../../../../bin/ - -clean: +# +# kernel/security/selinux-testsuite/tests/sysctl test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/task_create/Makefile b/testcases/kernel/security/selinux-testsuite/tests/task_create/Makefile dissimilarity index 99% index 5267fa83..65017885 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/task_create/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/task_create/Makefile @@ -1,9 +1,27 @@ -TARGETS=selinux_task_create_parent - -all: $(TARGETS) -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_task_create.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/task_create test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/task_getpgid/Makefile b/testcases/kernel/security/selinux-testsuite/tests/task_getpgid/Makefile dissimilarity index 98% index 18adf140..48c574f6 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/task_getpgid/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/task_getpgid/Makefile @@ -1,10 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_task_getpgid.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/task_getpgid test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/task_getscheduler/Makefile b/testcases/kernel/security/selinux-testsuite/tests/task_getscheduler/Makefile dissimilarity index 98% index 831b054f..c7b1e727 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/task_getscheduler/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/task_getscheduler/Makefile @@ -1,11 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_task_getscheduler.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) - +# +# kernel/security/selinux-testsuite/tests/task_getscheduler test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/task_getsid/Makefile b/testcases/kernel/security/selinux-testsuite/tests/task_getsid/Makefile dissimilarity index 98% index 1660405b..1c8c65e8 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/task_getsid/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/task_getsid/Makefile @@ -1,10 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_task_getsid.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/task_getsid test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/task_setnice/Makefile b/testcases/kernel/security/selinux-testsuite/tests/task_setnice/Makefile dissimilarity index 98% index 847335cd..e7fe28a7 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/task_setnice/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/task_setnice/Makefile @@ -1,10 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_task_setnice.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/task_setnice test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/task_setpgid/Makefile b/testcases/kernel/security/selinux-testsuite/tests/task_setpgid/Makefile dissimilarity index 99% index d2be7347..b085d704 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/task_setpgid/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/task_setpgid/Makefile @@ -1,8 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) -all: $(TARGETS) -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_task_setpgid.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/task_setpgid test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/task_setscheduler/Makefile b/testcases/kernel/security/selinux-testsuite/tests/task_setscheduler/Makefile dissimilarity index 98% index 7648b3cc..71b2ed3a 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/task_setscheduler/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/task_setscheduler/Makefile @@ -1,11 +1,27 @@ -TARGETS=$(patsubst %.c,%,$(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_task_setscheduler.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) - +# +# kernel/security/selinux-testsuite/tests/task_setscheduler test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/selinux-testsuite/tests/wait/Makefile b/testcases/kernel/security/selinux-testsuite/tests/wait/Makefile dissimilarity index 99% index 90bf9354..dc6152aa 100644 --- a/testcases/kernel/security/selinux-testsuite/tests/wait/Makefile +++ b/testcases/kernel/security/selinux-testsuite/tests/wait/Makefile @@ -1,10 +1,30 @@ -TARGETS=selinux_wait_parent selinux_wait_child -LDLIBS += -lselinux - -all: $(TARGETS) -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../../bin/$$i; done - ln -f selinux_wait.sh ../../../../../bin/ - -clean: - rm -f $(TARGETS) +# +# kernel/security/selinux-testsuite/tests/wait test 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../Makefile.inc + +LDLIBS += -lselinux + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/smack/Makefile b/testcases/kernel/security/smack/Makefile dissimilarity index 69% index 09d238bc..e1149989 100644 --- a/testcases/kernel/security/smack/Makefile +++ b/testcases/kernel/security/smack/Makefile @@ -1,30 +1,15 @@ -# -# Copyright (c) Casey Schaufler, 2009 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# - -SCRIPTS = \ - smack_set_ambient.sh \ - smack_set_cipso.sh \ - smack_set_current.sh \ - smack_set_direct.sh \ - smack_set_doi.sh \ - smack_set_load.sh \ - smack_set_netlabel.sh \ - smack_set_onlycap.sh \ - smack_file_access.sh - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) -INSTALLTARGETS = $(TARGETS) $(SCRIPTS) -all: $(TARGETS) - -INSTALLTARGETS = $(TARGETS) $(SCRIPTS) -install: $(INSTALLTARGETS) - @set -e; for i in $(INSTALLTARGETS); do ln -f $$i ../../../bin/$$i ; chmod +x ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *.o +# +# Copyright (c) Casey Schaufler, 2009 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/smack/smack_common.sh b/testcases/kernel/security/smack/smack_common.sh new file mode 100755 index 00000000..eb339f31 --- /dev/null +++ b/testcases/kernel/security/smack/smack_common.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# +# testcases/security/smack/smack_common.sh +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# +# This file serves the sole purpose of executing every common piece of +# prerequisite code for all of the smack tests, s.t. a lot of duplicate shell +# code isn't laying around all over the place. +# + +smackfsdir=${smackfsdir:=/smack} + +check_mounted() { + if [ ! -d "$smackfsdir" ]; then + echo "smackfs not mounted at $smackfsdir" + exit 1 + fi +} + +check_onlycap() { + onlycap=`cat "$smackfsdir/onlycap" 2>/dev/null` + if [ -z "$onlycap" ]; then + cat < $TestFile" + ./notroot /bin/sh -c "echo InitialData 2>/dev/null > $TestFile" if [ ! -d "$TestFile" ]; then - echo Test file \"$TestFile\" can not be created. + echo "Test file \"$TestFile\" can not be created." rm -rf "$Where" exit 1 fi @@ -60,65 +55,65 @@ SetTo=`getfattr --only-values -n security.SMACK64 -e text $TestFile` SetTo=`echo $SetTo` if [ "TheOther" != "$SetTo" ]; then - echo Test file \"$TestFile\" labeled \"$SetTo\" incorrectly. + echo "Test file \"$TestFile\" labeled \"$SetTo\" incorrectly." rm -rf "$Where" exit 1 fi -OldRule=`grep "^TheOne" /smack/load | grep ' TheOther '` +OldRule=`grep "^TheOne" "$smackfsdir/load" 2>/dev/null | grep ' TheOther '` -echo -n "$RuleA" > /smack/load -NewRule=`grep "^TheOne" /smack/load | grep ' TheOther '` -if [ "$NewRule" == "" ]; then - echo Rule did not get set. +echo -n "$RuleA" > "$smackfsdir/load" +NewRule=`grep "^TheOne" "$smackfsdir/load" 2>/dev/null | grep ' TheOther '` +if [ "$NewRule" = "" ]; then + echo "Rule did not get set." rm -rf "$Where" exit 1 fi Mode=`echo $NewRule | sed -e 's/.* //'` if [ "$Mode" != "r" ]; then - echo Rule \"$NewRule\" is not set correctly. + echo "Rule \"$NewRule\" is not set correctly." rm -rf "$Where" exit 1 fi -OldProc=`cat /proc/self/attr/current` +OldProc=`cat /proc/self/attr/current 2>/dev/null` -echo TheOne > /proc/self/attr/current +echo TheOne 2>/dev/null > /proc/self/attr/current GotRead=`./notroot $CAT "$TestFile"` if [ "$GotRead" != "InitialData" ]; then - echo Read failed for \"$TestFile\" labeled \"TheOther\". + echo "Read failed for \"$TestFile\" labeled \"TheOther\"." rm -rf "$Where" exit 1 fi -echo NotTheOne > /proc/self/attr/current +echo NotTheOne 2>/dev/null > /proc/self/attr/current GotRead=`./notroot $CAT "$TestFile"` -if [ "$GotRead" == "InitialData" ]; then - echo Read should have failed for \"$TestFile\" labeled \"TheOther\". +if [ "$GotRead" = "InitialData" ]; then + echo "Read should have failed for \"$TestFile\" labeled \"TheOther\"." rm -rf "$Where" exit 1 fi -echo -n "$RuleB" > /smack/load -NewRule=`grep "^TheOne" /smack/load | grep ' TheOther '` -if [ "$NewRule" == "" ]; then - echo Rule did not get set. +echo -n "$RuleB" 2>/dev/null > "$smackfsdir/load" +NewRule=`grep "^TheOne" $smackfsdir/load 2>/dev/null | grep ' TheOther '` +if [ "$NewRule" = "" ]; then + echo "Rule did not get set." rm -rf "$Where" exit 1 fi Mode=`echo $NewRule | sed -e 's/.* //'` if [ "$Mode" != "rw" ]; then - echo Rule \"$NewRule\" is not set correctly. + echo "Rule \"$NewRule\" is not set correctly." rm -rf "$Where" exit 1 fi if [ "$OldRule" != "$NewRule" ]; then - echo Notice: Test access rule changed from - echo \"$OldRule\" to \"$NewRule\". + cat < /smack/ambient +NotTheFloorLabel="XYZZY" +StartLabel=`cat "$smackfsdir/ambient" 2>/dev/null` + +echo "$NotTheFloorLabel" 2>/dev/null > "$smackfsdir/ambient" -label=`cat /smack/ambient` +label=`cat "$smackfsdir/ambient" 2>/dev/null` if [ "$label" != "$NotTheFloorLabel" ]; then - echo The smack label reported for the current process is \"$label\", - echo not the expected \"$NotTheFloorLabel\". + cat < /smack/ambient +echo "$StartLabel" 2>/dev/null > "$smackfsdir/ambient" -label=`cat /smack/ambient` +label=`cat "$smackfsdir/ambient" 2>/dev/null` if [ "$label" != "$StartLabel" ]; then - echo The smack label reported for the current process is \"$label\", - echo not the expected \"$StartLabel\". + cat </dev/null` -OldRule=`grep "^TheOne" /smack/cipso` - -echo -n "$RuleA" > /smack/cipso -NewRule=`grep "^TheOne" /smack/cipso` -if [ "$NewRule" == "" ]; then - echo Rule did not get set. +echo -n "$RuleA" 2>/dev/null > "$smackfsdir/cipso" +NewRule=`grep "^TheOne" "$smackfsdir/cipso" 2>/dev/null` +if [ "$NewRule" = "" ]; then + echo "Rule did not get set." exit 1 fi -Right=`echo $NewRule | grep ' 2'` -if [ "$Right" == "" ]; then - echo Rule \"$NewRule\" is not set correctly. +Right=`echo "$NewRule" | grep ' 2'` +if [ "$Right" = "" ]; then + echo "Rule \"$NewRule\" is not set correctly." exit 1 fi -echo -n "$RuleB" > /smack/cipso -NewRule=`grep "^TheOne" /smack/cipso` -if [ "$NewRule" == "" ]; then - echo Rule did not get set. +echo -n "$RuleB" 2>/dev/null > "$smackfsdir/cipso" +NewRule=`grep "^TheOne" "$smackfsdir/cipso" 2>/dev/null` +if [ "$NewRule" = "" ]; then + echo "Rule did not get set." exit 1 fi Right=`echo $NewRule | grep '/55'` -if [ "$Right" == "" ]; then - echo Rule \"$NewRule\" is not set correctly. +if [ "$Right" = "" ]; then + echo "Rule \"$NewRule\" is not set correctly." exit 1 fi -echo -n "$RuleC" > /smack/cipso -NewRule=`grep "^TheOne" /smack/cipso` -if [ "$NewRule" == "" ]; then - echo Rule did not get set. +echo -n "$RuleC" 2>/dev/null > "$smackfsdir/cipso" +NewRule=`grep "^TheOne" "$smackfsdir/cipso" 2>/dev/null` +if [ "$NewRule" = "" ]; then + echo "Rule did not get set." exit 1 fi -Right=`echo $NewRule | grep '/17,33'` -if [ "$Right" == "" ]; then - echo Rule \"$NewRule\" is not set correctly. +Right=`echo "$NewRule" | grep '/17,33'` +if [ "$Right" = "" ]; then + echo "Rule \"$NewRule\" is not set correctly." exit 1 fi - if [ "$OldRule" != "$NewRule" ]; then - echo Notice: Test access rule changed from \"$OldRule\" to \"$NewRule\". + cat < /proc/self/attr/current +NotTheFloorLabel="XYZZY" +StartLabel=`cat /proc/self/attr/current 2>/dev/null` + +echo "$NotTheFloorLabel" 2>/dev/null > /proc/self/attr/current -label=`cat /proc/self/attr/current` +label=`cat /proc/self/attr/current 2>/dev/null` if [ "$label" != "$NotTheFloorLabel" ]; then - echo The smack label reported for the current process is \"$label\", - echo not the expected \"$NotTheFloorLabel\". + cat < /proc/self/attr/current +echo "$StartLabel" 2>/dev/null > /proc/self/attr/current -label=`cat /proc/self/attr/current` +label=`cat /proc/self/attr/current > /dev/null` if [ "$label" != "$StartLabel" ]; then - echo The smack label reported for the current process is \"$label\", - echo not the expected \"$StartLabel\". + cat < /smack/direct +NotTheStartValue="17" +StartValue=`cat "$smackfsdir/direct" 2>/dev/null` + +echo "$NotTheStartValue" 2>/dev/null > "$smackfsdir/direct" -DirectValue=`cat /smack/direct` +DirectValue=`cat "$smackfsdir/direct" 2>/dev/null` if [ "$DirectValue" != "$NotTheStartValue" ]; then - echo The CIPSO direct level reported is \"$DirectValue\", - echo not the expected \"$NotTheStartValue\". + cat < /smack/direct +echo "$StartValue" 2>/dev/null> "$smackfsdir/direct" -DirectValue=`cat /smack/direct` +DirectValue=`cat "$smackfsdir/direct" 2>/dev/null` if [ "$DirectValue" != "$StartValue" ]; then - echo The CIPSO direct level reported is \"$DirectValue\", - echo not the expected \"$StartValue\". + cat </dev/null` -echo $NotTheStartValue > /smack/doi +echo "$NotTheStartValue" 2>/dev/null > "$smackfsdir/doi" -DirectValue=`cat /smack/doi` +DirectValue=`cat "$smackfsdir/doi" 2>/dev/null` if [ "$DirectValue" != "$NotTheStartValue" ]; then - echo The CIPSO doi reported is \"$DirectValue\", - echo not the expected \"$NotTheStartValue\". + cat < /smack/doi +echo "$StartValue" 2>/dev/null > "$smackfsdir/doi" -DirectValue=`cat /smack/doi` +DirectValue=`cat "$smackfsdir/doi" 2>/dev/null` if [ "$DirectValue" != "$StartValue" ]; then - echo The CIPSO doi reported is \"$DirectValue\", - echo not the expected \"$StartValue\". + cat </dev/null | grep ' TheOther '` -echo -n "$RuleA" > /smack/load -NewRule=`grep "^TheOne" /smack/load | grep ' TheOther '` -if [ "$NewRule" == "" ]; then - echo Rule did not get set. +echo -n "$RuleA" 2>/dev/null > "$smackfsdir/load" +NewRule=`grep "^TheOne" "$smackfsdir/load" 2>/dev/null | grep ' TheOther '` +if [ "$NewRule" = "" ]; then + echo "Rule did not get set." exit 1 fi -Mode=`echo $NewRule | sed -e 's/.* //'` +Mode=`echo "$NewRule" | sed -e 's/.* //'` if [ "$Mode" != "rwxa" ]; then - echo Rule \"$NewRule\" is not set correctly. + echo "Rule \"$NewRule\" is not set correctly." exit 1 fi -echo -n "$RuleB" > /smack/load -NewRule=`grep "^TheOne" /smack/load | grep ' TheOther '` -if [ "$NewRule" == "" ]; then - echo Rule did not get set. +echo -n "$RuleB" 2>/dev/null > "$smackfsdir/load" +NewRule=`grep "^TheOne" "$smackfsdir/load" 2>/dev/null | grep ' TheOther '` +if [ "$NewRule" = "" ]; then + echo "Rule did not get set." exit 1 fi -Mode=`echo $NewRule | sed -e 's/.* //'` +Mode=`echo "$NewRule" | sed -e 's/.* //'` if [ "$Mode" != "r" ]; then - echo Rule \"$NewRule\" is not set correctly. + echo "Rule \"$NewRule\" is not set correctly." exit 1 fi if [ "$OldRule" != "$NewRule" ]; then - echo Notice: Test access rule changed from - echo \"$OldRule\" to \"$NewRule\". + cat </dev/null` +Old24=`grep "^191.190.190.0/24" "$smackfsdir/netlabel" 2>/dev/null` -Old32=`grep "^191.191.191.191/32" /smack/netlabel` -Old24=`grep "^191.190.190.0/24" /smack/netlabel` - -echo -n "$RuleA" > /smack/netlabel -New32=`grep "$RuleA1" /smack/netlabel` +echo -n "$RuleA" 2>/dev/null > "$smackfsdir/netlabel" +New32=`grep "$RuleA1" $smackfsdir/netlabel 2>/dev/null` if [ "$New32" != "$RuleA1" ]; then - echo Rule \"$RuleA\" did not get set. + echo "Rule \"$RuleA\" did not get set." exit 1 fi -echo -n "$RuleB" > /smack/netlabel -New24=`grep "$RuleB" /smack/netlabel` +echo -n "$RuleB" 2>/dev/null > "$smackfsdir/netlabel" +New24=`grep "$RuleB" "$smackfsdir/netlabel" 2>/dev/null` if [ "$New24" != "$RuleB" ]; then - echo Rule \"$RuleB\" did not get set. + echo "Rule \"$RuleB\" did not get set." exit 1 fi if [ "$Old24" != "$New24" ]; then - echo Notice: Test access rule changed from - echo \"$Old24\" to \"$New24\". + cat < /smack/onlycap - -label=`cat /smack/onlycap` -if [ "$label" != "$MyLabel" ]; then - echo The smack label reported for /smack/onlycap is \"$label\", - echo not the expected \"$MyLabel\". - exit 1 -fi - -echo "$StartLabel" > /smack/onlycap - -label=`cat /smack/onlycap` -if [ "$label" != "$StartLabel" ]; then - echo The smack label reported for the current process is \"$label\", - echo not the expected \"$StartLabel\". - exit 1 -fi - -exit 0 +#!/bin/sh +# +# Copyright (c) 2009 Casey Schaufler under the terms of the +# GNU General Public License version 2, as published by the +# Free Software Foundation +# +# Test setting of the privileged Smack label +# +# Environment: +# CAP_MAC_ADMIN +# + +source smack_common.sh + +MyLabel=`cat /proc/self/attr/current 2>/dev/null` +StartLabel=`cat "$smackfsdir/onlycap" 2>/dev/null` + +echo "$MyLabel" 2>/dev/null > "$smackfsdir/onlycap" + +label=`cat "$smackfsdir/onlycap" 2>/dev/null` +if [ "$label" != "$MyLabel" ]; then + cat </dev/null > "$smackfsdir/onlycap" + +label=`cat "$smackfsdir/onlycap" 2>/dev/null` +if [ "$label" != "$StartLabel" ]; then + cat < /dev/null 2>&1 && echo "-Wno-pointer-sign"} - -# -# Tools for kernel testing. -# - -.c: include.h - $(CC) $(CFLAGS) -o $@ $< - chmod 700 $@ - -# -# Delete all tools in this package. -# - -clean: - rm -f $(ALL_FILES) +# +# kernel/security/smack testcase Makefile +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := testall.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/tomoyo/include.h b/testcases/kernel/security/tomoyo/include.h index bbde2ea8..be83a5a6 100644 --- a/testcases/kernel/security/tomoyo/include.h +++ b/testcases/kernel/security/tomoyo/include.h @@ -48,10 +48,22 @@ #include #include +/* + * Some architectures like mips n32 don't have __NR_uselib defined in the + * system headers. + */ +#ifdef __NR_uselib static inline int uselib(const char *library) { return syscall(__NR_uselib, library); } +#else +static inline int uselib(const char *library) +{ + errno = ENOSYS; + return -1; +} +#endif #define proc_policy_dir "/sys/kernel/security/tomoyo/" #define proc_policy_domain_policy proc_policy_dir "domain_policy" diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile dissimilarity index 98% index 15b5a562..ee677a16 100644 --- a/testcases/kernel/syscalls/Makefile +++ b/testcases/kernel/syscalls/Makefile @@ -1,55 +1,35 @@ -# -# Copyright (c) International Business Machines Corp., 2001 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# - -DEBUG_CFLAGS=-O -DEBUG_LDFLAGS=-s -CFLAGS+=-I../../include -g -Wall -LDLIBS+= -EXCLUDE_DIR=epoll - -# -# Commented this out since there are directories here we don't want built by default -# -SUBDIR = `ls */Makefile | sed "s/Makefile//g"` -UCLINUX_SUBDIR = `ls */Makefile | sed "s/Makefile//g" | grep -vE "^fork|epoll|capget|capset|chmod|chown|llseek|nftw|clone|profil|getcontext|remap_file_pages"` - -all: - @set -e; for i in $(SUBDIR); do \ - $(MAKE) -C $$i all; \ - done - -install: - @set -e; for i in $(SUBDIR); do \ - $(MAKE) -C $$i install; \ - done - -uclinux: - @set -e; for i in $(UCLINUX_SUBDIR); do \ - $(MAKE) -C $$i UCLINUX=1 all; \ - done - -uclinux_install: - @set -e; for i in $(UCLINUX_SUBDIR); do \ - $(MAKE) -C $$i UCLINUX=1 install; \ - done - -clean: - @set -e; for i in $(SUBDIR); do \ - $(MAKE) -C $$i clean; \ - done - +# +# testcases/kernel/timers 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +# pcllib is busted as all heck because of libtool +FILTER_OUT_DIRS := pcllib + +ifeq ($(UCLINUX),1) +FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \ + nftw profil remap_file_pages +endif + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/syscalls/abort/Makefile b/testcases/kernel/syscalls/abort/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/abort/Makefile +++ b/testcases/kernel/syscalls/abort/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/accept/Makefile b/testcases/kernel/syscalls/accept/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/accept/Makefile +++ b/testcases/kernel/syscalls/accept/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/accept4/Makefile b/testcases/kernel/syscalls/accept4/Makefile index 810f38c2..504042e1 100644 --- a/testcases/kernel/syscalls/accept4/Makefile +++ b/testcases/kernel/syscalls/accept4/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/access/Makefile b/testcases/kernel/syscalls/access/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/access/Makefile +++ b/testcases/kernel/syscalls/access/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/acct/Makefile b/testcases/kernel/syscalls/acct/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/acct/Makefile +++ b/testcases/kernel/syscalls/acct/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/add_key/Makefile b/testcases/kernel/syscalls/add_key/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/add_key/Makefile +++ b/testcases/kernel/syscalls/add_key/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/adjtimex/Makefile b/testcases/kernel/syscalls/adjtimex/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/adjtimex/Makefile +++ b/testcases/kernel/syscalls/adjtimex/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/alarm/Makefile b/testcases/kernel/syscalls/alarm/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/alarm/Makefile +++ b/testcases/kernel/syscalls/alarm/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/asyncio/Makefile b/testcases/kernel/syscalls/asyncio/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/asyncio/Makefile +++ b/testcases/kernel/syscalls/asyncio/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/bdflush/Makefile b/testcases/kernel/syscalls/bdflush/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/bdflush/Makefile +++ b/testcases/kernel/syscalls/bdflush/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/bind/Makefile b/testcases/kernel/syscalls/bind/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/bind/Makefile +++ b/testcases/kernel/syscalls/bind/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/brk/Makefile b/testcases/kernel/syscalls/brk/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/brk/Makefile +++ b/testcases/kernel/syscalls/brk/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/cacheflush/Makefile b/testcases/kernel/syscalls/cacheflush/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/cacheflush/Makefile +++ b/testcases/kernel/syscalls/cacheflush/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/capget/Makefile b/testcases/kernel/syscalls/capget/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/capget/Makefile +++ b/testcases/kernel/syscalls/capget/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/capset/Makefile b/testcases/kernel/syscalls/capset/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/capset/Makefile +++ b/testcases/kernel/syscalls/capset/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/chdir/Makefile b/testcases/kernel/syscalls/chdir/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/chdir/Makefile +++ b/testcases/kernel/syscalls/chdir/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/chmod/Makefile b/testcases/kernel/syscalls/chmod/Makefile index c3f60c5e..bd617d80 100644 --- a/testcases/kernel/syscalls/chmod/Makefile +++ b/testcases/kernel/syscalls/chmod/Makefile @@ -16,17 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/chown/Makefile b/testcases/kernel/syscalls/chown/Makefile index 1ecc0aee..1260f448 100644 --- a/testcases/kernel/syscalls/chown/Makefile +++ b/testcases/kernel/syscalls/chown/Makefile @@ -16,19 +16,14 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk +include $(top_srcdir)/include/mk/testcases.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +SRCS := $(filter-out %/change_owner.c,$(wildcard $(abs_srcdir)/*.c)) -all: $(TARGETS) +include $(abs_srcdir)/../utils/compat_16.mk -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +MAKE_TARGETS += change_owner +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/chroot/Makefile b/testcases/kernel/syscalls/chroot/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/chroot/Makefile +++ b/testcases/kernel/syscalls/chroot/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/clock_getres/Makefile b/testcases/kernel/syscalls/clock_getres/Makefile index e7168a75..4e1b6128 100644 --- a/testcases/kernel/syscalls/clock_getres/Makefile +++ b/testcases/kernel/syscalls/clock_getres/Makefile @@ -16,16 +16,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -LDLIBS += -L../../../../lib -lltp -lrt +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CPPFLAGS += -I$(abs_srcdir)/../utils -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +LDLIBS += -lpthread -lrt -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/clock_getres/clock_getres01.c b/testcases/kernel/syscalls/clock_getres/clock_getres01.c index 1860e28b..251d1dae 100644 --- a/testcases/kernel/syscalls/clock_getres/clock_getres01.c +++ b/testcases/kernel/syscalls/clock_getres/clock_getres01.c @@ -53,9 +53,8 @@ #include #include #include - - -#include "../utils/include_j_h.h" +#include "config.h" +#include "include_j_h.h" /* Harness Specific Include Files. */ #include "test.h" @@ -223,7 +222,7 @@ static int do_test(struct test_case *tc) * Execute system call */ errno = 0; - if (tc->ttype == NULL_POINTER) + if (tc->ttype == NULL_POINTER) TEST(sys_ret = clock_getres(tc->clk_id, NULL)); else TEST(sys_ret = clock_getres(tc->clk_id, &res)); diff --git a/testcases/kernel/syscalls/clock_nanosleep/Makefile b/testcases/kernel/syscalls/clock_nanosleep/Makefile index e7168a75..71ebae98 100644 --- a/testcases/kernel/syscalls/clock_nanosleep/Makefile +++ b/testcases/kernel/syscalls/clock_nanosleep/Makefile @@ -16,16 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -LDLIBS += -L../../../../lib -lltp -lrt +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +LDLIBS += -lpthread -lrt -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c b/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c index 444a5a42..7a70a84a 100644 --- a/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c +++ b/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c @@ -70,6 +70,18 @@ extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ char *TCID = "clock_nanosleep01"; /* Test program identifier.*/ int testno; int TST_TOTAL = 1; /* total number of tests in this file. */ +struct sigaction act; + +/* + * sighandler() + */ +void sighandler(int sig) +{ + if (sig == SIGINT) + return; + // NOTREACHED + return; +} /* Extern Global Functions */ /******************************************************************************/ @@ -118,6 +130,10 @@ extern void cleanup() { /******************************************************************************/ void setup() { /* Capture signals if any */ + act.sa_handler = sighandler; + sigfillset(&act.sa_mask); + sigaction(SIGINT, &act, NULL); + /* Create temporary directories */ TEST_PAUSE; tst_tmpdir(); @@ -353,17 +369,6 @@ EXIT: return result; } -/* - * sighandler() - */ -void sighandler(int sig) -{ - if (sig == SIGINT) - return; - // NOTREACHED - return; -} - /* * usage() @@ -437,7 +442,6 @@ int main(int ac, char **av) { /* * Execute test */ - TEST(signal(SIGINT, sighandler)); for (i = 0; i < (int)(sizeof(tcase) / sizeof(tcase[0])); i++) { int ret; tst_resm(TINFO,"(case%02d) START", i); diff --git a/testcases/kernel/syscalls/clock_nanosleep2/Makefile b/testcases/kernel/syscalls/clock_nanosleep2/Makefile index 1ea8ecaf..71ebae98 100644 --- a/testcases/kernel/syscalls/clock_nanosleep2/Makefile +++ b/testcases/kernel/syscalls/clock_nanosleep2/Makefile @@ -16,16 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -lrt +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +LDLIBS += -lpthread -lrt -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/clone/Makefile b/testcases/kernel/syscalls/clone/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/clone/Makefile +++ b/testcases/kernel/syscalls/clone/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/close/Makefile b/testcases/kernel/syscalls/close/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/close/Makefile +++ b/testcases/kernel/syscalls/close/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/close/close08.c b/testcases/kernel/syscalls/close/close08.c index 6e055b7e..ccd8bfa2 100644 --- a/testcases/kernel/syscalls/close/close08.c +++ b/testcases/kernel/syscalls/close/close08.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: close08.c,v 1.5 2009/03/23 13:35:40 subrata_modak Exp $ */ +/* $Id: close08.c,v 1.6 2009/10/13 14:00:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -178,7 +178,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "close(%s) returned %d", fname, + tst_resm(TPASS, "close(%s) returned %ld", fname, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/confstr/Makefile b/testcases/kernel/syscalls/confstr/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/confstr/Makefile +++ b/testcases/kernel/syscalls/confstr/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/connect/Makefile b/testcases/kernel/syscalls/connect/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/connect/Makefile +++ b/testcases/kernel/syscalls/connect/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/creat/Makefile b/testcases/kernel/syscalls/creat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/creat/Makefile +++ b/testcases/kernel/syscalls/creat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/dup/Makefile b/testcases/kernel/syscalls/dup/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/dup/Makefile +++ b/testcases/kernel/syscalls/dup/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/dup/dup01.c b/testcases/kernel/syscalls/dup/dup01.c index 22f4f7a3..3a3235de 100644 --- a/testcases/kernel/syscalls/dup/dup01.c +++ b/testcases/kernel/syscalls/dup/dup01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: dup01.c,v 1.5 2009/03/23 13:35:40 subrata_modak Exp $ */ +/* $Id: dup01.c,v 1.6 2009/10/13 14:00:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -178,7 +178,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "dup(%s) returned %d", Fname, + tst_resm(TPASS, "dup(%s) returned %ld", Fname, TEST_RETURN); } diff --git a/testcases/kernel/syscalls/dup/dup02.c b/testcases/kernel/syscalls/dup/dup02.c index 05dce9ea..f19d6ef7 100644 --- a/testcases/kernel/syscalls/dup/dup02.c +++ b/testcases/kernel/syscalls/dup/dup02.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: dup02.c,v 1.5 2009/03/23 13:35:40 subrata_modak Exp $ */ +/* $Id: dup02.c,v 1.6 2009/10/13 14:00:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -186,13 +186,13 @@ int main(int ac, char **av) } } else { tst_resm(TFAIL, - "dup(%d) returned %d, expected -1, errno:%d (EBADF)", + "dup(%d) returned %ld, expected -1, errno:%d (EBADF)", Fds[ind], TEST_RETURN, EBADF); /* close the new file so loops do not open too many files */ if (close(TEST_RETURN) == -1) { tst_brkm(TBROK, cleanup, - "close(%d) Failed, errno=%d : %s", + "close(%ld) Failed, errno=%d : %s", TEST_RETURN, errno, strerror(errno)); } diff --git a/testcases/kernel/syscalls/dup/dup03.c b/testcases/kernel/syscalls/dup/dup03.c index 11e64c36..1309bee5 100644 --- a/testcases/kernel/syscalls/dup/dup03.c +++ b/testcases/kernel/syscalls/dup/dup03.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: dup03.c,v 1.4 2009/03/23 13:35:40 subrata_modak Exp $ */ +/* $Id: dup03.c,v 1.5 2009/10/13 14:00:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -176,7 +176,7 @@ int main(int ac, char **av) } } else { tst_resm(TFAIL, - "dup(%d) returned %d, expected -1, errno:%d (EMFILE)", + "dup(%d) returned %ld, expected -1, errno:%d (EMFILE)", Fd[0], TEST_RETURN, EMFILE); /* close the new file so loops do not open too many files */ @@ -252,7 +252,7 @@ void setup() } if (Nfds > maxfds) { tst_brkm(TBROK, cleanup, - "Unable to open enough files to use all file descriptors, tried %d", + "Unable to open enough files to use all file descriptors, tried %ld", maxfds); } } /* End setup() */ diff --git a/testcases/kernel/syscalls/dup/dup04.c b/testcases/kernel/syscalls/dup/dup04.c index 1fab0a63..5e14d171 100644 --- a/testcases/kernel/syscalls/dup/dup04.c +++ b/testcases/kernel/syscalls/dup/dup04.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: dup04.c,v 1.5 2009/03/23 13:35:40 subrata_modak Exp $ */ +/* $Id: dup04.c,v 1.6 2009/10/13 14:00:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -179,7 +179,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "dup(%d) read side of syspipe returned %d", + "dup(%d) read side of syspipe returned %ld", Fd[0], TEST_RETURN); } else @@ -188,7 +188,7 @@ int main(int ac, char **av) /* close the new file so loops do not open too many files */ if (close(TEST_RETURN) == -1) { tst_brkm(TBROK, cleanup, - "close(%d) Failed, errno=%d : %s", + "close(%ld) Failed, errno=%d : %s", TEST_RETURN, errno, strerror(errno)); } } @@ -212,7 +212,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "dup(%d) write side of syspipe returned %d", + "dup(%d) write side of syspipe returned %ld", Fd[1], TEST_RETURN); } else @@ -221,7 +221,7 @@ int main(int ac, char **av) /* close the new file so loops do not open too many files */ if (close(TEST_RETURN) == -1) { tst_brkm(TBROK, cleanup, - "close(%d) Failed, errno=%d : %s", + "close(%ld) Failed, errno=%d : %s", TEST_RETURN, errno, strerror(errno)); } } diff --git a/testcases/kernel/syscalls/dup/dup05.c b/testcases/kernel/syscalls/dup/dup05.c index c3f798fd..03339f2f 100644 --- a/testcases/kernel/syscalls/dup/dup05.c +++ b/testcases/kernel/syscalls/dup/dup05.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: dup05.c,v 1.5 2009/03/23 13:35:40 subrata_modak Exp $ */ +/* $Id: dup05.c,v 1.6 2009/10/13 14:00:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -179,7 +179,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "dup(%s) returned %d", Fname, + tst_resm(TPASS, "dup(%s) returned %ld", Fname, TEST_RETURN); } diff --git a/testcases/kernel/syscalls/dup2/Makefile b/testcases/kernel/syscalls/dup2/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/dup2/Makefile +++ b/testcases/kernel/syscalls/dup2/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/dup3/Makefile b/testcases/kernel/syscalls/dup3/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/dup3/Makefile +++ b/testcases/kernel/syscalls/dup3/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/epoll/Makefile b/testcases/kernel/syscalls/epoll/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/epoll/Makefile +++ b/testcases/kernel/syscalls/epoll/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/epoll_create1/Makefile b/testcases/kernel/syscalls/epoll_create1/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/epoll_create1/Makefile +++ b/testcases/kernel/syscalls/epoll_create1/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/eventfd/Makefile b/testcases/kernel/syscalls/eventfd/Makefile index 81913bea..268d2e74 100644 --- a/testcases/kernel/syscalls/eventfd/Makefile +++ b/testcases/kernel/syscalls/eventfd/Makefile @@ -16,21 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # +top_srcdir ?= ../../../.. -include ../../../../config.mk +include $(top_srcdir)/include/mk/testcases.mk +LDLIBS += $(AIO_LIBS) -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib $(AIO_LIBS) -lltp - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c, %, $(wildcard *.c)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) a.out - +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/eventfd2/Makefile b/testcases/kernel/syscalls/eventfd2/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/eventfd2/Makefile +++ b/testcases/kernel/syscalls/eventfd2/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/execl/Makefile b/testcases/kernel/syscalls/execl/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/execl/Makefile +++ b/testcases/kernel/syscalls/execl/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/execle/Makefile b/testcases/kernel/syscalls/execle/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/execle/Makefile +++ b/testcases/kernel/syscalls/execle/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/execlp/Makefile b/testcases/kernel/syscalls/execlp/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/execlp/Makefile +++ b/testcases/kernel/syscalls/execlp/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/execv/Makefile b/testcases/kernel/syscalls/execv/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/execv/Makefile +++ b/testcases/kernel/syscalls/execv/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/execve/Makefile b/testcases/kernel/syscalls/execve/Makefile index af4706cf..139875ff 100644 --- a/testcases/kernel/syscalls/execve/Makefile +++ b/testcases/kernel/syscalls/execve/Makefile @@ -16,16 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -I../lib -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CPPFLAGS += -I$(abs_srcdir)/../lib -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/execvp/Makefile b/testcases/kernel/syscalls/execvp/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/execvp/Makefile +++ b/testcases/kernel/syscalls/execvp/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/exit/Makefile b/testcases/kernel/syscalls/exit/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/exit/Makefile +++ b/testcases/kernel/syscalls/exit/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/exit_group/Makefile b/testcases/kernel/syscalls/exit_group/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/exit_group/Makefile +++ b/testcases/kernel/syscalls/exit_group/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/faccessat/Makefile b/testcases/kernel/syscalls/faccessat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/faccessat/Makefile +++ b/testcases/kernel/syscalls/faccessat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fadvise/Makefile b/testcases/kernel/syscalls/fadvise/Makefile index 2b9eda20..13aa315d 100644 --- a/testcases/kernel/syscalls/fadvise/Makefile +++ b/testcases/kernel/syscalls/fadvise/Makefile @@ -19,19 +19,12 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -all: $(TARGETS) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D$(DEF_64)=1 -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c index 1b0fc91f..10fe2de8 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c @@ -122,7 +122,7 @@ int main(int ac, char **av) tst_resm(TPASS, "call succeeded expectedly"); } else { tst_resm(TFAIL, - "unexpected return value - %d : %s, advise %d - " + "unexpected return value - %ld : %s, advise %d - " "expected %d", TEST_RETURN, strerror(TEST_RETURN), diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c index 3c4ff421..53f65637 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c @@ -126,11 +126,11 @@ int main(int ac, char **av) "On error, an error number is returned." */ if (TEST_RETURN == TC[i].error) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", + "returned value = %ld : %s", TEST_RETURN, strerror(TEST_RETURN)); } else { tst_resm(TFAIL, - "unexpected returnd value - %d : %s - " + "unexpected returnd value - %ld : %s - " "expected %d", TEST_RETURN, strerror(TEST_RETURN), TC[i].error); } diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c index 3d4b663b..37e32bdc 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c @@ -151,12 +151,12 @@ int main(int ac, char **av) if (TEST_RETURN == expected_error) { tst_resm(TPASS, "expected failure - " - "returned value = %d, advise = %d : %s", + "returned value = %ld, advise = %d : %s", TEST_RETURN, advise, strerror(TEST_RETURN)); } else { tst_resm(TFAIL, - "unexpected return value - %d : %s, advise %d - " + "unexpected return value - %ld : %s, advise %d - " "expected %d", TEST_RETURN, strerror(TEST_RETURN), diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c index 406c0c82..8b132b40 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c @@ -132,11 +132,11 @@ int main(int ac, char **av) "On error, an error number is returned." */ if (TEST_RETURN == TC[i].error) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", + "returned value = %ld : %s", TEST_RETURN, strerror(TEST_RETURN)); } else { tst_resm(TFAIL, - "unexpected return value - %d : %s - " + "unexpected return value - %ld : %s - " "expected %d", TEST_RETURN, strerror(TEST_RETURN), TC[i].error); } diff --git a/testcases/kernel/syscalls/fallocate/Makefile b/testcases/kernel/syscalls/fallocate/Makefile index d6016be2..bd617d80 100644 --- a/testcases/kernel/syscalls/fallocate/Makefile +++ b/testcases/kernel/syscalls/fallocate/Makefile @@ -1,4 +1,3 @@ - # # Copyright (c) International Business Machines Corp., 2001 # @@ -17,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) +top_srcdir ?= ../../../.. -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +include $(top_srcdir)/include/mk/testcases.mk -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fchdir/Makefile b/testcases/kernel/syscalls/fchdir/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/fchdir/Makefile +++ b/testcases/kernel/syscalls/fchdir/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fchmod/Makefile b/testcases/kernel/syscalls/fchmod/Makefile index c3f60c5e..bd617d80 100644 --- a/testcases/kernel/syscalls/fchmod/Makefile +++ b/testcases/kernel/syscalls/fchmod/Makefile @@ -16,17 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fchmod/fchmod01.c b/testcases/kernel/syscalls/fchmod/fchmod01.c index 14b60d69..cf507cf8 100644 --- a/testcases/kernel/syscalls/fchmod/fchmod01.c +++ b/testcases/kernel/syscalls/fchmod/fchmod01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fchmod01.c,v 1.5 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fchmod01.c,v 1.6 2009/10/26 14:55:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -172,7 +172,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "fchmod(%s, 0700) returned %d", + tst_resm(TPASS, "fchmod(%s, 0700) returned %ld", fname, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/fchmod/fchmod06.c b/testcases/kernel/syscalls/fchmod/fchmod06.c index 4cb589b2..47c2df62 100644 --- a/testcases/kernel/syscalls/fchmod/fchmod06.c +++ b/testcases/kernel/syscalls/fchmod/fchmod06.c @@ -188,7 +188,7 @@ int main(int ac, char **av) Test_cases[ind].exp_errno); } } else { - tst_resm(TFAIL, "fchmod() returned %d, expected" + tst_resm(TFAIL, "fchmod() returned %ld, expected" " -1, errno:%d", TEST_RETURN, Test_cases[ind].exp_errno); } diff --git a/testcases/kernel/syscalls/fchmodat/Makefile b/testcases/kernel/syscalls/fchmodat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/fchmodat/Makefile +++ b/testcases/kernel/syscalls/fchmodat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fchown/Makefile b/testcases/kernel/syscalls/fchown/Makefile index 1ecc0aee..f3ab6575 100644 --- a/testcases/kernel/syscalls/fchown/Makefile +++ b/testcases/kernel/syscalls/fchown/Makefile @@ -16,19 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp - -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fchown/fchown01.c b/testcases/kernel/syscalls/fchown/fchown01.c index c1b2e96c..bcb1f2eb 100644 --- a/testcases/kernel/syscalls/fchown/fchown01.c +++ b/testcases/kernel/syscalls/fchown/fchown01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fchown01.c,v 1.3 2007/04/13 20:58:17 vapier Exp $ */ +/* $Id: fchown01.c,v 1.4 2009/10/26 14:55:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -167,7 +167,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* Perform functional verification here */ tst_resm(TPASS, - "fchown(Fd, geteuid(), getegid()) returned %d", + "fchown(Fd, geteuid(), getegid()) returned %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/fchown/fchown04.c b/testcases/kernel/syscalls/fchown/fchown04.c index 0980d441..d87d3863 100644 --- a/testcases/kernel/syscalls/fchown/fchown04.c +++ b/testcases/kernel/syscalls/fchown/fchown04.c @@ -185,7 +185,7 @@ int main(int ac, char **av) Test_cases[ind].exp_errno); } } else { - tst_resm(TFAIL, "fchown() returned %d, expected" + tst_resm(TFAIL, "fchown() returned %ld, expected" " -1, errno:%d", TEST_RETURN, Test_cases[ind].exp_errno); } diff --git a/testcases/kernel/syscalls/fchownat/Makefile b/testcases/kernel/syscalls/fchownat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/fchownat/Makefile +++ b/testcases/kernel/syscalls/fchownat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fcntl/Makefile b/testcases/kernel/syscalls/fcntl/Makefile index 627e22bb..ee876f14 100644 --- a/testcases/kernel/syscalls/fcntl/Makefile +++ b/testcases/kernel/syscalls/fcntl/Makefile @@ -16,20 +16,13 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -CPPFLAGS += -D_GNU_SOURCE -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -all: $(TARGETS) +CPPFLAGS += -D_GNU_SOURCE -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fcntl/fcntl02.c b/testcases/kernel/syscalls/fcntl/fcntl02.c index 8bf856ab..83566cc3 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl02.c +++ b/testcases/kernel/syscalls/fcntl/fcntl02.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fcntl02.c,v 1.6 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fcntl02.c,v 1.7 2009/10/26 14:55:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -177,7 +177,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fcntl(%s, F_DUPFD, 0) returned %d", + "fcntl(%s, F_DUPFD, 0) returned %ld", fname, TEST_RETURN); } if (close(TEST_RETURN) == -1) { diff --git a/testcases/kernel/syscalls/fcntl/fcntl03.c b/testcases/kernel/syscalls/fcntl/fcntl03.c index 06810a55..dd99bf4b 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl03.c +++ b/testcases/kernel/syscalls/fcntl/fcntl03.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fcntl03.c,v 1.6 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fcntl03.c,v 1.7 2009/10/26 14:55:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -177,7 +177,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fcntl(%s, F_GETFD, 0) returned %d", + "fcntl(%s, F_GETFD, 0) returned %ld", fname, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/fcntl/fcntl04.c b/testcases/kernel/syscalls/fcntl/fcntl04.c index cd824deb..65c8ed84 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl04.c +++ b/testcases/kernel/syscalls/fcntl/fcntl04.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fcntl04.c,v 1.6 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fcntl04.c,v 1.7 2009/10/26 14:55:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -177,7 +177,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fcntl(%s, F_GETFL, 0) returned %d", + "fcntl(%s, F_GETFL, 0) returned %ld", fname, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/fcntl/fcntl05.c b/testcases/kernel/syscalls/fcntl/fcntl05.c index 75042bd7..d7773f02 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl05.c +++ b/testcases/kernel/syscalls/fcntl/fcntl05.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fcntl05.c,v 1.6 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fcntl05.c,v 1.7 2009/10/26 14:55:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -179,7 +179,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fcntl(%s, F_GETLK, &flocks) returned %d", + "fcntl(%s, F_GETLK, &flocks) returned %ld", fname, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/fcntl/fcntl08.c b/testcases/kernel/syscalls/fcntl/fcntl08.c index cedb677e..99249adb 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl08.c +++ b/testcases/kernel/syscalls/fcntl/fcntl08.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fcntl08.c,v 1.5 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fcntl08.c,v 1.6 2009/10/26 14:55:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -173,7 +173,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fcntl(%s, F_SETFL, %d) returned %d", + "fcntl(%s, F_SETFL, %d) returned %ld", fname, arg, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/fcntl/fcntl09.c b/testcases/kernel/syscalls/fcntl/fcntl09.c index cbd54465..8a107198 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl09.c +++ b/testcases/kernel/syscalls/fcntl/fcntl09.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fcntl09.c,v 1.7 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fcntl09.c,v 1.8 2009/10/26 14:55:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -183,7 +183,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fcntl(%s, F_SETLK, &flocks) flocks.l_type = %s returned %d", + "fcntl(%s, F_SETLK, &flocks) flocks.l_type = %s returned %ld", fname, type ? "F_RDLCK" : "F_WRLCK", TEST_RETURN); @@ -211,7 +211,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fcntl(%s, F_SETLK, &flocks) flocks.l_type = F_UNLCK returned %d", + "fcntl(%s, F_SETLK, &flocks) flocks.l_type = F_UNLCK returned %ld", fname, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/fcntl/fcntl10.c b/testcases/kernel/syscalls/fcntl/fcntl10.c index d2ead6bf..dea5b278 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl10.c +++ b/testcases/kernel/syscalls/fcntl/fcntl10.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fcntl10.c,v 1.7 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fcntl10.c,v 1.8 2009/10/26 14:55:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -183,7 +183,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fcntl(%s, F_SETLKW, &flocks) flocks.l_type = %s returned %d", + "fcntl(%s, F_SETLKW, &flocks) flocks.l_type = %s returned %ld", fname, type ? "F_RDLCK" : "F_WRLCK", TEST_RETURN); @@ -211,7 +211,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fcntl(%s, F_SETLKW, &flocks) flocks.l_type = F_UNLCK returned %d", + "fcntl(%s, F_SETLKW, &flocks) flocks.l_type = F_UNLCK returned %ld", fname, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/fcntl/fcntl22.c b/testcases/kernel/syscalls/fcntl/fcntl22.c index 6a8f0380..1f1958ac 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl22.c +++ b/testcases/kernel/syscalls/fcntl/fcntl22.c @@ -134,7 +134,7 @@ int main(int ac, char **av) /* Check return code from fcntl(2) */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "fcntl() returned %d," + tst_resm(TFAIL, "fcntl() returned %ld," "expected -1, errno=%d", TEST_RETURN, exp_enos[0]); } else { diff --git a/testcases/kernel/syscalls/fcntl/fcntl23.c b/testcases/kernel/syscalls/fcntl/fcntl23.c index 240e51eb..bd98d3ff 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl23.c +++ b/testcases/kernel/syscalls/fcntl/fcntl23.c @@ -163,13 +163,13 @@ int main(int ac, char **av) TEST(fcntl(fd, F_GETLEASE)); if (TEST_RETURN != F_RDLCK) tst_resm(TFAIL, - "fcntl(%s, F_GETLEASE) did not return F_RDLCK, returned %d", + "fcntl(%s, F_GETLEASE) did not return F_RDLCK, returned %ld", fname, TEST_RETURN); else { TEST(fcntl(fd, F_SETLEASE, F_UNLCK)); if (TEST_RETURN != 0) tst_resm(TFAIL, - "fcntl(%s, F_SETLEASE, F_UNLCK) did not return 0, returned %d", + "fcntl(%s, F_SETLEASE, F_UNLCK) did not return 0, returned %ld", fname, TEST_RETURN); else tst_resm(TPASS, diff --git a/testcases/kernel/syscalls/fcntl/fcntl24.c b/testcases/kernel/syscalls/fcntl/fcntl24.c index af0e814c..87da1f1e 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl24.c +++ b/testcases/kernel/syscalls/fcntl/fcntl24.c @@ -175,13 +175,13 @@ int main(int ac, char **av) TEST(fcntl(fd, F_GETLEASE)); if (TEST_RETURN != F_WRLCK) tst_resm(TFAIL, - "fcntl(%s, F_GETLEASE) did not return F_WRLCK, returned %d", + "fcntl(%s, F_GETLEASE) did not return F_WRLCK, returned %ld", fname, TEST_RETURN); else { TEST(fcntl(fd, F_SETLEASE, F_UNLCK)); if (TEST_RETURN != 0) tst_resm(TFAIL, - "fcntl(%s, F_SETLEASE, F_UNLCK) did not return 0, returned %d", + "fcntl(%s, F_SETLEASE, F_UNLCK) did not return 0, returned %ld", fname, TEST_RETURN); else tst_resm(TPASS, diff --git a/testcases/kernel/syscalls/fcntl/fcntl25.c b/testcases/kernel/syscalls/fcntl/fcntl25.c index 6e2adc65..35a7c605 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl25.c +++ b/testcases/kernel/syscalls/fcntl/fcntl25.c @@ -176,13 +176,13 @@ int main(int ac, char **av) TEST(fcntl(fd, F_GETLEASE)); if (TEST_RETURN != F_WRLCK) tst_resm(TFAIL, - "fcntl(%s, F_GETLEASE) did not return F_WRLCK, returned %d", + "fcntl(%s, F_GETLEASE) did not return F_WRLCK, returned %ld", fname, TEST_RETURN); else { TEST(fcntl(fd, F_SETLEASE, F_UNLCK)); if (TEST_RETURN != 0) tst_resm(TFAIL, - "fcntl(%s, F_SETLEASE, F_UNLCK) did not return 0, returned %d", + "fcntl(%s, F_SETLEASE, F_UNLCK) did not return 0, returned %ld", fname, TEST_RETURN); else tst_resm(TPASS, diff --git a/testcases/kernel/syscalls/fcntl/fcntl26.c b/testcases/kernel/syscalls/fcntl/fcntl26.c index df220637..ba3c9759 100644 --- a/testcases/kernel/syscalls/fcntl/fcntl26.c +++ b/testcases/kernel/syscalls/fcntl/fcntl26.c @@ -176,13 +176,13 @@ int main(int ac, char **av) TEST(fcntl(fd, F_GETLEASE)); if (TEST_RETURN != F_WRLCK) tst_resm(TFAIL, - "fcntl(%s, F_GETLEASE) did not return F_WRLCK, returned %d", + "fcntl(%s, F_GETLEASE) did not return F_WRLCK, returned %ld", fname, TEST_RETURN); else { TEST(fcntl(fd, F_SETLEASE, F_UNLCK)); if (TEST_RETURN != 0) tst_resm(TFAIL, - "fcntl(%s, F_SETLEASE, F_UNLCK) did not return 0, returned %d", + "fcntl(%s, F_SETLEASE, F_UNLCK) did not return 0, returned %ld", fname, TEST_RETURN); else tst_resm(TPASS, diff --git a/testcases/kernel/syscalls/fdatasync/Makefile b/testcases/kernel/syscalls/fdatasync/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/fdatasync/Makefile +++ b/testcases/kernel/syscalls/fdatasync/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fdatasync/fdatasync02.c b/testcases/kernel/syscalls/fdatasync/fdatasync02.c index 33152d74..2c0d352c 100644 --- a/testcases/kernel/syscalls/fdatasync/fdatasync02.c +++ b/testcases/kernel/syscalls/fdatasync/fdatasync02.c @@ -142,7 +142,7 @@ int main(int argc, char **argv) TEST_ERRNO); } else { tst_resm(TFAIL, "Unexpected results for %s ; " - "returned %d (expected %d), errno %d " + "returned %ld (expected %d), errno %d " "(expected %d)", tdat[testno].desc, TEST_RETURN, EXP_RET_VAL, TEST_ERRNO, tdat[testno].experrno); diff --git a/testcases/kernel/syscalls/flock/Makefile b/testcases/kernel/syscalls/flock/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/flock/Makefile +++ b/testcases/kernel/syscalls/flock/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fmtmsg/Makefile b/testcases/kernel/syscalls/fmtmsg/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/fmtmsg/Makefile +++ b/testcases/kernel/syscalls/fmtmsg/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fork/Makefile b/testcases/kernel/syscalls/fork/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/fork/Makefile +++ b/testcases/kernel/syscalls/fork/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fork/fork01.c b/testcases/kernel/syscalls/fork/fork01.c index 8edef8b7..b6bf9e6f 100644 --- a/testcases/kernel/syscalls/fork/fork01.c +++ b/testcases/kernel/syscalls/fork/fork01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fork01.c,v 1.5 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fork01.c,v 1.6 2009/10/26 14:55:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -178,7 +178,7 @@ void parent_pid() child_id = atoi(tmp_line); if (TEST_RETURN != child_id) { tst_resm(TFAIL, - "child reported a pid of %d. parent received %d from fork()", + "child reported a pid of %d. parent received %ld from fork()", child_id, TEST_RETURN); } else { tst_resm(TPASS, @@ -246,7 +246,7 @@ int main(int ac, char **av) } else { /* parent */ if (STD_FUNCTIONAL_TEST) { - tst_resm(TPASS, "fork() returned %d", + tst_resm(TPASS, "fork() returned %ld", TEST_RETURN); } /* wait for the child to complete */ diff --git a/testcases/kernel/syscalls/fpathconf/Makefile b/testcases/kernel/syscalls/fpathconf/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/fpathconf/Makefile +++ b/testcases/kernel/syscalls/fpathconf/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fpathconf/fpathconf01.c b/testcases/kernel/syscalls/fpathconf/fpathconf01.c index 3441d0de..e7d0e831 100644 --- a/testcases/kernel/syscalls/fpathconf/fpathconf01.c +++ b/testcases/kernel/syscalls/fpathconf/fpathconf01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fpathconf01.c,v 1.5 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fpathconf01.c,v 1.6 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -200,7 +200,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fpathconf(fd, %s) returned %d", + "fpathconf(fd, %s) returned %ld", args[i].define_tag, TEST_RETURN); } diff --git a/testcases/kernel/syscalls/fstat/Makefile b/testcases/kernel/syscalls/fstat/Makefile index 3c22a28a..bf120101 100644 --- a/testcases/kernel/syscalls/fstat/Makefile +++ b/testcases/kernel/syscalls/fstat/Makefile @@ -16,19 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fstatat/Makefile b/testcases/kernel/syscalls/fstatat/Makefile index 3c22a28a..048f8ce9 100644 --- a/testcases/kernel/syscalls/fstatat/Makefile +++ b/testcases/kernel/syscalls/fstatat/Makefile @@ -16,19 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fstatfs/Makefile b/testcases/kernel/syscalls/fstatfs/Makefile index 3c22a28a..bf120101 100644 --- a/testcases/kernel/syscalls/fstatfs/Makefile +++ b/testcases/kernel/syscalls/fstatfs/Makefile @@ -16,19 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fstatfs/fstatfs01.c b/testcases/kernel/syscalls/fstatfs/fstatfs01.c index 998db810..71be1a50 100644 --- a/testcases/kernel/syscalls/fstatfs/fstatfs01.c +++ b/testcases/kernel/syscalls/fstatfs/fstatfs01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fstatfs01.c,v 1.6 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fstatfs01.c,v 1.7 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -182,7 +182,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "fstatfs(%d, &stats, sizeof(struct statfs), 0) returned %d", + "fstatfs(%d, &stats, sizeof(struct statfs), 0) returned %ld", fd, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/fsync/Makefile b/testcases/kernel/syscalls/fsync/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/fsync/Makefile +++ b/testcases/kernel/syscalls/fsync/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/fsync/fsync01.c b/testcases/kernel/syscalls/fsync/fsync01.c index c0f4b6d8..6e705fb6 100644 --- a/testcases/kernel/syscalls/fsync/fsync01.c +++ b/testcases/kernel/syscalls/fsync/fsync01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: fsync01.c,v 1.5 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: fsync01.c,v 1.6 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -181,7 +181,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "fsync(%s) returned %d", fname, + tst_resm(TPASS, "fsync(%s) returned %ld", fname, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/ftruncate/Makefile b/testcases/kernel/syscalls/ftruncate/Makefile index e3d1fcd4..c31978ae 100644 --- a/testcases/kernel/syscalls/ftruncate/Makefile +++ b/testcases/kernel/syscalls/ftruncate/Makefile @@ -16,23 +16,13 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 +INSTALL_TARGETS := ftruncate.sh ftruncate_64.sh -all: $(TARGETS) - -install: - @set -e; \ - ln -f ftruncate.sh ../../../bin/ftruncate.sh; \ - ln -f ftruncate_64.sh ../../../bin/ftruncate_64.sh; \ - for i in $(TARGETS); do install -m 755 $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/futimesat/Makefile b/testcases/kernel/syscalls/futimesat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/futimesat/Makefile +++ b/testcases/kernel/syscalls/futimesat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/get_mempolicy/Makefile b/testcases/kernel/syscalls/get_mempolicy/Makefile index 0d24c355..2ef86f06 100644 --- a/testcases/kernel/syscalls/get_mempolicy/Makefile +++ b/testcases/kernel/syscalls/get_mempolicy/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/get_robust_list/Makefile b/testcases/kernel/syscalls/get_robust_list/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/get_robust_list/Makefile +++ b/testcases/kernel/syscalls/get_robust_list/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c b/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c index a379734c..15569a81 100644 --- a/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c +++ b/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c @@ -110,17 +110,17 @@ int main(int argc, char **argv) if (TEST_RETURN) { if (TEST_ERRNO == EFAULT) tst_resm(TPASS, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, EFAULT); else tst_resm(TFAIL, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, EFAULT); } else { tst_resm(TFAIL, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, EFAULT); } @@ -132,17 +132,17 @@ int main(int argc, char **argv) if (TEST_RETURN) { if (TEST_ERRNO == EFAULT) tst_resm(TPASS, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, EFAULT); else tst_resm(TFAIL, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, EFAULT); } else { tst_resm(TFAIL, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, EFAULT); } @@ -160,17 +160,17 @@ int main(int argc, char **argv) if (TEST_RETURN) { if (TEST_ERRNO == ESRCH) tst_resm(TPASS, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, ESRCH); else tst_resm(TFAIL, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, ESRCH); } else { tst_resm(TFAIL, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, ESRCH); } @@ -194,17 +194,17 @@ int main(int argc, char **argv) if (TEST_RETURN) { if (TEST_ERRNO == EPERM) tst_resm(TPASS, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, EPERM); else tst_resm(TFAIL, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, EPERM); } else { tst_resm(TFAIL, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, -1, TEST_ERRNO, EPERM); } @@ -224,12 +224,12 @@ int main(int argc, char **argv) if (TEST_RETURN == 0) { tst_resm(TPASS, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, 0, TEST_ERRNO, 0); } else { tst_resm(TFAIL, - "get_robust_list: retval = %d (expected %d), " + "get_robust_list: retval = %ld (expected %d), " "errno = %d (expected %d)", TEST_RETURN, 0, TEST_ERRNO, 0); } diff --git a/testcases/kernel/syscalls/getcontext/Makefile b/testcases/kernel/syscalls/getcontext/Makefile index 3f66038e..bd617d80 100644 --- a/testcases/kernel/syscalls/getcontext/Makefile +++ b/testcases/kernel/syscalls/getcontext/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getcpu/Makefile b/testcases/kernel/syscalls/getcpu/Makefile index 76b3f691..b8bf68bf 100644 --- a/testcases/kernel/syscalls/getcpu/Makefile +++ b/testcases/kernel/syscalls/getcpu/Makefile @@ -16,23 +16,21 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -ifeq ($(shell uname -r | grep -c "^2\.6\.*"), 1) +ifneq ($(shell uname -r | grep -c "^2\.6\.*"), 1) -all: $(TARGETS) +MAKE_TARGETS := -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done -else +.PHONY: no-all-install -all install: +all install: no-all-install + +no-all-install: @echo "Warning: Kernel doesn't support this test case" + endif -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getcwd/Makefile b/testcases/kernel/syscalls/getcwd/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getcwd/Makefile +++ b/testcases/kernel/syscalls/getcwd/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getdents/Makefile b/testcases/kernel/syscalls/getdents/Makefile index fc9634f6..df7b63f7 100644 --- a/testcases/kernel/syscalls/getdents/Makefile +++ b/testcases/kernel/syscalls/getdents/Makefile @@ -16,19 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getdomainname/Makefile b/testcases/kernel/syscalls/getdomainname/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getdomainname/Makefile +++ b/testcases/kernel/syscalls/getdomainname/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getdomainname/getdomainname01.c b/testcases/kernel/syscalls/getdomainname/getdomainname01.c index a5673281..fac4a680 100644 --- a/testcases/kernel/syscalls/getdomainname/getdomainname01.c +++ b/testcases/kernel/syscalls/getdomainname/getdomainname01.c @@ -109,7 +109,7 @@ int main(int ac, char **av) tst_resm(TFAIL, "getdomainname() Failed, errno = %d :" " %s", TEST_ERRNO, strerror(TEST_ERRNO)); } else { - tst_resm(TPASS, "getdomainname() returned %d ", + tst_resm(TPASS, "getdomainname() returned %ld ", TEST_RETURN); } diff --git a/testcases/kernel/syscalls/getdtablesize/Makefile b/testcases/kernel/syscalls/getdtablesize/Makefile index 3f66038e..bd617d80 100644 --- a/testcases/kernel/syscalls/getdtablesize/Makefile +++ b/testcases/kernel/syscalls/getdtablesize/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getegid/Makefile b/testcases/kernel/syscalls/getegid/Makefile index 2067f28e..f3ab6575 100644 --- a/testcases/kernel/syscalls/getegid/Makefile +++ b/testcases/kernel/syscalls/getegid/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -I../utils -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getegid/getegid01.c b/testcases/kernel/syscalls/getegid/getegid01.c index 3a9907a2..369f74b7 100644 --- a/testcases/kernel/syscalls/getegid/getegid01.c +++ b/testcases/kernel/syscalls/getegid/getegid01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: getegid01.c,v 1.7 2009/03/23 13:35:41 subrata_modak Exp $ */ +/* $Id: getegid01.c,v 1.8 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -180,7 +180,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "getegid - Get effective group id. returned %d", + "getegid - Get effective group id. returned %ld", TEST_RETURN); } } /* End for TEST_LOOPING */ diff --git a/testcases/kernel/syscalls/getegid/getegid02.c b/testcases/kernel/syscalls/getegid/getegid02.c index b8f40416..be0578f7 100644 --- a/testcases/kernel/syscalls/getegid/getegid02.c +++ b/testcases/kernel/syscalls/getegid/getegid02.c @@ -116,10 +116,10 @@ int main(int ac, char **av) } else { if (pwent->pw_gid != TEST_RETURN) { tst_resm(TFAIL, "getegid() return value" - " %d unexpected - expected %d", + " %ld unexpected - expected %d", TEST_RETURN, pwent->pw_gid); } else { - tst_resm(TPASS, "effective group id %d " + tst_resm(TPASS, "effective group id %ld " "is correct", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/geteuid/Makefile b/testcases/kernel/syscalls/geteuid/Makefile index b59851c7..ad6b9f57 100644 --- a/testcases/kernel/syscalls/geteuid/Makefile +++ b/testcases/kernel/syscalls/geteuid/Makefile @@ -16,18 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +CPPFLAGS += -I$(abs_srcdir)/../utils -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/geteuid/compat_16.h b/testcases/kernel/syscalls/geteuid/compat_16.h new file mode 100644 index 00000000..18be12b0 --- /dev/null +++ b/testcases/kernel/syscalls/geteuid/compat_16.h @@ -0,0 +1,48 @@ +/* + * + * Copyright (c) Red Hat Inc., 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* Author: Masatake YAMATO */ + +#ifndef __GETUID_COMPAT_16_H__ +#define __GETUID_COMPAT_16_H__ + + +#include "linux_syscall_numbers.h" +#include "compat_uid.h" + + +#ifdef TST_USE_COMPAT16_SYSCALL + +UID_T +GETEUID(void) +{ + return syscall(__NR_geteuid); +} + +#else + +UID_T +GETEUID(void) +{ + return geteuid(); +} + +#endif + +#endif /* __GETUID_COMPAT_16_H__ */ diff --git a/testcases/kernel/syscalls/geteuid/geteuid01.c b/testcases/kernel/syscalls/geteuid/geteuid01.c index ea4d0f2c..d93c57fb 100644 --- a/testcases/kernel/syscalls/geteuid/geteuid01.c +++ b/testcases/kernel/syscalls/geteuid/geteuid01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: geteuid01.c,v 1.5 2009/03/23 13:35:42 subrata_modak Exp $ */ +/* $Id: geteuid01.c,v 1.7 2009/10/26 16:02:46 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -116,10 +116,12 @@ #include "test.h" #include "usctest.h" +#include "compat_16.h" + void setup(); void cleanup(); -char *TCID = "geteuid01"; /* Test program identifier. */ +TCID_DEFINE(geteuid01); /* Test program identifier. */ int TST_TOTAL = 1; /* Total number of test cases. */ extern int Tst_count; /* Test Case counter for tst_* routines */ @@ -161,7 +163,7 @@ int main(int ac, char **av) ; /* Call geteuid(2) */ - TEST(geteuid()); + TEST(GETEUID()); /* check return code */ if (TEST_RETURN < 0) { @@ -178,7 +180,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "geteuid - Get effective user id. returned %d", + "geteuid - Get effective user id. returned %ld", TEST_RETURN); } } /* End for TEST_LOOPING */ diff --git a/testcases/kernel/syscalls/getgid/Makefile b/testcases/kernel/syscalls/getgid/Makefile index 2067f28e..f3ab6575 100644 --- a/testcases/kernel/syscalls/getgid/Makefile +++ b/testcases/kernel/syscalls/getgid/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -I../utils -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getgid/getgid01.c b/testcases/kernel/syscalls/getgid/getgid01.c index e16aba31..038b9aca 100644 --- a/testcases/kernel/syscalls/getgid/getgid01.c +++ b/testcases/kernel/syscalls/getgid/getgid01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: getgid01.c,v 1.6 2009/03/23 13:35:42 subrata_modak Exp $ */ +/* $Id: getgid01.c,v 1.7 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -171,7 +171,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "getgid() returned %d", + tst_resm(TPASS, "getgid() returned %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/getgid/getgid03.c b/testcases/kernel/syscalls/getgid/getgid03.c index 548e6383..90fdb496 100644 --- a/testcases/kernel/syscalls/getgid/getgid03.c +++ b/testcases/kernel/syscalls/getgid/getgid03.c @@ -115,10 +115,10 @@ int main(int ac, char **av) } else { if (pwent->pw_gid != TEST_RETURN) { tst_resm(TFAIL, "getgid() return value " - "%d unexpected - expected %d", + "%ld unexpected - expected %d", TEST_RETURN, pwent->pw_gid); } else { - tst_resm(TPASS, "group id %d returned " + tst_resm(TPASS, "group id %ld returned " "correctly", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/getgroups/Makefile b/testcases/kernel/syscalls/getgroups/Makefile index 65b0d3f8..f3ab6575 100644 --- a/testcases/kernel/syscalls/getgroups/Makefile +++ b/testcases/kernel/syscalls/getgroups/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) *.o +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/gethostid/Makefile b/testcases/kernel/syscalls/gethostid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/gethostid/Makefile +++ b/testcases/kernel/syscalls/gethostid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/gethostname/Makefile b/testcases/kernel/syscalls/gethostname/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/gethostname/Makefile +++ b/testcases/kernel/syscalls/gethostname/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/gethostname/gethostname01.c b/testcases/kernel/syscalls/gethostname/gethostname01.c index c7e11627..fa7b8125 100644 --- a/testcases/kernel/syscalls/gethostname/gethostname01.c +++ b/testcases/kernel/syscalls/gethostname/gethostname01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: gethostname01.c,v 1.5 2009/03/23 13:35:42 subrata_modak Exp $ */ +/* $Id: gethostname01.c,v 1.6 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -176,7 +176,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "gethostname - Get host name returned %d", + "gethostname - Get host name returned %ld", TEST_RETURN); } } /* End for TEST_LOOPING */ diff --git a/testcases/kernel/syscalls/getitimer/Makefile b/testcases/kernel/syscalls/getitimer/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getitimer/Makefile +++ b/testcases/kernel/syscalls/getitimer/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getpagesize/Makefile b/testcases/kernel/syscalls/getpagesize/Makefile index 3f66038e..bd617d80 100644 --- a/testcases/kernel/syscalls/getpagesize/Makefile +++ b/testcases/kernel/syscalls/getpagesize/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getpeername/Makefile b/testcases/kernel/syscalls/getpeername/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getpeername/Makefile +++ b/testcases/kernel/syscalls/getpeername/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getpgid/Makefile b/testcases/kernel/syscalls/getpgid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getpgid/Makefile +++ b/testcases/kernel/syscalls/getpgid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getpgrp/Makefile b/testcases/kernel/syscalls/getpgrp/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getpgrp/Makefile +++ b/testcases/kernel/syscalls/getpgrp/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getpgrp/getpgrp01.c b/testcases/kernel/syscalls/getpgrp/getpgrp01.c index a5f505a2..4ad40bbc 100644 --- a/testcases/kernel/syscalls/getpgrp/getpgrp01.c +++ b/testcases/kernel/syscalls/getpgrp/getpgrp01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: getpgrp01.c,v 1.5 2009/03/23 13:35:45 subrata_modak Exp $ */ +/* $Id: getpgrp01.c,v 1.6 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -170,7 +170,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "getpgrp() returned %d", + tst_resm(TPASS, "getpgrp() returned %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/getpid/Makefile b/testcases/kernel/syscalls/getpid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getpid/Makefile +++ b/testcases/kernel/syscalls/getpid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getpid/getpid01.c b/testcases/kernel/syscalls/getpid/getpid01.c index ccb2020a..36e8561d 100644 --- a/testcases/kernel/syscalls/getpid/getpid01.c +++ b/testcases/kernel/syscalls/getpid/getpid01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: getpid01.c,v 1.7 2009/03/23 13:35:45 subrata_modak Exp $ */ +/* $Id: getpid01.c,v 1.8 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -168,7 +168,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "getpid() returned %d", + tst_resm(TPASS, "getpid() returned %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/getppid/Makefile b/testcases/kernel/syscalls/getppid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getppid/Makefile +++ b/testcases/kernel/syscalls/getppid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getppid/getppid01.c b/testcases/kernel/syscalls/getppid/getppid01.c index 976aa102..be498a81 100644 --- a/testcases/kernel/syscalls/getppid/getppid01.c +++ b/testcases/kernel/syscalls/getppid/getppid01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: getppid01.c,v 1.5 2009/03/23 13:35:45 subrata_modak Exp $ */ +/* $Id: getppid01.c,v 1.6 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -170,7 +170,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "getppid() returned %d", + tst_resm(TPASS, "getppid() returned %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/getpriority/Makefile b/testcases/kernel/syscalls/getpriority/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getpriority/Makefile +++ b/testcases/kernel/syscalls/getpriority/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getpriority/getpriority01.c b/testcases/kernel/syscalls/getpriority/getpriority01.c index 9c5e099e..607c97dd 100644 --- a/testcases/kernel/syscalls/getpriority/getpriority01.c +++ b/testcases/kernel/syscalls/getpriority/getpriority01.c @@ -126,7 +126,7 @@ int main(int ac, char **av) strerror(TEST_ERRNO)); } else { tst_resm(TPASS, "getpriority(%d, 0) returned " - "%d priority value", + "%ld priority value", which, TEST_RETURN); } } /* End of TEST CASE LOOPING */ diff --git a/testcases/kernel/syscalls/getpriority/getpriority02.c b/testcases/kernel/syscalls/getpriority/getpriority02.c index 6a3ffe36..0aacb6c8 100644 --- a/testcases/kernel/syscalls/getpriority/getpriority02.c +++ b/testcases/kernel/syscalls/getpriority/getpriority02.c @@ -162,7 +162,7 @@ int main(int ac, char **av) Test_cases[ind].exp_errno); } } else { - tst_resm(TFAIL, "getpriority() returned %d, " + tst_resm(TFAIL, "getpriority() returned %ld, " "expected -1, errno:%d", TEST_RETURN, Test_cases[ind].exp_errno); } diff --git a/testcases/kernel/syscalls/getresgid/Makefile b/testcases/kernel/syscalls/getresgid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getresgid/Makefile +++ b/testcases/kernel/syscalls/getresgid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getresuid/Makefile b/testcases/kernel/syscalls/getresuid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getresuid/Makefile +++ b/testcases/kernel/syscalls/getresuid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getrlimit/Makefile b/testcases/kernel/syscalls/getrlimit/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getrlimit/Makefile +++ b/testcases/kernel/syscalls/getrlimit/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getrusage/Makefile b/testcases/kernel/syscalls/getrusage/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getrusage/Makefile +++ b/testcases/kernel/syscalls/getrusage/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getrusage/getrusage01.c b/testcases/kernel/syscalls/getrusage/getrusage01.c index 7d2ae261..5e878a40 100755 --- a/testcases/kernel/syscalls/getrusage/getrusage01.c +++ b/testcases/kernel/syscalls/getrusage/getrusage01.c @@ -110,7 +110,7 @@ int main(int ac, char **av) tst_resm(TPASS, "TEST Passed"); } else { tst_resm(TFAIL, "test Failed," - "getrusage() returned %d" + "getrusage() returned %ld" " errno = %d : %s", TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO)); } diff --git a/testcases/kernel/syscalls/getrusage/getrusage02.c b/testcases/kernel/syscalls/getrusage/getrusage02.c index 935f120a..d45bf0c6 100755 --- a/testcases/kernel/syscalls/getrusage/getrusage02.c +++ b/testcases/kernel/syscalls/getrusage/getrusage02.c @@ -136,7 +136,7 @@ int main(int ac, char **av) tst_resm(TPASS, "TEST Passed"); } else { tst_resm(TFAIL, "test Failed," - "getrusage() returned %d" + "getrusage() returned %ld" " errno = %d : %s", TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO)); } diff --git a/testcases/kernel/syscalls/getsid/Makefile b/testcases/kernel/syscalls/getsid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getsid/Makefile +++ b/testcases/kernel/syscalls/getsid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getsockname/Makefile b/testcases/kernel/syscalls/getsockname/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getsockname/Makefile +++ b/testcases/kernel/syscalls/getsockname/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getsockname/getsockname01.c b/testcases/kernel/syscalls/getsockname/getsockname01.c index 638d95a5..eaef170b 100644 --- a/testcases/kernel/syscalls/getsockname/getsockname01.c +++ b/testcases/kernel/syscalls/getsockname/getsockname01.c @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) (TEST_RETURN < 0 && TEST_ERRNO != tdat[testno].experrno)) { tst_resm(TFAIL, "%s ; returned" - " %d (expected %d), errno %d (expected" + " %ld (expected %d), errno %d (expected" " %d)", tdat[testno].desc, TEST_RETURN, tdat[testno].retval, TEST_ERRNO, tdat[testno].experrno); diff --git a/testcases/kernel/syscalls/getsockopt/Makefile b/testcases/kernel/syscalls/getsockopt/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/getsockopt/Makefile +++ b/testcases/kernel/syscalls/getsockopt/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getsockopt/getsockopt01.c b/testcases/kernel/syscalls/getsockopt/getsockopt01.c index b2a5ad7e..2b7118c5 100644 --- a/testcases/kernel/syscalls/getsockopt/getsockopt01.c +++ b/testcases/kernel/syscalls/getsockopt/getsockopt01.c @@ -160,7 +160,7 @@ int main(int argc, char *argv[]) (TEST_RETURN < 0 && TEST_ERRNO != tdat[testno].experrno)) { tst_resm(TFAIL, "%s ; returned" - " %d (expected %d), errno %d (expected" + " %ld (expected %d), errno %d (expected" " %d)", tdat[testno].desc, TEST_RETURN, tdat[testno].retval, TEST_ERRNO, tdat[testno].experrno); diff --git a/testcases/kernel/syscalls/gettid/Makefile b/testcases/kernel/syscalls/gettid/Makefile index e086e795..77e928b2 100644 --- a/testcases/kernel/syscalls/gettid/Makefile +++ b/testcases/kernel/syscalls/gettid/Makefile @@ -20,16 +20,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/gettid/gettid01.c b/testcases/kernel/syscalls/gettid/gettid01.c index 4dd5445e..bcf07c42 100644 --- a/testcases/kernel/syscalls/gettid/gettid01.c +++ b/testcases/kernel/syscalls/gettid/gettid01.c @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Id: gettid01.c,v 1.4 2009/03/23 13:35:45 subrata_modak Exp $ + * $Id: gettid01.c,v 1.5 2009/10/26 14:55:47 subrata_modak Exp $ * */ @@ -77,7 +77,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "gettid() returned %d", + tst_resm(TPASS, "gettid() returned %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/gettimeofday/Makefile b/testcases/kernel/syscalls/gettimeofday/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/gettimeofday/Makefile +++ b/testcases/kernel/syscalls/gettimeofday/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getuid/Makefile b/testcases/kernel/syscalls/getuid/Makefile index b59851c7..f3ab6575 100644 --- a/testcases/kernel/syscalls/getuid/Makefile +++ b/testcases/kernel/syscalls/getuid/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getuid/compat_16.h b/testcases/kernel/syscalls/getuid/compat_16.h new file mode 100644 index 00000000..2a739a2f --- /dev/null +++ b/testcases/kernel/syscalls/getuid/compat_16.h @@ -0,0 +1,60 @@ +/* + * + * Copyright (c) Red Hat Inc., 2008 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* Author: Masatake YAMATO */ + +#ifndef __GETUID_COMPAT_16_H__ +#define __GETUID_COMPAT_16_H__ + + +#include "linux_syscall_numbers.h" +#include "compat_uid.h" + + +#ifdef TST_USE_COMPAT16_SYSCALL + +UID_T +GETUID(void) +{ + return syscall(__NR_getuid); +} + +UID_T +GETEUID(void) +{ + return syscall(__NR_geteuid); +} + +#else + +UID_T +GETUID(void) +{ + return getuid(); +} + +UID_T +GETEUID(void) +{ + return geteuid(); +} + +#endif + +#endif /* __GETUID_COMPAT_16_H__ */ diff --git a/testcases/kernel/syscalls/getuid/getuid01.c b/testcases/kernel/syscalls/getuid/getuid01.c index d40404c5..cdcbda5b 100644 --- a/testcases/kernel/syscalls/getuid/getuid01.c +++ b/testcases/kernel/syscalls/getuid/getuid01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: getuid01.c,v 1.7 2009/03/23 13:35:45 subrata_modak Exp $ */ +/* $Id: getuid01.c,v 1.9 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -116,11 +116,12 @@ #include #include "test.h" #include "usctest.h" +#include "compat_16.h" void setup(); void cleanup(); -char *TCID = "getuid01"; /* Test program identifier. */ +TCID_DEFINE(getuid01); /* Test program identifier. */ int TST_TOTAL = 1; /* Total number of test cases. */ extern int Tst_count; /* Test Case counter for tst_* routines */ @@ -156,7 +157,7 @@ int main(int ac, char **av) /* * Call getuid(2) */ - TEST(getuid()); + TEST(GETUID()); /* check return code */ if (TEST_RETURN == -1) { @@ -170,7 +171,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "getuid() returned %d", + tst_resm(TPASS, "getuid() returned %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/getuid/getuid02.c b/testcases/kernel/syscalls/getuid/getuid02.c index db45fe1d..74fad340 100644 --- a/testcases/kernel/syscalls/getuid/getuid02.c +++ b/testcases/kernel/syscalls/getuid/getuid02.c @@ -44,8 +44,9 @@ #include #include #include +#include "compat_16.h" -char *TCID = "getuid02"; +TCID_DEFINE(getuid02); int TST_TOTAL = 1; extern int Tst_count; @@ -71,7 +72,7 @@ int main(int ac, char **av) /* reset Tst_count in case we are looping */ Tst_count = 0; - TEST(geteuid()); + TEST(GETEUID()); if (TEST_RETURN < 0) { tst_brkm(TBROK, cleanup, "This should never happen"); @@ -82,12 +83,17 @@ int main(int ac, char **av) pwent = getpwuid(TEST_RETURN); if (pwent == NULL) { tst_resm(TFAIL, "geteuid() returned unexpected " - "value %d", TEST_RETURN); + "value %ld", TEST_RETURN); + } else if (!UID_SIZE_CHECK(pwent->pw_uid)) { + tst_brkm(TBROK, + cleanup, + "uid(%ld) is too large for testing geteuid16", + TEST_RETURN); } else { if (pwent->pw_uid != TEST_RETURN) { tst_resm(TFAIL, "getpwuid() value, %d, " "does not match geteuid() " - "value, %d", pwent->pw_uid, + "value, %ld", pwent->pw_uid, TEST_RETURN); } else { tst_resm(TPASS, "values from geteuid()" diff --git a/testcases/kernel/syscalls/getuid/getuid03.c b/testcases/kernel/syscalls/getuid/getuid03.c index 9b7d2fe4..1f321862 100644 --- a/testcases/kernel/syscalls/getuid/getuid03.c +++ b/testcases/kernel/syscalls/getuid/getuid03.c @@ -44,8 +44,10 @@ #include #include #include +#include "compat_16.h" -char *TCID = "getuid03"; + +TCID_DEFINE(getuid03); int TST_TOTAL = 1; extern int Tst_count; @@ -72,7 +74,7 @@ int main(int ac, char **av) /* reset Tst_count in case we are looping */ Tst_count = 0; - TEST(getuid()); + TEST(GETUID()); if (TEST_RETURN < 0) { tst_brkm(TBROK, cleanup, "This should never happen"); @@ -83,12 +85,18 @@ int main(int ac, char **av) pwent = getpwuid(TEST_RETURN); if (pwent == NULL) { tst_resm(TFAIL, "getuid() returned unexpected " - "value %d", TEST_RETURN); + "value %ld", TEST_RETURN); + } else if (!UID_SIZE_CHECK(pwent->pw_uid)) { + tst_brkm(TBROK, + cleanup, + "uid(%ld) is too large for testing getuid16", + TEST_RETURN); + } else { if (pwent->pw_uid != TEST_RETURN) { tst_resm(TFAIL, "getpwuid() value, %d, " "does not match getuid() " - "value, %d", pwent->pw_uid, + "value, %ld", pwent->pw_uid, TEST_RETURN); } else { tst_resm(TPASS, "values from getuid()" diff --git a/testcases/kernel/syscalls/inotify/Makefile b/testcases/kernel/syscalls/inotify/Makefile index 73eb2278..91da9ff9 100644 --- a/testcases/kernel/syscalls/inotify/Makefile +++ b/testcases/kernel/syscalls/inotify/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/inotify_init/Makefile b/testcases/kernel/syscalls/inotify_init/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/inotify_init/Makefile +++ b/testcases/kernel/syscalls/inotify_init/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/io_cancel/Makefile b/testcases/kernel/syscalls/io_cancel/Makefile index bfca371a..9b6eae82 100644 --- a/testcases/kernel/syscalls/io_cancel/Makefile +++ b/testcases/kernel/syscalls/io_cancel/Makefile @@ -1,8 +1,4 @@ # -# Copied from ../modify_ldt/Makefile by Masatake YAMATO -# -### -# # Copyright (c) International Business Machines Corp., 2001 # # This program is free software; you can redistribute it and/or modify @@ -20,19 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # +top_srcdir ?= ../../../.. -include ../../../../config.mk - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -CFLAGS += -I../../../../include -Wall -LDLIBS += $(AIO_LIBS) -L../../../../lib -lltp - -all: $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +LDFLAGS += $(AIO_LIBS) -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/io_cancel/io_cancel01.c b/testcases/kernel/syscalls/io_cancel/io_cancel01.c index 183d0470..e077f778 100644 --- a/testcases/kernel/syscalls/io_cancel/io_cancel01.c +++ b/testcases/kernel/syscalls/io_cancel/io_cancel01.c @@ -110,11 +110,11 @@ int main(int argc, char **argv) if (TEST_RETURN == expected_return) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", TEST_RETURN, + "returned value = %ld : %s", TEST_RETURN, strerror(-1 * TEST_RETURN)); } else { - tst_resm(TFAIL, "unexpected returned value - %d - " - "expected %d", TEST_RETURN, expected_return); + tst_resm(TFAIL, "unexpected returned value - %ld - " + "expected %ld", TEST_RETURN, expected_return); } /* diff --git a/testcases/kernel/syscalls/io_destroy/Makefile b/testcases/kernel/syscalls/io_destroy/Makefile index e984f60c..9b6eae82 100644 --- a/testcases/kernel/syscalls/io_destroy/Makefile +++ b/testcases/kernel/syscalls/io_destroy/Makefile @@ -1,8 +1,4 @@ # -# Copied from ../modify_ldt/Makefile by Masatake YAMATO -# -### -# # Copyright (c) International Business Machines Corp., 2001 # # This program is free software; you can redistribute it and/or modify @@ -20,20 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # +top_srcdir ?= ../../../.. -include ../../../../config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -CFLAGS += -I../../../../include -Wall -LDLIBS += $(AIO_LIBS) -L../../../../lib -lltp - -all: $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +LDFLAGS += $(AIO_LIBS) -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/io_destroy/io_destroy01.c b/testcases/kernel/syscalls/io_destroy/io_destroy01.c index e6dc25e9..0395e0db 100644 --- a/testcases/kernel/syscalls/io_destroy/io_destroy01.c +++ b/testcases/kernel/syscalls/io_destroy/io_destroy01.c @@ -102,11 +102,11 @@ ERRORS tst_resm(TFAIL, "call succeeded unexpectedly"); } else if (TEST_RETURN == expected_return) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", TEST_RETURN, + "returned value = %ld : %s", TEST_RETURN, strerror(-1 * TEST_RETURN)); } else { - tst_resm(TFAIL, "unexpected returned value - %d - " - "expected %d", TEST_RETURN, expected_return); + tst_resm(TFAIL, "unexpected returned value - %ld - " + "expected %ld", TEST_RETURN, expected_return); } /* diff --git a/testcases/kernel/syscalls/io_getevents/Makefile b/testcases/kernel/syscalls/io_getevents/Makefile index e984f60c..9b6eae82 100644 --- a/testcases/kernel/syscalls/io_getevents/Makefile +++ b/testcases/kernel/syscalls/io_getevents/Makefile @@ -1,8 +1,4 @@ # -# Copied from ../modify_ldt/Makefile by Masatake YAMATO -# -### -# # Copyright (c) International Business Machines Corp., 2001 # # This program is free software; you can redistribute it and/or modify @@ -20,20 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # +top_srcdir ?= ../../../.. -include ../../../../config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -CFLAGS += -I../../../../include -Wall -LDLIBS += $(AIO_LIBS) -L../../../../lib -lltp - -all: $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +LDFLAGS += $(AIO_LIBS) -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/io_getevents/io_getevents01.c b/testcases/kernel/syscalls/io_getevents/io_getevents01.c index 963b7b68..fe4160fc 100644 --- a/testcases/kernel/syscalls/io_getevents/io_getevents01.c +++ b/testcases/kernel/syscalls/io_getevents/io_getevents01.c @@ -110,11 +110,11 @@ int main(int argc, char **argv) if (TEST_RETURN == expected_return) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", TEST_RETURN, + "returned value = %ld : %s", TEST_RETURN, strerror(-1 * TEST_RETURN)); } else { - tst_resm(TFAIL, "unexpected returned value - %d - " - "expected %d", TEST_RETURN, expected_return); + tst_resm(TFAIL, "unexpected returned value - %ld - " + "expected %ld", TEST_RETURN, expected_return); } /* EFAULT Either events or timeout is an invalid pointer. diff --git a/testcases/kernel/syscalls/io_setup/Makefile b/testcases/kernel/syscalls/io_setup/Makefile index e984f60c..9b6eae82 100644 --- a/testcases/kernel/syscalls/io_setup/Makefile +++ b/testcases/kernel/syscalls/io_setup/Makefile @@ -1,8 +1,4 @@ # -# Copied from ../modify_ldt/Makefile by Masatake YAMATO -# -### -# # Copyright (c) International Business Machines Corp., 2001 # # This program is free software; you can redistribute it and/or modify @@ -20,20 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # +top_srcdir ?= ../../../.. -include ../../../../config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -CFLAGS += -I../../../../include -Wall -LDLIBS += $(AIO_LIBS) -L../../../../lib -lltp - -all: $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +LDFLAGS += $(AIO_LIBS) -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/io_setup/io_setup01.c b/testcases/kernel/syscalls/io_setup/io_setup01.c index d7057aef..2bf9e29f 100644 --- a/testcases/kernel/syscalls/io_setup/io_setup01.c +++ b/testcases/kernel/syscalls/io_setup/io_setup01.c @@ -100,7 +100,7 @@ int main(int argc, char **argv) tst_resm(TPASS, "call succeeded expectedly"); io_destroy(ctx); } else { - tst_resm(TFAIL, "unexpected returned value - %d - " + tst_resm(TFAIL, "unexpected returned value - %ld - " "expected %d", TEST_RETURN, expected_return); } @@ -122,10 +122,10 @@ int main(int argc, char **argv) io_destroy(ctx); } else if (TEST_RETURN == expected_return) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", TEST_RETURN, + "returned value = %ld : %s", TEST_RETURN, strerror(-1 * TEST_RETURN)); } else { - tst_resm(TFAIL, "unexpected returned value - %d - " + tst_resm(TFAIL, "unexpected returned value - %ld - " "expected %d", TEST_RETURN, expected_return); } @@ -137,10 +137,10 @@ int main(int argc, char **argv) io_destroy(ctx); } else if (TEST_RETURN == expected_return) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", TEST_RETURN, + "returned value = %ld : %s", TEST_RETURN, strerror(-1 * TEST_RETURN)); } else { - tst_resm(TFAIL, "unexpected returned value - %d - " + tst_resm(TFAIL, "unexpected returned value - %ld - " "expected %d", TEST_RETURN, expected_return); } @@ -155,10 +155,10 @@ int main(int argc, char **argv) io_destroy(ctx); } else if (TEST_RETURN == expected_return) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", TEST_RETURN, + "returned value = %ld : %s", TEST_RETURN, strerror(-1 * TEST_RETURN)); } else { - tst_resm(TFAIL, "unexpected returned value - %d - " + tst_resm(TFAIL, "unexpected returned value - %ld - " "expected %d", TEST_RETURN, expected_return); } diff --git a/testcases/kernel/syscalls/io_submit/Makefile b/testcases/kernel/syscalls/io_submit/Makefile index 00fe37ba..9b6eae82 100644 --- a/testcases/kernel/syscalls/io_submit/Makefile +++ b/testcases/kernel/syscalls/io_submit/Makefile @@ -1,8 +1,4 @@ # -# Copied from ../modify_ldt/Makefile by Masatake YAMATO -# -### -# # Copyright (c) International Business Machines Corp., 2001 # # This program is free software; you can redistribute it and/or modify @@ -20,21 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # +top_srcdir ?= ../../../.. -include ../../../../config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) -SYSCALL = io_submit - -CFLAGS += -I../../../../include -Wall -LDLIBS += $(AIO_LIBS) -L../../../../lib -lltp - -all: $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +LDFLAGS += $(AIO_LIBS) -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/io_submit/io_submit01.c b/testcases/kernel/syscalls/io_submit/io_submit01.c index f7524a5a..a4c87f20 100644 --- a/testcases/kernel/syscalls/io_submit/io_submit01.c +++ b/testcases/kernel/syscalls/io_submit/io_submit01.c @@ -112,11 +112,11 @@ int main(int argc, char **argv) tst_resm(TFAIL, "call succeeded unexpectedly"); } else if (TEST_RETURN == expected_return) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", (-1 * TEST_RETURN), + "returned value = %ld : %s", (-1 * TEST_RETURN), strerror(-1 * TEST_RETURN)); } else { - tst_resm(TFAIL, "unexpected returned value - %d - " - "expected %d", TEST_RETURN, expected_return); + tst_resm(TFAIL, "unexpected returned value - %ld - " + "expected %ld", TEST_RETURN, expected_return); } /* @@ -128,11 +128,11 @@ int main(int argc, char **argv) tst_resm(TFAIL, "call succeeded unexpectedly"); } else if (TEST_RETURN == expected_return) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", (-1 * TEST_RETURN), + "returned value = %ld : %s", (-1 * TEST_RETURN), strerror(-1 * TEST_RETURN)); } else { - tst_resm(TFAIL, "unexpected returned value - %d - " - "expected %d", TEST_RETURN, expected_return); + tst_resm(TFAIL, "unexpected returned value - %ld - " + "expected %ld", TEST_RETURN, expected_return); } /* Special case EFAULT or EINVAL (indetermination) @@ -150,13 +150,13 @@ int main(int argc, char **argv) } else if (TEST_RETURN == expected_fault || TEST_RETURN == expected_inval) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", + "returned value = %ld : %s", (-1 * TEST_RETURN), strerror(-1 * TEST_RETURN)); } else { tst_resm(TFAIL, - "unexpected returned value - %d - " - "expected %d(%s) or %d(%s)", + "unexpected returned value - %ld - " + "expected %ld(%s) or %ld(%s)", TEST_RETURN, expected_fault, strerror(-1 * expected_fault), expected_inval, @@ -182,11 +182,11 @@ int main(int argc, char **argv) tst_resm(TFAIL, "call succeeded unexpectedly"); } else if (TEST_RETURN == expected_return) { tst_resm(TPASS, "expected failure - " - "returned value = %d : %s", (-1 * TEST_RETURN), + "returned value = %ld : %s", (-1 * TEST_RETURN), strerror(-1 * TEST_RETURN)); } else { - tst_resm(TFAIL, "unexpected returned value - %d - " - "expected %d", TEST_RETURN, expected_return); + tst_resm(TFAIL, "unexpected returned value - %ld - " + "expected %ld", TEST_RETURN, expected_return); } /* diff --git a/testcases/kernel/syscalls/ioctl/Makefile b/testcases/kernel/syscalls/ioctl/Makefile index 7bab8b3c..a15afa76 100644 --- a/testcases/kernel/syscalls/ioctl/Makefile +++ b/testcases/kernel/syscalls/ioctl/Makefile @@ -16,17 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +INSTALL_TARGETS += test_ioctl -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - ln -f test_ioctl ../../../bin/ - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ioperm/Makefile b/testcases/kernel/syscalls/ioperm/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/ioperm/Makefile +++ b/testcases/kernel/syscalls/ioperm/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ioperm/ioperm02.c b/testcases/kernel/syscalls/ioperm/ioperm02.c index 735e8897..333557cb 100644 --- a/testcases/kernel/syscalls/ioperm/ioperm02.c +++ b/testcases/kernel/syscalls/ioperm/ioperm02.c @@ -152,7 +152,7 @@ int main(int ac, char **av) TEST_ERRNO); } else { tst_resm(TFAIL, "Unexpected results for %s ; " - "returned %d (expected %d), errno %d " + "returned %ld (expected %d), errno %d " "(expected errno %d)", test_cases[i].desc, TEST_RETURN, EXP_RET_VAL, diff --git a/testcases/kernel/syscalls/iopl/Makefile b/testcases/kernel/syscalls/iopl/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/iopl/Makefile +++ b/testcases/kernel/syscalls/iopl/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/iopl/iopl01.c b/testcases/kernel/syscalls/iopl/iopl01.c index fa19dae0..0a6bbd8b 100644 --- a/testcases/kernel/syscalls/iopl/iopl01.c +++ b/testcases/kernel/syscalls/iopl/iopl01.c @@ -118,7 +118,7 @@ int main(int ac, char **av) TEST_ERRNO, strerror(TEST_ERRNO)); } else { tst_resm(TPASS, "iopl() passed for level %d, " - "returned %d", level, TEST_RETURN); + "returned %ld", level, TEST_RETURN); } } } /* End for TEST_LOOPING */ diff --git a/testcases/kernel/syscalls/iopl/iopl02.c b/testcases/kernel/syscalls/iopl/iopl02.c index be044ea0..b1572c9a 100644 --- a/testcases/kernel/syscalls/iopl/iopl02.c +++ b/testcases/kernel/syscalls/iopl/iopl02.c @@ -149,7 +149,7 @@ int main(int ac, char **av) TEST_ERRNO); } else { tst_resm(TFAIL, "Unexpected results for %s ; " - "returned %d (expected %d), errno %d " + "returned %ld (expected %d), errno %d " "(expected errno %d)", test_cases[i].desc, TEST_RETURN, EXP_RET_VAL, diff --git a/testcases/kernel/syscalls/ipc/Makefile b/testcases/kernel/syscalls/ipc/Makefile index 377cc2ac..2d6b4414 100644 --- a/testcases/kernel/syscalls/ipc/Makefile +++ b/testcases/kernel/syscalls/ipc/Makefile @@ -16,10 +16,25 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -SUBDIRS = $(patsubst %/Makefile,%,$(wildcard */Makefile)) +top_srcdir ?= ../../../.. -all %:: - @set -e; \ - for i in $(SUBDIRS); do \ - $(MAKE) -C $$i $@; \ - done +include $(top_srcdir)/include/mk/env_pre.mk + +LIBDIR := lib +FILTER_OUT_DIRS := $(LIBDIR) +LIB := $(LIBDIR)/libipc.a + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all + +trunk-all: $(LIB) + +trunk-clean:: | lib-clean + +lib-clean:: $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/syscalls/ipc/Makefile.inc b/testcases/kernel/syscalls/ipc/Makefile.inc new file mode 100644 index 00000000..43c303ae --- /dev/null +++ b/testcases/kernel/syscalls/ipc/Makefile.inc @@ -0,0 +1,42 @@ +# +# kernel/syscalls/ipc 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. +# +# Garrett Cooper, July 2009 +# + +# DO NOT USE THIS FILE FOR ipc / lib!!! + +LDLIBS += -lipc +LIBDIR := ../lib + +LIB := $(LIBDIR)/libipc.a + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all + +all: | $(LIB) + +CPPFLAGS += -I$(abs_srcdir)/$(LIBDIR) + +LDFLAGS += -L$(abs_builddir)/$(LIBDIR) + +# vim: syntax=make diff --git a/testcases/kernel/syscalls/ipc/lib/Makefile b/testcases/kernel/syscalls/ipc/lib/Makefile index 952665d4..760f86b6 100644 --- a/testcases/kernel/syscalls/ipc/lib/Makefile +++ b/testcases/kernel/syscalls/ipc/lib/Makefile @@ -16,22 +16,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -SRCS = libipc.c -OBJS = $(SRCS:.c=.o) -LIBIPC = ../libipc.a -LIBIPC_HEADERS = ipcmsg.h ipcsem.h +top_srcdir ?= ../../../../.. -CFLAGS += -I../../../../../include -Wall -CFLAGS += -D_USC_LIB_ +include $(top_srcdir)/include/mk/env_pre.mk -all: $(LIBIPC) +LIB := libipc.a -$(LIBIPC): $(OBJS) - $(AR) -rc $@ $(OBJS) +CFLAGS += -D_USC_LIB_ -$(OBJS): $(LIBIPC_HEADERS) - -install: - -clean: - rm -f $(OBJS) $(LIBIPC) +include $(top_srcdir)/include/mk/lib.mk diff --git a/testcases/kernel/syscalls/ipc/msgctl/Makefile b/testcases/kernel/syscalls/ipc/msgctl/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/Makefile +++ b/testcases/kernel/syscalls/ipc/msgctl/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c index 44011b4c..f644b9dc 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c @@ -94,9 +94,7 @@ int main(int ac, char **av) TEST(msgctl(msg_q_1, IPC_STAT, &qs_buf)); if (TEST_RETURN == -1) { - tst_resm(TFAIL, "%s call failed - errno = %d" - " : %s", TCID, TEST_ERRNO, - strerror(TEST_ERRNO)); + tst_resm(TFAIL|TTERRNO, "msgctl() call failed"); } else { if (STD_FUNCTIONAL_TEST) { if (qs_buf.msg_qbytes > 0) { diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c index acbca788..702a2cf0 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c @@ -96,9 +96,7 @@ int main(int ac, char **av) TEST(msgctl(msg_q_1, IPC_SET, &qs_buf)); if (TEST_RETURN == -1) { - tst_resm(TFAIL, "%s call failed - errno = %d" - " : %s", TCID, TEST_ERRNO, - strerror(TEST_ERRNO)); + tst_resm(TFAIL|TTERRNO, "msgctl() call failed"); } else { if (STD_FUNCTIONAL_TEST) { diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c index 9949b0a7..18a0ac67 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c @@ -86,8 +86,7 @@ int main(int ac, char **av) TEST(msgctl(msg_q_1, IPC_RMID, NULL)); if (TEST_RETURN == -1) { - tst_brkm(TFAIL, cleanup, "%s call failed - errno = %d" - " : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO)); + tst_brkm(TFAIL|TTERRNO, cleanup, "msgctl() call failed"); } else { if (STD_FUNCTIONAL_TEST) { /* diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c index bb0c2455..245cea7d 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c @@ -137,12 +137,9 @@ int main(int ac, char **av) TEST_ERROR_LOG(TEST_ERRNO); if (TEST_ERRNO == TC[i].error) { - tst_resm(TPASS, "expected failure - " - "errno = %d : %s", TEST_ERRNO, - strerror(TEST_ERRNO)); + tst_resm(TPASS|TTERRNO, "expected failure"); } else { - tst_resm(TFAIL, "unexpected error - %d : %s -", - TEST_ERRNO, strerror(TEST_ERRNO)); + tst_resm(TFAIL|TTERRNO, "unexpected error"); tst_resm(TINFO, "expected error is - %d : %s", TC[i].error, strerror(TC[i].error)); } @@ -192,15 +189,13 @@ void setup(void) /* now we have a key, so let's create a message queue */ if ((msg_q_1 = msgget(msgkey, IPC_CREAT | IPC_EXCL)) == -1) { - tst_brkm(TBROK, cleanup, "Can't create message queue #1: %s", - strerror(errno)); + tst_brkm(TBROK|TERRNO, cleanup, "Can't create message queue #1"); } /* now let's create another message queue with read & write access */ if ((msg_q_2 = msgget(msgkey2, IPC_CREAT | IPC_EXCL | MSG_RD | MSG_WR)) == -1) { - tst_brkm(TBROK, cleanup, "Can't create message queue #2: %s", - strerror(errno)); + tst_brkm(TBROK|TERRNO, cleanup, "Can't create message queue #2"); } } diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c index 4012223b..a22cf7fd 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c @@ -101,9 +101,7 @@ int main(int ac, char **av) do_child(); } else { /* parent */ if (waitpid(pid, NULL, 0) == -1) { - tst_resm(TBROK, "waitpid() failed"); - tst_resm(TINFO, "waitpid() error = %d : %s", errno, - strerror(errno)); + tst_resm(TBROK|TERRNO, "waitpid() failed"); } /* if it exists, remove the message queue */ diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c index f6d05739..029b6019 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c @@ -39,7 +39,6 @@ #include /* needed for test */ #include /* needed for test */ #include /* needed by testhead.h */ -#include /* definitions needed for errno */ #include "test.h" #include "usctest.h" #include "ipcmsg.h" @@ -80,16 +79,15 @@ int main(int argc, char *argv[]) TEST(msgget(key, IPC_CREAT | IPC_EXCL)); msqid = TEST_RETURN; if (TEST_RETURN == -1) { - tst_resm(TFAIL, "msgget() failed errno = %d", errno); + tst_resm(TFAIL|TTERRNO, "msgget() failed"); tst_exit(); } TEST(msgctl(msqid, IPC_STAT, &buf)); status = TEST_RETURN; if (TEST_RETURN == -1) { - tst_resm(TFAIL, - "msgctl(msqid, IPC_STAT, &buf) failed errno = %d", - errno); + tst_resm(TFAIL|TTERRNO, + "msgctl(msqid, IPC_STAT, &buf) failed"); (void)msgctl(msqid, IPC_RMID, (struct msqid_ds *)NULL); tst_exit(); } diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c index e5d78664..d75f8d4b 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) key = getipckey(); if ((msqid = msgget(key, IPC_CREAT | IPC_EXCL)) == -1) { - tst_resm(TFAIL, "msgget() failed errno = %d", errno); + tst_resm(TFAIL|TERRNO, "msgget() failed"); tst_exit(); } @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGALRM); if ((sigaction(SIGALRM, &act, NULL)) < 0) { - tst_resm(TFAIL, "signal failed. errno = %d", errno); + tst_resm(TFAIL|TERRNO, "signal failed"); kill(pid, SIGKILL); (void)msgctl(msqid, IPC_RMID, (struct msqid_ds *)NULL); tst_exit(); @@ -141,7 +141,7 @@ int main(int argc, char *argv[]) p1_msgp.text[i] = 'i'; p1_msgp.type = 1; if (msgsnd(msqid, &p1_msgp, BYTES, 0) == -1) { - tst_resm(TFAIL, "msgsnd() failed. errno = %d", errno); + tst_resm(TFAIL|TERRNO, "msgsnd() failed"); kill(pid, SIGKILL); (void)msgctl(msqid, IPC_RMID, (struct msqid_ds *)NULL); tst_exit(); @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGALRM); if ((sigaction(SIGALRM, &act, NULL)) < 0) { - tst_resm(TFAIL, "signal failed. errno = %d", errno); + tst_resm(TFAIL|TERRNO, "signal failed"); kill(pid, SIGKILL); (void)msgctl(msqid, IPC_RMID, (struct msqid_ds *)NULL); tst_exit(); @@ -189,7 +189,7 @@ int main(int argc, char *argv[]) p1_msgp.text[i] = 'i'; p1_msgp.type = 1; if (msgsnd(msqid, &p1_msgp, BYTES, 0) == -1) { - tst_resm(TFAIL, "msgsnd() failed. errno = %d", errno); + tst_resm(TFAIL|TERRNO, "msgsnd() failed"); kill(pid, SIGKILL); (void)msgctl(msqid, IPC_RMID, (struct msqid_ds *)NULL); tst_exit(); @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) p2_msgp.text[j] = 'j'; p2_msgp.type = 2; if (msgsnd(msqid, &p2_msgp, BYTES, 0) == -1) { - tst_resm(TFAIL, "msgsnd() failed. errno = %d", errno); + tst_resm(TFAIL|TERRNO, "msgsnd() failed"); kill(pid, SIGKILL); (void)msgctl(msqid, IPC_RMID, (struct msqid_ds *)NULL); tst_exit(); @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) p3_msgp.text[k] = 'k'; p3_msgp.type = 3; if (msgsnd(msqid, &p3_msgp, BYTES, 0) == -1) { - tst_resm(TFAIL, "msgsnd() failed. errno = %d", errno); + tst_resm(TFAIL|TERRNO, "msgsnd() failed"); kill(pid, SIGKILL); (void)msgctl(msqid, IPC_RMID, (struct msqid_ds *)NULL); tst_exit(); @@ -257,7 +257,7 @@ void do_child_1() int size; if ((size = msgrcv(msqid, &c1_msgp, BYTES, 0, 0)) == -1) { - tst_resm(TFAIL, "msgrcv() failed errno = %d", errno); + tst_resm(TFAIL|TERRNO, "msgrcv() failed"); tst_exit(); } if (size != BYTES) { @@ -279,7 +279,7 @@ void do_child_2() int size; if ((size = msgrcv(msqid, &c3_msgp, BYTES, 3, 0)) == -1) { - tst_resm(TFAIL, "msgrcv() failed errno = %d", errno); + tst_resm(TFAIL|TERRNO, "msgrcv() failed"); tst_exit(); } if (size != BYTES) { @@ -293,7 +293,7 @@ void do_child_2() tst_exit(); } if ((size = msgrcv(msqid, &c2_msgp, BYTES, 2, 0)) == -1) { - tst_resm(TFAIL, "msgrcv() failed errno = %d", errno); + tst_resm(TFAIL|TERRNO, "msgrcv() failed"); tst_exit(); } if (size != BYTES) { @@ -307,7 +307,7 @@ void do_child_2() tst_exit(); } if ((size = msgrcv(msqid, &c1_msgp, BYTES, 1, 0)) == -1) { - tst_resm(TFAIL, "msgrcv() failed errno = %d", errno); + tst_resm(TFAIL|TERRNO, "msgrcv() failed"); tst_exit(); } if (size != BYTES) { diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c index 01505d06..4c36e176 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c @@ -282,8 +282,8 @@ int child_process; sighold(SIGTERM); TEST(msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR)); if (TEST_RETURN < 0) { - tst_resm(TFAIL, "Msgget error in child %d, errno = %d", - child_process, TEST_ERRNO); + tst_resm(TFAIL|TTERRNO, "Msgget error in child %d", + child_process); tst_exit(); } tid = id = TEST_RETURN; @@ -294,8 +294,7 @@ int child_process; tst_resm(TWARN, "\tFork failed (may be OK if under stress)"); TEST(msgctl(tid, IPC_RMID, 0)); if (TEST_RETURN < 0) { - tst_resm(TFAIL, "Msgctl error in cleanup, errno = %d", - errno); + tst_resm(TFAIL|TTERRNO, "Msgctl error in cleanup"); } tst_exit(); } @@ -306,8 +305,7 @@ int child_process; tst_resm(TWARN, "self_exec failed"); TEST(msgctl(tid, IPC_RMID, 0)); if (TEST_RETURN < 0) { - tst_resm(TFAIL, "\tMsgctl error in cleanup, " - "errno = %d\n", errno); + tst_resm(TFAIL|TTERRNO, "Msgctl error in cleanup"); } tst_exit(); } @@ -336,9 +334,9 @@ long key; for (i = 0; i < nreps; i++) { if ((size = msgrcv(id, &buffer, 100, 0, 0)) < 0) { - tst_brkm(TBROK, cleanup, - "Msgrcv error in child %d, read # = %d, errno = %d", - (i + 1), child, errno); + tst_brkm(TBROK|TERRNO, cleanup, + "Msgrcv error in child %d, read # = %d", + (i + 1), child); tst_exit(); } if (buffer.data.len + 1 != size) { @@ -375,9 +373,9 @@ long key; buffer.type = 1; TEST(msgsnd(id, &buffer, size + 1, 0)); if (TEST_RETURN < 0) { - tst_brkm(TBROK, cleanup, - "Msgsnd error in child %d, key = %lx errno = %d", - child, key, TEST_ERRNO); + tst_brkm(TBROK|TTERRNO, cleanup, + "Msgsnd error in child %d, key = %lx", + child, key); } key++; } diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c index c598077f..fef16739 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c @@ -311,7 +311,7 @@ void cleanup_msgqueue(int i, int tid) } if (msgctl(tid, IPC_RMID, 0) < 0) { - tst_resm(TFAIL, "Msgctl error in cleanup, errno = %d", errno); + tst_resm(TFAIL|TERRNO, "Msgctl error in cleanup"); tst_exit(); } } @@ -325,8 +325,8 @@ int child_process; sighold(SIGTERM); if ((id = msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR)) < 0) { - tst_resm(TFAIL, "Msgget error in child %d, errno = %d", - child_process, errno); + tst_resm(TFAIL|TERRNO, "Msgget error in child %d", + child_process); tst_exit(); } tid = id; @@ -406,9 +406,8 @@ int child_process; kill(wkidarray[i], SIGTERM); } if (msgctl(tid, IPC_RMID, 0) < 0) { - tst_resm(TFAIL, - "Msgctl error, errno = %d", - errno); + tst_resm(TFAIL|TERRNO, + "Msgctl error"); } tst_exit(); } @@ -425,13 +424,13 @@ int child_process; "Wrong number of children exited in child group %d, Saw %d Expected %d", child_process, count, (nkids * 2)); if (msgctl(tid, IPC_RMID, 0) < 0) { - tst_resm(TFAIL, "Msgctl error, errno = %d", errno); + tst_resm(TFAIL|TERRNO, "Msgctl error"); } tst_exit(); } if (msgctl(id, IPC_RMID, 0) < 0) { - tst_resm(TFAIL, "Msgctl failure in child group %d, errno %d", - child_process, errno); + tst_resm(TFAIL|TERRNO, "Msgctl failure in child group %d", + child_process); tst_exit(); } exit(exit_status); @@ -445,9 +444,9 @@ long key; int id; if ((id = msgget(key, 0)) < 0) { - tst_resm(TFAIL, - "Msgget error in reader of child group %d, errno = %d", - child, errno); + tst_resm(TFAIL|TERRNO, + "Msgget error in reader of child group %d", + child); tst_exit(); } if (id != tid) { @@ -458,9 +457,9 @@ long key; } for (i = 0; i < nreps; i++) { if ((size = msgrcv(id, &buffer, 100, type, 0)) < 0) { - tst_resm(TFAIL, - "Msgrcv error in child %d, read # = %d, errno = %d", - (i + 1), child, errno); + tst_resm(TFAIL|TERRNO, + "Msgrcv error in child %d, read # = %d", + (i + 1), child); tst_exit(); } if (buffer.type != type) { @@ -496,9 +495,9 @@ long key; int id; if ((id = msgget(key, 0)) < 0) { - tst_resm(TFAIL, - "Msgget error in writer of child group %d, errno = %d", - child, errno); + tst_resm(TFAIL|TERRNO, + "Msgget error in writer of child group %d", + child); tst_exit(); } if (id != tid) { @@ -518,9 +517,9 @@ long key; buffer.data.len = size; buffer.type = type; if (msgsnd(id, &buffer, size + 1, 0) < 0) { - tst_resm(TFAIL, - "Msgsnd error in child %d, key = %lx errno = %d", - child, key, errno); + tst_resm(TFAIL|TERRNO, + "Msgsnd error in child %d, key = %lx", + child, key); tst_exit(); } key++; diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c index cf85d472..90c9c994 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c @@ -283,8 +283,8 @@ int child_process; sighold(SIGTERM); TEST(msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR)); if (TEST_RETURN < 0) { - tst_resm(TFAIL, "Msgget error in child %d, errno = %d", - child_process, TEST_ERRNO); + tst_resm(TFAIL|TTERRNO, "Msgget error in child %d", + child_process); tst_exit(); } tid = id = TEST_RETURN; @@ -295,8 +295,7 @@ int child_process; tst_resm(TWARN, "\tFork failed (may be OK if under stress)"); TEST(msgctl(tid, IPC_RMID, 0)); if (TEST_RETURN < 0) { - tst_resm(TFAIL, "Msgctl error in cleanup, errno = %d", - errno); + tst_resm(TFAIL|TTERRNO, "Msgctl error in cleanup"); } tst_exit(); } @@ -307,8 +306,7 @@ int child_process; tst_resm(TWARN, "self_exec failed"); TEST(msgctl(tid, IPC_RMID, 0)); if (TEST_RETURN < 0) { - tst_resm(TFAIL, "\tMsgctl error in cleanup, " - "errno = %d\n", errno); + tst_resm(TFAIL|TTERRNO, "Msgctl error in cleanup"); } tst_exit(); } @@ -323,7 +321,7 @@ int child_process; wait(0); TEST(msgctl(id, IPC_RMID, 0)); if (TEST_RETURN < 0) { - tst_resm(TFAIL, "msgctl errno %d", TEST_ERRNO); + tst_resm(TFAIL|TTERRNO, "msgctl failed"); tst_exit(); } exit(PASS); @@ -337,9 +335,9 @@ long key; for (i = 0; i < nreps; i++) { if ((size = msgrcv(id, &buffer, 100, 0, 0)) < 0) { - tst_brkm(TBROK, cleanup, - "Msgrcv error in child %d, read # = %d, errno = %d", - (i + 1), child, errno); + tst_brkm(TBROK|TERRNO, cleanup, + "Msgrcv error in child %d, read # = %d", + (i + 1), child); tst_exit(); } if (buffer.data.len + 1 != size) { @@ -376,9 +374,9 @@ long key; buffer.type = 1; TEST(msgsnd(id, &buffer, size + 1, 0)); if (TEST_RETURN < 0) { - tst_brkm(TBROK, cleanup, - "Msgsnd error in child %d, key = %lx errno = %d", - child, key, TEST_ERRNO); + tst_brkm(TBROK|TTERRNO, cleanup, + "Msgsnd error in child %d, key = %lx", + child, key); } key++; } diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c index dd7682ca..e20926e1 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c @@ -314,7 +314,7 @@ void cleanup_msgqueue(int i, int tid) } if (msgctl(tid, IPC_RMID, 0) < 0) { - tst_resm(TFAIL, "Msgctl error in cleanup, errno = %d", errno); + tst_resm(TFAIL|TERRNO, "Msgctl error in cleanup"); tst_exit(); } } @@ -328,8 +328,8 @@ int child_process; sighold(SIGTERM); if ((id = msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR)) < 0) { - tst_resm(TFAIL, "Msgget error in child %d, errno = %d", - child_process, errno); + tst_resm(TFAIL|TERRNO, "Msgget error in child %d", + child_process); tst_exit(); } tid = id; @@ -409,9 +409,8 @@ int child_process; kill(wkidarray[i], SIGTERM); } if (msgctl(tid, IPC_RMID, 0) < 0) { - tst_resm(TFAIL, - "Msgctl error, errno = %d", - errno); + tst_resm(TFAIL|TERRNO, + "Msgctl error"); } tst_exit(); } @@ -428,13 +427,13 @@ int child_process; "Wrong number of children exited in child group %d, Saw %d Expected %d", child_process, count, (nkids * 2)); if (msgctl(tid, IPC_RMID, 0) < 0) { - tst_resm(TFAIL, "Msgctl error, errno = %d", errno); + tst_resm(TFAIL|TERRNO, "Msgctl error"); } tst_exit(); } if (msgctl(id, IPC_RMID, 0) < 0) { - tst_resm(TFAIL, "Msgctl failure in child group %d, errno %d", - child_process, errno); + tst_resm(TFAIL|TERRNO, "Msgctl failure in child group %d", + child_process); tst_exit(); } exit(exit_status); @@ -448,9 +447,9 @@ long key; int id; if ((id = msgget(key, 0)) < 0) { - tst_resm(TFAIL, - "Msgget error in reader of child group %d, errno = %d", - child, errno); + tst_resm(TFAIL|TERRNO, + "Msgget error in reader of child group %d", + child); tst_exit(); } if (id != tid) { @@ -461,9 +460,9 @@ long key; } for (i = 0; i < nreps; i++) { if ((size = msgrcv(id, &buffer, 100, type, 0)) < 0) { - tst_resm(TFAIL, - "Msgrcv error in child %d, read # = %d, errno = %d", - (i + 1), child, errno); + tst_resm(TFAIL|TERRNO, + "Msgrcv error in child %d, read # = %d", + (i + 1), child); tst_exit(); } if (buffer.type != type) { @@ -499,9 +498,9 @@ long key; int id; if ((id = msgget(key, 0)) < 0) { - tst_resm(TFAIL, - "Msgget error in writer of child group %d, errno = %d", - child, errno); + tst_resm(TFAIL|TERRNO, + "Msgget error in writer of child group %d", + child); tst_exit(); } if (id != tid) { @@ -521,9 +520,9 @@ long key; buffer.data.len = size; buffer.type = type; if (msgsnd(id, &buffer, size + 1, 0) < 0) { - tst_resm(TFAIL, - "Msgsnd error in child %d, key = %lx errno = %d", - child, key, errno); + tst_resm(TFAIL|TERRNO, + "Msgsnd error in child %d, key = %lx", + child, key); tst_exit(); } key++; diff --git a/testcases/kernel/syscalls/ipc/msgget/Makefile b/testcases/kernel/syscalls/ipc/msgget/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/msgget/Makefile +++ b/testcases/kernel/syscalls/ipc/msgget/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/msgrcv/Makefile b/testcases/kernel/syscalls/ipc/msgrcv/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/msgrcv/Makefile +++ b/testcases/kernel/syscalls/ipc/msgrcv/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/msgsnd/Makefile b/testcases/kernel/syscalls/ipc/msgsnd/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/msgsnd/Makefile +++ b/testcases/kernel/syscalls/ipc/msgsnd/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/semctl/Makefile b/testcases/kernel/syscalls/ipc/semctl/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/semctl/Makefile +++ b/testcases/kernel/syscalls/ipc/semctl/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/semget/Makefile b/testcases/kernel/syscalls/ipc/semget/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/semget/Makefile +++ b/testcases/kernel/syscalls/ipc/semget/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/semop/Makefile b/testcases/kernel/syscalls/ipc/semop/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/semop/Makefile +++ b/testcases/kernel/syscalls/ipc/semop/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/shmat/Makefile b/testcases/kernel/syscalls/ipc/shmat/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/shmat/Makefile +++ b/testcases/kernel/syscalls/ipc/shmat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/shmctl/Makefile b/testcases/kernel/syscalls/ipc/shmctl/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/shmctl/Makefile +++ b/testcases/kernel/syscalls/ipc/shmctl/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/shmdt/Makefile b/testcases/kernel/syscalls/ipc/shmdt/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/shmdt/Makefile +++ b/testcases/kernel/syscalls/ipc/shmdt/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/shmget/Makefile b/testcases/kernel/syscalls/ipc/shmget/Makefile index 9071354e..f467389b 100644 --- a/testcases/kernel/syscalls/ipc/shmget/Makefile +++ b/testcases/kernel/syscalls/ipc/shmget/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../lib -I../../../../../include -Wall -LDLIBS += -L../../../../../lib -lltp -L.. -lipc +top_srcdir ?= ../../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/keyctl/Makefile b/testcases/kernel/syscalls/keyctl/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/keyctl/Makefile +++ b/testcases/kernel/syscalls/keyctl/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/kill/Makefile b/testcases/kernel/syscalls/kill/Makefile index 28ebaaa0..6971d967 100644 --- a/testcases/kernel/syscalls/kill/Makefile +++ b/testcases/kernel/syscalls/kill/Makefile @@ -16,16 +16,26 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -L../ipc -lipc +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +LDLIBS += -lipc -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +LIBDIR := ../ipc/lib -clean: - rm -f $(TARGETS) +LIB := $(LIBDIR)/libipc.a + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all + +all: | $(LIB) + +CPPFLAGS += -I$(abs_srcdir)/$(LIBDIR) + +LDFLAGS += -L$(abs_builddir)/$(LIBDIR) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/lchown/Makefile b/testcases/kernel/syscalls/lchown/Makefile index 360f5df7..f3ab6575 100644 --- a/testcases/kernel/syscalls/lchown/Makefile +++ b/testcases/kernel/syscalls/lchown/Makefile @@ -16,23 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: create_link.mode - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) - -create_link.mode: - @/bin/sh ./create_link.mode.sh - -.PHONY: create_link.mode +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/lchown/create_link.mode.sh b/testcases/kernel/syscalls/lchown/create_link.mode.sh deleted file mode 100644 index e9270e07..00000000 --- a/testcases/kernel/syscalls/lchown/create_link.mode.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -whoami | grep root > /dev/null -if [ $? -eq 0 ];then - chown root create_link - chmod 04755 create_link -else - echo "" - echo " ************** WARNING **************" - echo " Cannot change permission or ownership of \"create_link\"." - echo " Tests in this directory will fail"$ - echo " Run "make install" as root." - echo " *************************************" - sleep 2 -fi - diff --git a/testcases/kernel/syscalls/lchown/lchown02.c b/testcases/kernel/syscalls/lchown/lchown02.c index d91b7fcb..6ea85ce3 100644 --- a/testcases/kernel/syscalls/lchown/lchown02.c +++ b/testcases/kernel/syscalls/lchown/lchown02.c @@ -209,7 +209,7 @@ int main(int ac, char **av) Test_cases[ind].exp_errno); } } else { - tst_resm(TFAIL, "lchown() returned %d, " + tst_resm(TFAIL, "lchown() returned %ld, " "expected -1, errno:%d", TEST_RETURN, Test_cases[ind].exp_errno); } @@ -234,8 +234,10 @@ int main(int ac, char **av) */ void setup() { + char file[PATH_MAX]; int ind; /* counter for setup functions */ - + struct stat change_link_stat; + /* Capture unexpected signals */ tst_sig(FORK, DEF_HANDLER, cleanup); @@ -271,6 +273,22 @@ void setup() "getcwd(3) fails to get working directory of process"); } + snprintf(file, PATH_MAX, "%schange_link", EXEC_DIR); + if (stat(file, &change_link_stat) < 0) { + tst_brkm(TBROK, cleanup, "stat for change_link failed"); + } else { + if ((change_link_stat.st_uid || change_link_stat.st_gid) && + chown(file, 0, 0) < 0) { + tst_brkm(TBROK, cleanup, + "chown for change_link failed"); + } + if (change_link_stat.st_mode != 04511 && + chmod(file, 04755) < 0) { + tst_brkm(TBROK, cleanup, + "setuid for change_link failed"); + } + } + /* Make a temp dir and cd to it */ tst_tmpdir(); diff --git a/testcases/kernel/syscalls/link/Makefile b/testcases/kernel/syscalls/link/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/link/Makefile +++ b/testcases/kernel/syscalls/link/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/link/link02.c b/testcases/kernel/syscalls/link/link02.c index ea3f9bb8..04b090f7 100644 --- a/testcases/kernel/syscalls/link/link02.c +++ b/testcases/kernel/syscalls/link/link02.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: link02.c,v 1.4 2009/03/23 13:35:53 subrata_modak Exp $ */ +/* $Id: link02.c,v 1.5 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -186,11 +186,11 @@ int main(int ac, char **av) fbuf.st_nlink == lbuf.st_nlink) tst_resm(TPASS, - "link(%s, %s) returned %d and link cnts match", + "link(%s, %s) returned %ld and link cnts match", Fname, Lname, TEST_RETURN); else { tst_resm(TFAIL, - "link(%s, %s) returned %d, stat link cnts do not match %d %d", + "link(%s, %s) returned %ld, stat link cnts do not match %d %d", Fname, Lname, TEST_RETURN, fbuf.st_nlink, lbuf.st_nlink); } diff --git a/testcases/kernel/syscalls/link/link03.c b/testcases/kernel/syscalls/link/link03.c index 712bc5ca..54c36758 100644 --- a/testcases/kernel/syscalls/link/link03.c +++ b/testcases/kernel/syscalls/link/link03.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: link03.c,v 1.4 2009/03/23 13:35:53 subrata_modak Exp $ */ +/* $Id: link03.c,v 1.5 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -233,7 +233,7 @@ int main(int ac, char **av) (fbuf.st_nlink != lbuf.st_nlink)) { tst_resm(TFAIL, - "link(%s, %s[1-%d]) ret %d for %d files, stat values do not match %d %d", + "link(%s, %s[1-%d]) ret %ld for %d files, stat values do not match %d %d", Fname, Basename, nlinks, TEST_RETURN, nlinks, fbuf.st_nlink, lbuf.st_nlink); @@ -242,7 +242,7 @@ int main(int ac, char **av) } if (cnt >= nlinks) { tst_resm(TPASS, - "link(%s, %s[1-%d]) ret %d for %d files, stat linkcounts match %d", + "link(%s, %s[1-%d]) ret %ld for %d files, stat linkcounts match %d", Fname, Basename, nlinks, TEST_RETURN, nlinks, fbuf.st_nlink); } diff --git a/testcases/kernel/syscalls/link/link04.c b/testcases/kernel/syscalls/link/link04.c index c6aa40f9..93bc7f0d 100644 --- a/testcases/kernel/syscalls/link/link04.c +++ b/testcases/kernel/syscalls/link/link04.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: link04.c,v 1.8 2009/03/23 13:35:53 subrata_modak Exp $ */ +/* $Id: link04.c,v 1.9 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -276,7 +276,7 @@ int main(int ac, char **av) Tst_count++; } else { tst_resm(TFAIL, - "link(<%s>, <%s>) returned %d, expected -1, errno:%d", + "link(<%s>, <%s>) returned %ld, expected -1, errno:%d", desc1, desc2, TEST_RETURN, Test_cases[ind].exp_errno); } diff --git a/testcases/kernel/syscalls/link/link05.c b/testcases/kernel/syscalls/link/link05.c index ca55455b..1db03b20 100644 --- a/testcases/kernel/syscalls/link/link05.c +++ b/testcases/kernel/syscalls/link/link05.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: link05.c,v 1.4 2009/03/23 13:35:53 subrata_modak Exp $ */ +/* $Id: link05.c,v 1.5 2009/10/26 14:55:47 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -216,7 +216,7 @@ int main(int ac, char **av) (fbuf.st_nlink != lbuf.st_nlink)) { tst_resm(TFAIL, - "link(%s, %s[1-%d]) ret %d for %d files, stat values do not match %d %d", + "link(%s, %s[1-%d]) ret %ld for %d files, stat values do not match %d %d", Fname, Basename, nlinks, TEST_RETURN, nlinks, fbuf.st_nlink, lbuf.st_nlink); @@ -225,7 +225,7 @@ int main(int ac, char **av) } if (cnt >= nlinks) { tst_resm(TPASS, - "link(%s, %s[1-%d]) ret %d for %d files, stat linkcounts match %d", + "link(%s, %s[1-%d]) ret %ld for %d files, stat linkcounts match %d", Fname, Basename, nlinks, TEST_RETURN, nlinks, fbuf.st_nlink); } diff --git a/testcases/kernel/syscalls/link/link06.c b/testcases/kernel/syscalls/link/link06.c index fe76d1bb..8f2a42f8 100644 --- a/testcases/kernel/syscalls/link/link06.c +++ b/testcases/kernel/syscalls/link/link06.c @@ -136,7 +136,7 @@ int main(int ac, char **av) /* Check return code from link(2) */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "link() returned %d," + tst_resm(TFAIL, "link() returned %ld," "expected -1, errno=%d", TEST_RETURN, exp_enos[0]); } else { diff --git a/testcases/kernel/syscalls/link/link07.c b/testcases/kernel/syscalls/link/link07.c index f2ca9a9e..5b2f8e5f 100644 --- a/testcases/kernel/syscalls/link/link07.c +++ b/testcases/kernel/syscalls/link/link07.c @@ -143,7 +143,7 @@ int main(int ac, char **av) /* Check return code from link(2) */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "link() returned %d," + tst_resm(TFAIL, "link() returned %ld," "expected -1, errno=%d", TEST_RETURN, exp_enos[0]); } else { diff --git a/testcases/kernel/syscalls/linkat/Makefile b/testcases/kernel/syscalls/linkat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/linkat/Makefile +++ b/testcases/kernel/syscalls/linkat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/listen/Makefile b/testcases/kernel/syscalls/listen/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/listen/Makefile +++ b/testcases/kernel/syscalls/listen/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/listen/listen01.c b/testcases/kernel/syscalls/listen/listen01.c index 21339569..ac52e246 100644 --- a/testcases/kernel/syscalls/listen/listen01.c +++ b/testcases/kernel/syscalls/listen/listen01.c @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) (TEST_RETURN < 0 && TEST_ERRNO != tdat[testno].experrno)) { tst_resm(TFAIL, "%s ; returned" - " %d (expected %d), errno %d (expected" + " %ld (expected %d), errno %d (expected" " %d)", tdat[testno].desc, TEST_RETURN, tdat[testno].retval, TEST_ERRNO, tdat[testno].experrno); diff --git a/testcases/kernel/syscalls/llseek/Makefile b/testcases/kernel/syscalls/llseek/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/llseek/Makefile +++ b/testcases/kernel/syscalls/llseek/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/llseek/llseek02.c b/testcases/kernel/syscalls/llseek/llseek02.c index 0788f83e..3afe98c9 100644 --- a/testcases/kernel/syscalls/llseek/llseek02.c +++ b/testcases/kernel/syscalls/llseek/llseek02.c @@ -167,7 +167,7 @@ int main(int ac, char **av) /* check return code of llseek(2) */ if (TEST_RETURN != (loff_t) - 1) { - tst_resm(TFAIL, "llseek() returned %d, expected" + tst_resm(TFAIL, "llseek() returned %ld, expected" " -1, errno:%d", TEST_RETURN, Test_cases[ind].exp_errno); continue; diff --git a/testcases/kernel/syscalls/lseek/Makefile b/testcases/kernel/syscalls/lseek/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/lseek/Makefile +++ b/testcases/kernel/syscalls/lseek/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/lseek/lseek02.c b/testcases/kernel/syscalls/lseek/lseek02.c index 916444f3..78790e33 100644 --- a/testcases/kernel/syscalls/lseek/lseek02.c +++ b/testcases/kernel/syscalls/lseek/lseek02.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: lseek02.c,v 1.4 2009/03/23 13:35:54 subrata_modak Exp $ */ +/* $Id: lseek02.c,v 1.5 2009/10/26 14:55:48 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -187,7 +187,7 @@ int main(int ac, char **av) } else { - tst_resm(TFAIL, "lseek(-1, 1, SEEK_SET) returned %d", + tst_resm(TFAIL, "lseek(-1, 1, SEEK_SET) returned %ld", TEST_RETURN); } diff --git a/testcases/kernel/syscalls/lseek/lseek03.c b/testcases/kernel/syscalls/lseek/lseek03.c index f024f5ff..29e1a741 100644 --- a/testcases/kernel/syscalls/lseek/lseek03.c +++ b/testcases/kernel/syscalls/lseek/lseek03.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: lseek03.c,v 1.5 2009/03/23 13:35:54 subrata_modak Exp $ */ +/* $Id: lseek03.c,v 1.6 2009/10/26 14:55:48 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -215,7 +215,7 @@ But SIGSYS signal was NOT received.", fname, whence, TEST_ERRNO, strerror Tst_count++; } else { - tst_resm(TFAIL, "lseek(%s, 1, %d) returned %d", + tst_resm(TFAIL, "lseek(%s, 1, %d) returned %ld", fname, whence, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/lseek/lseek04.c b/testcases/kernel/syscalls/lseek/lseek04.c index a3e42874..b33fad8b 100644 --- a/testcases/kernel/syscalls/lseek/lseek04.c +++ b/testcases/kernel/syscalls/lseek/lseek04.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: lseek04.c,v 1.4 2009/03/23 13:35:54 subrata_modak Exp $ */ +/* $Id: lseek04.c,v 1.5 2009/10/26 14:55:48 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -184,7 +184,7 @@ int main(int ac, char **av) } else { tst_resm(TFAIL, - "lseek(fifofd, 1, SEEK_SET) returned %d", + "lseek(fifofd, 1, SEEK_SET) returned %ld", TEST_RETURN); } diff --git a/testcases/kernel/syscalls/lseek/lseek05.c b/testcases/kernel/syscalls/lseek/lseek05.c index dd5ab6e1..ef1166c4 100644 --- a/testcases/kernel/syscalls/lseek/lseek05.c +++ b/testcases/kernel/syscalls/lseek/lseek05.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: lseek05.c,v 1.4 2009/03/23 13:35:54 subrata_modak Exp $ */ +/* $Id: lseek05.c,v 1.5 2009/10/26 14:55:48 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -185,7 +185,7 @@ int main(int ac, char **av) } else { tst_resm(TFAIL, - "lseek(pipefd, 1, SEEK_SET) returned %d", + "lseek(pipefd, 1, SEEK_SET) returned %ld", TEST_RETURN); } diff --git a/testcases/kernel/syscalls/lseek/lseek06.c b/testcases/kernel/syscalls/lseek/lseek06.c index b90a0471..748f8165 100644 --- a/testcases/kernel/syscalls/lseek/lseek06.c +++ b/testcases/kernel/syscalls/lseek/lseek06.c @@ -135,7 +135,7 @@ int main(int ac, char **av) */ if (TEST_RETURN != OFFSET) { tst_resm(TFAIL, "lseek() returned incorrect " - "value %d, expected %d", + "value %ld, expected %d", TEST_RETURN, OFFSET); continue; } diff --git a/testcases/kernel/syscalls/lseek/lseek08.c b/testcases/kernel/syscalls/lseek/lseek08.c index 56867d10..2b342709 100644 --- a/testcases/kernel/syscalls/lseek/lseek08.c +++ b/testcases/kernel/syscalls/lseek/lseek08.c @@ -135,7 +135,7 @@ int main(int ac, char **av) */ if (TEST_RETURN != file_size) { tst_resm(TFAIL, "lseek() returned incorrect " - "value %d, expected %d", + "value %ld, expected %d", TEST_RETURN, file_size); continue; } diff --git a/testcases/kernel/syscalls/lseek/lseek09.c b/testcases/kernel/syscalls/lseek/lseek09.c index e7c012bf..d44b5a03 100644 --- a/testcases/kernel/syscalls/lseek/lseek09.c +++ b/testcases/kernel/syscalls/lseek/lseek09.c @@ -140,7 +140,7 @@ int main(int ac, char **av) */ if (TEST_RETURN != 3) { tst_resm(TFAIL, "lseek() returned incorrect " - "value %d, expected 4", TEST_RETURN); + "value %ld, expected 4", TEST_RETURN); continue; } /* diff --git a/testcases/kernel/syscalls/lseek/lseek10.c b/testcases/kernel/syscalls/lseek/lseek10.c index 5765e5a3..681e4e18 100644 --- a/testcases/kernel/syscalls/lseek/lseek10.c +++ b/testcases/kernel/syscalls/lseek/lseek10.c @@ -171,7 +171,7 @@ int main(int ac, char **av) /* check return code of lseek(2) */ if (TEST_RETURN != (off_t) - 1) { - tst_resm(TFAIL, "lseek() returned %d, expected " + tst_resm(TFAIL, "lseek() returned %ld, expected " "-1, errno:%d", TEST_RETURN, Test_cases[ind].exp_errno); continue; diff --git a/testcases/kernel/syscalls/lstat/Makefile b/testcases/kernel/syscalls/lstat/Makefile index 3c22a28a..bf120101 100644 --- a/testcases/kernel/syscalls/lstat/Makefile +++ b/testcases/kernel/syscalls/lstat/Makefile @@ -16,19 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/lstat/lstat01.c b/testcases/kernel/syscalls/lstat/lstat01.c index be10f695..5314eeba 100644 --- a/testcases/kernel/syscalls/lstat/lstat01.c +++ b/testcases/kernel/syscalls/lstat/lstat01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: lstat01.c,v 1.6 2009/03/23 13:35:54 subrata_modak Exp $ */ +/* $Id: lstat01.c,v 1.7 2009/10/26 14:55:48 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -177,7 +177,7 @@ int main(int ac, char **av) if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, - "lstat(%s, &statter) returned %d", + "lstat(%s, &statter) returned %ld", symlnk, TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/lstat/lstat02.c b/testcases/kernel/syscalls/lstat/lstat02.c index 23b583e7..de7e82d6 100644 --- a/testcases/kernel/syscalls/lstat/lstat02.c +++ b/testcases/kernel/syscalls/lstat/lstat02.c @@ -191,7 +191,7 @@ int main(int ac, char **av) /* Check return code from lstat(2) */ if (TEST_RETURN != -1) { - tst_resm(TFAIL, "lstat(2) returned %d, expected" + tst_resm(TFAIL, "lstat(2) returned %ld, expected" " -1, errno:%d", TEST_RETURN, Test_cases[ind].exp_errno); continue; diff --git a/testcases/kernel/syscalls/madvise/Makefile b/testcases/kernel/syscalls/madvise/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/madvise/Makefile +++ b/testcases/kernel/syscalls/madvise/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/madvise/madvise01.c b/testcases/kernel/syscalls/madvise/madvise01.c index ee9f727a..f37d49db 100644 --- a/testcases/kernel/syscalls/madvise/madvise01.c +++ b/testcases/kernel/syscalls/madvise/madvise01.c @@ -254,7 +254,7 @@ void check_and_print(char *advice) if (TEST_RETURN == -1) { tst_resm(TFAIL, "madvise test for %s failed with " - "return = %d, errno = %d : %s", + "return = %ld, errno = %d : %s", advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO)); } else if (STD_FUNCTIONAL_TEST) { tst_resm(TPASS, "madvise test for %s PASSED", advice); diff --git a/testcases/kernel/syscalls/madvise/madvise02.c b/testcases/kernel/syscalls/madvise/madvise02.c index 6198f5c3..4f0a8373 100644 --- a/testcases/kernel/syscalls/madvise/madvise02.c +++ b/testcases/kernel/syscalls/madvise/madvise02.c @@ -340,6 +340,6 @@ void check_and_print(int expected_errno) } } else { tst_resm(TFAIL, "madvise failed, expected " - "return value = -1, got %d", TEST_RETURN); + "return value = -1, got %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/madvise/madvise03.c b/testcases/kernel/syscalls/madvise/madvise03.c index 89adc16a..25278657 100644 --- a/testcases/kernel/syscalls/madvise/madvise03.c +++ b/testcases/kernel/syscalls/madvise/madvise03.c @@ -284,7 +284,7 @@ void check_and_print(char *advice) if (TEST_RETURN == -1) { tst_resm(TFAIL, "madvise test for %s failed with " - "return = %d, errno = %d : %s", + "return = %ld, errno = %d : %s", advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO)); } else if (STD_FUNCTIONAL_TEST) { tst_resm(TPASS, "madvise test for %s PASSED", advice); diff --git a/testcases/kernel/syscalls/mallopt/Makefile b/testcases/kernel/syscalls/mallopt/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/mallopt/Makefile +++ b/testcases/kernel/syscalls/mallopt/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mbind/Makefile b/testcases/kernel/syscalls/mbind/Makefile index 66e1321f..4a465715 100644 --- a/testcases/kernel/syscalls/mbind/Makefile +++ b/testcases/kernel/syscalls/mbind/Makefile @@ -16,16 +16,19 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -I../utils/ -Wall -O2 -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +# +# gcc complains about unused functions / variables when HAS_NUMA_H isn't +# defined, so let's just skip the warning. It's nothing more than a few extra +# variables and functions allocated on the stack, so meh... no harm, no foul. +# +ifeq ($(NUMA_LIBS),) +CPPFLAGS += -Wno-unused +endif -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +CPPFLAGS += -I$(abs_srcdir)/../utils/ -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c index 4afa71bf..3cf7f975 100644 --- a/testcases/kernel/syscalls/mbind/mbind01.c +++ b/testcases/kernel/syscalls/mbind/mbind01.c @@ -55,7 +55,9 @@ #include #include #include -#include "numaif.h" +#if HAS_NUMAIF_H +#include +#endif #include "include_j_h.h" /* Harness Specific Include Files. */ @@ -174,6 +176,7 @@ struct test_case { * (only we can do is simulate 1-node NUMA) */ +#if HAS_NUMA_H static struct test_case tcase[] = { { // case00 .policy = MPOL_DEFAULT, @@ -244,6 +247,9 @@ static struct test_case tcase[] = { .err = EFAULT, }, }; +#else +static struct test_case tcase[] = { }; +#endif #define MEM_LENGTH (4 * 1024 * 1024) /* @@ -255,6 +261,7 @@ static struct test_case tcase[] = { */ static int do_test(struct test_case *tc) { +#if HAS_NUMA_H int sys_ret; int sys_errno; int result = RESULT_OK; @@ -270,6 +277,7 @@ static int do_test(struct test_case *tc) { nodemask_set(&nodemask, 0); nodemask_zero(&getnodemask); + /* * mmap memory */ @@ -326,6 +334,9 @@ TEST_END: result |= ((sys_errno != tc->err) || (!cmp_ok)); PRINT_RESULT_CMP(0, tc->ret, tc->err, sys_ret, sys_errno, cmp_ok); return result; +#else + return -1; +#endif } /* @@ -346,8 +357,6 @@ static void usage(char *progname) { int main(int ac, char **av) { - int result = 0; - int lc, i; /* loop counter */ char *msg; /* message returned from parse_opts */ struct option long_options[] = { @@ -367,6 +376,10 @@ int main(int ac, char **av) { progname = strchr(av[0],'/'); progname = (progname ? progname + 1 : av[0]); +#if HAS_NUMA_H + int result = 0; + int lc, i; /* loop counter */ + /* Check looping state if -i option given */ for (lc = 0; TEST_LOOPING(lc); ++lc) { Tst_count = 0; @@ -416,8 +429,10 @@ int main(int ac, char **av) { } - } + } +#else + tst_resm(TCONF, "NUMA support not provided."); +#endif cleanup(); tst_exit(); } - diff --git a/testcases/kernel/syscalls/memcmp/Makefile b/testcases/kernel/syscalls/memcmp/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/memcmp/Makefile +++ b/testcases/kernel/syscalls/memcmp/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/memcpy/Makefile b/testcases/kernel/syscalls/memcpy/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/memcpy/Makefile +++ b/testcases/kernel/syscalls/memcpy/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/memmap/Makefile b/testcases/kernel/syscalls/memmap/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/memmap/Makefile +++ b/testcases/kernel/syscalls/memmap/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/memset/Makefile b/testcases/kernel/syscalls/memset/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/memset/Makefile +++ b/testcases/kernel/syscalls/memset/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mincore/Makefile b/testcases/kernel/syscalls/mincore/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/mincore/Makefile +++ b/testcases/kernel/syscalls/mincore/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mkdir/Makefile b/testcases/kernel/syscalls/mkdir/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/mkdir/Makefile +++ b/testcases/kernel/syscalls/mkdir/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mkdirat/Makefile b/testcases/kernel/syscalls/mkdirat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/mkdirat/Makefile +++ b/testcases/kernel/syscalls/mkdirat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mknod/Makefile b/testcases/kernel/syscalls/mknod/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/mknod/Makefile +++ b/testcases/kernel/syscalls/mknod/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mknodat/Makefile b/testcases/kernel/syscalls/mknodat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/mknodat/Makefile +++ b/testcases/kernel/syscalls/mknodat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mlock/Makefile b/testcases/kernel/syscalls/mlock/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/mlock/Makefile +++ b/testcases/kernel/syscalls/mlock/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mlock/mlock01.c b/testcases/kernel/syscalls/mlock/mlock01.c index 9b1585da..5fd2b430 100644 --- a/testcases/kernel/syscalls/mlock/mlock01.c +++ b/testcases/kernel/syscalls/mlock/mlock01.c @@ -125,7 +125,7 @@ int main(int ac, char **av) if (TEST_RETURN == -1) { TEST_ERROR_LOG(TEST_ERRNO); tst_resm(TFAIL, "mlock(%p, %d) Failed with " - "return=%d, errno=%d : %s", + "return=%ld, errno=%d : %s", TC[i].addr, TC[i].len, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO)); diff --git a/testcases/kernel/syscalls/mlock/mlock02.c b/testcases/kernel/syscalls/mlock/mlock02.c index cf058b7b..a8697053 100644 --- a/testcases/kernel/syscalls/mlock/mlock02.c +++ b/testcases/kernel/syscalls/mlock/mlock02.c @@ -137,7 +137,7 @@ int main(int ac, char **av) } else { tst_brkm(TFAIL, cleanup, "mlock() Failed, expected " - "return value=-1, got %d", + "return value=-1, got %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/mlockall/Makefile b/testcases/kernel/syscalls/mlockall/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/mlockall/Makefile +++ b/testcases/kernel/syscalls/mlockall/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mmap/Makefile b/testcases/kernel/syscalls/mmap/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/mmap/Makefile +++ b/testcases/kernel/syscalls/mmap/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/modify_ldt/Makefile b/testcases/kernel/syscalls/modify_ldt/Makefile index 9cd92c5f..bd617d80 100644 --- a/testcases/kernel/syscalls/modify_ldt/Makefile +++ b/testcases/kernel/syscalls/modify_ldt/Makefile @@ -15,17 +15,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -g -Wall -Wall -LDLIBS += -L../../../../lib -lltp -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +top_srcdir ?= ../../../.. -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mount/Makefile b/testcases/kernel/syscalls/mount/Makefile index bc5e3c17..4c6aa45e 100644 --- a/testcases/kernel/syscalls/mount/Makefile +++ b/testcases/kernel/syscalls/mount/Makefile @@ -21,22 +21,12 @@ # ############################################################################# -CFLAGS += -I../../../../include -Wall -D_GNU_SOURCE -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CFLAGS += -D_GNU_SOURCE -install: setuid_test.mode - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - ln -f test_mount ../../../bin/ +INSTALL_TARGETS := test_mount -clean: - rm -f $(TARGETS) - -setuid_test.mode: - @/bin/sh ./setuid_test.mode.sh - -.PHONY: setuid_test.mode +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mount/mount03.c b/testcases/kernel/syscalls/mount/mount03.c index 266af58b..5d572870 100644 --- a/testcases/kernel/syscalls/mount/mount03.c +++ b/testcases/kernel/syscalls/mount/mount03.c @@ -159,7 +159,6 @@ int main(int ac, char **av) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); tst_exit(); } - /* Check for mandatory option of the testcase */ if (!Dflag) { tst_resm(TWARN, "You must specifiy the device used for " @@ -259,7 +258,7 @@ int test_rwflag(int i, int cnt) case 0: /* Validate MS_RDONLY flag of mount call */ - sprintf(file, "%stmp", Path_name); + snprintf(file, PATH_MAX, "%stmp", Path_name); if ((fd = open(file, O_CREAT | O_RDWR, S_IRWXU)) == -1) { if (errno == EROFS) { return 0; @@ -275,7 +274,8 @@ int test_rwflag(int i, int cnt) case 1: /* Validate MS_NODEV flag of mount call */ - sprintf(file, "%smynod_%d_%d", Path_name, getpid(), cnt); + snprintf(file, PATH_MAX, "%smynod_%d_%d", Path_name, getpid(), + cnt); if (mknod(file, S_IFBLK | 0777, 0) == 0) { if ((fd = open(file, O_RDWR, S_IRWXU)) == -1) { if (errno == EACCES) { @@ -298,7 +298,7 @@ int test_rwflag(int i, int cnt) case 2: /* Validate MS_NOEXEC flag of mount call */ - sprintf(file, "%stmp1", Path_name); + snprintf(file, PATH_MAX, "%stmp1", Path_name); if ((fd = open(file, O_CREAT | O_RDWR, S_IRWXU)) == -1) { tst_resm(TWARN, "open() of %s failed with error" " %d : %s", @@ -321,7 +321,7 @@ int test_rwflag(int i, int cnt) strcpy(write_buffer, "abcdefghijklmnopqrstuvwxyz"); /* Creat a temporary file under above directory */ - sprintf(file, "%s%s", Path_name, TEMP_FILE); + snprintf(file, PATH_MAX, "%s%s", Path_name, TEMP_FILE); if ((fildes = open(file, O_RDWR | O_CREAT, FILE_MODE)) == -1) { tst_resm(TWARN, "open(%s, O_RDWR | O_CREAT," @@ -376,7 +376,7 @@ int test_rwflag(int i, int cnt) strerror(TEST_ERRNO)); return 1; } else { - sprintf(file, "%stmp2", Path_name); + snprintf(file, PATH_MAX, "%stmp2", Path_name); if ((fd = open(file, O_CREAT | O_RDWR, S_IRWXU)) == -1) { tst_resm(TWARN, "open(%s) on readonly " @@ -392,7 +392,7 @@ int test_rwflag(int i, int cnt) setup_uid(); if ((pid = fork()) == 0) { - sprintf(file, "%ssetuid_test", Path_name); + snprintf(file, PATH_MAX, "%ssetuid_test", Path_name); if (chmod(file, SUID_MODE) != 0) { tst_resm(TWARN, "chmod() failed to " "change mode %d errno = %d : %s", @@ -461,6 +461,7 @@ void setup_uid() void setup() { char *test_home; /* variable to hold TESTHOME env */ + struct stat setuid_test_stat; /* capture signals */ tst_sig(FORK, DEF_HANDLER, cleanup); @@ -485,7 +486,6 @@ void setup() "errno = %d: %s", mntpoint, DIR_MODE, errno, strerror(errno)); } - /* Get the current working directory of the process */ if (getcwd(Path_name, sizeof(Path_name)) == NULL) { tst_brkm(TBROK, cleanup, @@ -496,12 +496,27 @@ void setup() "errno = %d : %s", DIR_MODE, TEST_ERRNO, strerror(TEST_ERRNO)); } + snprintf(file, PATH_MAX, "%ssetuid_test", Path_name); + if (stat(file, &setuid_test_stat) < 0) { + tst_brkm(TBROK, cleanup, "stat for setuid_test failed"); + } else { + if ((setuid_test_stat.st_uid || setuid_test_stat.st_gid) && + chown(file, 0, 0) < 0) { + tst_brkm(TBROK, cleanup, + "chown for setuid_test failed"); + } + if (setuid_test_stat.st_mode != 04511 && + chmod(file, 04511) < 0) { + tst_brkm(TBROK, cleanup, + "setuid for setuid_test failed"); + } + } /* * Get the complete path of TESTDIR created * under temporary directory */ - sprintf(Path_name, "%s/%s/", Path_name, mntpoint); + snprintf(Path_name, PATH_MAX, "%s/%s/", Path_name, mntpoint); strcpy(testhome_path, test_home); diff --git a/testcases/kernel/syscalls/mount/setuid_test.mode.sh b/testcases/kernel/syscalls/mount/setuid_test.mode.sh deleted file mode 100644 index 017a72c9..00000000 --- a/testcases/kernel/syscalls/mount/setuid_test.mode.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -whoami | grep root > /dev/null -if [ $? -eq 0 ];then - chown root:root setuid_test - chmod 04511 setuid_test -else - echo "" - echo " ************** WARNING **************" - echo " Cannot change permission or ownership of \"setuid_test\"." - echo " Tests in this directory will fail"$ - echo " Run "make install" as root." - echo " *************************************" - sleep 2 -fi - diff --git a/testcases/kernel/syscalls/move_pages/Makefile b/testcases/kernel/syscalls/move_pages/Makefile index 3be37e47..cf87cd40 100644 --- a/testcases/kernel/syscalls/move_pages/Makefile +++ b/testcases/kernel/syscalls/move_pages/Makefile @@ -16,48 +16,21 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -lnuma -lrt +top_srcdir ?= ../../../.. -check_numa_move_pages = $(shell \ - if printf \ - "\#include \n\ - int main() \ - { \ - numa_move_pages(0, 0, NULL, NULL, NULL, 0); \ - return 0; \ - }" | $(CC) -xc -lnuma - > /dev/null 2>&1 ; \ - then echo yes ; \ - else echo no ; fi) +include $(top_srcdir)/include/mk/testcases.mk -HAS_NUMA_MOVE_PAGES := $(call check_numa_move_pages) +INSTALL_TARGETS := move_pages.sh -ifeq ($(HAS_NUMA_MOVE_PAGES),yes) -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c, %, $(wildcard *[0-9].c)) -endif +MAKE_TARGETS := $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*[0-9].c)) -all: $(TARGETS) -ifeq ($(HAS_NUMA_MOVE_PAGES),no) - @echo "Note: Libnuma with move_pages support is required for" \ - "move_pages testcases."; -endif +# linux_syscall_numbers.h is forcing move_pages_support.o to complain about +# cleanup being undefined [and when defined] unused. Let's just skip this +# warning... +move_pages_support.o: CFLAGS += -Wno-unused-function -move_pages_support.o: move_pages_support.h move_pages_support.c +$(MAKE_TARGETS): %: %.o move_pages_support.o -$(TARGETS): move_pages_support.o +LDLIBS += $(NUMA_LIBS) -lpthread -lrt -install: move_page03.mode move_page11.mode - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - chmod 755 move_pages.sh; cp move_pages.sh ../../../bin/. - -clean: - rm -f $(TARGETS) a.out move_pages_support.o - -move_page03.mode: - @/bin/sh ./move_pages03.mode.sh - -move_page11.mode: - @/bin/sh ./move_pages11.mode.sh - -.PHONY: move_pages03.mode \ No newline at end of file +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/move_pages/move_pages01.c b/testcases/kernel/syscalls/move_pages/move_pages01.c index 1c4d9121..f805a3ee 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages01.c +++ b/testcases/kernel/syscalls/move_pages/move_pages01.c @@ -53,7 +53,9 @@ #include #include #include +#if HAVE_NUMA_H #include +#endif #include #include @@ -72,7 +74,6 @@ extern int Tst_count; int main(int argc, char **argv) { - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ /* parse standard options */ @@ -85,6 +86,9 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + int lc; /* loop counter */ + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[TEST_PAGES] = { 0 }; @@ -100,6 +104,7 @@ int main(int argc, char **argv) ret = numa_move_pages(0, TEST_PAGES, pages, NULL, status, 0); TEST_ERRNO = errno; + if (ret != 0) { tst_resm(TFAIL, "retrieving NUMA nodes failed"); free_pages(pages, TEST_PAGES); @@ -109,7 +114,11 @@ int main(int argc, char **argv) verify_pages_linear(pages, status, TEST_PAGES); free_pages(pages, TEST_PAGES); + } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages02.c b/testcases/kernel/syscalls/move_pages/move_pages02.c index 6c89073c..7ccd7af4 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages02.c +++ b/testcases/kernel/syscalls/move_pages/move_pages02.c @@ -54,7 +54,10 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include +#endif #include #include @@ -73,11 +76,7 @@ extern int Tst_count; int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ msg = parse_opts(argc, argv, (option_t *) NULL, NULL); @@ -89,6 +88,12 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[TEST_PAGES] = { 0 }; @@ -123,6 +128,9 @@ int main(int argc, char **argv) free_pages(pages, TEST_PAGES); } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages03.c b/testcases/kernel/syscalls/move_pages/move_pages03.c index 05be4053..5c58a2cd 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages03.c +++ b/testcases/kernel/syscalls/move_pages/move_pages03.c @@ -58,7 +58,10 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include +#endif #include #include @@ -111,11 +114,7 @@ void child(void **pages, sem_t * sem) int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ msg = parse_opts(argc, argv, (option_t *) NULL, NULL); @@ -127,6 +126,12 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[TEST_PAGES] = { 0 }; @@ -192,6 +197,9 @@ int main(int argc, char **argv) err_free_pages: free_shared_pages(pages, TEST_PAGES); } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages03.mode.sh b/testcases/kernel/syscalls/move_pages/move_pages03.mode.sh deleted file mode 100755 index c0edac6b..00000000 --- a/testcases/kernel/syscalls/move_pages/move_pages03.mode.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -failed() { - echo "" - echo " ************** WARNING **************" - echo " Cannot change permission or ownership of \"move_pages03\"." - echo " Test move_pages03 will fail" - echo " Run "make install" as root." - echo " *************************************" - sleep 2 -} - -if [ -f move_pages03 ]; then - chown root move_pages03 || failed - chmod 04755 move_pages03 || failed -fi - -exit 0 diff --git a/testcases/kernel/syscalls/move_pages/move_pages04.c b/testcases/kernel/syscalls/move_pages/move_pages04.c index 50e1f4a9..3ae2e997 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages04.c +++ b/testcases/kernel/syscalls/move_pages/move_pages04.c @@ -56,7 +56,10 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include +#endif #include #include @@ -79,11 +82,7 @@ typedef void (*sighandler_t) (int); int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ msg = parse_opts(argc, argv, (option_t *) NULL, NULL); @@ -95,6 +94,12 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[TEST_PAGES] = { 0 }; @@ -137,12 +142,15 @@ int main(int argc, char **argv) tst_resm(TFAIL, "status[%d] is %d", UNTOUCHED_PAGE, status[UNTOUCHED_PAGE]); - err_free_pages: - /* This is capable of freeing both the touched and - * untouched pages. - */ - free_pages(pages, TEST_PAGES); + err_free_pages: + /* This is capable of freeing both the touched and + * untouched pages. + */ + free_pages(pages, TEST_PAGES); } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages05.c b/testcases/kernel/syscalls/move_pages/move_pages05.c index d7ccfd25..13051c9a 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages05.c +++ b/testcases/kernel/syscalls/move_pages/move_pages05.c @@ -56,7 +56,10 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include +#endif #include #include @@ -112,11 +115,7 @@ void child(void **pages, sem_t * sem) int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ msg = parse_opts(argc, argv, (option_t *) NULL, NULL); @@ -128,6 +127,12 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[N_TEST_PAGES] = { 0 }; @@ -206,6 +211,9 @@ int main(int argc, char **argv) err_free_shared: free_shared_pages(pages + SHARED_PAGE, N_SHARED_PAGES); } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages06.c b/testcases/kernel/syscalls/move_pages/move_pages06.c index 4702fb11..285dcf31 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages06.c +++ b/testcases/kernel/syscalls/move_pages/move_pages06.c @@ -54,7 +54,10 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include +#endif #include #include @@ -73,11 +76,7 @@ extern int Tst_count; int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node; /* parse standard options */ msg = parse_opts(argc, argv, (option_t *) NULL, NULL); @@ -89,6 +88,12 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[TEST_PAGES] = { 0 }; @@ -119,6 +124,9 @@ int main(int argc, char **argv) free_pages(pages, TEST_PAGES); } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages07.c b/testcases/kernel/syscalls/move_pages/move_pages07.c index 060a54ed..3032fc9b 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages07.c +++ b/testcases/kernel/syscalls/move_pages/move_pages07.c @@ -54,7 +54,10 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include +#endif #include #include @@ -73,11 +76,7 @@ extern int Tst_count; int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ msg = parse_opts(argc, argv, (option_t *) NULL, NULL); @@ -89,6 +88,12 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[TEST_PAGES] = { 0 }; @@ -130,6 +135,9 @@ int main(int argc, char **argv) err_free_pages: free_pages(pages, TEST_PAGES); } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages08.c b/testcases/kernel/syscalls/move_pages/move_pages08.c index c285c4d5..1b340ee4 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages08.c +++ b/testcases/kernel/syscalls/move_pages/move_pages08.c @@ -54,7 +54,10 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include +#endif #include #include @@ -73,11 +76,7 @@ extern int Tst_count; int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ msg = parse_opts(argc, argv, (option_t *) NULL, NULL); @@ -89,6 +88,12 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[TEST_PAGES] = { 0 }; @@ -118,6 +123,9 @@ int main(int argc, char **argv) free_pages(pages, TEST_PAGES); } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages09.c b/testcases/kernel/syscalls/move_pages/move_pages09.c index d53b69af..30c2915d 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages09.c +++ b/testcases/kernel/syscalls/move_pages/move_pages09.c @@ -54,7 +54,10 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include +#endif #include #include @@ -73,10 +76,7 @@ extern int Tst_count; int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; /* parse standard options */ msg = parse_opts(argc, argv, (option_t *) NULL, NULL); @@ -88,6 +88,11 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[TEST_PAGES] = { 0 }; @@ -117,6 +122,9 @@ int main(int argc, char **argv) free_pages(pages, TEST_PAGES); } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages10.c b/testcases/kernel/syscalls/move_pages/move_pages10.c index b0403e02..b693f03b 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages10.c +++ b/testcases/kernel/syscalls/move_pages/move_pages10.c @@ -54,7 +54,10 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include +#endif #include #include @@ -73,11 +76,7 @@ extern int Tst_count; int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ msg = parse_opts(argc, argv, (option_t *) NULL, NULL); @@ -89,6 +88,12 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[TEST_PAGES] = { 0 }; @@ -118,6 +123,9 @@ int main(int argc, char **argv) free_pages(pages, TEST_PAGES); } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages11.c b/testcases/kernel/syscalls/move_pages/move_pages11.c index 3d6b3665..5046a5b0 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages11.c +++ b/testcases/kernel/syscalls/move_pages/move_pages11.c @@ -57,7 +57,10 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include +#endif #include #include @@ -111,11 +114,7 @@ void child(void **pages, sem_t * sem) int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ msg = parse_opts(argc, argv, (option_t *) NULL, NULL); @@ -127,6 +126,12 @@ int main(int argc, char **argv) setup(); +#if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { void *pages[TEST_PAGES] = { 0 }; @@ -191,6 +196,9 @@ int main(int argc, char **argv) err_free_pages: free_shared_pages(pages, TEST_PAGES); } +#else + tst_resm(TCONF, "move_pages support not found."); +#endif cleanup(); /* NOT REACHED */ diff --git a/testcases/kernel/syscalls/move_pages/move_pages11.mode.sh b/testcases/kernel/syscalls/move_pages/move_pages11.mode.sh deleted file mode 100755 index 9975621d..00000000 --- a/testcases/kernel/syscalls/move_pages/move_pages11.mode.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -failed() { - echo "" - echo " ************** WARNING **************" - echo " Cannot change permission or ownership of \"move_pages11\"." - echo " Test move_pages11 will fail" - echo " Run "make install" as root." - echo " *************************************" - sleep 2 -} - -if [ -f move_pages11 ]; then - chown root move_pages11 || failed - chmod 04755 move_pages11 || failed -fi - -exit 0 diff --git a/testcases/kernel/syscalls/move_pages/move_pages_support.c b/testcases/kernel/syscalls/move_pages/move_pages_support.c index 0d3cfc76..05492d3d 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages_support.c +++ b/testcases/kernel/syscalls/move_pages/move_pages_support.c @@ -20,8 +20,15 @@ #include #include #include +#include "config.h" +#if HAVE_NUMA_H #include -#include +#endif +/* + * #if HAVE_NUMAIF_H + #include + #endif + */ #include #include @@ -48,6 +55,8 @@ long get_page_size() */ void free_pages(void **pages, unsigned int num) { + +#if HAS_NUMA_H int i; size_t onepage = get_page_size(); @@ -56,6 +65,7 @@ void free_pages(void **pages, unsigned int num) numa_free(pages[i], onepage); } } +#endif } /* @@ -73,7 +83,9 @@ void free_pages(void **pages, unsigned int num) int alloc_pages_on_nodes(void **pages, unsigned int num, int *nodes) { int i; +#if HAVE_NUMA_ALLOC_ONNODE size_t onepage = get_page_size(); +#endif for (i = 0; i < num; i++) { pages[i] = NULL; @@ -82,7 +94,9 @@ int alloc_pages_on_nodes(void **pages, unsigned int num, int *nodes) for (i = 0; i < num; i++) { char *page; +#if HAVE_NUMA_ALLOC_ONNODE pages[i] = numa_alloc_onnode(onepage, nodes[i]); +#endif if (pages[i] == NULL) { tst_resm(TBROK, "allocation of page on node " "%d failed", nodes[i]); @@ -115,9 +129,11 @@ int alloc_pages_on_nodes(void **pages, unsigned int num, int *nodes) */ int alloc_pages_linear(void **pages, unsigned int num) { + int nodes[num]; + +#if HAS_NUMA_H unsigned int i; unsigned int n; - int nodes[num]; n = 0; for (i = 0; i < num; i++) { @@ -127,6 +143,7 @@ int alloc_pages_linear(void **pages, unsigned int num) if (n > numa_max_node()) n = 0; } +#endif return alloc_pages_on_nodes(pages, num, nodes); } @@ -164,6 +181,7 @@ int alloc_pages_on_node(void **pages, unsigned int num, int node) void verify_pages_on_nodes(void **pages, int *status, unsigned int num, int *nodes) { +#if HAVE_NUMA_H unsigned int i; int which_node; int ret; @@ -196,6 +214,9 @@ verify_pages_on_nodes(void **pages, int *status, unsigned int num, int *nodes) } tst_resm(TPASS, "pages are present in expected nodes"); +#else + tst_resm(TCONF, "NUMA support not provided"); +#endif } /* @@ -206,11 +227,13 @@ verify_pages_on_nodes(void **pages, int *status, unsigned int num, int *nodes) */ void verify_pages_linear(void **pages, int *status, unsigned int num) { +#if HAS_NUMA_H unsigned int i; unsigned int n; int nodes[num]; n = 0; + for (i = 0; i < num; i++) { nodes[i] = i; @@ -220,6 +243,7 @@ void verify_pages_linear(void **pages, int *status, unsigned int num) } verify_pages_on_nodes(pages, status, num, nodes); +#endif } /* @@ -252,6 +276,7 @@ void verify_pages_on_node(void **pages, int *status, unsigned int num, int node) */ int alloc_shared_pages_on_node(void **pages, unsigned int num, int node) { +#if HAS_NUMA_H char *shared; unsigned int i; int nodes[num]; @@ -281,6 +306,9 @@ int alloc_shared_pages_on_node(void **pages, unsigned int num, int node) } return 0; +#else + return -1; +#endif } /* @@ -377,6 +405,7 @@ void free_sem(sem_t * sem, int num) */ void check_config(unsigned int min_nodes) { +#if HAS_NUMA_H if (numa_available() < 0) { tst_resm(TCONF, "NUMA support is not available"); tst_exit(); @@ -396,4 +425,8 @@ void check_config(unsigned int min_nodes) tst_resm(TCONF, "this arch does not support move_pages"); tst_exit(); } +#else + tst_resm(TCONF, "NUMA support not provided"); + tst_exit(); +#endif } diff --git a/testcases/kernel/syscalls/move_pages/move_pages_support.h b/testcases/kernel/syscalls/move_pages/move_pages_support.h index 70b26ab6..f760730c 100644 --- a/testcases/kernel/syscalls/move_pages/move_pages_support.h +++ b/testcases/kernel/syscalls/move_pages/move_pages_support.h @@ -19,7 +19,9 @@ #ifndef MOVE_PAGES_SUPPORT_H #define MOVE_PAGES_SUPPORT_H +#if HAVE_NUMAIF_H #include +#endif #include long get_page_size(); diff --git a/testcases/kernel/syscalls/mprotect/Makefile b/testcases/kernel/syscalls/mprotect/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/mprotect/Makefile +++ b/testcases/kernel/syscalls/mprotect/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mq_notify/Makefile b/testcases/kernel/syscalls/mq_notify/Makefile index 8f836a02..2e1628e9 100644 --- a/testcases/kernel/syscalls/mq_notify/Makefile +++ b/testcases/kernel/syscalls/mq_notify/Makefile @@ -16,16 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -D_POSIX_C_SOURCE=$(shell getconf _POSIX_MESSAGE_PASSING)L -LDLIBS += -L../../../../lib -lltp -lrt +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CPPFLAGS ?= -D_POSIX_C_SOURCE=$(shell getconf _POSIX_MESSAGE_PASSING)L +LDLIBS += -lpthread -lrt -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mq_open/Makefile b/testcases/kernel/syscalls/mq_open/Makefile index e7168a75..71ebae98 100644 --- a/testcases/kernel/syscalls/mq_open/Makefile +++ b/testcases/kernel/syscalls/mq_open/Makefile @@ -16,16 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -LDLIBS += -L../../../../lib -lltp -lrt +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +LDLIBS += -lpthread -lrt -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mq_timedreceive/Makefile b/testcases/kernel/syscalls/mq_timedreceive/Makefile index 8f836a02..2e1628e9 100644 --- a/testcases/kernel/syscalls/mq_timedreceive/Makefile +++ b/testcases/kernel/syscalls/mq_timedreceive/Makefile @@ -16,16 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -D_POSIX_C_SOURCE=$(shell getconf _POSIX_MESSAGE_PASSING)L -LDLIBS += -L../../../../lib -lltp -lrt +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CPPFLAGS ?= -D_POSIX_C_SOURCE=$(shell getconf _POSIX_MESSAGE_PASSING)L +LDLIBS += -lpthread -lrt -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c b/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c index 2d41a48c..eb3232fa 100644 --- a/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c +++ b/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c @@ -78,6 +78,18 @@ extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ char *TCID = "mq_timedreceive01"; /* Test program identifier.*/ int testno; int TST_TOTAL = 1; /* total number of tests in this file. */ +struct sigaction act; + +/* + * sighandler() + */ +void sighandler(int sig) +{ + if (sig == SIGINT) + return; + // NOTREACHED + return; +} /* Extern Global Functions */ /******************************************************************************/ @@ -106,12 +118,6 @@ extern void cleanup() { tst_exit(); } -/* - * sighandler() - */ -void sighandler(int sig) -{ -} /* Local Functions */ /******************************************************************************/ @@ -132,8 +138,10 @@ void sighandler(int sig) /* */ /******************************************************************************/ void setup() { - /* Capture signals if any */ - signal(SIGINT, sighandler); + /* Capture signals if any */ + act.sa_handler = sighandler; + sigfillset(&act.sa_mask); + sigaction(SIGINT, &act, NULL); /* Create temporary directories */ TEST_PAUSE; tst_tmpdir(); @@ -284,6 +292,8 @@ static struct test_case tcase[] = { { // case13 .ttype = SEND_SIGINT, .len = 16, + .sec = 3, + .nsec = 0, .ret = -1, .err = EINTR, }, @@ -306,10 +316,10 @@ static int do_test(struct test_case *tc) int sys_ret; int sys_errno; int result = RESULT_OK; - int oflag; + int oflag; int i, rc, cmp_ok = 1, fd = -1; char smsg[MAX_MSGSIZE], rmsg[MAX_MSGSIZE]; - struct timespec ts, *p_ts = NULL; + struct timespec ts = {0,0}; pid_t pid = 0; unsigned prio; size_t msg_len; @@ -376,7 +386,7 @@ switch (tc->ttype) { case FD_FILE: break; default: - TEST(rc = mq_timedsend(fd, smsg, tc->len, tc->prio, p_ts)); + TEST(rc = mq_timedsend(fd, smsg, tc->len, tc->prio, &ts)); if (TEST_RETURN < 0) { tst_resm(TFAIL, "mq_timedsend failed - errno = %d : %s",TEST_ERRNO, strerror(TEST_ERRNO)); result = 1; @@ -393,19 +403,18 @@ switch (tc->ttype) { msg_len -= 1; ts.tv_sec = tc->sec; ts.tv_nsec = tc->nsec; - p_ts = &ts; - if (tc->sec == 0 && tc->nsec == 0) - p_ts = NULL; + if (tc->sec >= 0 || tc->nsec != 0) + ts.tv_sec += time(NULL); /* * Execute system call */ errno = 0; - TEST(sys_ret = mq_timedreceive(fd, rmsg, msg_len, &prio, p_ts)); + TEST(sys_ret = mq_timedreceive(fd, rmsg, msg_len, &prio, &ts)); sys_errno = errno; if (sys_ret < 0) goto TEST_END; - + /* * Compare received message */ @@ -478,8 +487,8 @@ int main(int ac, char **av) { }; progname = strchr(av[0], '/'); - progname = progname ? progname + 1 : av[0]; - + progname = progname ? progname + 1 : av[0]; + /* parse standard options */ if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){ tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); @@ -521,7 +530,7 @@ int main(int ac, char **av) { tst_resm(TINFO,"(case%02d) END => %s", i, (ret == 0) ? "OK" : "NG"); result |= ret; } - + /* * Check results */ @@ -539,7 +548,7 @@ int main(int ac, char **av) { } } - } + } cleanup(); tst_exit(); } diff --git a/testcases/kernel/syscalls/mq_timedsend/Makefile b/testcases/kernel/syscalls/mq_timedsend/Makefile index e7168a75..71ebae98 100644 --- a/testcases/kernel/syscalls/mq_timedsend/Makefile +++ b/testcases/kernel/syscalls/mq_timedsend/Makefile @@ -16,16 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -LDLIBS += -L../../../../lib -lltp -lrt +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +LDLIBS += -lpthread -lrt -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c b/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c index b2cc7fc0..60ed7f97 100644 --- a/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c +++ b/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c @@ -77,6 +77,18 @@ extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ char *TCID = "mq_timedsend01"; /* Test program identifier.*/ int testno; int TST_TOTAL = 1; /* total number of tests in this file. */ +struct sigaction act; + +/* + * sighandler() + */ +void sighandler(int sig) +{ + if (sig == SIGINT) + return; + // NOTREACHED + return; +} /* Extern Global Functions */ /******************************************************************************/ @@ -124,7 +136,12 @@ extern void cleanup() { /* */ /******************************************************************************/ void setup() { + /* Capture signals if any */ + act.sa_handler = sighandler; + sigfillset(&act.sa_mask); + + sigaction(SIGINT, &act, NULL); /* Create temporary directories */ TEST_PAUSE; tst_tmpdir(); @@ -282,6 +299,8 @@ static struct test_case tcase[] = { .ttype = SEND_SIGINT, .len = 16, .ret = -1, + .sec = 3, + .nsec = 0, .err = EINTR, }, }; @@ -303,7 +322,7 @@ static int do_test(struct test_case *tc) int oflag; int i, rc, cmp_ok = 1, fd = -1; char smsg[MAX_MSGSIZE], rmsg[MAX_MSGSIZE]; - struct timespec ts, *p_ts; + struct timespec ts = {0,0}; pid_t pid = 0; unsigned prio; @@ -343,7 +362,7 @@ static int do_test(struct test_case *tc) } if (tc->ttype == FULL_QUEUE || tc->ttype == SEND_SIGINT) { for (i = 0; i < MAX_MSG; i++) { - TEST(rc = mq_timedsend(fd, smsg, tc->len, 0, NULL)); + TEST(rc = mq_timedsend(fd, smsg, tc->len, 0, &ts)); if (rc < 0) { tst_resm(TFAIL, "mq_timedsend failed - errno = %d : %s\n",TEST_ERRNO, strerror(TEST_ERRNO)); result = 1; @@ -372,15 +391,14 @@ static int do_test(struct test_case *tc) */ ts.tv_sec = tc->sec; ts.tv_nsec = tc->nsec; - p_ts = &ts; - if (tc->sec == 0 && tc->nsec == 0) - p_ts = NULL; + if (tc->sec >= 0 || tc->nsec != 0) + ts.tv_sec += time(NULL); /* * Execut test system call */ errno = 0; - TEST(sys_ret = mq_timedsend(fd, smsg, tc->len, tc->prio, p_ts)); + TEST(sys_ret = mq_timedsend(fd, smsg, tc->len, tc->prio, &ts)); sys_errno = errno; if (sys_ret < 0) goto TEST_END; @@ -388,7 +406,9 @@ static int do_test(struct test_case *tc) /* * Receive echoed message and compare */ - TEST(rc = mq_timedreceive(fd, rmsg, MAX_MSGSIZE, &prio, NULL)); + ts.tv_sec = 0; + ts.tv_nsec = 0; + TEST(rc = mq_timedreceive(fd, rmsg, MAX_MSGSIZE, &prio, &ts)); if (rc < 0) { tst_resm(TFAIL, "mq_timedreceive failed - errno = %d : %s\n",TEST_ERRNO, strerror(TEST_ERRNO)); result = 1; @@ -420,21 +440,10 @@ EXIT: kill(pid, SIGTERM); wait(&st); } - exit(result); + return result; } -/* - * sighandler() - */ -void sighandler(int sig) -{ - if (sig == SIGINT) - return; - // NOTREACHED - return; -} - /* * usage() @@ -507,7 +516,6 @@ int main(int ac, char **av) { /* * Execute test */ - signal(SIGINT, sighandler); for (i = 0; i < (int)(sizeof(tcase) / sizeof(tcase[0])); i++) { int ret; diff --git a/testcases/kernel/syscalls/mq_unlink/Makefile b/testcases/kernel/syscalls/mq_unlink/Makefile index e7168a75..2e1628e9 100644 --- a/testcases/kernel/syscalls/mq_unlink/Makefile +++ b/testcases/kernel/syscalls/mq_unlink/Makefile @@ -16,16 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -LDLIBS += -L../../../../lib -lltp -lrt +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CPPFLAGS ?= -D_POSIX_C_SOURCE=$(shell getconf _POSIX_MESSAGE_PASSING)L +LDLIBS += -lpthread -lrt -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mremap/Makefile b/testcases/kernel/syscalls/mremap/Makefile index 28ebaaa0..63e74853 100644 --- a/testcases/kernel/syscalls/mremap/Makefile +++ b/testcases/kernel/syscalls/mremap/Makefile @@ -16,16 +16,26 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -L../ipc -lipc +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +LDLIBS += -lipc -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +LIBDIR := ../ipc/lib -clean: - rm -f $(TARGETS) +LIB := $(LIBDIR)/libipc.a + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all + +all: | $(LIB) + +CPPFLAGS += -I$(abs_srcdir)/$(LIBDIR) + +LDFLAGS += -L$(abs_builddir)/$(LIBDIR) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/msync/Makefile b/testcases/kernel/syscalls/msync/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/msync/Makefile +++ b/testcases/kernel/syscalls/msync/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/munlock/Makefile b/testcases/kernel/syscalls/munlock/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/munlock/Makefile +++ b/testcases/kernel/syscalls/munlock/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/munlockall/Makefile b/testcases/kernel/syscalls/munlockall/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/munlockall/Makefile +++ b/testcases/kernel/syscalls/munlockall/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/munmap/Makefile b/testcases/kernel/syscalls/munmap/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/munmap/Makefile +++ b/testcases/kernel/syscalls/munmap/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/nanosleep/Makefile b/testcases/kernel/syscalls/nanosleep/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/nanosleep/Makefile +++ b/testcases/kernel/syscalls/nanosleep/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/newuname/Makefile b/testcases/kernel/syscalls/newuname/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/newuname/Makefile +++ b/testcases/kernel/syscalls/newuname/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/nftw/Makefile b/testcases/kernel/syscalls/nftw/Makefile dissimilarity index 63% index 61b12acd..3873f375 100644 --- a/testcases/kernel/syscalls/nftw/Makefile +++ b/testcases/kernel/syscalls/nftw/Makefile @@ -1,47 +1,37 @@ -# IBM Corporation -# 10/31/2002 Port to LTP robbiew@us.ibm.com -# 06/30/2001 Port to Linux nsharoff@us.ibm.com - -# -# $Copyright: $ -# Copyright (c) 1984-1999 -# Sequent Computer Systems, Inc. All rights reserved. -# -# This software is furnished under a license and may be used -# only in accordance with the terms of that license and with the -# inclusion of the above copyright notice. This software may not -# be provided or otherwise made available to, or used by, any -# other person. No title to or ownership of the software is -# hereby transferred. - -LINT = lint -CFLAGS+= -Wall -g -ansi -O -DLINUX -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -I../../../../include -SRCS1 = nftw.c tools.c test_func.c test.c lib.c -OBJS1 = nftw.o tools.o test_func.o test.o lib.o -SRCS2 = nftw64.c tools64.c test_func64.c test64.c lib64.c -OBJS2 = nftw64.o tools64.o test_func64.o test64.o lib64.o -BINS= nftw01 nftw6401 - -all: nftw01 nftw6401 - -nftw01: $(&) nftw.h $(OBJS1) ../../../../include/test.h ../../../../include/usctest.h ../../../../lib/libltp.a - $(CC) $(CFLAGS) -o nftw01 $(OBJS1) $(LDFLAGS) ../../../../lib/libltp.a - -nftw6401:$(&) nftw64.h $(OBJS2) ../../../../include/test.h ../../../../include/usctest.h ../../../../lib/libltp.a - $(CC) $(CFLAGS) -o nftw6401 $(OBJS2) $(LDFLAGS) ../../../../lib/libltp.a - -remove_bin: - rm -f $(BINS) $(OBJS1) $(OBJS2) - -remove_obj: - rm -f $(OBJS1) - rm -f $(OBJS2) - -clean: remove_bin remove_obj - -lint: - $(LINT) -mnuts $(SRCS1) - $(LINT) -mnuts $(SRCS2) - -install: - ln -f $(BINS) ../../../bin +# IBM Corporation +# 10/31/2002 Port to LTP robbiew@us.ibm.com +# 06/30/2001 Port to Linux nsharoff@us.ibm.com + +# +# $Copyright: $ +# Copyright (c) 1984-1999 +# Sequent Computer Systems, Inc. All rights reserved. +# +# This software is furnished under a license and may be used +# only in accordance with the terms of that license and with the +# inclusion of the above copyright notice. This software may not +# be provided or otherwise made available to, or used by, any +# other person. No title to or ownership of the software is +# hereby transferred. + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -ansi -DLINUX -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE + +MAKE_TARGETS := nftw01 nftw6401 + +nftw01: CPPFLAGS += -D_LARGEFILE_SOURCE + +nftw01: nftw.o tools.o test_func.o test.o lib.o + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o "$@" + +nftw64.o tools64.o test_func64.o test64.o lib64.o: %.o: %.c + +%64.o: CPPFLAGS += -D_LARGEFILE64_SOURCE + +nftw6401: nftw64.o tools64.o test_func64.o test64.o lib64.o + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/nftw/nftw.c b/testcases/kernel/syscalls/nftw/nftw.c index 2f4a9f69..801f5a3a 100644 --- a/testcases/kernel/syscalls/nftw/nftw.c +++ b/testcases/kernel/syscalls/nftw/nftw.c @@ -17,8 +17,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* 10/31/2002 Port to LTP robbiew@us.ibm.com */ -/* 06/30/2001 Port to Linux nsharoff@us.ibm.com */ +/* 10/31/2002 Port to LTP robbiew@us.ibm.com */ +/* 06/30/2001 Port to Linux nsharoff@us.ibm.com */ /* * NAME @@ -48,7 +48,6 @@ int TST_TOTAL = 10; /* Total number of test cases. */ extern int Tst_count; /* Test Case counter for tst_* routines */ struct passwd *ltpuser; /* password struct for ltpuser */ - /**************/ /* Used for error return for some library routines */ @@ -242,7 +241,7 @@ struct list mnem[] = { {"FTW_DNR", FTW_DNR}, {"FTW_NS", FTW_NS}, {"FTW_SL", FTW_SL}, -#ifndef LINUX +#ifndef __linux__ /* How do we define __USE_XOPEN_EXTENDED ? Following depends on that */ {"FTW_DP", FTW_DP}, {"FTW_SLN", FTW_SLN}, @@ -252,11 +251,7 @@ struct list mnem[] = { int npathdats, ngoods, nbads, nmnem; /*--------------------------------------------------------------*/ -#ifdef LINUX int -#else -void -#endif main(void) { setup(); /* temp file is now open */ diff --git a/testcases/kernel/syscalls/nftw/nftw64.c b/testcases/kernel/syscalls/nftw/nftw64.c index 6689f4b1..49410655 100644 --- a/testcases/kernel/syscalls/nftw/nftw64.c +++ b/testcases/kernel/syscalls/nftw/nftw64.c @@ -248,11 +248,7 @@ struct list mnem[] = { int npathdats, ngoods, nbads, nmnem; /*--------------------------------------------------------------*/ -#ifdef LINUX int -#else -void -#endif main(void) { setup(); /* temp file is now open */ diff --git a/testcases/kernel/syscalls/nice/Makefile b/testcases/kernel/syscalls/nice/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/nice/Makefile +++ b/testcases/kernel/syscalls/nice/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/open/Makefile b/testcases/kernel/syscalls/open/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/open/Makefile +++ b/testcases/kernel/syscalls/open/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/openat/Makefile b/testcases/kernel/syscalls/openat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/openat/Makefile +++ b/testcases/kernel/syscalls/openat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/paging/Makefile b/testcases/kernel/syscalls/paging/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/paging/Makefile +++ b/testcases/kernel/syscalls/paging/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/pathconf/Makefile b/testcases/kernel/syscalls/pathconf/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/pathconf/Makefile +++ b/testcases/kernel/syscalls/pathconf/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/pause/Makefile b/testcases/kernel/syscalls/pause/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/pause/Makefile +++ b/testcases/kernel/syscalls/pause/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/personality/Makefile b/testcases/kernel/syscalls/personality/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/personality/Makefile +++ b/testcases/kernel/syscalls/personality/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/pipe/Makefile b/testcases/kernel/syscalls/pipe/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/pipe/Makefile +++ b/testcases/kernel/syscalls/pipe/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/pipe2/Makefile b/testcases/kernel/syscalls/pipe2/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/pipe2/Makefile +++ b/testcases/kernel/syscalls/pipe2/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/poll/Makefile b/testcases/kernel/syscalls/poll/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/poll/Makefile +++ b/testcases/kernel/syscalls/poll/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ppoll/Makefile b/testcases/kernel/syscalls/ppoll/Makefile index 0d24c355..2ef86f06 100644 --- a/testcases/kernel/syscalls/ppoll/Makefile +++ b/testcases/kernel/syscalls/ppoll/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ppoll/ppoll01.c b/testcases/kernel/syscalls/ppoll/ppoll01.c index f76d61f5..3f34fe27 100644 --- a/testcases/kernel/syscalls/ppoll/ppoll01.c +++ b/testcases/kernel/syscalls/ppoll/ppoll01.c @@ -106,6 +106,8 @@ extern void cleanup() { tst_exit(); } +void sighandler(int sig); /* signals handler function for the test */ + /* Local Functions */ /******************************************************************************/ /* */ @@ -126,6 +128,8 @@ extern void cleanup() { /******************************************************************************/ void setup() { /* Capture signals if any */ + signal(SIGINT, &sighandler); + /* Create temporary directories */ TEST_PAUSE; tst_tmpdir(); diff --git a/testcases/kernel/syscalls/prctl/Makefile b/testcases/kernel/syscalls/prctl/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/prctl/Makefile +++ b/testcases/kernel/syscalls/prctl/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/pread/Makefile b/testcases/kernel/syscalls/pread/Makefile index 3c22a28a..c006930f 100644 --- a/testcases/kernel/syscalls/pread/Makefile +++ b/testcases/kernel/syscalls/pread/Makefile @@ -16,19 +16,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -all: $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) diff --git a/testcases/kernel/syscalls/profil/Makefile b/testcases/kernel/syscalls/profil/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/profil/Makefile +++ b/testcases/kernel/syscalls/profil/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/pselect/Makefile b/testcases/kernel/syscalls/pselect/Makefile index 07248d40..c006930f 100644 --- a/testcases/kernel/syscalls/pselect/Makefile +++ b/testcases/kernel/syscalls/pselect/Makefile @@ -16,21 +16,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ptrace/Makefile b/testcases/kernel/syscalls/ptrace/Makefile index 57b05a6a..078792b3 100644 --- a/testcases/kernel/syscalls/ptrace/Makefile +++ b/testcases/kernel/syscalls/ptrace/Makefile @@ -16,16 +16,34 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *[^6].c) -TARGETS = $(patsubst ptrace%.c,ptrace%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +# - ptrace06 is a broken test ; it hangs the target consistently, chewing up +# CPU. See: `Issue 3 - ptrace06 hung for 7 hours' -- +# http://sourceforge.net/mailarchive/forum.php?thread_name=364299f40910062300s65c43c93w9cccdfe8835c2334%40mail.gmail.com&forum_name=ltp-list +# - simple_tracer is a utility that Mike Frysinger added that shouldn't be +# compiled by default: +# +# gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall +# -I//scratch/ltp-install6/include -I../../../../include +# -L//scratch/ltp-install6/lib simple_tracer.c -laio -lltp -o +# simple_tracer +# In file included from simple_tracer.c:25: +# syscalls.h:6:23: error: _syscalls.h: No such file or directory +# make[4]: *** [simple_tracer] Error 1 +# make[4]: Leaving directory +# `/scratch/ltp-dev2/ltp/testcases/kernel/syscalls/ptrace' +# make[3]: *** [all] Error 2 +# make[3]: Leaving directory `/scratch/ltp-dev2/ltp/testcases/kernel/syscalls' +# make[2]: *** [all] Error 2 +# make[2]: Leaving directory `/scratch/ltp-dev2/ltp/testcases/kernel' +# make[1]: *** [all] Error 2 +# make[1]: Leaving directory `/scratch/ltp-dev2/ltp/testcases' +# make: *** [testcases-all] Error 2 +# -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +FILTER_OUT_MAKE_TARGETS := ptrace06 simple_tracer -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ptrace/make_syscall_list.sh b/testcases/kernel/syscalls/ptrace/make_syscall_list.sh new file mode 100755 index 00000000..e5d6d276 --- /dev/null +++ b/testcases/kernel/syscalls/ptrace/make_syscall_list.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -- $( \ + printf '#include ' | \ + ${CC:-gcc} -E -dD - | \ + awk '$2 ~ /^SYS_/ { sub(/SYS_/,"",$2); print $2; }' +) +printf 'P(%s)\n' "$@" diff --git a/testcases/kernel/syscalls/ptrace/ptrace04.c b/testcases/kernel/syscalls/ptrace/ptrace04.c index a29029ae..a083a4ac 100644 --- a/testcases/kernel/syscalls/ptrace/ptrace04.c +++ b/testcases/kernel/syscalls/ptrace/ptrace04.c @@ -8,8 +8,6 @@ #define _GNU_SOURCE -#if defined(__bfin__) - #include #include #include @@ -75,7 +73,7 @@ void compare_registers(unsigned char poison) long *pt_val = (void *)&pt_regs + regs[i].off; if (*pt_val != ret) { tst_resm(TINFO, "register %s (offset %li) did not match", - regs[i].name, regs[i].off, *pt_val, ret); + regs[i].name, regs[i].off); tst_resm(TINFO, "\tGETREGS: 0x%08lx PEEKUSER: 0x%08lx", *pt_val, ret); failed = true; @@ -90,6 +88,9 @@ int main(int argc, char *argv[]) { char *msg; + if (ARRAY_SIZE(regs) == 0) + tst_brkm(TCONF, tst_exit, "test not supported for your arch (yet)"); + if ((msg = parse_opts(argc, argv, NULL, NULL))) tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); @@ -115,15 +116,3 @@ int main(int argc, char *argv[]) return 0; } - -#else - -#include - -int main() -{ - puts("ptrace04: test not supported for your arch (yet)"); - return 0; -} - -#endif diff --git a/testcases/kernel/syscalls/ptrace/ptrace05.c b/testcases/kernel/syscalls/ptrace/ptrace05.c new file mode 100644 index 00000000..0ce7c6ff --- /dev/null +++ b/testcases/kernel/syscalls/ptrace/ptrace05.c @@ -0,0 +1,199 @@ +/* + ****************************************************************************** + * + * ptrace05 - an app which ptraces itself as per arbitrarily specified signals, + * over a user specified range. + * + * Copyright (C) 2009, Garrett 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. + * + ****************************************************************************** + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "test.h" +#include "usctest.h" + +char *TCID = "ptrace05"; +int TST_TOTAL = 0; + +int usage(const char*); + +int +usage(const char *argv0) +{ + fprintf(stderr, "usage: %s [start-signum] [end-signum]\n", argv0); + return 1; +} + +int +main(int argc, char **argv) +{ + + int end_signum = -1; + int signum; + int start_signum = -1; + int status; + + pid_t child; + + /* Parse the CLI args appropriately. */ + switch (argc) { + case 3: + end_signum = (int) strtol((const char*) *(argv+2), NULL, 10); + /* Parse the signal value. */ + if (end_signum == 0 && errno != 0) { + tst_resm(TBROK, "argument (%s) isn't a valid number.\n", + *(argv+2)); + tst_exit(); + } + /* FALLTHROUGH */ + case 2: + start_signum = (int) strtol((const char*) *(argv+1), NULL, 10); + /* Parse the signal value. */ + if (end_signum == 0 && errno != 0) { + tst_resm(TBROK, "argument (%s) isn't a valid number.\n", + *(argv+1) ); + tst_exit(); + } + break; + case 1: + /* Do nothing. */ + break; + default: + return usage(basename(*argv)); + } + + if (start_signum == -1) { + start_signum = 0; + } + if (end_signum == -1) { + end_signum = SIGRTMAX; + } + + for (signum = start_signum; signum <= end_signum; signum++) { + + switch (child = fork()) { + case -1: + tst_resm(TBROK | TERRNO, "Failed to fork properly."); + break; + case 0: + + if (ptrace(PTRACE_TRACEME, 0, NULL, NULL) != -1) { + tst_resm(TINFO, "[child] Sending kill(.., %d)", + signum); + if (kill(getpid(), signum) < 0) { + tst_resm(TINFO | TERRNO, + "[child] kill(.., %d) failed.", + signum); + } + } else { + + /* + * This won't increment the TST_COUNT var. + * properly, but it'll show up as a failure + * nonetheless. + */ + tst_resm(TFAIL | TERRNO, + "Failed to ptrace(PTRACE_TRACEME, ...) " + "properly"); + + } + /* Shouldn't get here if signum == 0. */ + exit((signum == 0 ? 0 : 2)); + break; + + default: + + waitpid(child, &status, 0); + + switch(signum) { + case 0: + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { + tst_resm(TPASS, "kill(.., 0) exited " + "with 0, as expected."); + } else { + tst_resm(TFAIL, "kill(.., 0) didn't exit " + "with 0."); + } + break; + case SIGKILL: + if (WIFSIGNALED(status)) { + /* SIGKILL must be uncatchable. */ + if (WTERMSIG(status) == SIGKILL) { + tst_resm(TPASS, + "Killed with SIGKILL, " + "as expected."); + } else { + tst_resm(TPASS, + "Didn't die with " + "SIGKILL (?!) "); + } + } else if (WIFEXITED(status)) { + tst_resm(TFAIL, + "Exited unexpectedly instead " + "of dying with SIGKILL."); + } else if (WIFSTOPPED(status)) { + tst_resm(TFAIL, + "Stopped instead of dying " + "with SIGKILL."); + } + break; + /* All other processes should be stopped. */ + default: + if (WIFSTOPPED(status)) { + tst_resm(TPASS, "Stopped as expected"); + } else { + tst_resm(TFAIL, "Didn't stop as " + "expected."); + if (kill (child, 0)) { + tst_resm(TINFO, + "Is still alive!?"); + } else if (WIFEXITED(status)) { + tst_resm(TINFO, + "Exited normally"); + } else if (WIFSIGNALED(status)) { + tst_resm(TINFO, + "Was signaled with " + "signum=%d", + WTERMSIG(status)); + } + + } + + break; + + } + + } + /* Make sure the child dies a quick and painless death ... */ + kill(child, 9); + + } + + tst_exit(); + +} diff --git a/testcases/kernel/syscalls/ptrace/ptrace06.c b/testcases/kernel/syscalls/ptrace/ptrace06.c index f0a84e9f..9df707fd 100644 --- a/testcases/kernel/syscalls/ptrace/ptrace06.c +++ b/testcases/kernel/syscalls/ptrace/ptrace06.c @@ -23,6 +23,7 @@ #include "test.h" #include "usctest.h" #include "spawn_ptrace_child.h" +#include "config.h" /* this should be sizeof(struct user), but that info is only found * in the kernel asm/user.h which is not exported to userspace. @@ -140,6 +141,7 @@ struct test_case_t { { PTRACE_SETFGREGS, .data = -4 }, #endif +#if HAVE_DECL_PTRACE_GETSIGINFO { PTRACE_GETSIGINFO, .data = 0 }, { PTRACE_GETSIGINFO, .data = 1 }, { PTRACE_GETSIGINFO, .data = 2 }, @@ -148,7 +150,9 @@ struct test_case_t { { PTRACE_GETSIGINFO, .data = -2 }, { PTRACE_GETSIGINFO, .data = -3 }, { PTRACE_GETSIGINFO, .data = -4 }, - +#endif + +#if HAVE_DECL_PTRACE_SETSIGINFO { PTRACE_SETSIGINFO, .data = 0 }, { PTRACE_SETSIGINFO, .data = 1 }, { PTRACE_SETSIGINFO, .data = 2 }, @@ -157,6 +161,7 @@ struct test_case_t { { PTRACE_SETSIGINFO, .data = -2 }, { PTRACE_SETSIGINFO, .data = -3 }, { PTRACE_SETSIGINFO, .data = -4 }, +#endif }; int TST_TOTAL = ARRAY_SIZE(test_cases); diff --git a/testcases/kernel/syscalls/ptrace/simple_tracer.c b/testcases/kernel/syscalls/ptrace/simple_tracer.c new file mode 100644 index 00000000..52930b5e --- /dev/null +++ b/testcases/kernel/syscalls/ptrace/simple_tracer.c @@ -0,0 +1,99 @@ +/* + * simple example ptrace() code to help build basis for other tests + * + * Copyright (c) 2009 Analog Devices Inc. + * + * Licensed under the GPL-2 or later + */ + +#define _GNU_SOURCE + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "test.h" +#include "usctest.h" +#include "spawn_ptrace_child.h" + +#include "syscalls.h" + +char *TCID = "simple_tracer"; +int TST_TOTAL = 0; + +#define _decode(name, val) \ +({ \ + if (sizeof(long) == 4) \ + printf(name ":%08lx ", val); \ + else if (sizeof(long) == 8) \ + printf(name ":%016lx ", val); \ + else \ + printf(name ":%lx ", val); \ + val; \ +}) +#define decode(reg) _decode(#reg, pt->reg) +#define decode_user(name, offset) \ + _decode(name, vptrace(PTRACE_PEEKUSER, pid, offset, NULL)); +#define decode_sysnum(nr) printf("%s ", get_sysnum(nr)) +static void decode_regs(struct pt_regs *pt) +{ +#if defined(__bfin__) + long nr = decode_user("orig_p0", PT_ORIG_P0); + decode(p0); + decode(r0); + decode(r1); + decode(r2); + decode(r3); + decode(r4); + decode(r5); + decode_sysnum(nr); + puts(""); +#elif defined(__i386__) + long nr = decode_user("orig_eax", 4 * ORIG_EAX); + decode(eax); + decode(ebx); + decode(ecx); + decode(edx); + decode(esi); + decode(edi); + decode(ebp); + decode_sysnum(nr); + puts(""); +#else + puts("no idea how to decode your arch"); +#endif +} + +int main(int argc, char *argv[]) +{ + struct pt_regs pt_regs; + long ret; + int status; + + make_a_baby(argc, argv); + + while (1) { + ret = vptrace(PTRACE_GETREGS, pid, NULL, &pt_regs); + if (ret) + break; + decode_regs(&pt_regs); + + ret = vptrace(PTRACE_SYSCALL, pid, NULL, NULL); + if (ret) + break; + + if (waitpid(pid, &status, 0) == -1) + break; + } + + /* hopefully this worked */ + vptrace(PTRACE_KILL, pid, NULL, NULL); + + return 0; +} diff --git a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h index aeaba884..e7156420 100644 --- a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h +++ b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h @@ -46,11 +46,24 @@ static void child_signal(int sig) child_stopped = true; } +#define vptrace(request, pid, addr, data) \ +({ \ + errno = 0; \ + long __ret = ptrace(request, pid, addr, data); \ + if (__ret && errno) \ + perror("ptrace(" #request ", " #pid ", " #addr ", " #data ")"); \ + __ret; \ +}) + static void make_a_baby(int argc, char *argv[]) { if (argc > 1 && !strcmp(argv[1], "child")) { /* if we're the child, just sit around doing nothing */ - sleep(60); + int i = 60; + while (i--) { + close(-100); + sleep(1); + } exit(1); } @@ -94,8 +107,12 @@ static char *strings[] = { #ifdef PTRACE_SETREGS SPT(SETREGS) #endif +#ifdef PTRACE_GETSIGINFO SPT(GETSIGINFO) +#endif +#ifdef PTRACE_SETSIGINFO SPT(SETSIGINFO) +#endif #ifdef PTRACE_GETFGREGS SPT(GETFGREGS) #endif @@ -105,7 +122,7 @@ static char *strings[] = { SPT(KILL) SPT(SINGLESTEP) }; -static char *strptrace(enum __ptrace_request request) +static inline char *strptrace(enum __ptrace_request request) { return strings[request]; } diff --git a/testcases/kernel/syscalls/ptrace/syscalls.h b/testcases/kernel/syscalls/ptrace/syscalls.h new file mode 100644 index 00000000..2d9c5ceb --- /dev/null +++ b/testcases/kernel/syscalls/ptrace/syscalls.h @@ -0,0 +1,17 @@ +const struct sysnums { + long nr; + const char *snr; +} sysnums[] = { +#define P(NR) { .nr = SYS_##NR, .snr = #NR, }, +#include "_syscalls.h" +#undef P +}; + +const char *get_sysnum(long nr) +{ + int i; + for (i = 0; i < ARRAY_SIZE(sysnums); ++i) + if (sysnums[i].nr == nr) + break; + return i == ARRAY_SIZE(sysnums) ? "???" : sysnums[i].snr; +} diff --git a/testcases/kernel/syscalls/pwrite/Makefile b/testcases/kernel/syscalls/pwrite/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/pwrite/Makefile +++ b/testcases/kernel/syscalls/pwrite/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/quotactl/Makefile b/testcases/kernel/syscalls/quotactl/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/quotactl/Makefile +++ b/testcases/kernel/syscalls/quotactl/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c dissimilarity index 75% index f410948b..1f6bbf29 100644 --- a/testcases/kernel/syscalls/quotactl/quotactl01.c +++ b/testcases/kernel/syscalls/quotactl/quotactl01.c @@ -1,168 +1,202 @@ -/******************************************************************************/ -/* Copyright (c) Crackerjack Project., 2007 */ -/* */ -/* This program is free software; you can redistribute it and/or modify */ -/* it under the terms of the GNU General Public License as published by */ -/* the Free Software Foundation; either version 2 of the License, or */ -/* (at your option) any later version. */ -/* */ -/* This program is distributed in the hope that it will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ -/* the GNU General Public License for more details. */ -/* */ -/* You should have received a copy of the GNU General Public License */ -/* along with this program; if not, write to the Free Software */ -/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* */ -/******************************************************************************/ -/******************************************************************************/ -/* */ -/* File: quotactl01.c */ -/* */ -/* Description: This tests the quotactl() syscall */ -/* */ -/* Usage: */ -/* quotactl01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */ -/* where, -c n : Run n copies concurrently. */ -/* -e : Turn on errno logging. */ -/* -i n : Execute test n times. */ -/* -I x : Execute test for x seconds. */ -/* -P x : Pause for x seconds between iterations. */ -/* -t : Turn on syscall timing. */ -/* */ -/* Total Tests: 1 */ -/* */ -/* Test Name: quotactl01 */ -/* History: Porting from Crackerjack to LTP is done by */ -/* Manas Kumar Nayak maknayak@in.ibm.com> */ -/******************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include - - -/* Harness Specific Include Files. */ -#include "test.h" -#include "usctest.h" -#include "linux_syscall_numbers.h" - -/* Extern Global Variables */ -extern int Tst_count; /* counter for tst_xxx routines. */ -extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ - -/* Global Variables */ -char *TCID = "quotactl01"; /* Test program identifier.*/ -int testno; -int TST_TOTAL = 1; /* total number of tests in this file. */ - -/* Extern Global Functions */ -/******************************************************************************/ -/* */ -/* Function: cleanup */ -/* */ -/* Description: Performs all one time clean up for this test on successful */ -/* completion, premature exit or failure. Closes all temporary */ -/* files, removes all temporary directories exits the test with */ -/* appropriate return code by calling tst_exit() function. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */ -/* On success - Exits calling tst_exit(). With '0' return code. */ -/* */ -/******************************************************************************/ -extern void cleanup() { - /* Remove tmp dir and all files in it */ - TEST_CLEANUP; - tst_rmdir(); - - /* Exit with appropriate return code. */ - tst_exit(); -} - -/* Local Functions */ -/******************************************************************************/ -/* */ -/* Function: setup */ -/* */ -/* Description: Performs all one time setup for this test. This function is */ -/* typically used to capture signals, create temporary dirs */ -/* and temporary files that may be used in the course of this */ -/* test. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits by calling cleanup(). */ -/* On success - returns 0. */ -/* */ -/******************************************************************************/ -void setup() { - /* Capture signals if any */ - /* Create temporary directories */ - TEST_PAUSE; - tst_tmpdir(); -} - -/* -* WARNING!! This test may cause the potential harm to the system, we DO NOT -* provide any warranty for the safety!! -*/ -/* -* To use this testcase , the quota function must be turned on and the user must be * the super user -*/ - -int cmd[] = {Q_QUOTAON, Q_QUOTAOFF, Q_GETQUOTA, Q_SETQUOTA, Q_GETINFO, Q_SETINFO, Q_GETFMT, Q_SYNC}; -int retval = 0, id = 0, i = 0; - -int main(int ac, char **av) { - int newtid = -1; - int result; - int lc; /* loop counter */ - char *msg; /* message returned from parse_opts */ - - /* parse standard options */ - if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){ - tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); - tst_exit(); - } - - setup(); - - /* Check looping state if -i option given */ - for (lc = 0; TEST_LOOPING(lc); ++lc) { - Tst_count = 0; - for (testno = 0; testno < TST_TOTAL; ++testno) { - - id = getuid(); - for (i = 0; i <= 7; i++){ - TEST(retval = syscall(__NR_quotactl, cmd[i], (const char *)NULL, id, (caddr_t)NULL)); - if(TEST_RETURN != 0){ - tst_resm(TFAIL|TTERRNO, "%s failed, cmd=0x%x", TCID, cmd[i]); - }else{ - tst_resm(TPASS, "quotactl call succeeded"); - } - } - TEST(result = syscall(__NR_set_tid_address, &newtid)); - if(TEST_RETURN == getpid()) { - cleanup(); - } - else { - cleanup(); - tst_exit(); - } - } - } - cleanup(); - tst_exit(); -} - +/******************************************************************************/ +/* Copyright (c) Crackerjack Project., 2007 */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ +/* the GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* */ +/******************************************************************************/ +/******************************************************************************/ +/* */ +/* File: quotactl01.c */ +/* */ +/* Description: This tests the quotactl() syscall */ +/* */ +/* Usage: */ +/* quotactl01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */ +/* where, -c n : Run n copies concurrently. */ +/* -e : Turn on errno logging. */ +/* -i n : Execute test n times. */ +/* -I x : Execute test for x seconds. */ +/* -P x : Pause for x seconds between iterations. */ +/* -t : Turn on syscall timing. */ +/* */ +/* Total Tests: 1 */ +/* */ +/* Test Name: quotactl01 */ +/* History: Porting from Crackerjack to LTP is done by */ +/* Manas Kumar Nayak maknayak@in.ibm.com> */ +/******************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include "config.h" +#if defined(HAS_NEW_MINIMAL_QUOTACTL) || defined(HAS_RHEL48_QUOTACTL) +#include +#elif defined(HAS_RHEL46_QUOTACTL) +#include +#else +/* Not HAS_NEW_MINIMAL_QUOTACTL or HAS_RHEL48_QUOTACTL or HAS_RHEL46_QUOTACTL. */ +#define BROKEN_QUOTACTL 1 +#endif +#if defined(HAS_RHEL46_QUOTACTL) || defined(HAS_RHEL48_QUOTACTL) +#include +#include +#include +#endif /* defined(HAS_RHEL46_QUOTACTL) || defined(HAS_RHEL48_QUOTACTL) */ + +/* Harness Specific Include Files. */ +#include "test.h" +#include "usctest.h" +#include "linux_syscall_numbers.h" + +/* Extern Global Variables */ +extern int Tst_count; /* counter for tst_xxx routines. */ +extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ + +/* Global Variables */ +char *TCID = "quotactl01"; /* Test program identifier.*/ +int testno; +int TST_TOTAL = 1; /* total number of tests in this file. */ + +/* Extern Global Functions */ +/******************************************************************************/ +/* */ +/* Function: cleanup */ +/* */ +/* Description: Performs all one time clean up for this test on successful */ +/* completion, premature exit or failure. Closes all temporary */ +/* files, removes all temporary directories exits the test with */ +/* appropriate return code by calling tst_exit() function. */ +/* */ +/* Input: None. */ +/* */ +/* Output: None. */ +/* */ +/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */ +/* On success - Exits calling tst_exit(). With '0' return code. */ +/* */ +/******************************************************************************/ +extern void cleanup() { + /* Remove tmp dir and all files in it */ + TEST_CLEANUP; + tst_rmdir(); + + /* Exit with appropriate return code. */ + tst_exit(); +} + +/* Local Functions */ +/******************************************************************************/ +/* */ +/* Function: setup */ +/* */ +/* Description: Performs all one time setup for this test. This function is */ +/* typically used to capture signals, create temporary dirs */ +/* and temporary files that may be used in the course of this */ +/* test. */ +/* */ +/* Input: None. */ +/* */ +/* Output: None. */ +/* */ +/* Return: On failure - Exits by calling cleanup(). */ +/* On success - returns 0. */ +/* */ +/******************************************************************************/ +void setup() { + /* Capture signals if any */ + /* Create temporary directories */ + TEST_PAUSE; + tst_tmpdir(); +} + +/* +* WARNING!! This test may cause the potential harm to the system, we DO NOT +* provide any warranty for the safety!! +*/ +/* +* To use this testcase , the quota function must be turned on and the user must be * the super user +*/ + + +#ifdef BROKEN_QUOTACTL +int +main(void) { + tst_resm(TBROK, "The copy of quotactl is broken/missing on this system"); + tst_exit(); +} +#else +int cmd[] = {Q_QUOTAON, Q_QUOTAOFF, Q_GETQUOTA, Q_SETQUOTA, Q_GETINFO, Q_SETINFO, Q_GETFMT, Q_SYNC}; +int retval = 0, i = 0; + +int +main(int ac, char **av) +{ + int id = getuid(); + int newtid = -1; + int result; + int lc; /* loop counter */ + char *msg; /* message returned from parse_opts */ + + /* parse standard options */ + if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){ + tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); + tst_exit(); + } + + setup(); + + /* Check looping state if -i option given */ + for (lc = 0; TEST_LOOPING(lc); ++lc) { + + Tst_count = 0; + + for (testno = 0; testno < TST_TOTAL; ++testno) { + + for (i = 0; i <= 7; i++){ + + TEST(retval = syscall(__NR_quotactl, cmd[i], + (const char *)NULL, id, + (caddr_t)NULL)); + if (TEST_RETURN != 0) { + tst_resm(TFAIL|TTERRNO, "cmd=0x%x", cmd[i]); + } else { + tst_resm(TPASS, "quotactl call succeeded"); + } + + } + + TEST(result = syscall(__NR_set_tid_address, &newtid)); + + if (TEST_RETURN == getpid()) { + cleanup(); + } else { + cleanup(); + tst_exit(); + } + + } + + } + + cleanup(); + + tst_exit(); + +} +#endif diff --git a/testcases/kernel/syscalls/read/Makefile b/testcases/kernel/syscalls/read/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/read/Makefile +++ b/testcases/kernel/syscalls/read/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/readdir/Makefile b/testcases/kernel/syscalls/readdir/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/readdir/Makefile +++ b/testcases/kernel/syscalls/readdir/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/readlink/Makefile b/testcases/kernel/syscalls/readlink/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/readlink/Makefile +++ b/testcases/kernel/syscalls/readlink/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/readlinkat/Makefile b/testcases/kernel/syscalls/readlinkat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/readlinkat/Makefile +++ b/testcases/kernel/syscalls/readlinkat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/readv/Makefile b/testcases/kernel/syscalls/readv/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/readv/Makefile +++ b/testcases/kernel/syscalls/readv/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/reboot/Makefile b/testcases/kernel/syscalls/reboot/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/reboot/Makefile +++ b/testcases/kernel/syscalls/reboot/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/recv/Makefile b/testcases/kernel/syscalls/recv/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/recv/Makefile +++ b/testcases/kernel/syscalls/recv/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/recvfrom/Makefile b/testcases/kernel/syscalls/recvfrom/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/recvfrom/Makefile +++ b/testcases/kernel/syscalls/recvfrom/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/recvmsg/Makefile b/testcases/kernel/syscalls/recvmsg/Makefile index 484a8e51..bd617d80 100644 --- a/testcases/kernel/syscalls/recvmsg/Makefile +++ b/testcases/kernel/syscalls/recvmsg/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -g -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/remap_file_pages/Makefile b/testcases/kernel/syscalls/remap_file_pages/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/remap_file_pages/Makefile +++ b/testcases/kernel/syscalls/remap_file_pages/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/rename/Makefile b/testcases/kernel/syscalls/rename/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/rename/Makefile +++ b/testcases/kernel/syscalls/rename/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/renameat/Makefile b/testcases/kernel/syscalls/renameat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/renameat/Makefile +++ b/testcases/kernel/syscalls/renameat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/rmdir/Makefile b/testcases/kernel/syscalls/rmdir/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/rmdir/Makefile +++ b/testcases/kernel/syscalls/rmdir/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/rt_sigaction/Makefile b/testcases/kernel/syscalls/rt_sigaction/Makefile index ecdce09c..2ef86f06 100644 --- a/testcases/kernel/syscalls/rt_sigaction/Makefile +++ b/testcases/kernel/syscalls/rt_sigaction/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -W -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/rt_sigprocmask/Makefile b/testcases/kernel/syscalls/rt_sigprocmask/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/rt_sigprocmask/Makefile +++ b/testcases/kernel/syscalls/rt_sigprocmask/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/rt_sigqueueinfo/Makefile b/testcases/kernel/syscalls/rt_sigqueueinfo/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/rt_sigqueueinfo/Makefile +++ b/testcases/kernel/syscalls/rt_sigqueueinfo/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/rt_sigsuspend/Makefile b/testcases/kernel/syscalls/rt_sigsuspend/Makefile index 38c65f52..2ef86f06 100644 --- a/testcases/kernel/syscalls/rt_sigsuspend/Makefile +++ b/testcases/kernel/syscalls/rt_sigsuspend/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -g -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sbrk/Makefile b/testcases/kernel/syscalls/sbrk/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sbrk/Makefile +++ b/testcases/kernel/syscalls/sbrk/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sched_get_priority_max/Makefile b/testcases/kernel/syscalls/sched_get_priority_max/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sched_get_priority_max/Makefile +++ b/testcases/kernel/syscalls/sched_get_priority_max/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sched_get_priority_min/Makefile b/testcases/kernel/syscalls/sched_get_priority_min/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sched_get_priority_min/Makefile +++ b/testcases/kernel/syscalls/sched_get_priority_min/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sched_getaffinity/Makefile b/testcases/kernel/syscalls/sched_getaffinity/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/sched_getaffinity/Makefile +++ b/testcases/kernel/syscalls/sched_getaffinity/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sched_getparam/Makefile b/testcases/kernel/syscalls/sched_getparam/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sched_getparam/Makefile +++ b/testcases/kernel/syscalls/sched_getparam/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sched_getscheduler/Makefile b/testcases/kernel/syscalls/sched_getscheduler/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sched_getscheduler/Makefile +++ b/testcases/kernel/syscalls/sched_getscheduler/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sched_rr_get_interval/Makefile b/testcases/kernel/syscalls/sched_rr_get_interval/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sched_rr_get_interval/Makefile +++ b/testcases/kernel/syscalls/sched_rr_get_interval/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sched_setparam/Makefile b/testcases/kernel/syscalls/sched_setparam/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sched_setparam/Makefile +++ b/testcases/kernel/syscalls/sched_setparam/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sched_setscheduler/Makefile b/testcases/kernel/syscalls/sched_setscheduler/Makefile index 9b3299f6..bd617d80 100644 --- a/testcases/kernel/syscalls/sched_setscheduler/Makefile +++ b/testcases/kernel/syscalls/sched_setscheduler/Makefile @@ -16,17 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sched_yield/Makefile b/testcases/kernel/syscalls/sched_yield/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sched_yield/Makefile +++ b/testcases/kernel/syscalls/sched_yield/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/select/Makefile b/testcases/kernel/syscalls/select/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/select/Makefile +++ b/testcases/kernel/syscalls/select/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/send/Makefile b/testcases/kernel/syscalls/send/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/send/Makefile +++ b/testcases/kernel/syscalls/send/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sendfile/Makefile b/testcases/kernel/syscalls/sendfile/Makefile index a324fdad..df7b63f7 100644 --- a/testcases/kernel/syscalls/sendfile/Makefile +++ b/testcases/kernel/syscalls/sendfile/Makefile @@ -16,20 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sendmsg/Makefile b/testcases/kernel/syscalls/sendmsg/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sendmsg/Makefile +++ b/testcases/kernel/syscalls/sendmsg/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sendto/Makefile b/testcases/kernel/syscalls/sendto/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sendto/Makefile +++ b/testcases/kernel/syscalls/sendto/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/set_robust_list/Makefile b/testcases/kernel/syscalls/set_robust_list/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/set_robust_list/Makefile +++ b/testcases/kernel/syscalls/set_robust_list/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/set_thread_area/Makefile b/testcases/kernel/syscalls/set_thread_area/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/set_thread_area/Makefile +++ b/testcases/kernel/syscalls/set_thread_area/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/set_thread_area/set_thread_area.h b/testcases/kernel/syscalls/set_thread_area/set_thread_area.h index 66e92783..4f2f9e81 100644 --- a/testcases/kernel/syscalls/set_thread_area/set_thread_area.h +++ b/testcases/kernel/syscalls/set_thread_area/set_thread_area.h @@ -1,6 +1,5 @@ #include #include -#include /* Harness Specific Include Files. */ #include "test.h" @@ -9,6 +8,7 @@ #include "config.h" #if defined HAVE_ASM_LDT_H +#include #include #if defined HAVE_STRUCT_USER_DESC diff --git a/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c b/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c dissimilarity index 92% index a6aacf82..ea84749d 100644 --- a/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c +++ b/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c @@ -1,176 +1,183 @@ -/******************************************************************************/ -/* Copyright (c) Crackerjack Project., 2007 */ -/* */ -/* This program is free software; you can redistribute it and/or modify */ -/* it under the terms of the GNU General Public License as published by */ -/* the Free Software Foundation; either version 2 of the License, or */ -/* (at your option) any later version. */ -/* */ -/* This program is distributed in the hope that it will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ -/* the GNU General Public License for more details. */ -/* */ -/* You should have received a copy of the GNU General Public License */ -/* along with this program; if not, write to the Free Software */ -/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* */ -/******************************************************************************/ -/******************************************************************************/ -/* */ -/* File: set_thread_area01.c */ -/* */ -/* Description: This test two syscalls */ -/* 1) get__thread_area(): */ -/* get_thread_area returns an entry in the current thread's */ -/* Thread Local Storage (TLS) array.get_thread_area returns 0 */ -/* on success. Otherwise, it returns -1 */ -/* 2)set_thread_area(): */ -/* set_thread_area() sets an entry in the current thread's */ -/* Thread Local.When set_thread_area() is passed an */ -/* entry_number of -1, it uses a free TLS entry. */ -/* set_thread_area() returns 0 on success, and -1 on failure */ -/* */ -/* */ -/* */ -/* Usage: */ -/* set_tid_address01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */ -/* where, -c n : Run n copies concurrently. */ -/* -e : Turn on errno logging. */ -/* -i n : Execute test n times. */ -/* -I x : Execute test for x seconds. */ -/* -P x : Pause for x seconds between iterations. */ -/* -t : Turn on syscall timing. */ -/* */ -/* Total Tests: 2 */ -/* */ -/* Test Name: set_thread_area01 */ -/* History: Porting from Crackerjack to LTP is done by */ -/* Manas Kumar Nayak maknayak@in.ibm.com> */ -/******************************************************************************/ -#include "set_thread_area.h" - - -/* Global Variables */ -char *TCID = "set_thread_area01"; /* Test program identifier.*/ -int testno; -int TST_TOTAL = 2; /* total number of tests in this file. */ - -#if defined HAVE_ASM_LDT_H -/* Extern Global Variables */ -extern int Tst_count; /* counter for tst_xxx routines. */ -extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ - -/* Extern Global Functions */ -/******************************************************************************/ -/* */ -/* Function: cleanup */ -/* */ -/* Description: Performs all one time clean up for this test on successful */ -/* completion, premature exit or failure. Closes all temporary */ -/* files, removes all temporary directories exits the test with */ -/* appropriate return code by calling tst_exit() function. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */ -/* On success - Exits calling tst_exit(). With '0' return code. */ -/* */ -/******************************************************************************/ -extern void cleanup() { - /* Remove tmp dir and all files in it */ - TEST_CLEANUP; - tst_rmdir(); - - /* Exit with appropriate return code. */ - tst_exit(); -} - -/* Local Functions */ -/******************************************************************************/ -/* */ -/* Function: setup */ -/* */ -/* Description: Performs all one time setup for this test. This function is */ -/* typically used to capture signals, create temporary dirs */ -/* and temporary files that may be used in the course of this */ -/* test. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits by calling cleanup(). */ -/* On success - returns 0. */ -/* */ -/******************************************************************************/ -void setup() { - /* Capture signals if any */ - /* Create temporary directories */ - TEST_PAUSE; - tst_tmpdir(); -} - -int main(int ac, char **av) { - - thread_area_s u_info; - int lc; /* loop counter */ - char *msg; /* message returned from parse_opts */ - - /* parse standard options */ - if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){ - tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); - tst_exit(); - } - - setup(); - - /* Check looping state if -i option given */ - for (lc = 0; TEST_LOOPING(lc); ++lc) { - Tst_count = 0; - for (testno = 0; testno < TST_TOTAL; ++testno) { - u_info.entry_number = 6; - - /* - * This call to get_thread_area function should be sucessful. - */ - - TEST(syscall(__NR_get_thread_area, &u_info)); //call get_thread_area() - if(TEST_RETURN == 0) { - tst_resm(TPASS, "get_thread_area call succeeded"); - } - else { - tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO)); - cleanup(); - tst_exit(); - } - - u_info.entry_number = -1; - /* - * This call to set_thread_area function should be sucessful. - */ - - TEST(syscall(__NR_set_thread_area, &u_info)); //call set_thread_area() - if(TEST_RETURN == 0) { - tst_resm(TPASS, "set_thread_area call succeeded"); - } - else { - tst_resm(TFAIL, "%s failed----- errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO)); - cleanup(); - tst_exit(); - } - } - } - cleanup(); - tst_exit(); -} - -#else -int main(int ac, char **av) { - - tst_resm(TCONF, "is not available for this architecture"); - tst_exit(); -} -#endif +/****************************************************************************** + * Copyright (c) Crackerjack Project., 2007 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + ****************************************************************************** + * File: set_thread_area01.c + * Description: This test two syscalls + * 1) get__thread_area(): + * get_thread_area returns an entry in the current thread's + * Thread Local Storage (TLS) array.get_thread_area returns 0 + * on success. Otherwise, it returns -1 + * 2) set_thread_area(): + * set_thread_area() sets an entry in the current thread's + * Thread Local.When set_thread_area() is passed an + * entry_number of -1, it uses a free TLS entry. + * set_thread_area() returns 0 on success, and -1 on failure + * + * Usage: + * set_tid_address01 [-c n] [-e][-i n] [-I x] [-p x] [-t] + * where, -c n : Run n copies concurrently. + * -e : Turn on errno logging. + * -i n : Execute test n times. + * -I x : Execute test for x seconds. + * -P x : Pause for x seconds between iterations. + * -t : Turn on syscall timing. + * + * Total Tests: 2 + * Test Name: set_thread_area01 + * History: Porting from Crackerjack to LTP is done by + * Manas Kumar Nayak maknayak@in.ibm.com> + *****************************************************************************/ + +#include "set_thread_area.h" + +/* Global Variables */ +char *TCID = "set_thread_area01"; /* Test program identifier. */ +int testno; +int TST_TOTAL = 2; /* total number of tests in this file. */ + +#if defined(HAVE_ASM_LDT_H) && defined(HAVE_STRUCT_USER_DESC) +/* Extern Global Variables */ +extern int Tst_count; /* counter for tst_xxx routines. */ +extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ + +/* Extern Global Functions */ +/************************************************************************/ +/* */ +/* Function: cleanup */ +/* */ +/* Description: Performs all one time clean up for this test on */ +/* successful completion, premature exit or failure. Closes all */ +/* temporary files, removes all temporary directories exits the */ +/* test with appropriate return code by calling tst_exit() function. */ +/* */ +/* Input: None. */ +/* */ +/* Output: None. */ +/* */ +/* Return: On failure - Exits calling tst_exit(). Non '0' return */ +/* code. On success - Exits calling tst_exit(). With '0' */ +/* return code. */ +/* */ +/************************************************************************/ +extern void cleanup() { + /* Remove tmp dir and all files in it */ + TEST_CLEANUP; + tst_rmdir(); + + /* Exit with appropriate return code. */ + tst_exit(); +} + +/* Local Functions */ +/************************************************************************/ +/* */ +/* Function: setup */ +/* */ +/* Description: Performs all one time setup for this test. */ +/* This function is typically used to capture signals, create */ +/* temporary dirs and temporary files that may be used in the */ +/* course of this test. */ +/* */ +/* Input: None. */ +/* */ +/* Output: None. */ +/* */ +/* Return: On failure - Exits by calling cleanup(). */ +/* On success - returns 0. */ +/* */ +/************************************************************************/ +void setup() { + /* Capture signals if any */ + /* Create temporary directories */ + TEST_PAUSE; + tst_tmpdir(); +} + +int main(int ac, char **av) { + + thread_area_s u_info; + int lc; /* loop counter */ + char *msg; /* message returned from parse_opts */ + + /* parse standard options */ + if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){ + tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); + tst_exit(); + } + + setup(); + + /* Check looping state if -i option given */ + for (lc = 0; TEST_LOOPING(lc); ++lc) { + + Tst_count = 0; + + for (testno = 0; testno < TST_TOTAL; ++testno) { + + u_info.entry_number = 6; + + /* + * This call to get_thread_area function should be + * successful. + */ + + /* Call get_thread_area(). */ + TEST(syscall(__NR_get_thread_area, &u_info)); + if(TEST_RETURN == 0) { + tst_resm(TPASS, "get_thread_area call succeeded"); + } else { + tst_resm(TFAIL, "failed - errno = %d : %s", + TEST_ERRNO, strerror(TEST_ERRNO)); + cleanup(); + tst_exit(); + } + + u_info.entry_number = -1; + /* + * This call to set_thread_area function should be sucessful. + */ + + /* Call set_thread_area(). */ + TEST(syscall(__NR_set_thread_area, &u_info)); + + if(TEST_RETURN == 0) { + tst_resm(TPASS, "set_thread_area call succeeded"); + } else { + tst_resm(TFAIL, "failed - errno = %d : %s", + TEST_ERRNO, strerror(TEST_ERRNO)); + cleanup(); + tst_exit(); + } + + } + + } + + cleanup(); + + tst_exit(); + +} + +#else +int main(void) { + tst_resm(TCONF, "[gs]et_thread_area is not available on this " + "architecture"); + tst_exit(); +} +#endif diff --git a/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c b/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c dissimilarity index 89% index 1b351c1b..bc2d7f59 100644 --- a/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c +++ b/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c @@ -1,196 +1,196 @@ -/******************************************************************************/ -/* Copyright (c) Crackerjack Project., 2007 */ -/* */ -/* This program is free software; you can redistribute it and/or modify */ -/* it under the terms of the GNU General Public License as published by */ -/* the Free Software Foundation; either version 2 of the License, or */ -/* (at your option) any later version. */ -/* */ -/* This program is distributed in the hope that it will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ -/* the GNU General Public License for more details. */ -/* */ -/* You should have received a copy of the GNU General Public License */ -/* along with this program; if not, write to the Free Software */ -/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* */ -/******************************************************************************/ -/******************************************************************************/ -/* */ -/* File: set_thread_area_02.c */ -/* */ -/* Description: This test checks for propper error code on syscalls */ -/* 1) get__thread_area(): */ -/* get_thread_area returns an entry in the current thread's */ -/* Thread Local Storage (TLS) array.get_thread_area returns 0 */ -/* on success. Otherwise, it returns -1 */ -/* 2)set_thread_area(): */ -/* set_thread_area() sets an entry in the current thread's */ -/* Thread Local.When set_thread_area() is passed an */ -/* entry_number of -1, it uses a free TLS entry. */ -/* set_thread_area() returns 0 on success, and -1 on failure */ -/* with errno set appropriately. */ -/* */ -/* */ -/* Usage: */ -/* set_thread_area_02 [-c n] [-e][-i n] [-I x] [-p x] [-t] */ -/* where, -c n : Run n copies concurrently. */ -/* -e : Turn on errno logging. */ -/* -i n : Execute test n times. */ -/* -I x : Execute test for x seconds. */ -/* -P x : Pause for x seconds between iterations. */ -/* -t : Turn on syscall timing. */ -/* */ -/* Total Tests: 3 */ -/* */ -/* Test Name: set_thread_area_02 - */ -/* History: Porting from Crackerjack to LTP is done by */ -/* Manas Kumar Nayak maknayak@in.ibm.com> */ -/******************************************************************************/ -#include "set_thread_area.h" - -/* Global Variables */ -char *TCID = "set_thread_area_02"; /* Test program identifier.*/ -int testno; -int TST_TOTAL = 3; /* total number of tests in this file. */ - -#if defined HAVE_ASM_LDT_H -/* Extern Global Variables */ -extern int Tst_count; /* counter for tst_xxx routines. */ -extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ - -/* Extern Global Functions */ -/******************************************************************************/ -/* */ -/* Function: cleanup */ -/* */ -/* Description: Performs all one time clean up for this test on successful */ -/* completion, premature exit or failure. Closes all temporary */ -/* files, removes all temporary directories exits the test with */ -/* appropriate return code by calling tst_exit() function. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */ -/* On success - Exits calling tst_exit(). With '0' return code. */ -/* */ -/******************************************************************************/ -extern void cleanup() { - /* Remove tmp dir and all files in it */ - TEST_CLEANUP; - tst_rmdir(); - - /* Exit with appropriate return code. */ - tst_exit(); -} - -/* Local Functions */ -/******************************************************************************/ -/* */ -/* Function: setup */ -/* */ -/* Description: Performs all one time setup for this test. This function is */ -/* typically used to capture signals, create temporary dirs */ -/* and temporary files that may be used in the course of this */ -/* test. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits by calling cleanup(). */ -/* On success - returns 0. */ -/* */ -/******************************************************************************/ -void setup() { - /* Capture signals if any */ - /* Create temporary directories */ - TEST_PAUSE; - tst_tmpdir(); -} - -int main(int ac, char **av) { - - thread_area_s u_info; - int lc; /* loop counter */ - char *msg; /* message returned from parse_opts */ - - /* parse standard options */ - if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){ - tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); - tst_exit(); - } - - setup(); - - /* Check looping state if -i option given */ - for (lc = 0; TEST_LOOPING(lc); ++lc) { - Tst_count = 0; - for (testno = 0; testno < TST_TOTAL; ++testno) { - u_info.entry_number = 6; - - /* - * This call to get_thread_area function should be sucessful. - */ - - TEST(syscall(__NR_get_thread_area, &u_info)); //call get_thread_area() - if(TEST_RETURN == -1) { - tst_resm(TFAIL, "call get_thraed_area() failed with errno = %d ", TEST_ERRNO, strerror(TEST_ERRNO)); - cleanup(); - tst_exit(); - } - - u_info.entry_number = -2; - /* - * This call to set_thread_area function with invalid entry_number should be FAILED. - */ - - TEST(syscall(__NR_set_thread_area, &u_info)); //call set_thread_area() - if(TEST_RETURN == -1) { - if(TEST_ERRNO == EINVAL){ - tst_resm(TPASS, "Call to set_thread_area call failed with invalid entry_number errno = %d (expected EINVAL)",TEST_ERRNO); - } - else { - tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number got unexpected errno = %d (expected EINVAL)",TEST_ERRNO); - } - } - else { - tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number succeed,but should fail" ); - cleanup(); - tst_exit(); - } - - /* - * This call to set_thread_area function with an invalid pointer should be FAILED with EFAULT. - */ - - TEST(syscall(__NR_set_thread_area,(struct user_desc *)-9)); //call set_thread_area() - if(TEST_RETURN == -1) { - if(TEST_ERRNO == EFAULT){ - tst_resm(TPASS, "Call to set_thread_area call with invalid entry_number errno = %d (got expected error EFAULT)",TEST_ERRNO); - } - else { - tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number got unexpected errno = %d (expected EFAULT)",TEST_ERRNO); - } - } - else { - tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number succeed,but should fail" ); - tst_exit(); - } - } - } - cleanup(); - tst_exit(); -} -#else -int main(int ac, char **av) { - - tst_resm(TCONF, "is not available for this architecture"); - tst_exit(); -} -#endif - +/************************************************************************* + * Copyright (c) Crackerjack Project., 2007 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + ************************************************************************/ +/************************************************************************/ +/* */ +/* File: set_thread_area_02.c */ +/* */ +/* Description: This test checks for propper error code on syscalls */ +/* 1) get__thread_area(): */ +/* get_thread_area returns an entry in the current */ +/* thread's Thread Local Storage (TLS) array. */ +/* get_thread_area returns 0 on success. Otherwise, */ +/* it returns -1 */ +/* 2) set_thread_area(): */ +/* set_thread_area() sets an entry in the current */ +/* thread's Thread Local. When set_thread_area() is */ +/* passed an entry_number of -1, it uses a free TLS */ +/* entry. set_thread_area() returns 0 on success, and */ +/* -1 on failure with errno set appropriately. */ +/* */ +/* */ +/* Usage: */ +/* set_thread_area_02 [-c n] [-e][-i n] [-I x] [-p x] [-t] */ +/* where, -c n : Run n copies concurrently. */ +/* -e : Turn on errno logging. */ +/* -i n : Execute test n times. */ +/* -I x : Execute test for x seconds. */ +/* -P x : Pause for x seconds between iterations. */ +/* -t : Turn on syscall timing. */ +/* */ +/* Total Tests: 3 */ +/* */ +/* Test Name: set_thread_area_02 */ +/* History: Porting from Crackerjack to LTP is done by */ +/* Manas Kumar Nayak maknayak@in.ibm.com> */ +/************************************************************************/ +#include "set_thread_area.h" + +/* Global Variables */ +char *TCID = "set_thread_area_02"; /* Test program identifier.*/ +int testno; +int TST_TOTAL = 3; /* total number of tests in this file. */ + +#if defined(HAVE_ASM_LDT_H) && defined(HAVE_STRUCT_USER_DESC) +/* Extern Global Variables */ +extern int Tst_count; /* counter for tst_xxx routines. */ +extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ + +/* Extern Global Functions */ +/******************************************************************************/ +/* */ +/* Function: cleanup */ +/* */ +/* Description: Performs all one time clean up for this test on successful */ +/* completion, premature exit or failure. Closes all temporary */ +/* files, removes all temporary directories exits the test with */ +/* appropriate return code by calling tst_exit() function. */ +/* */ +/* Input: None. */ +/* */ +/* Output: None. */ +/* */ +/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */ +/* On success - Exits calling tst_exit(). With '0' return code. */ +/* */ +/******************************************************************************/ +extern void cleanup() { + /* Remove tmp dir and all files in it */ + TEST_CLEANUP; + tst_rmdir(); + + /* Exit with appropriate return code. */ + tst_exit(); +} + +/* Local Functions */ +/******************************************************************************/ +/* */ +/* Function: setup */ +/* */ +/* Description: Performs all one time setup for this test. This function is */ +/* typically used to capture signals, create temporary dirs */ +/* and temporary files that may be used in the course of this */ +/* test. */ +/* */ +/* Input: None. */ +/* */ +/* Output: None. */ +/* */ +/* Return: On failure - Exits by calling cleanup(). */ +/* On success - returns 0. */ +/* */ +/******************************************************************************/ +void setup() { + /* Capture signals if any */ + /* Create temporary directories */ + TEST_PAUSE; + tst_tmpdir(); +} + +int main(int ac, char **av) { + + thread_area_s u_info; + int lc; /* loop counter */ + char *msg; /* message returned from parse_opts */ + + /* parse standard options */ + if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){ + tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); + tst_exit(); + } + + setup(); + + /* Check looping state if -i option given */ + for (lc = 0; TEST_LOOPING(lc); ++lc) { + + Tst_count = 0; + + for (testno = 0; testno < TST_TOTAL; ++testno) { + + u_info.entry_number = 6; + + /* + * This call to get_thread_area function should be sucessful. + */ + + TEST(syscall(__NR_get_thread_area, &u_info)); //call get_thread_area() + if(TEST_RETURN == -1) { + tst_resm(TFAIL | TTERRNO, "call get_thread_area() failed"); + cleanup(); + tst_exit(); + } + + u_info.entry_number = -2; + /* + * This call to set_thread_area function with invalid entry_number should be FAILED. + */ + + TEST(syscall(__NR_set_thread_area, &u_info)); //call set_thread_area() + if(TEST_RETURN == -1) { + + if (TEST_ERRNO == EINVAL) { + tst_resm(TPASS, "Call to set_thread_area call failed with invalid entry_number errno = %d (expected EINVAL)",TEST_ERRNO); + } else { + tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number got unexpected errno = %d (expected EINVAL)",TEST_ERRNO); + } + + } else { + tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number succeed,but should fail" ); + cleanup(); + tst_exit(); + } + + /* + * This call to set_thread_area function with an invalid pointer should be FAILED with EFAULT. + */ + + TEST(syscall(__NR_set_thread_area,(struct user_desc *)-9)); //call set_thread_area() + if (TEST_RETURN == -1) { + if(TEST_ERRNO == EFAULT){ + tst_resm(TPASS, "Call to set_thread_area call with invalid entry_number errno = %d (got expected error EFAULT)",TEST_ERRNO); + } else { + tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number got unexpected errno = %d (expected EFAULT)",TEST_ERRNO); + } + } else { + tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number succeed,but should fail" ); + tst_exit(); + } + } + } + cleanup(); + tst_exit(); +} +#else +int main(void) { + tst_resm(TCONF, "is not available for this architecture"); + tst_exit(); +} +#endif + diff --git a/testcases/kernel/syscalls/set_tid_address/Makefile b/testcases/kernel/syscalls/set_tid_address/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/set_tid_address/Makefile +++ b/testcases/kernel/syscalls/set_tid_address/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setdomainname/Makefile b/testcases/kernel/syscalls/setdomainname/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/setdomainname/Makefile +++ b/testcases/kernel/syscalls/setdomainname/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setegid/Makefile b/testcases/kernel/syscalls/setegid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/setegid/Makefile +++ b/testcases/kernel/syscalls/setegid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setfsgid/Makefile b/testcases/kernel/syscalls/setfsgid/Makefile index b59851c7..f3ab6575 100644 --- a/testcases/kernel/syscalls/setfsgid/Makefile +++ b/testcases/kernel/syscalls/setfsgid/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setfsuid/Makefile b/testcases/kernel/syscalls/setfsuid/Makefile index b59851c7..f3ab6575 100644 --- a/testcases/kernel/syscalls/setfsuid/Makefile +++ b/testcases/kernel/syscalls/setfsuid/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setgid/Makefile b/testcases/kernel/syscalls/setgid/Makefile index dc7ac891..ad6b9f57 100644 --- a/testcases/kernel/syscalls/setgid/Makefile +++ b/testcases/kernel/syscalls/setgid/Makefile @@ -16,19 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -I../utils -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +CPPFLAGS += -I$(abs_srcdir)/../utils - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setgroups/Makefile b/testcases/kernel/syscalls/setgroups/Makefile index 2067f28e..f3ab6575 100644 --- a/testcases/kernel/syscalls/setgroups/Makefile +++ b/testcases/kernel/syscalls/setgroups/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -I../utils -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sethostname/Makefile b/testcases/kernel/syscalls/sethostname/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sethostname/Makefile +++ b/testcases/kernel/syscalls/sethostname/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setitimer/Makefile b/testcases/kernel/syscalls/setitimer/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/setitimer/Makefile +++ b/testcases/kernel/syscalls/setitimer/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setpgid/Makefile b/testcases/kernel/syscalls/setpgid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/setpgid/Makefile +++ b/testcases/kernel/syscalls/setpgid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setpgrp/Makefile b/testcases/kernel/syscalls/setpgrp/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/setpgrp/Makefile +++ b/testcases/kernel/syscalls/setpgrp/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setpriority/Makefile b/testcases/kernel/syscalls/setpriority/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/setpriority/Makefile +++ b/testcases/kernel/syscalls/setpriority/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setregid/Makefile b/testcases/kernel/syscalls/setregid/Makefile index b59851c7..f3ab6575 100644 --- a/testcases/kernel/syscalls/setregid/Makefile +++ b/testcases/kernel/syscalls/setregid/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setresgid/Makefile b/testcases/kernel/syscalls/setresgid/Makefile index b59851c7..f3ab6575 100644 --- a/testcases/kernel/syscalls/setresgid/Makefile +++ b/testcases/kernel/syscalls/setresgid/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setresuid/Makefile b/testcases/kernel/syscalls/setresuid/Makefile index b59851c7..f3ab6575 100644 --- a/testcases/kernel/syscalls/setresuid/Makefile +++ b/testcases/kernel/syscalls/setresuid/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setreuid/Makefile b/testcases/kernel/syscalls/setreuid/Makefile index b59851c7..f3ab6575 100644 --- a/testcases/kernel/syscalls/setreuid/Makefile +++ b/testcases/kernel/syscalls/setreuid/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setrlimit/Makefile b/testcases/kernel/syscalls/setrlimit/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/setrlimit/Makefile +++ b/testcases/kernel/syscalls/setrlimit/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setsid/Makefile b/testcases/kernel/syscalls/setsid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/setsid/Makefile +++ b/testcases/kernel/syscalls/setsid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setsockopt/Makefile b/testcases/kernel/syscalls/setsockopt/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/setsockopt/Makefile +++ b/testcases/kernel/syscalls/setsockopt/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/settimeofday/Makefile b/testcases/kernel/syscalls/settimeofday/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/settimeofday/Makefile +++ b/testcases/kernel/syscalls/settimeofday/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setuid/Makefile b/testcases/kernel/syscalls/setuid/Makefile index b59851c7..f3ab6575 100644 --- a/testcases/kernel/syscalls/setuid/Makefile +++ b/testcases/kernel/syscalls/setuid/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/compat_16.mk - -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/compat_16.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sgetmask/Makefile b/testcases/kernel/syscalls/sgetmask/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/sgetmask/Makefile +++ b/testcases/kernel/syscalls/sgetmask/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sigaction/Makefile b/testcases/kernel/syscalls/sigaction/Makefile index b6c34e29..d4924c40 100644 --- a/testcases/kernel/syscalls/sigaction/Makefile +++ b/testcases/kernel/syscalls/sigaction/Makefile @@ -16,20 +16,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -CFLAGS += -DGLIBC_SIGACTION_BUG=1 -D_GNU_SOURCE +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CFLAGS += -DGLIBC_SIGACTION_BUG=1 -D_GNU_SOURCE -sigaction01: - $(CC) -o sigaction01 sigaction01.c $(CFLAGS) $(LDFLAGS) $(LDLIBS) -lpthread $(LOADLIBES2) +LDLIBS += -lpthread -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sigaltstack/Makefile b/testcases/kernel/syscalls/sigaltstack/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sigaltstack/Makefile +++ b/testcases/kernel/syscalls/sigaltstack/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sighold/Makefile b/testcases/kernel/syscalls/sighold/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sighold/Makefile +++ b/testcases/kernel/syscalls/sighold/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/signal/Makefile b/testcases/kernel/syscalls/signal/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/signal/Makefile +++ b/testcases/kernel/syscalls/signal/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/signalfd/Makefile b/testcases/kernel/syscalls/signalfd/Makefile index cf5a1564..bd617d80 100644 --- a/testcases/kernel/syscalls/signalfd/Makefile +++ b/testcases/kernel/syscalls/signalfd/Makefile @@ -15,16 +15,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +top_srcdir ?= ../../../.. -all: $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/signalfd4/Makefile b/testcases/kernel/syscalls/signalfd4/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/signalfd4/Makefile +++ b/testcases/kernel/syscalls/signalfd4/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sigpending/Makefile b/testcases/kernel/syscalls/sigpending/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sigpending/Makefile +++ b/testcases/kernel/syscalls/sigpending/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sigprocmask/Makefile b/testcases/kernel/syscalls/sigprocmask/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sigprocmask/Makefile +++ b/testcases/kernel/syscalls/sigprocmask/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sigrelse/Makefile b/testcases/kernel/syscalls/sigrelse/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sigrelse/Makefile +++ b/testcases/kernel/syscalls/sigrelse/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sigreturn/Makefile b/testcases/kernel/syscalls/sigreturn/Makefile deleted file mode 100644 index b5289a98..00000000 --- a/testcases/kernel/syscalls/sigreturn/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (c) International Business Machines Corp., 2009 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# - -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) diff --git a/testcases/kernel/syscalls/sigreturn/sigreturn01.c b/testcases/kernel/syscalls/sigreturn/sigreturn01.c deleted file mode 100644 index 6ba4550b..00000000 --- a/testcases/kernel/syscalls/sigreturn/sigreturn01.c +++ /dev/null @@ -1,172 +0,0 @@ -/******************************************************************************/ -/* Copyright (c) Crackerjack Project., 2007 */ -/* */ -/* This program is free software; you can redistribute it and/or modify */ -/* it under the terms of the GNU General Public License as published by */ -/* the Free Software Foundation; either version 2 of the License, or */ -/* (at your option) any later version. */ -/* */ -/* This program is distributed in the hope that it will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ -/* the GNU General Public License for more details. */ -/* */ -/* You should have received a copy of the GNU General Public License */ -/* along with this program; if not, write to the Free Software */ -/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* */ -/******************************************************************************/ -/******************************************************************************/ -/* */ -/* File: sigreturn01.c */ -/* */ -/* Description: This tests the sigreturn() syscall - sigreturn - return from signal handler and cleanup stack frame. - When the Linux kernel creates the stack frame for a signal handler, - a call to sigreturn() is inserted into the stack frame so that the - signal handler will call sigreturn() upon return. This inserted call - to sigreturn() cleans up the stack so that the process can restart - from where it was interrupted by the signal. - */ -/* */ -/* Usage: */ -/* sigreturn01 [-c n] [-e][-i n] [-I x] [-p x] [-t] */ -/* where, -c n : Run n copies concurrently. */ -/* -e : Turn on errno logging. */ -/* -i n : Execute test n times. */ -/* -I x : Execute test for x seconds. */ -/* -P x : Pause for x seconds between iterations. */ -/* -t : Turn on syscall timing. */ -/* */ -/* Total Tests: 1 */ -/* */ -/* Test Name: sigreturn01 */ -/* History: Porting from Crackerjack to LTP is done by */ -/* Manas Kumar Nayak maknayak@in.ibm.com> */ -/******************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Harness Specific Include Files. */ -#include "test.h" -#include "usctest.h" -#include "linux_syscall_numbers.h" - -/* Extern Global Variables */ -extern int Tst_count; /* counter for tst_xxx routines. */ -extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ - -/* Global Variables */ -char *TCID = "sigreturn01"; /* Test program identifier.*/ -int testno; -int TST_TOTAL = 2; /* total number of tests in this file. */ - -/* Extern Global Functions */ -/******************************************************************************/ -/* */ -/* Function: cleanup */ -/* */ -/* Description: Performs all one time clean up for this test on successful */ -/* completion, premature exit or failure. Closes all temporary */ -/* files, removes all temporary directories exits the test with */ -/* appropriate return code by calling tst_exit() function. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */ -/* On success - Exits calling tst_exit(). With '0' return code. */ -/* */ -/******************************************************************************/ -extern void cleanup() { - /* Remove tmp dir and all files in it */ - TEST_CLEANUP; - tst_rmdir(); - - /* Exit with appropriate return code. */ - tst_exit(); -} - -/* Local Functions */ -/******************************************************************************/ -/* */ -/* Function: setup */ -/* */ -/* Description: Performs all one time setup for this test. This function is */ -/* typically used to capture signals, create temporary dirs */ -/* and temporary files that may be used in the course of this */ -/* test. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits by calling cleanup(). */ -/* On success - returns 0. */ -/* */ -/******************************************************************************/ -void setup() { - /* Capture signals if any */ - /* Create temporary directories */ - TEST_PAUSE; - tst_tmpdir(); -} - - -#define PRINT(X) fprintf(stdout,"%s\n", X) - -int ngexit(void); - -int main(int ac, char **av) { - int retval = 0; - unsigned long parm = 0; - int lc; /* loop counter */ - char *msg; /* message returned from parse_opts */ - - /* parse standard options */ - if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){ - tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); - tst_exit(); - } - - setup(); - - /* Check looping state if -i option given */ - for (lc = 0; TEST_LOOPING(lc); ++lc) { - Tst_count = 0; - for (testno = 0; testno < TST_TOTAL; ++testno) { - TEST(retval = sigreturn(parm)); - if(TEST_RETURN > 0 ) { - tst_resm(TFAIL, "%s ERROR!! sigreturn never return- errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO)); - cleanup(); - tst_exit(); - } - else if (TEST_RETURN <= 0 ){ - tst_resm(TPASS, "sigreturn call succeeded: result = %d ",TEST_RETURN); - } - - parm = 0xffffffff; - TEST(retval = sigreturn(parm)); - if(TEST_RETURN > 0 ) { - tst_resm(TFAIL, "%s ERROR!! sigreturn never return- errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO)); - cleanup(); - tst_exit(); - } - else if (TEST_RETURN <= 0 ){ - tst_resm(TPASS, "sigreturn call succeeded: result = %d ",TEST_RETURN); - } - } - } - cleanup(); - tst_exit(); -} - diff --git a/testcases/kernel/syscalls/sigsuspend/Makefile b/testcases/kernel/syscalls/sigsuspend/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sigsuspend/Makefile +++ b/testcases/kernel/syscalls/sigsuspend/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/socket/Makefile b/testcases/kernel/syscalls/socket/Makefile index ad5008c3..96d779a1 100644 --- a/testcases/kernel/syscalls/socket/Makefile +++ b/testcases/kernel/syscalls/socket/Makefile @@ -16,16 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -lpthread +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +LDLIBS += -lpthread -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/socketcall/Makefile b/testcases/kernel/syscalls/socketcall/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/socketcall/Makefile +++ b/testcases/kernel/syscalls/socketcall/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/socketpair/Makefile b/testcases/kernel/syscalls/socketpair/Makefile index ad5008c3..bd457ff8 100644 --- a/testcases/kernel/syscalls/socketpair/Makefile +++ b/testcases/kernel/syscalls/socketpair/Makefile @@ -16,16 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp -lpthread +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +LDLIBS += -lpthread -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sockioctl/Makefile b/testcases/kernel/syscalls/sockioctl/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sockioctl/Makefile +++ b/testcases/kernel/syscalls/sockioctl/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/splice/Makefile b/testcases/kernel/syscalls/splice/Makefile index 3f66038e..bd617d80 100644 --- a/testcases/kernel/syscalls/splice/Makefile +++ b/testcases/kernel/syscalls/splice/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ssetmask/Makefile b/testcases/kernel/syscalls/ssetmask/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/ssetmask/Makefile +++ b/testcases/kernel/syscalls/ssetmask/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/stat/Makefile b/testcases/kernel/syscalls/stat/Makefile index 3c22a28a..bf120101 100644 --- a/testcases/kernel/syscalls/stat/Makefile +++ b/testcases/kernel/syscalls/stat/Makefile @@ -16,19 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/statfs/Makefile b/testcases/kernel/syscalls/statfs/Makefile index 3c22a28a..bf120101 100644 --- a/testcases/kernel/syscalls/statfs/Makefile +++ b/testcases/kernel/syscalls/statfs/Makefile @@ -16,19 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/statvfs/Makefile b/testcases/kernel/syscalls/statvfs/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/statvfs/Makefile +++ b/testcases/kernel/syscalls/statvfs/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/stime/Makefile b/testcases/kernel/syscalls/stime/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/stime/Makefile +++ b/testcases/kernel/syscalls/stime/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/string/Makefile b/testcases/kernel/syscalls/string/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/string/Makefile +++ b/testcases/kernel/syscalls/string/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/swapoff/Makefile b/testcases/kernel/syscalls/swapoff/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/swapoff/Makefile +++ b/testcases/kernel/syscalls/swapoff/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/swapoff/swapoff01.c b/testcases/kernel/syscalls/swapoff/swapoff01.c index 71ec3341..35c21d2f 100644 --- a/testcases/kernel/syscalls/swapoff/swapoff01.c +++ b/testcases/kernel/syscalls/swapoff/swapoff01.c @@ -78,8 +78,18 @@ #include "test.h" #include "usctest.h" #include -#include #include +#include "config.h" +#if defined(HAVE_OLD_SWAPONOFF) +#define MAX_SWAPFILES 30 +#include +#include +#elif defined(HAVE_NEW_SWAPONOFF) +#define MAX_SWAPFILES 32 +#include +#else +#error "Cannot determine what copy of swapon/swapoff you are using." +#endif static void setup(); static void cleanup(); diff --git a/testcases/kernel/syscalls/swapoff/swapoff02.c b/testcases/kernel/syscalls/swapoff/swapoff02.c index fe6851e9..98499633 100644 --- a/testcases/kernel/syscalls/swapoff/swapoff02.c +++ b/testcases/kernel/syscalls/swapoff/swapoff02.c @@ -85,7 +85,17 @@ #include "test.h" #include "usctest.h" #include +#include "config.h" +#if defined(HAVE_OLD_SWAPONOFF) +#define MAX_SWAPFILES 30 #include +#include +#elif defined(HAVE_NEW_SWAPONOFF) +#define MAX_SWAPFILES 32 +#include +#else +#error "Cannot determine what copy of swapon/swapoff you are using." +#endif static void setup(); static void cleanup(); diff --git a/testcases/kernel/syscalls/swapon/Makefile b/testcases/kernel/syscalls/swapon/Makefile index 42770f23..7ff50f19 100644 --- a/testcases/kernel/syscalls/swapon/Makefile +++ b/testcases/kernel/syscalls/swapon/Makefile @@ -16,22 +16,13 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -NEEDSPECIAL:=$(shell echo MAX_SWAPFILES | $(CC) -E -xc -include linux/swap.h 2>/dev/null - | tail -n 1 | grep 32; echo $?) -ifeq ($(strip $(NEEDSPECIAL)),) -export CFLAGS+=-I../../../../include -g -Wall -else -export CFLAGS+=-I../../../../include -g -Wall -DOLDER_DISTRO_RELEASE +NEEDSPECIAL := $(shell echo MAX_SWAPFILES | $(CC) -E -xc -include linux/swap.h 2>/dev/null - | tail -n 1 | grep 32; echo $?) +ifneq ($(strip $(NEEDSPECIAL)),) +export CFLAGS += -DOLDER_DISTRO_RELEASE endif -LDLIBS+= -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/swapon/swapon01.c b/testcases/kernel/syscalls/swapon/swapon01.c index e0c57196..502ce39f 100644 --- a/testcases/kernel/syscalls/swapon/swapon01.c +++ b/testcases/kernel/syscalls/swapon/swapon01.c @@ -74,11 +74,21 @@ *****************************************************************************/ #include +#include +#include #include "test.h" #include "usctest.h" -#include +#include "config.h" +#if defined(HAVE_OLD_SWAPONOFF) +#define MAX_SWAPFILES 30 #include -#include +#include +#elif defined(HAVE_NEW_SWAPONOFF) +#define MAX_SWAPFILES 32 +#include +#else +#error "Cannot determine what copy of swapon/swapoff you are using." +#endif static void setup(); static void cleanup(); diff --git a/testcases/kernel/syscalls/swapon/swapon02.c b/testcases/kernel/syscalls/swapon/swapon02.c index 86fe7f94..4d9bb993 100644 --- a/testcases/kernel/syscalls/swapon/swapon02.c +++ b/testcases/kernel/syscalls/swapon/swapon02.c @@ -89,10 +89,6 @@ #include #include #include -#include -#ifdef OLDER_DISTRO_RELEASE -#include -#endif #include #include #include @@ -100,9 +96,16 @@ #include #include "test.h" #include "usctest.h" - -#ifndef OLDER_DISTRO_RELEASE +#include "config.h" +#if defined(HAVE_OLD_SWAPONOFF) +#define MAX_SWAPFILES 30 +#include +#include +#elif defined(HAVE_NEW_SWAPONOFF) #define MAX_SWAPFILES 32 +#include +#else +#error "Cannot determine what copy of swapon/swapoff you are using." #endif static void setup(); diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c index 46cd7d52..b2eb3231 100644 --- a/testcases/kernel/syscalls/swapon/swapon03.c +++ b/testcases/kernel/syscalls/swapon/swapon03.c @@ -64,10 +64,6 @@ #include #include #include -#include -#ifdef OLDER_DISTRO_RELEASE -#include -#endif #include #include #include @@ -75,9 +71,17 @@ #include #include "test.h" #include "usctest.h" - -/* This handle when we have MAX_SWAPFILES = 30 or 32 */ -#define TEST_MAX_SWAPFILES 30 +#include "config.h" +#if defined(HAVE_OLD_SWAPONOFF) +#define MAX_SWAPFILES 30 +#include +#include +#elif defined(HAVE_NEW_SWAPONOFF) +#define MAX_SWAPFILES 32 +#include +#else +#error "Cannot determine what copy of swapon/swapoff you are using." +#endif void setup(); void cleanup(); @@ -261,9 +265,9 @@ int setup_swap() } /* Determine how many more files are to be created */ - swapfiles = TEST_MAX_SWAPFILES - swapfiles; - if (swapfiles > TEST_MAX_SWAPFILES) { - swapfiles = TEST_MAX_SWAPFILES; + swapfiles = MAX_SWAPFILES - swapfiles; + if (swapfiles > MAX_SWAPFILES) { + swapfiles = MAX_SWAPFILES; } /* args for dd */ diff --git a/testcases/kernel/syscalls/switch/Makefile b/testcases/kernel/syscalls/switch/Makefile dissimilarity index 72% index 9acf426a..504042e1 100644 --- a/testcases/kernel/syscalls/switch/Makefile +++ b/testcases/kernel/syscalls/switch/Makefile @@ -1,32 +1,23 @@ -################################################################################# -# Copyright (c) International Business Machines Corp., 2008 # -# # -# This program is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See # -# the GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program; if not, write to the Free Software # -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -################################################################################# - - -CFLAGS += -I../../../../include -Wall -LDLIBS+= -L../../../../lib -lltp - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +# +# Copyright (c) International Business Machines Corp., 2008 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/symlink/Makefile b/testcases/kernel/syscalls/symlink/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/symlink/Makefile +++ b/testcases/kernel/syscalls/symlink/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/symlinkat/Makefile b/testcases/kernel/syscalls/symlinkat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/symlinkat/Makefile +++ b/testcases/kernel/syscalls/symlinkat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sync/Makefile b/testcases/kernel/syscalls/sync/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sync/Makefile +++ b/testcases/kernel/syscalls/sync/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sync_file_range/Makefile b/testcases/kernel/syscalls/sync_file_range/Makefile index 0353bbfd..bd617d80 100644 --- a/testcases/kernel/syscalls/sync_file_range/Makefile +++ b/testcases/kernel/syscalls/sync_file_range/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/syscall/Makefile b/testcases/kernel/syscalls/syscall/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/syscall/Makefile +++ b/testcases/kernel/syscalls/syscall/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sysconf/Makefile b/testcases/kernel/syscalls/sysconf/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sysconf/Makefile +++ b/testcases/kernel/syscalls/sysconf/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sysctl/Makefile b/testcases/kernel/syscalls/sysctl/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sysctl/Makefile +++ b/testcases/kernel/syscalls/sysctl/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sysfs/Makefile b/testcases/kernel/syscalls/sysfs/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sysfs/Makefile +++ b/testcases/kernel/syscalls/sysfs/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sysinfo/Makefile b/testcases/kernel/syscalls/sysinfo/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/sysinfo/Makefile +++ b/testcases/kernel/syscalls/sysinfo/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/syslog/Makefile b/testcases/kernel/syscalls/syslog/Makefile index 932d419d..eda3f38b 100644 --- a/testcases/kernel/syscalls/syslog/Makefile +++ b/testcases/kernel/syscalls/syslog/Makefile @@ -16,17 +16,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) -SCRIPTS = syslog01 syslog02 syslog03 syslog04 syslog05 syslog06 syslog07 syslog08 syslog09 syslog10 +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +# Not all of the files are bourne shell scripts; hence, I removed the syslog* +# glob to avoid overridden target command noise from make. +INSTALL_TARGETS := syslog0* syslog10 -install: - @set -e; for i in $(TARGETS) $(SCRIPTS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/tee/Makefile b/testcases/kernel/syscalls/tee/Makefile index 3f66038e..bd617d80 100644 --- a/testcases/kernel/syscalls/tee/Makefile +++ b/testcases/kernel/syscalls/tee/Makefile @@ -16,18 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/time/Makefile b/testcases/kernel/syscalls/time/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/time/Makefile +++ b/testcases/kernel/syscalls/time/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/timer_getoverrun/Makefile b/testcases/kernel/syscalls/timer_getoverrun/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/timer_getoverrun/Makefile +++ b/testcases/kernel/syscalls/timer_getoverrun/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/timer_gettime/Makefile b/testcases/kernel/syscalls/timer_gettime/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/timer_gettime/Makefile +++ b/testcases/kernel/syscalls/timer_gettime/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/timerfd/Makefile b/testcases/kernel/syscalls/timerfd/Makefile index efbf280d..3691a8c3 100644 --- a/testcases/kernel/syscalls/timerfd/Makefile +++ b/testcases/kernel/syscalls/timerfd/Makefile @@ -16,16 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lrt -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +LDLIBS += -lpthread -lrt -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/times/Makefile b/testcases/kernel/syscalls/times/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/times/Makefile +++ b/testcases/kernel/syscalls/times/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/times/times01.c b/testcases/kernel/syscalls/times/times01.c index b732a324..69c5f651 100644 --- a/testcases/kernel/syscalls/times/times01.c +++ b/testcases/kernel/syscalls/times/times01.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: times01.c,v 1.5 2009/03/23 13:36:13 subrata_modak Exp $ */ +/* $Id: times01.c,v 1.6 2009/10/26 14:55:48 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -171,7 +171,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "times(&mytimes) returned %d", + tst_resm(TPASS, "times(&mytimes) returned %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/times/times03.c b/testcases/kernel/syscalls/times/times03.c index 22b8a3d2..bb3d1ebd 100644 --- a/testcases/kernel/syscalls/times/times03.c +++ b/testcases/kernel/syscalls/times/times03.c @@ -144,13 +144,14 @@ int main(int argc, char **argv) } if (buf1.tms_cutime != 0) { tst_resm(TFAIL, "Error: times() report " - "%d child user time", buf1.tms_cutime); + "%ld child user time", + buf1.tms_cutime); fail = 1; } if (buf1.tms_cstime != 0) { tst_resm(TFAIL, "Error: times() report " - "%d child system time", + "%ld child system time", buf1.tms_cstime); fail = 1; } @@ -205,22 +206,22 @@ int main(int argc, char **argv) } if (buf1.tms_utime > buf2.tms_utime) { tst_resm(TFAIL, "Error: parents's " - "user time(%d) before child " - "> parent's user time (%d) " + "user time(%ld) before child " + "> parent's user time (%ld) " "after child", buf1.tms_utime, buf2.tms_utime); fail = 1; } if (buf2.tms_cutime == 0) { tst_resm(TFAIL, "Error: times() " - "report %d child user " + "report %ld child user " "time should be > than " "zero", buf2.tms_cutime); fail = 1; } if (buf2.tms_cstime == 0) { tst_resm(TFAIL, "Error: times() " - "report %d child system time " + "report %ld child system time " "should be > than zero", buf2.tms_cstime); fail = 1; diff --git a/testcases/kernel/syscalls/tkill/Makefile b/testcases/kernel/syscalls/tkill/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/tkill/Makefile +++ b/testcases/kernel/syscalls/tkill/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/truncate/Makefile b/testcases/kernel/syscalls/truncate/Makefile index fb023553..bf120101 100644 --- a/testcases/kernel/syscalls/truncate/Makefile +++ b/testcases/kernel/syscalls/truncate/Makefile @@ -16,20 +16,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -include ../utils/newer_64.mk -%_64: CFLAGS += -D_FILE_OFFSET_BITS=64 +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../utils/newer_64.mk -SRCS = $(wildcard *.c) -TARGETS += $(patsubst %.c,%,$(SRCS)) +%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ulimit/Makefile b/testcases/kernel/syscalls/ulimit/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/ulimit/Makefile +++ b/testcases/kernel/syscalls/ulimit/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/umask/Makefile b/testcases/kernel/syscalls/umask/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/umask/Makefile +++ b/testcases/kernel/syscalls/umask/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/umount/Makefile b/testcases/kernel/syscalls/umount/Makefile index dc9c6930..f1e48b38 100644 --- a/testcases/kernel/syscalls/umount/Makefile +++ b/testcases/kernel/syscalls/umount/Makefile @@ -16,17 +16,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +INSTALL_TARGETS := test_umount -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - ln -f test_umount ../../../bin/ - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/uname/Makefile b/testcases/kernel/syscalls/uname/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/uname/Makefile +++ b/testcases/kernel/syscalls/uname/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/unlink/Makefile b/testcases/kernel/syscalls/unlink/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/unlink/Makefile +++ b/testcases/kernel/syscalls/unlink/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/unlinkat/Makefile b/testcases/kernel/syscalls/unlinkat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/unlinkat/Makefile +++ b/testcases/kernel/syscalls/unlinkat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/unshare/Makefile b/testcases/kernel/syscalls/unshare/Makefile index b5289a98..2ef86f06 100644 --- a/testcases/kernel/syscalls/unshare/Makefile +++ b/testcases/kernel/syscalls/unshare/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ustat/Makefile b/testcases/kernel/syscalls/ustat/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/ustat/Makefile +++ b/testcases/kernel/syscalls/ustat/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/utils/compat_16.mk b/testcases/kernel/syscalls/utils/compat_16.mk index de825e33..59bc01a4 100644 --- a/testcases/kernel/syscalls/utils/compat_16.mk +++ b/testcases/kernel/syscalls/utils/compat_16.mk @@ -27,7 +27,7 @@ # assume the source file name for fooN is fooN.c. # On the above assumption, this file does: # -# * adding fooN_16 as TARGETS, +# * adding fooN_16 as MAKE_TARGETS, # * making *.c depend on compat_16.h if the header file exists, # * adding rules to build fooN_16 from fooN.c (and compat_16.h), and # * passing a cpp symbol TST_USE_COMPAT16_SYSCALL to @@ -44,29 +44,39 @@ # 4. don't forget putting compat_16.h in all fooN.c # if you introduced compat_16.h. # 5. include this file compat_16.mk in your Makefile. -# 6. use `+=' instead of `=' as assignment operator for TARGETS. +# 6. use `+=' instead of `=' as assignment operator for MAKE_TARGETS. # 7. Added extra definitions to CFLAGS in %_16 target if needed. # # See Makefile of setuid test case. # -TARGETS_16 = $(patsubst %.c,%_16,$(SRCS)) + +CPPFLAGS += -I$(abs_srcdir) -I$(abs_srcdir)/../utils + +SRCS ?= $(wildcard $(abs_srcdir)/*.c) + +MAKE_TARGETS := $(notdir $(patsubst %.c,%,$(SRCS))) + ifneq ($(TST_COMPAT_16_SYSCALL),no) -TARGETS += $(TARGETS_16) +MAKE_TARGETS += $(addsuffix _16,$(MAKE_TARGETS)) endif -DEF_16 = TST_USE_COMPAT16_SYSCALL -COMPAT_16_H = compat_16.h -HAS_COMPAT_16 := $(shell if [ -f $(COMPAT_16_H) ]; then \ - echo yes; \ - else \ - echo no; \ - fi) +# XXX (garrcoop): This code should be put in question as it cannot be applied +# (no .h file, no TST_USE_NEWER64_SYSCALL def). +DEF_16 := TST_USE_COMPAT16_SYSCALL +COMPAT_16_H := $(abs_srcdir)/../utils/compat_16.h + +ifneq ($(wildcard $(COMPAT_16_H)),) +HAS_COMPAT_16 := 1 -ifeq ($(HAS_COMPAT_16),yes) %.c: $(COMPAT_16_H) + +else +HAS_COMPAT_16 := 0 endif +%_16: CPPFLAGS += -D$(DEF_16)=1 +# XXX (garrcoop): End section of code in question.. + %_16.o: %.c $(COMPILE.c) $(OUTPUT_OPTION) $< -%_16: CFLAGS += -D$(DEF_16)=1 diff --git a/testcases/kernel/syscalls/utils/compat_uid.h b/testcases/kernel/syscalls/utils/compat_uid.h new file mode 100644 index 00000000..24a407db --- /dev/null +++ b/testcases/kernel/syscalls/utils/compat_uid.h @@ -0,0 +1,51 @@ +/* + * + * Copyright (c) Red Hat Inc., 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* Author: Masatake YAMATO */ + +#ifndef __COMPAT_UID_16_H__ +#define __COMPAT_UID_16_H__ + + +#include + + +#ifdef TST_USE_COMPAT16_SYSCALL +typedef __kernel_old_uid_t UID_T; +int +UID_SIZE_CHECK(uid_t uid) +{ + /* See high2lowuid in linux/highuid.h + Return 0 if uid is too large to store + it to __kernel_old_uid_t. */ + return ((uid) & ~0xFFFF)? 0: 1; +} + +#else + +typedef uid_t UID_T; +int +UID_SIZE_CHECK(uid_t uid) +{ + return 1; +} + +#endif + +#endif /* __SETUID_COMPAT_16_H__ */ diff --git a/testcases/kernel/syscalls/utils/newer_64.mk b/testcases/kernel/syscalls/utils/newer_64.mk index fd050636..ead21f82 100644 --- a/testcases/kernel/syscalls/utils/newer_64.mk +++ b/testcases/kernel/syscalls/utils/newer_64.mk @@ -23,25 +23,33 @@ # as compat_16.mk does on foo16. See both compat_16.mk # and Makefile for fadvise test case. -TARGETS_64 = $(patsubst %.c,%_64,$(SRCS)) +CPPFLAGS += -I$(abs_srcdir) -I$(abs_srcdir)/../utils + +SRCS ?= $(wildcard $(abs_srcdir)/*.c) + +MAKE_TARGETS := $(notdir $(patsubst %.c,%,$(SRCS))) ifneq ($(TST_NEWER_64_SYSCALL),no) -TARGETS += $(TARGETS_64) +MAKE_TARGETS += $(addsuffix _64,$(MAKE_TARGETS)) endif -DEF_64 = TST_USE_NEWER64_SYSCALL -NEWER_64_H = newer_64.h -HAS_NEWER_64 := $(shell if [ -f $(NEWER_64_H) ]; then \ - echo yes; \ - else \ - echo no; \ - fi) +# XXX (garrcoop): This code should be put in question as it cannot be applied +# (no .h file, no TST_USE_NEWER64_SYSCALL def). +DEF_64 := TST_USE_NEWER64_SYSCALL +NEWER_64_H := $(abs_srcdir)/../utils/newer_64.h + +ifneq ($(wildcard $(NEWER_64_H)),) +HAS_NEWER_64 := 1 -ifeq ($(HAS_NEWER_64),yes) %.c: $(NEWER_64_H) + +else +HAS_NEWER_64 := 0 endif +%_64: CFLAGS += -D$(DEF_64)=1 +# XXX (garrcoop): End section of code in question.. + %_64.o: %.c $(COMPILE.c) $(OUTPUT_OPTION) $< -%_64: CFLAGS += -D$(DEF_64)=1 diff --git a/testcases/kernel/syscalls/utime/Makefile b/testcases/kernel/syscalls/utime/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/utime/Makefile +++ b/testcases/kernel/syscalls/utime/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/utimensat/Makefile b/testcases/kernel/syscalls/utimensat/Makefile index 443265ae..172a0ba1 100644 --- a/testcases/kernel/syscalls/utimensat/Makefile +++ b/testcases/kernel/syscalls/utimensat/Makefile @@ -16,25 +16,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: - @set -e; $(MAKE) check_for_utimensat_support; - $(MAKE) utimensat01; +$(eval $(call generate_vpath_rule,c,$(srcdir):$(top_srcdir)/lib)) -check_for_utimensat_support: check_for_utimensat_support.c - $(CC) $(CFLAGS) -o $@ $< ../../../../lib/tst_kvercmp.c -I../../../../include +INSTALL_TARGETS := utimensat_tests.sh -install: - @set -e; \ - chmod 755 utimensat_tests.sh; \ - ln -f utimensat_tests.sh ../../../bin/utimensat_tests.sh; \ - for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) - rm -rf check_for_utimensat_support +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/utimensat/check_for_utimensat_support.c b/testcases/kernel/syscalls/utimensat/check_for_utimensat_support.c deleted file mode 100644 index 8b9f719e..00000000 --- a/testcases/kernel/syscalls/utimensat/check_for_utimensat_support.c +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include - -int kernel_support_available(void) -{ - if (tst_kvercmp(2, 6, 22) < 0) - return 1; - return 0; -} - -int main() -{ - exit(kernel_support_available()); -} diff --git a/testcases/kernel/syscalls/utimes/Makefile b/testcases/kernel/syscalls/utimes/Makefile index 0d24c355..2ef86f06 100644 --- a/testcases/kernel/syscalls/utimes/Makefile +++ b/testcases/kernel/syscalls/utimes/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -O2 -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/utimes/utimes01.c b/testcases/kernel/syscalls/utimes/utimes01.c index 390b5723..ae2fa2db 100644 --- a/testcases/kernel/syscalls/utimes/utimes01.c +++ b/testcases/kernel/syscalls/utimes/utimes01.c @@ -191,8 +191,6 @@ static struct test_case tcase[] = { }, { // case02 .ttype = NORMAL, - .a_sec = 1000, - .m_sec = 2000, .user = "nobody", .ret = -1, .err = EACCES, // RHEL4U1 + 2.6.18 returns EPERM @@ -270,9 +268,13 @@ static int do_test(struct test_case *tc) const char *dummy = NULL; TEST(sys_ret = utimes(dummy, tv)); } - else - TEST(sys_ret = utimes(fpath, tv)); - sys_errno = errno; + else { + if (tc->user == NULL) + TEST(sys_ret = utimes(fpath, tv)); + else + TEST(sys_ret = utimes(fpath, (struct timeval *)NULL)); + } + sys_errno = errno; if (tc->ttype == FILE_NOT_EXIST) fpath[len - 1] = c; if (sys_ret < 0) diff --git a/testcases/kernel/syscalls/vfork/Makefile b/testcases/kernel/syscalls/vfork/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/vfork/Makefile +++ b/testcases/kernel/syscalls/vfork/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/vhangup/Makefile b/testcases/kernel/syscalls/vhangup/Makefile index 9b3299f6..bd617d80 100644 --- a/testcases/kernel/syscalls/vhangup/Makefile +++ b/testcases/kernel/syscalls/vhangup/Makefile @@ -16,17 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. +include $(top_srcdir)/include/mk/testcases.mk -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/vmsplice/Makefile b/testcases/kernel/syscalls/vmsplice/Makefile index dbc7de30..bd617d80 100644 --- a/testcases/kernel/syscalls/vmsplice/Makefile +++ b/testcases/kernel/syscalls/vmsplice/Makefile @@ -16,17 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -I../../../kernel/include -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/wait/Makefile b/testcases/kernel/syscalls/wait/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/wait/Makefile +++ b/testcases/kernel/syscalls/wait/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/wait/wait02.c b/testcases/kernel/syscalls/wait/wait02.c index 77716f38..ef6e517a 100644 --- a/testcases/kernel/syscalls/wait/wait02.c +++ b/testcases/kernel/syscalls/wait/wait02.c @@ -30,7 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ -/* $Id: wait02.c,v 1.6 2009/03/23 13:36:15 subrata_modak Exp $ */ +/* $Id: wait02.c,v 1.7 2009/10/26 14:55:48 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. @@ -182,7 +182,7 @@ int main(int ac, char **av) ***************************************************************/ if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ - tst_resm(TPASS, "wait(&ret_code) returned %d", + tst_resm(TPASS, "wait(&ret_code) returned %ld", TEST_RETURN); } } diff --git a/testcases/kernel/syscalls/wait4/Makefile b/testcases/kernel/syscalls/wait4/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/wait4/Makefile +++ b/testcases/kernel/syscalls/wait4/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/waitid/Makefile b/testcases/kernel/syscalls/waitid/Makefile index 1ebe5d56..2ef86f06 100644 --- a/testcases/kernel/syscalls/waitid/Makefile +++ b/testcases/kernel/syscalls/waitid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/waitpid/Makefile b/testcases/kernel/syscalls/waitpid/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/waitpid/Makefile +++ b/testcases/kernel/syscalls/waitpid/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/write/Makefile b/testcases/kernel/syscalls/write/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/write/Makefile +++ b/testcases/kernel/syscalls/write/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/writev/Makefile b/testcases/kernel/syscalls/writev/Makefile index 6706403a..bd617d80 100644 --- a/testcases/kernel/syscalls/writev/Makefile +++ b/testcases/kernel/syscalls/writev/Makefile @@ -16,16 +16,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -LDLIBS += -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/timers/Makefile b/testcases/kernel/timers/Makefile dissimilarity index 98% index 377cc2ac..69c4e85e 100644 --- a/testcases/kernel/timers/Makefile +++ b/testcases/kernel/timers/Makefile @@ -1,25 +1,27 @@ -# -# Copyright (c) International Business Machines Corp., 2001 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# - -SUBDIRS = $(patsubst %/Makefile,%,$(wildcard */Makefile)) - -all %:: - @set -e; \ - for i in $(SUBDIRS); do \ - $(MAKE) -C $$i $@; \ - done +# +# testcases/kernel/timers 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/timers/clock_gettime/Makefile b/testcases/kernel/timers/clock_gettime/Makefile index 88a08023..173ce50c 100644 --- a/testcases/kernel/timers/clock_gettime/Makefile +++ b/testcases/kernel/timers/clock_gettime/Makefile @@ -16,16 +16,14 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -I../include -D_GNU_SOURCE -LDLIBS += -L ../../../../lib -lpthread -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CFLAGS += -D_GNU_SOURCE -install: - set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; +CPPFLAGS += -I$(abs_srcdir)/../include -clean: - rm -f $(TARGETS) +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/timers/clock_settime/Makefile b/testcases/kernel/timers/clock_settime/Makefile index 88a08023..173ce50c 100644 --- a/testcases/kernel/timers/clock_settime/Makefile +++ b/testcases/kernel/timers/clock_settime/Makefile @@ -16,16 +16,14 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -I../include -D_GNU_SOURCE -LDLIBS += -L ../../../../lib -lpthread -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CFLAGS += -D_GNU_SOURCE -install: - set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; +CPPFLAGS += -I$(abs_srcdir)/../include -clean: - rm -f $(TARGETS) +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/timers/timer_create/Makefile b/testcases/kernel/timers/timer_create/Makefile index 88a08023..173ce50c 100644 --- a/testcases/kernel/timers/timer_create/Makefile +++ b/testcases/kernel/timers/timer_create/Makefile @@ -16,16 +16,14 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -I../include -D_GNU_SOURCE -LDLIBS += -L ../../../../lib -lpthread -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CFLAGS += -D_GNU_SOURCE -install: - set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; +CPPFLAGS += -I$(abs_srcdir)/../include -clean: - rm -f $(TARGETS) +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/timers/timer_delete/Makefile b/testcases/kernel/timers/timer_delete/Makefile index 88a08023..173ce50c 100644 --- a/testcases/kernel/timers/timer_delete/Makefile +++ b/testcases/kernel/timers/timer_delete/Makefile @@ -16,16 +16,14 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -I../include -D_GNU_SOURCE -LDLIBS += -L ../../../../lib -lpthread -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CFLAGS += -D_GNU_SOURCE -install: - set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; +CPPFLAGS += -I$(abs_srcdir)/../include -clean: - rm -f $(TARGETS) +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/timers/timer_settime/Makefile b/testcases/kernel/timers/timer_settime/Makefile index 88a08023..173ce50c 100644 --- a/testcases/kernel/timers/timer_settime/Makefile +++ b/testcases/kernel/timers/timer_settime/Makefile @@ -16,16 +16,14 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -CFLAGS += -I../../../../include -Wall -I../include -D_GNU_SOURCE -LDLIBS += -L ../../../../lib -lpthread -lltp +top_srcdir ?= ../../../.. -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CFLAGS += -D_GNU_SOURCE -install: - set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ; +CPPFLAGS += -I$(abs_srcdir)/../include -clean: - rm -f $(TARGETS) +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/lib/Makefile b/testcases/lib/Makefile new file mode 100644 index 00000000..88c7344f --- /dev/null +++ b/testcases/lib/Makefile @@ -0,0 +1,31 @@ +# +# testcases library Makefile (differs from lib/). +# +# 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. +# +# Garrett Cooper, August 2009 +# + +top_srcdir ?= ../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/lib/cmdlib.sh b/testcases/lib/cmdlib.sh new file mode 100644 index 00000000..8b90a36b --- /dev/null +++ b/testcases/lib/cmdlib.sh @@ -0,0 +1,151 @@ +#!/bin/sh +# +# Command library that provides a boilerplate set of functions and variables +# required for all bourne shell based scripts. +# +# 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. +# +# Garrett Cooper, August 2009 +# + +set -u + +export SHELL_DEBUG=${SHELL_DEBUG:=0} +if [ "x$SHELL_DEBUG" = x1 ] ; then + set -x +fi + +#============================================================================= +# FUNCTION: tst_cleanup +# PURPOSE: Clean up after a testcase. +#============================================================================= +tst_cleanup() +{ + # Disable the trap EXIT handler. + trap '' EXIT + # To ensure set -u passes... + TCtmp=${TCtmp:=} + tst_resm TINFO "Cleaning up." + # Nuke the testcase temporary directory if it exists. + [ -d "$TCtmp" ] && rm -rf "$TCtmp" +} + +#============================================================================= +# FUNCTION: setup +# PURPOSE: Setup the test environment. +#============================================================================= +tst_setup() { + + TST_COUNT=1 + TST_TOTAL=${TST_TOTAL:=1} + export TCID TST_COUNT TST_TOTAL + + for varname in TST_TOTAL; do + if eval "test -z \"\$${varname}\""; then + end_testcase "You must set ${varname} before calling setup()." + fi + done + + LTPROOT=${LTPROOT:="../../../../"} + TEMPDIR=${TEMPDIR:=/tmp} + + TCtmp=${TCtmp:=$TEMPDIR/$TC$$} + # User wants a temporary sandbox to play with. + if [ -n "$TCtmp" -a "$TCtmp" != "$TEMPDIR/$$" ] ; then + test -d "$TCtmp" || mkdir -p "$TCtmp" + # Clean up on exit. + trap tst_cleanup EXIT + fi + +} + +#============================================================================= +# FUNCTION NAME: end_testcase +# +# FUNCTION DESCRIPTION: Print out whether or not a test failed. Do not use +# this when TBROK messages should be applied. +# +# PARAMETERS: Failure message, or "" / unset if passed. +# +# RETURNS: None. +#============================================================================= +end_testcase() +{ + tst_cleanup + if [ $# -eq 0 ]; then + tst_resm TPASS "Test successful" + else + tst_resm TFAIL "Test broken: $*" + exit 1 + fi +} + +#============================================================================= +# FUNCTION: exists +# PURPOSE: Check if command(s) used by this test script exist. +#============================================================================= +exists() +{ + for cmd in "$@"; do + if ! type $cmd 2>&1 1>/dev/null; then + end_testcase "$cmd: command not found" + exit 1 + fi + done +} + +incr_tst_count() +{ + : $(( TST_COUNT += 1 )) +} + +is_root() +{ + [ "x$(id -ru)" = x0 ] +} + +# +# $0 is maintained by the caller script; tested on FreeBSD (ash) and Gentoo +# GNU/Linux (bash) -- assuming you aren't calling this from another function +# or command: +# +# foo.sh: +# echo ${0##*/} +# . ${$0%%*}/bar.sh +# bar.sh: +# echo ${0##*/} +# echo $SHELL +# +# Gentoo: +# gcooper@orangebox ~/Desktop $ ./foo.sh +# foo.sh +# foo.sh +# /bin/bash +# gcooper@orangebox ~/Desktop $ uname -sr +# Linux 2.6.29-gentoo-r5 +# +# FreeBSD: +# $ ./foo.sh +# foo.sh +# foo.sh +# /bin/sh +# $ uname -sr +# FreeBSD 8.0-BETA2 +# +TCID=${TCID:=} +[ -z "$TCID" ] && TCID=${0##*/} +TC=$(echo "$TCID" | awk '{ sub( /[0-9]+$/,""); print; }') diff --git a/testcases/lib/net_cmdlib.sh b/testcases/lib/net_cmdlib.sh new file mode 100644 index 00000000..d3488f93 --- /dev/null +++ b/testcases/lib/net_cmdlib.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# +# An extension to cmdlib.sh, purely for networking based commands. +# +# 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. +# +# Garrett Cooper, August 2009 +# + +. cmdlib.sh + +# Blank for an IPV4 test; 6 for an IPV6 test. +EXEC_SUFFIX= + +read_opts() +{ + while getopts "6" opt; do + case "$opt" in + 6) + EXEC_SUFFIX=6;; + *) + echo "Setup 0 : FAIL Unknown option: $opt" + exit 1;; + esac + done +} diff --git a/testcases/misc/Makefile b/testcases/misc/Makefile dissimilarity index 98% index 581e41ae..3c70bd33 100644 --- a/testcases/misc/Makefile +++ b/testcases/misc/Makefile @@ -1,11 +1,27 @@ -SUBDIRS = crash f00f math tcore_patch_test_suites - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - +# +# misc test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/misc/crash/Makefile b/testcases/misc/crash/Makefile dissimilarity index 98% index 0432f579..26350eac 100644 --- a/testcases/misc/crash/Makefile +++ b/testcases/misc/crash/Makefile @@ -1,37 +1,27 @@ -# -# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -########################################################################### -# name of file : Makefile # -# description : make(1) description file for the send(2) tests. # -########################################################################### -CFLAGS+= -I../../../include -LOADLIBES+= -L../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) - - +# +# misc/crash test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/misc/crash/crash02.c b/testcases/misc/crash/crash02.c index 9ade84c2..1d139289 100644 --- a/testcases/misc/crash/crash02.c +++ b/testcases/misc/crash/crash02.c @@ -486,16 +486,31 @@ in_blacklist (int sysno) int i; const list[] = { -#ifdef __ia64__ +#if defined(__ia64__) SYS_clone2, #else - /* No SYS_fork(vfork) on IA-64. Instead, it uses, - clone(child_stack=0, flags=CLONE_VM|CLONE_VFORK|SIGCHLD) - clone2() */ + /* + * No SYS_fork(vfork) on IA-64. Instead, it uses, + * clone(child_stack=0, flags=CLONE_VM|CLONE_VFORK|SIGCHLD) + * clone2() + */ + + /* + * NOTE (garrcoop): + * Could not find reference to SYS_fork(vfork) on mips32 + * with the Montavista / Octeon toolchain. Need to develop an + * autoconf check for this item. + */ +#if defined(__NR_vfork) && __NR_vfork SYS_vfork, +#endif +#if defined(__NR_fork) && __NR_fork SYS_fork, +#endif #endif /* __ia64__ */ +#if defined(__NR_clone) && __NR_clone SYS_clone, +#endif -1 }; diff --git a/testcases/misc/f00f/Makefile b/testcases/misc/f00f/Makefile dissimilarity index 98% index 0432f579..7645de47 100644 --- a/testcases/misc/f00f/Makefile +++ b/testcases/misc/f00f/Makefile @@ -1,37 +1,29 @@ -# -# Copyright (c) International Business Machines Corp., 2001 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -########################################################################### -# name of file : Makefile # -# description : make(1) description file for the send(2) tests. # -########################################################################### -CFLAGS+= -I../../../include -LOADLIBES+= -L../../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) - - +# +# misc/f00f test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LDLIBS += -lm + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/misc/math/Makefile b/testcases/misc/math/Makefile dissimilarity index 98% index e5ec0f4c..991ff5aa 100644 --- a/testcases/misc/math/Makefile +++ b/testcases/misc/math/Makefile @@ -1,11 +1,27 @@ -SUBDIRS = abs atof float fptests nextafter - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - +# +# misc/math test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/misc/math/abs/Makefile b/testcases/misc/math/abs/Makefile index d654861b..c1e4c198 100644 --- a/testcases/misc/math/abs/Makefile +++ b/testcases/misc/math/abs/Makefile @@ -16,21 +16,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -########################################################################### -# name of file : Makefile # -########################################################################### -CFLAGS+= -I../../../../include -O -g -Wall -LOADLIBES+= -lm -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +LDLIBS += -lm +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/misc/math/atof/Makefile b/testcases/misc/math/atof/Makefile index d654861b..c1e4c198 100644 --- a/testcases/misc/math/atof/Makefile +++ b/testcases/misc/math/atof/Makefile @@ -16,21 +16,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -########################################################################### -# name of file : Makefile # -########################################################################### -CFLAGS+= -I../../../../include -O -g -Wall -LOADLIBES+= -lm -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +LDLIBS += -lm +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/misc/math/float/Makefile b/testcases/misc/math/float/Makefile dissimilarity index 98% index 9b46b79a..f52f2033 100644 --- a/testcases/misc/math/float/Makefile +++ b/testcases/misc/math/float/Makefile @@ -1,20 +1,32 @@ -CFLAGS+= -I../../../../include -Wall -g -LOADLIBES+= -lpthread -lm -L../../../../lib -lltp - -SRCS=$(wildcard float*.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -SUBDIRS=bessel exp_log iperb power trigo - -all: $(TARGETS) - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - rm -f $(TARGETS) - @set -e; for i in $(TARGETS); do rm -rf ../../../bin/$$i ; done - +# +# misc/math/float test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +LDLIBS += -lpthread -lm + +# main.c doesn't compile... +MAKE_TARGETS := $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/float*.c)) + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/misc/math/float/bessel/Makefile b/testcases/misc/math/float/bessel/Makefile dissimilarity index 99% index 9c0d6d85..df31dc4c 100644 --- a/testcases/misc/math/float/bessel/Makefile +++ b/testcases/misc/math/float/bessel/Makefile @@ -1,19 +1,31 @@ -CFLAGS += -Wall -LOADLIBES = -lm -BIN = genj0 genj1 geny0 geny1 genlgamma genbessel -REF = gamma_inp.ref gamma_out.ref gamma_sign.ref j0_inp.ref j1_inp.ref y0_inp.ref y1_inp.ref -REF2 = j0_out.ref2 j1_out.ref2 y0_out.ref2 y1_out.ref2 - -all: $(BIN) - - -clean: - rm -f $(BIN) - @set -e; for i in $(BIN); do rm -f ../../../../bin/$$i ; done - rm -f *.ref - @set -e; for i in $(REF); do rm -f ../../../../bin/$$i ; done - rm -f *.ref2 - @set -e; for i in $(REF2); do rm -f ../../../../bin/$$i ; done - -install: - @set -e; for i in $(BIN); do ln -f $$i ../../../../bin/$$i ; done +# +# testcases/misc/math/float/bessel test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CLEAN_TARGETS := *.ref* + +LDLIBS += -lm + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/misc/math/float/exp_log/Makefile b/testcases/misc/math/float/exp_log/Makefile dissimilarity index 99% index 45fcd938..22386a3a 100644 --- a/testcases/misc/math/float/exp_log/Makefile +++ b/testcases/misc/math/float/exp_log/Makefile @@ -1,20 +1,31 @@ -CFLAGS += -Wall -LOADLIBES = -lm - -BIN = genexp genlog genlog10 genfrexp genldexp genhypot genmodf genexp_log -REF = exp_inp.ref frexp_inp.ref hypot_out.ref ldexp_out.ref log_inp.ref modf_out.ref exp_out.ref frexp_out.ref ildexp_inp.ref log10_inp.ref modf1_out.ref frexp1_out.ref hypot_inp.ref ldexp_inp.ref log10_out.ref modf_inp.ref -REF2 = log_out.ref2 - -all: $(BIN) - - -clean: - rm -f $(BIN) - @set -e; for i in $(BIN); do rm -f ../../../../bin/$$i ; done - rm -f *.ref - @set -e; for i in $(REF); do rm -f ../../../../bin/$$i ; done - rm -f *.ref2 - @set -e; for i in $(REF2); do rm -f ../../../../bin/$$i ; done - -install: - @set -e; for i in $(BIN); do ln -f $$i ../../../../bin/$$i ; done +# +# testcases/misc/math/float/exp_log test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CLEAN_TARGETS := *.ref* + +LDLIBS += -lm + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/misc/math/float/exp_log/genexp.c b/testcases/misc/math/float/exp_log/genexp.c index 8901d77e..b0b52d48 100644 --- a/testcases/misc/math/float/exp_log/genexp.c +++ b/testcases/misc/math/float/exp_log/genexp.c @@ -51,7 +51,7 @@ int create_Result_file() Inc = log( exp(1)/10 ); for (i=0; i EPS) { /* error ? */ + if ((x > EPS) || (x != x)) { /* error ? */ /* compute exponent parts */ (void)frexp(r, &pr); /* for computed */ (void)frexp(x, &px); /* for difference */ diff --git a/testcases/misc/math/float/trigo/Makefile b/testcases/misc/math/float/trigo/Makefile dissimilarity index 98% index faaffb48..c7390ff2 100644 --- a/testcases/misc/math/float/trigo/Makefile +++ b/testcases/misc/math/float/trigo/Makefile @@ -1,17 +1,31 @@ -CFLAGS += -Wall -LOADLIBES = -lm - -BIN = gensin gencos gentan genatan genatan2 genacos genasin gentrigo -DATA = dtan rtan datan ratan dsin rsin datan2 ratan2 dcos rcos dasin rasin dacos racos - -all: $(BIN) - - -clean: - rm -f $(BIN) - @set -e; for i in $(BIN); do rm -f ../../../../bin/$$i ; done - rm -f $(DATA) - @set -e; for i in $(DATA); do rm -f ../../../../bin/$$i ; done - -install: - @set -e; for i in $(BIN); do ln -f $$i ../../../../bin/$$i ; done +# +# testcases/misc/math/float/trigo test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CLEAN_TARGETS := [dr]* + +LDLIBS += -lm + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/misc/math/fptests/Makefile b/testcases/misc/math/fptests/Makefile index 1d7fed5e..f837a4a3 100644 --- a/testcases/misc/math/fptests/Makefile +++ b/testcases/misc/math/fptests/Makefile @@ -19,18 +19,11 @@ ########################################################################### # name of file : Makefile # ########################################################################### -CFLAGS += -Wall -CPPFLAGS += -I../../../../include -LDFLAGS += -L../../../../lib -LDLIBS += -lm -lltp -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) +top_srcdir ?= ../../../.. -all: $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done +LDLIBS += -lm -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/misc/math/nextafter/Makefile b/testcases/misc/math/nextafter/Makefile index d654861b..c1e4c198 100644 --- a/testcases/misc/math/nextafter/Makefile +++ b/testcases/misc/math/nextafter/Makefile @@ -16,21 +16,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -########################################################################### -# name of file : Makefile # -########################################################################### -CFLAGS+= -I../../../../include -O -g -Wall -LOADLIBES+= -lm -L../../../../lib -lltp +top_srcdir ?= ../../../.. -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +include $(top_srcdir)/include/mk/testcases.mk +LDLIBS += -lm +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/misc/tcore_patch_test_suites/Makefile b/testcases/misc/tcore_patch_test_suites/Makefile dissimilarity index 98% index 10e1de39..85ec229a 100644 --- a/testcases/misc/tcore_patch_test_suites/Makefile +++ b/testcases/misc/tcore_patch_test_suites/Makefile @@ -1,15 +1,36 @@ -CFLAGS += -Wall -CPPFLAGS += -I../../../include -LDFLAGS += -L../../../lib -LDLIBS += -lltp -lm -lpthread -MODCFLAGS := -Wall -DLINUX -I/usr/src/linux/include -EXECS=tcore tcore.sh tcore.exp - -all: tcore - -install: - @set -e; for i in $(EXECS) ; do ln -f $$i ../../bin/$$i ; done ; - -clean: - rm -f tcore - +# +# misc/crash test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +INSTALL_TARGETS := tcore.exp tcore.sh + +LDLIBS += -lm -lpthread + +MAKE_TARGETS := tcore + +#MODCFLAGS := -DLINUX -I$(prefix)/usr/src/linux/include +MODCFLAGS := -DLINUX + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/Makefile b/testcases/network/Makefile dissimilarity index 98% index fc92b1e6..0b35c715 100644 --- a/testcases/network/Makefile +++ b/testcases/network/Makefile @@ -1,11 +1,48 @@ -SUBDIRS = `ls */Makefile | sed "s/Makefile//g"` - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - +# +# network test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +DIR := datafiles + +CLEAN_TARGETS += $(DIR) + +INSTALL_DIR := testcases/bin + +INSTALL_TARGETS := $(addprefix $(DIR)/bin.,sm med lg jmb) + +RM += -r + +$(INSTALL_TARGETS): | generate + +.PHONY: generate + +include $(top_srcdir)/include/mk/generic_trunk_target.mk + +$(DESTDIR)/$(INSTALL_DIR)/$(DIR) $(DIR): %: + mkdir -p "$@" + +generate: $(DIR) + cd "$(DIR)" && \ + abs_top_srcdir="$(abs_top_srcdir)" "$(abs_srcdir)/generate.sh" diff --git a/testcases/network/can/filter-tests/run_ltp-can_tests.sh b/testcases/network/can/filter-tests/run_ltp-can_tests.sh index aefcbe14..6d7aafc2 100644 --- a/testcases/network/can/filter-tests/run_ltp-can_tests.sh +++ b/testcases/network/can/filter-tests/run_ltp-can_tests.sh @@ -19,7 +19,7 @@ ## ## ################################################################################ -if [ $UID -ne 0 ]; then +if [ $(id -ru) -ne 0 ]; then echo You need to be root to execute these tests exit 1 fi diff --git a/testcases/network/dhcpd/Makefile b/testcases/network/dhcpd/Makefile dissimilarity index 97% index e264b10d..a963a453 100644 --- a/testcases/network/dhcpd/Makefile +++ b/testcases/network/dhcpd/Makefile @@ -1,6 +1,31 @@ -all: - -install: - @ln -f dhcpd_tests.sh ../../bin/dhcpd_tests.sh - -clean: +# +# network/dhcpd 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := dhcpd_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/generate.sh b/testcases/network/generate.sh index dda80dfe..8cc773b1 100755 --- a/testcases/network/generate.sh +++ b/testcases/network/generate.sh @@ -25,51 +25,49 @@ # ############################################################################ -data_dir=datafiles -small_file='ascii.sm' -medium_file='ascii.med' -large_file='ascii.lg' -jumbo_file='ascii.jmb' +small_file=ascii.sm +medium_file=ascii.med +large_file=ascii.lg +jumbo_file=ascii.jmb jumbo_size=1600020 large_size=80020 medium_size=4020 small_size=220 -if [ ! -d $data_dir ] ; then - mkdir $data_dir - chmod 777 $data_dir -fi +set -e -for m in .. ../.. ../../.. ../../../.. ; do - makeit=$m/tools/make-file.sh - if [ -e $makeit ] ; then - break +if [ -z "$abs_top_srcdir" ] ; then + echo "The variable \`abs_top_srcdir', must be defined." >&2 + exit 1 +else + make_file="$abs_top_srcdir/tools/make-file.sh" + if [ ! -x "$make_file" ] ; then + echo "$make_file isn't an executable file" >&2 + exit 1 fi -done +fi -$makeit $data_dir/$small_file $small_size -$makeit $data_dir/$medium_file $medium_size -$makeit $data_dir/$large_file $large_size -$makeit $data_dir/$jumbo_file $jumbo_size +"$make_file" "$small_file" $small_size +"$make_file" "$medium_file" $medium_size +"$make_file" "$large_file" $large_size +"$make_file" "$jumbo_file" $jumbo_size -if [ ! -e $data_dir/bin.sm ] ; then - cnt=5 - while [ $cnt -ge 0 ] ; do - gzip -1 -c datafiles/ascii.sm >> $data_dir/bin.sm - cnt=$(($cnt-1)) +if [ ! -e "bin.sm" ] ; then + cnt=0 + while [ $cnt -lt 5 ] ; do + gzip -1 -c ascii.sm >> "bin.sm" + cnt=$(($cnt + 1)) done fi genfile() { - local input=$data_dir/$1 output=$data_dir/$2 + local input="$1" output="$2" local cnt=19 - if [ -e $output ] ; then - return 0 - fi + [ -e "$output" ] && return $? while [ $cnt -ge 0 ] ; do - cat $input >> $output + cat "$input" >> "$output" cnt=$(($cnt-1)) done } @@ -78,4 +76,4 @@ genfile bin.sm bin.med genfile bin.med bin.lg genfile bin.lg bin.jmb -chmod 666 $data_dir/bin.* +chmod 666 bin.* diff --git a/testcases/network/iproute/Makefile b/testcases/network/iproute/Makefile dissimilarity index 96% index 8f5b38e6..334ad027 100644 --- a/testcases/network/iproute/Makefile +++ b/testcases/network/iproute/Makefile @@ -1,6 +1,31 @@ -all: - -install: - @ln -f ip_tests.sh ../../bin/ip_tests.sh - -clean: +# +# network/iproute 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := ip_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/iptables/Makefile b/testcases/network/iptables/Makefile dissimilarity index 97% index 77825dc7..4849d915 100644 --- a/testcases/network/iptables/Makefile +++ b/testcases/network/iptables/Makefile @@ -1,6 +1,29 @@ -all: - -install: - @ln -f iptables_tests.sh ../../bin/iptables_tests.sh - -clean: +# +# network/iptables 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := iptables_tests.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/ipv6/Makefile b/testcases/network/ipv6/Makefile deleted file mode 100644 index b469c663..00000000 --- a/testcases/network/ipv6/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -SUBDIRS = `ls */Makefile | sed "s/Makefile//g"` - -all: - @set -e; rm -f ftp6 2>/dev/null;ln -fs ../tcp_cmds/ftp ftp6 - @set -e; rm -f rcp6 2>/dev/null;ln -fs ../tcp_cmds/rcp rcp6 - @set -e; rm -f rlogin6 2>/dev/null;ln -fs ../tcp_cmds/rlogin rlogin6 - @set -e; rm -f rsh6 2> /dev/null;ln -fs ../tcp_cmds/rsh rsh6 - @set -e; rm -f rwho6 2> /dev/null;ln -fs ../tcp_cmds/rwho rwho6 - @set -e; rm -f telnet6 2> /dev/null;ln -fs ../tcp_cmds/telnet telnet6 - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - @rm -f ftp6 - @rm -f rcp6 - @rm -f rlogin6 - @rm -f rsh6 - @rm -f rwho6 - @rm -f telnet6 - diff --git a/testcases/network/ipv6/echo6/Makefile b/testcases/network/ipv6/echo6/Makefile deleted file mode 100644 index 8b6e5017..00000000 --- a/testcases/network/ipv6/echo6/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -CFLAGS += -w -O -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f echo601 ../../../bin - -clean: - rm -f $(TARGETS) - - diff --git a/testcases/network/ipv6/echo6/createfile.c b/testcases/network/ipv6/echo6/createfile.c deleted file mode 100644 index d947c654..00000000 --- a/testcases/network/ipv6/echo6/createfile.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -@! # TESTCASE DESCRIPTION: -@! # Purpose: to create an input file of any size -@! # Command: none -@! # Subcommand: none -@! # Design: Write an array the size of BUFSIZ to created file until -@! # the file size matches the file size required -@! # SPEC. EXEC. REQS: This program is used by ctatcdt3.c and ctatcet3.c -*/ -#include -#include -main (int argc,char *argv[]) -{ -int fd; -int fsize; -int count=0; -int n,remain; -static char buf[BUFSIZ]; - for ( fsize=0;fsize= BUFSIZ) { - count=fsize/BUFSIZ; - remain=fsize%BUFSIZ; - } - else remain=fsize; - while (count-- !=0) - if((n=write(fd,buf,BUFSIZ)) != BUFSIZ) - perror("createfile"); - if ((n=write(fd,buf,remain)) != remain) - perror("createfile"); - close(fd); -} diff --git a/testcases/network/ipv6/echo6/echo601 b/testcases/network/ipv6/echo6/echo601 deleted file mode 100755 index ea8143eb..00000000 --- a/testcases/network/ipv6/echo6/echo601 +++ /dev/null @@ -1,154 +0,0 @@ -#!/bin/sh -unset LIBPATH -# -# Copyright (c) International Business Machines Corp., 2000 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this pronram; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# -# FILE : echo601 -# -# PURPOSE: Stresses the inetd/xinetd daemon using the `echo` service. -# -# SETUP: The echo service MUST be active on the RHOST machine. This is -# controlled by the inetd/xinetd daemon. -# -# HISTORY: -# 03/01 Robbie Williamson (robbiew@us.ibm.com) -# -Ported -# -# -#*********************************************************************** -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -TC=sine -RHOST=${RHOST:-`hostname`} -TCbin=${TCbin:-`pwd`} -TCsrc=${TCsrc:-$TCbin} -TCtmp=${TCtmp:-$TCsrc/echo6$$} -CLEANUP=${CLEANUP:-ON} -CREATFILE=createfile -ECHOES=echoes6 - -EXECUTABLES=${EXECUTABLES:-"$CREATFILE $ECHOES"} -ECHOFILE=${ECHOFILE:-echofile} -NUMLOOPS=${NUMLOOPS:-2} -NUMPROCESSES=${NUMPROCESSES:-15} -ECHOSIZE=${ECHOSIZE:-8192} - -#----------------------------------------------------------------------- -# -# FUNCTION: do_test -# PURPOSE: Loop until interrupted creating the echo file and then -# echoing it to RHOST. -# INPUT: None. -# OUTPUT: Informational messages are logged into the run log. -# -#----------------------------------------------------------------------- - -do_test() -{ - $trace_logic - mkdir -p $TCtmp - echo "Creating echo file $ECHOFILE" - $TCbin/$CREATFILE $ECHOSIZE $TCtmp/$ECHOFILE - [ $? = 0 ] || end_testcase "$ECHOFILE not created" - - echo "Compute the checksum of this file" - csum1=`sum $TCtmp/$ECHOFILE |awk '{print $1}'` - [ $csum1 ] || end_testcase "initial checksum computation failed" - - COUNT=1 - while [ $COUNT -le $NUMLOOPS ] - do - $TCbin/$ECHOES $RHOST $TCtmp/$ECHOFILE $NUMPROCESSES - [ $? = 0 ] || end_testcase "Error in $ECHOES test in loop $COUNT" - - NUM=0 - while [ $NUM -lt $NUMPROCESSES ] - do - csum2=`sum $TCtmp/$ECHOFILE\$NUM |awk '{print $1}'` - [ "$csum1" -eq "$csum2" ] || end_testcase "Checksums differ in loop $COUNT" - NUM=`expr $NUM + 1` - done - - echo "Successful execution for loop $COUNT" - COUNT=`expr $COUNT + 1` - if [ $COUNT -le $NUMLOOPS ]; then - echo "Sleeping 60 seconds to avoid hitting max. connections setting for service" - sleep 60 - fi - done -} - -#----------------------------------------------------------------------- -# -# FUNCTION: do_cleanup -# PURPOSE: Called when the testcase is interrupted by the user -# or by interrupt_testcase() when time limit expired -# INPUT: None. -# OUTPUT: None. -# -#----------------------------------------------------------------------- - -do_cleanup() -{ - $trace_logic - - cd / - rm -rf $TCtmp -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - - # Call other cleanup functions - [ $CLEANUP = "ON" ] && do_cleanup - - [ $# -eq 0 ] && { echo "Test Successful"; exit 0; } - echo "Test Failed: $@" - echo"" - echo "***NOTE***" - echo "Make sure the streamed echo is uncommented in inetd.conf" - echo "on the server. Also try increasing max connections from" - echo "default of 40, i.e. nowait.400" - exit 1 -} - -#----------------------------------------------------------------------- -# -# FUNCTION: MAIN -# PURPOSE: To invoke functions that perform the tasks as described in -# the design in the prolog above. -# INPUT: See SETUP in the prolog above. -# OUTPUT: Logged run results written to testcase run log -# -#----------------------------------------------------------------------- -do_test -end_testcase diff --git a/testcases/network/ipv6/echo6/echoes6.c b/testcases/network/ipv6/echo6/echoes6.c deleted file mode 100644 index 2bea83bc..00000000 --- a/testcases/network/ipv6/echo6/echoes6.c +++ /dev/null @@ -1,291 +0,0 @@ -/* -@! # TEST TYPE(S): Concurrency, Load stress -@! # TESTCASE DESCRIPTION: -@! # Purpose: to send packets from the file to echo protocol on remote -@! # machine and read the echoing packets back and compare them -@! # Design: Connect to echo protocol on the remote machine -@! # read from the file and send the file to remote machine -@! # read the echoing packets and store them in a file -@! # repeat until file exhausted. -@! # compare result -@! # -@! # SPEC. EXEC. REQS: May require multiple of this test to run -@! # to target machines from multiple machine in order -@! # to create stress condition -@! # echoes -*/ -#include -#include -#include -#include -#include -#include -#include - -#define TRUE 1 -#define FALSE 0 - -main (int argc,char *argv[],char *env[]) -{ - - int i,j,k,wait_stat,pid,finish,gai; - struct servent *sp; - struct addrinfo *hp; - struct addrinfo hints; - struct { - char resultfile[35]; - int pid; - int status; - }echo_struc[200]; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_INET6; - - if ((gai=getaddrinfo(argv[1], NULL, &hints, &hp))!=0) { - fprintf(stderr, "Unknown subject address %s: %s\n", argv[1], gai_strerror(gai)); - exit(1); - } - if (!hp->ai_addr || hp->ai_addr->sa_family != AF_INET6) { - fprintf(stderr, "getaddrinfo failed"); - exit(1); - } - if ((sp=getservbyname("echo","tcp"))==NULL) { - printf("ERROR service is not available\n"); - perror("echo"); - exit(1); - } - i=atoi(argv[3]); - j=0; - while ( i-- > 0 ) { - echo_struc[j].status=0; - switch (pid=fork()) { - case 0: - getfilename(argv[2],echo_struc[j].resultfile,j); - echofile(sp,hp,echo_struc[j].resultfile,argv[2]); - break; - case -1: - printf("ERROR when forking a new process\n"); - perror("echo"); - exit(1); - break; - default: - echo_struc[j].pid=pid; - echo_struc[j].status=1; - j++; - break; - } - } - finish=atoi(argv[3]); - i=finish; - while (finish != 0) { - if ((pid=wait(&wait_stat)) == -1) { - printf("ERROR in wait process\n"); - perror("echo"); - exit(1); - } - if (wait_stat==0) - for (j=0;js_port; - memcpy(&sa, hp->ai_addr, hp->ai_addrlen); - sa.sin6_port=port; - -#ifdef DEBUG - printf("port=%d\n", ntohs(port)); - printf("Connect .......\n"); -#endif - if (connect(s,(struct sockaddr *) &sa,sizeof(sa))==-1) { - printf ("ERROR occured during connect socket operation(%d)\n",pid); - perror("echo:connect"); - cleanup(s); - exit(1); - } -#ifdef DEBUG - printf("hp->ai_addrlen=%d\n",hp->ai_addrlen); - printf("hp->ai_family=%d\n",hp->ai_family); - printf("hp->ai_socktype=%d\n",hp->ai_socktype); - printf("hp->ai_protocol=%d\n",hp->ai_protocol); -#endif - if ((fdr=open(orgfile,O_RDONLY)) < 0 ) { - printf("ERROR when opening the input file(%d)\n",pid); - perror("echo:orginal file"); - cleanup(s); - exit(1); - } - if ((fdw=creat(resultfile,0644)) < 0 ) { - printf("ERROR when opening the temporary temp file(%d)\n",pid); - perror("echo:resultfile"); - cleanup(s); - exit(1); - } - finish=FALSE; - count=0; - while (!finish) { - if ((nwrite=read(fdr,wr_buffer,BUFSIZ))==-1) { - printf("ERROR when reading input file(%d)\n",pid); - perror("echo:orginal file"); - cleanup(s); - exit(1); - } - if (nwrite==0) - finish=TRUE; - else { - count++; - if((n=write(s,wr_buffer,nwrite))!=nwrite) { - printf("ERROR during write to socket(%d)\n",pid); - perror("echo:socket write"); - cleanup(s); - exit(1); - } -#ifdef DEBUG -/* - printf("Writing .......%d\n",count); -*/ -#endif - while (nwrite!=0) { - if((nread=read(s,rd_buffer,BUFSIZ))==-1) { - printf("read size:%d\n",n); - printf("ERROR during read from socket(%d)\n",pid); - perror("echo:socket read"); - cleanup(s); - exit(1); - } -#ifdef DEBUG -/* - printf("Reading ....... %d\n",count); -*/ -#endif - if((n=write(fdw,rd_buffer,nread))!=nread) { - printf("read size:%d\n",n); - printf("ERROR during write to result file(%d)\n",pid); - perror("echo:result file"); - cleanup(s); - exit(1); - } - nwrite-=nread; - } - - }/* end of else */ - } /* end of while */ - if ((n=close(s)) == -1) { - printf("ERROR in closing socket(%d)\n",pid); - perror("echo"); - exit(1); - } - if ((n=close(fdr)) == -1) { - printf("ERROR in closing input file(%d)\n",pid); - perror("echo"); - exit(1); - } - if ((n=close(fdw) ) == -1) { - printf("ERROR in closing temp file(%d)\n",pid); - perror("echo"); - exit(1); - } - if (checkfile(orgfile,resultfile)) { - printf("ERROR input file and output file are not equal(%d)\n",pid); - exit(1); - } - printf("Finish ....%d\n",pid); - exit(0); -} - -getfilename(char *strptr, char* filename, int j) -{ - int i; - char s[10],*sptr=&s[0]; - - strcpy(filename,strptr); - itoa(j,s); - strcat(filename,s); -} - -checkfile(char *file1, char *file2) -{ - int n; - struct stat buffer,*bufptr=&buffer; - stat(file1,bufptr); - n=bufptr->st_size; -#ifdef DEBUG - /* printf("%s size= %d \n",file1,n); -*/ -#endif - stat(file2,bufptr); -#ifdef DEBUG - /* printf("%s size= %d \n",file2,bufptr->st_size); -*/ -#endif - if(n != buffer.st_size) - return(TRUE); - else return(FALSE); -} - -itoa(int n, char s[]) -{ - int i, sign; - - if ((sign = n) < 0) - n = -n; - i = 0; - do { - s[i++] = n % 10 + '0'; - } while ((n /= 10) > 0); - if (sign < 0) - s[i++] = '-'; - s[i] = '\0'; - reverse(s); -} - -reverse(char s[]) -{ - int c, i, j; - - for (i=0, j=strlen(s)-1; i < j; i++, j--) { - c = s[i]; - s[i] = s[j]; - s[j] = c; - } -} -cleanup(int s) -{ -close(s); -} diff --git a/testcases/network/ipv6/finger6/Makefile b/testcases/network/ipv6/finger6/Makefile deleted file mode 100644 index 72a19f5b..00000000 --- a/testcases/network/ipv6/finger6/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: - -install: - ln -f finger601 ../../../bin - -clean: - diff --git a/testcases/network/ipv6/finger6/finger601 b/testcases/network/ipv6/finger6/finger601 deleted file mode 100755 index 67dc5498..00000000 --- a/testcases/network/ipv6/finger6/finger601 +++ /dev/null @@ -1,235 +0,0 @@ -#!/bin/sh -# -# Copyright (c) International Business Machines Corp., 2000 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this pronram; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# -# FILE : finger6 -# -# PURPOSE: To test the basic functionality of the `finger6` command. -# -# SETUP: The home directory of root on the machine exported as "RHOST" -# MUST have a ".rhosts" file with the hostname of the machine -# where the test is executed. Also, both machines MUST have -# the fingerd daemon active (see inetd or xinetd config file). -# -# HISTORY: -# 03/01 Robbie Williamson (robbiew@us.ibm.com) -# -Ported -# -# -#----------------------------------------------------------------------- -# Uncomment line below for debugging information -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -RUSER=root -RHOST=${RHOST:-`hostname`} -LHOST=`hostname` -SLEEPTIME=${SLEEPTIME:-1} -LUSER=`id | tr -s '()' ' ' | awk '{print $2}'` - -this_file=${0##*/} -#----------------------------------------------------------------------- -# -# FUNCTION: do_setup -# -#----------------------------------------------------------------------- - -do_setup () -{ - $trace_logic - - # Start fingerd locally and remotely. - - [ "$LUSER" = "root" ] || end_testcase "MUST BE root to run the test!" - - FINGER=`netstat -an | grep "::79" |awk '{print $6}'` - if [ $FINGER != "LISTEN" ]; then - end_testcase "Please start fingerd for IPv6 locally." - fi - - FINGER=`rsh -n $RHOST netstat -an |grep "::79"|awk '{print $6}'` - if [ $FINGER != "LISTEN" ]; then - end_testcase "Please start fingerd for IPv6 on remote host." - fi -} - -#----------------------------------------------------------------------- -# FUNCTION: do_test1 -# PURPOSE: Run finger with no flags -# INPUT: None. -# OUTPUT: Error messages are logged for all discrepancies found. -#----------------------------------------------------------------------- - -do_test1() -{ - $trace_logic - - echo "finger: do_test1 started" - - finger @$LHOST - [ $? = 0 ] || end_testcase "finger @$LHOST" - finger @$RHOST - [ $? = 0 ] || end_testcase "finger @$RHOST" - - # Testing finger command with user argument - - finger $LUSER - [ $? = 0 ] || end_testcase "finger $LUSER" - finger $LUSER@$LHOST - [ $? = 0 ] || end_testcase "finger $LUSER@$LHOST" - finger $RUSER@$RHOST - [ $? = 0 ] || end_testcase "finger @$RUSER" -} - -#----------------------------------------------------------------------- -# FUNCTION: do_test2 -# PURPOSE: To run the "finger User@host" commands and verify that the -# "finger" command is functioning properly. -# INPUT: None. -# OUTPUT: Error messages are logged for all discrepancies found. -#----------------------------------------------------------------------- - -do_test2() -{ - $trace_logic - - echo "do_test2 $TC finger -bad flag" - BADUSER="uuuu" - BADHOST="xxxx" - - echo "finger -badflag default " - finger -x - [ $? = 0 ] && end_testcase "finger -x should fail" - - echo "finger -bad user " - finger $BADUSER - [ $? = 0 ] || end_testcase "finger $BADUSER " - finger @$BADHOST - [ $? = 0 ] || end_testcase "finger @$BADHOST" - finger $BADUSER@$BADHOST - [ $? = 0 ] || end_testcase "finger $BADUSER@$BADHOST" -} - -#----------------------------------------------------------------------- -# FUNCTION: do_test3 -# PURPOSE: To run the "finger -flag User@Host" commands and verify that the -# "finger" command is functioning properly. -# INPUT: None. -# OUTPUT: Error messages are logged for all discrepancies found. -#----------------------------------------------------------------------- - -do_test3() -{ - $trace_logic - - echo "do_test3 $TC finger -f flag" - - echo "finger -l : gives a long listing" - finger -l - [ $? = 0 ] || end_testcase "finger -l" - finger -l $LUSER - [ $? = 0 ] || end_testcase "finger -l $LUSER " - finger -l @$LHOST - [ $? = 0 ] || end_testcase "finger -l @$LHOST" - finger -l $LUSER@$LHOST - [ $? = 0 ] || end_testcase "finger -l $LUSER@$LHOST" - finger -l @$RHOST - [ $? = 0 ] || end_testcase "finger -l @$RHOST" - finger -l $RUSER@$RHOST - [ $? = 0 ] || end_testcase "finger -l $RUSER@$RHOST" - - echo "finger -m : assures that user is a user ID discretionary" - finger -m - [ $? = 0 ] || end_testcase "finger -m" - finger -m $LUSER - [ $? = 0 ] || end_testcase "finger -m $LUSER " - finger -m @$LHOST - [ $? = 0 ] || end_testcase "finger -m @$LHOST" - finger -m $LUSER@$LHOST - [ $? = 0 ] || end_testcase "finger -m $LUSER@$LHOST" - finger -m @$RHOST - [ $? = 0 ] || end_testcase "finger -m @$RHOST" - finger -m $RUSER@$RHOST - [ $? = 0 ] || end_testcase "finger -m $RUSER@$RHOST" - - echo "finger -p:suppresses printing of .plan files on long and brief long formats" - finger -p - [ $? = 0 ] || end_testcase "finger -p" - finger -p $LUSER - [ $? = 0 ] || end_testcase "finger -p $LUSER " - finger -p @$LHOST - [ $? = 0 ] || end_testcase "finger -p @$LHOST" - finger -p $LUSER@$LHOST - [ $? = 0 ] || end_testcase "finger -p $LUSER@$LHOST" - finger -p @$RHOST - [ $? = 0 ] || end_testcase "finger -p @$RHOST" - finger -p $RUSER@$RHOST - [ $? = 0 ] || end_testcase "finger -p $RUSER@$RHOST" - - echo "finger -s : gives a short format list" - finger -s - [ $? = 0 ] || end_testcase "finger -s" - finger -s $LUSER - [ $? = 0 ] || end_testcase "finger -s $LUSER " - finger -s @$LHOST - [ $? = 0 ] || end_testcase "finger -s @$LHOST" - finger -s $LUSER@$LHOST - [ $? = 0 ] || end_testcase "finger -s $LUSER@$LHOST" - finger -s @$RHOST - [ $? = 0 ] || end_testcase "finger -s @$RHOST" - finger -s $RUSER@$RHOST - [ $? = 0 ] || end_testcase "finger -s $RUSER@$RHOST" - -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - echo "$this_file: doing $0." - - [ $# = 0 ] && { echo "Test Successful"; exit 0; } - echo "test failed: $@" - exit 1 -} - -#----------------------------------------------------------------------- -# FUNCTION: MAIN -# PURPOSE: To invoke the functions to perform the tasks outlined in the -# prologue. -# INPUT: None. -# OUTPUT: None. -#----------------------------------------------------------------------- -do_setup -do_test1 -sleep $SLEEPTIME -do_test2 -sleep $SLEEPTIME -do_test3 -sleep $SLEEPTIME -end_testcase diff --git a/testcases/network/ipv6/perf_lan6/Makefile b/testcases/network/ipv6/perf_lan6/Makefile deleted file mode 100644 index e5b657fe..00000000 --- a/testcases/network/ipv6/perf_lan6/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -CFLAGS += -w -O -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f perf_lan6 ../../../bin - -clean: - rm -f $(TARGETS) - - diff --git a/testcases/network/ipv6/perf_lan6/perf_lan6 b/testcases/network/ipv6/perf_lan6/perf_lan6 deleted file mode 100755 index f8eff78b..00000000 --- a/testcases/network/ipv6/perf_lan6/perf_lan6 +++ /dev/null @@ -1,166 +0,0 @@ -#! /bin/sh -unset LIBPATH -# -# Copyright (c) International Business Machines Corp., 2000 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this pronram; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# -# FILE : perf_lan -# -# PURPOSE: Generates LAN traffic using ICMP echo packets. -# -# -# SETUP: The home directory of root on the machine exported as "RHOST" -# MUST have a ".rhosts" file with the hostname of the client -# machine, where the test is executed. -# -# HISTORY: -# 03/01 Robbie Williamson (robbiew@us.ibm.com) -# -Ported -# -# -#*********************************************************************** -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -TC=slan -RHOST=${RHOST:-`hostname`} -TCbin=${TCbin:-`pwd`} -TCsrc=${TCsrc:-$TCbin} -TCtmp=${TCtmp:-$TCsrc} -CLEANUP=${CLEANUP:-ON} - -PACKETSIZE=${PACKETSIZE:-512} -NUMPACKETS=${NUMPACKETS:-5} -NUMLOOPS=${NUMLOOPS:-5} -EXECUTABLES="pingpong6" - -trap "interrupt_testcase" 2 15 16 30 - -#----------------------------------------------------------------------- -# -# FUNCTION: do_test -# INPUT: None. -# OUTPUT: Informational messages are logged into the run log. -# -#----------------------------------------------------------------------- - -do_test() -{ - $trace_logic - echo "$this_file: doing $0." - - TLOOP=1 - COUNT=1 - [ $NUMLOOPS -gt 0 ] || TLOOP=$NUMLOOPS - while [ $TLOOP -le $NUMLOOPS ] - do - $TCbin/$EXECUTABLES $RHOST $PACKETSIZE $NUMPACKETS - RETVALUE=$? - - case "$RETVALUE" in - 0) echo "Successful execution for loop $COUNT" ;; - 1) end_testcase "Error trying to send to host" ;; - 2) end_testcase "Error - Data length is too long";; - 3) end_testcase "Usage error ";; - 5) end_testcase "Error - Socket setting" ;; - 6) end_testcase "Error - Pipe broken";; - 7) end_testcase "Error - Fork fail";; - 10)end_testcase "Error - wrong Protocol" ;; - *) end_testcase "Return code from $EXECUTABLES is $RETVALUE" ;; - esac - if [ $NUMLOOPS -gt 0 ] ; then TLOOP=$(( $TLOOP + 1 )); fi - COUNT=$(( $COUNT + 1 )) - done -} - -#----------------------------------------------------------------------- -# -# FUNCTION: do_cleanup -# PURPOSE: Called when the testcase is interrupted by the user -# or by interrupt_testcase() when time limit expired -# INPUT: None. -# OUTPUT: None. -# -#----------------------------------------------------------------------- - -do_cleanup() -{ - $trace_logic - echo "$this_file: doing $0." - - cd / - if [ $TCtmp != $TCsrc ]; then - rm -rf $TCtmp - fi -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - echo "$this_file: doing $0." - - # Call other cleanup functions - [ $CLEANUP = "ON" ] && do_cleanup - - [ $# -eq 0 ] && { echo "Test Successful"; exit 0; } - echo "Test Failed: $@" - exit 1 -} - -#----------------------------------------------------------------------- -# -# FUNCTION: interrupt_testcase -# PURPOSE: Finish up the testcase - called when the time has expired -# INPUT: None. -# OUTPUT: None. -# -#----------------------------------------------------------------------- - -interrupt_testcase() -{ - $trace_logic - echo "$this_file: doing $0." - - echo "Testcase interrupted - cleaning up" - echo "Killing background process if it is still running" - kill -9 $CHILDPID - end_testcase -} - -#----------------------------------------------------------------------- -# -# FUNCTION: MAIN -# PURPOSE: To invoke functions that perform the tasks as described in -# the design in the prolog above. -# INPUT: See SETUP in the prolog above. -# OUTPUT: Logged run results written to testcase run log -# -#----------------------------------------------------------------------- -do_test -end_testcase diff --git a/testcases/network/ipv6/perf_lan6/pingpong6.c b/testcases/network/ipv6/perf_lan6/pingpong6.c deleted file mode 100644 index 052aab12..00000000 --- a/testcases/network/ipv6/perf_lan6/pingpong6.c +++ /dev/null @@ -1,294 +0,0 @@ -/* -# -# -# Task Subprogram -# -# SUBPROGRAM NAME: PINGPONG6.C -# -# REQUIRED PARAMETERS: -# Calling Procedure: pingpong6 HOST SIZE PACKETS -# HOST - Current host -# SIZE - Size of each packet -# PACKETS - the number of packets across the network -# -# SETUP REQUIRED: -# o This task must be run as root. -# o TCP/IP must be configured before executing this task. -# -# DESCRIPTION: -# Purpose:To generate lan traffic with ICMP6 echo packet -# Command: None -# Subcommand:None -# Design: -# Create raw socket -# spawn child process to send echo ICMP6 packet -# the child process build echo packet and send to network -# repeat n times -# the parent goes on to receive the reply -# when finish print # of packets sent & # pf packets received -# -# -#=========================================================================== -*/ - -#define PS2 -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#define MAXPACKET 4096 /* max packet size */ -#ifndef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 64 -#endif - -int pfd[2]; -int fdstr[10]; -int verbose; -int count; -u_char packet[MAXPACKET]; -int options; -int s; /* Socket file descriptor */ -struct addrinfo *hp; /* Pointer to host info */ -struct addrinfo hints; - -struct sockaddr_in6 whereto;/* Who to pingpong */ -int datalen; /* How much data */ - - -char *hostname; -char hnamebuf[MAXHOSTNAMELEN]; - -int npackets=1; -int ntransmitted = 0; /* sequence # for outbound packets = #sent */ -int ident; - -int nreceived = 0; /* # of packets we got back */ -int timing = 0; -void finish(int); -int nwrite; -/* - * M A I N - */ -main(argc, argv) -char *argv[]; -{ - struct sockaddr_in6 from; - char **av = argv; - int nrcv; - int on = 1; - int rc = 0; - struct protoent *proto; - int gai; - - printf ("Starting pingpong - to send / receive packets from host \n"); - - /* Get Host net address */ - printf ("Get host net address for sending packets \n"); - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_INET6; - - if ((gai=getaddrinfo(av[1], NULL, &hints, &hp))!=0) { - fprintf(stderr, "Unknown subject address %s: %s\n",av[1], gai_strerror(gai)); - exit(1); - } - if (!hp->ai_addr || hp->ai_addr->sa_family != AF_INET6) { - fprintf(stderr, "getaddrinfo failed"); - exit(1); - } - strcpy(hnamebuf, av[1]); - hostname = hnamebuf; - memset( (char *)&whereto, 0x00, sizeof(struct sockaddr) ); - memcpy(&whereto, hp->ai_addr, hp->ai_addrlen); - - /* Determine Packet Size - either use what was passed in or default */ - printf ("Determine packet size \n"); - if( argc >= 3 ) - datalen = atoi( av[2] ) - 8; - else - datalen = 64-8; - if (datalen > MAXPACKET) { - printf("Pingpong: packet size too large\n"); - exit(1); - } - - - /* Set number of packets to be sent */ - printf ("Determine number of packets to send \n"); - if (argc >= 4) - npackets = atoi(av[3]); - - - /* Get PID of current process */ - ident = getpid() & 0xFFFF; - - - /* Get network protocol to use (check /etc/protocol) */ - if ((proto = getprotobyname("ipv6-icmp")) == NULL) { - printf("ICMP6: unknown protocol\n"); - exit(1); - } - - - /* Create a socket endpoint for communications - returns a descriptor */ - if ((s = socket(AF_INET6, SOCK_RAW, proto->p_proto)) < 0) { - printf("Pingpong: socket - could not create link \n"); - exit(1); - } - - printf("echoing %s: %d data bytes\n", hostname, datalen ); - printf("Total packet size is %d bytes\n",datalen+8); - - setlinebuf( stdout ); - - /* Setup traps */ - signal( SIGINT, finish ); - signal( SIGCLD, finish ); - - - /* Fork a child process to continue sending packets */ - printf ("Create a child process to continue to send packets \n"); - switch (fork()) { - case -1: - printf("ERROR when forking a new process\n"); - exit(1); - case 0: - /* Child's work */ - ntransmitted=echopkt(datalen,npackets); - printf("%d packets transmitted, ",ntransmitted); - sleep(10); - break; - default: - printf ("Parent started - to receive packets \n"); - /* Parent's work - receive packets back from child */ - for (;;) { - int len = sizeof (packet); - unsigned int fromlen = sizeof (from); -#ifdef __64BIT__ - long cc; -#else - int cc; -#endif - - /* Receive packet from socket */ - fromlen = sizeof (from); - if ( (cc=recvfrom(s, packet, len, 0, (struct sockaddr *)&from, &fromlen)) < 0) { - printf("ERROR in recvfrom\n"); - } - /* Verify contents of packet */ - if ((rc = ck_packet (packet, cc, &from)) == 0) - nreceived++; - } - } -} - -echopkt(datalen,npackets) -int datalen; -int npackets; -{ - int count=0; - static u_char outpack[MAXPACKET]; - register struct icmp6_hdr *icp = (struct icmp6_hdr *) outpack; - int i; -#ifdef __64BIT__ - long cc; -#else - int cc; -#endif - - register u_char *datap = &outpack[8]; - - - /* Setup the packet structure */ - printf ("Setup ICMP packet structure to send to host \n"); - icp->icmp6_type = ICMP6_ECHO_REQUEST; - icp->icmp6_code = 0; - icp->icmp6_cksum = 0; - icp->icmp6_id = ident; /* ID */ - - cc = datalen+8; /* skips ICMP portion */ - - for( i=0; iicmp6_type != ICMP6_ECHO_REPLY) { - return(1); /* Not your packet 'cause not an echo */ - } - if (icp->icmp6_id != ident) { - return(1); /* Sent to us by someone else */ - } - printf("Receiving packet \n"); - /* Verify data in packet */ - - printf ("Checking Data.\n"); - for( i=0; i - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -main(argc, argv) -int argc; -char *argv[]; - -{ - struct sockaddr_in6 sa; - int s, fd; - char *lp, *sp; - int i; - int nbyte; - char *serv_fname; - char *clnt_fname; - char rbuf[81]; - int flen, nlen; - int gai; - struct addrinfo *hp; - struct addrinfo hints; - int port; - - /* open socket to server */ - if ((s = socket(AF_INET6, SOCK_STREAM, 0)) < 0) { - printf("socket error = %d\n", errno); - exit(1); - } - - clnt_fname = argv[3]; /* filename to create */ - serv_fname = argv[4]; /* filename to request */ - - /* prepare to copy file from server to local machine */ - if ((fd = open(clnt_fname, O_CREAT | O_TRUNC | O_WRONLY, 0777)) < 0) { - printf("file open error = %d\n", errno); - close(s); - exit(1); - } - - lp = argv[5]; /* get file size */ - flen = strtol(lp,(char **)NULL,10); - - - /* initialize request info: */ - rbuf[0] = '\0'; - sp = &rbuf[0]; - sp = strcat(sp, argv[5]); /* file size */ - sp = strcat(sp, "="); - sp = strcat(sp, serv_fname); /* requested file */ - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_INET6; - if ((gai=getaddrinfo(argv[1], NULL, &hints, &hp))!=0) - fprintf(stderr, "Unknown subject address %s: %s\n",argv[1], gai_strerror(gai)); - if (!hp->ai_addr || hp->ai_addr->sa_family != AF_INET6) - fprintf(stderr, "getaddrinfo failed"); - - - /* initialize server info to make the connection */ - memcpy(&sa, hp->ai_addr, hp->ai_addrlen); - port=atoi(argv[2]); - sa.sin6_port = htons(port); - - if ( connect(s, (struct sockaddr*) &sa, sizeof(sa) ) < 0 ) { - printf("connect error = %d\n", errno); - close(s); - exit(1); - } - - /* send request info to server */ - if ((nbyte = write(s, rbuf, strlen(rbuf))) <= 0) { - printf("socket write error = %d\n", errno); - close(s); - exit(1); - } - -printf("client write %d bytes to server with contents %s\n", nbyte, rbuf); - - nlen = 0; /* init size of info received */ - rbuf[0] = '\0'; - while ((nbyte = read(s, rbuf, 80)) >0) { /* receive info until EOF */ - nlen += nbyte; - if (write(fd, rbuf, nbyte) != nbyte) { - printf("Error writing to file %s on client\n",clnt_fname); - exit(1); - } - } - - printf("Asking for %s\n",serv_fname); - if (nlen != flen) { /* compare expected size with current size */ - printf("WRONG!!! nlen = %d, should be %d\n", nlen, flen); - exit (1); - } - else - printf("File %s received\n", serv_fname); - - close(s); - close(fd); - exit(0); -} diff --git a/testcases/network/ipv6/sendfile6/testsf_s6.c b/testcases/network/ipv6/sendfile6/testsf_s6.c deleted file mode 100644 index a7ae05ce..00000000 --- a/testcases/network/ipv6/sendfile6/testsf_s6.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Server for the sendfile test program - * Syntax: testsf_s - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define LISTEN_BACKLOG 10 - - -void * -test_sig(sig) -int sig; -{ - - int status; - - wait(&status); - - -} - - -main(argc, argv) -int argc; -char *argv[]; - -{ - struct sockaddr_in6 sa, *ap; - struct sockaddr_in6 from; - struct addrinfo *hp; - struct addrinfo hints; - int s, fd, as, rc; - char *lp; - char *number; - int i, clen, pid; - int flags, nonblocking; - int nbytes, flen,gai,count; - char rbuf[81]; - int chunks=0; - off_t *offset; - char nbuf[81]; - int port; - - /* open socket */ - if ((s = socket(AF_INET6, SOCK_STREAM, 0)) < 0) { - printf("socket error = %d\n", errno); - exit(1); - } - - signal(SIGCHLD, SIG_IGN); /* ignore signals from children */ - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_INET6; - if ((gai=getaddrinfo(argv[1], NULL, &hints, &hp))!=0) { - fprintf(stderr, "Unknown subject address %s: %s\n",argv[1], gai_strerror(gai)); - exit(1); - } - if (!hp || !hp->ai_addr || hp->ai_addr->sa_family != AF_INET6) { - fprintf(stderr, "getaddrinfo failed"); - exit(1); - } - - - /* server IP and port */ - memcpy(&sa, hp->ai_addr, hp->ai_addrlen); - port=atoi(argv[2]); - sa.sin6_port = htons(port); - - /* bind IP and port to socket */ - if ( bind(s, (struct sockaddr_in6*) &sa, sizeof(sa) ) < 0 ) { - printf("bind error = %d\n", errno); - close(s); - exit(1); - } - - /* start to listen socket */ - if ( listen(s, LISTEN_BACKLOG ) < 0 ) { - printf("listen error = %d\n", errno); - close(s); - exit(1); - } - - /* process connections */ - while(1) { - /* accept a connection from a client */ - clen = sizeof(from); - if ((as = accept(s, &from, &clen )) < 0 ) { - printf("accept error = %d\n", errno); - if (errno == EINTR) - continue; - close(s); - exit(1); - } - - ap = (struct sockaddr_in6 *)&from; - - /* create a process to manage the connection */ - if ((pid = fork()) < 0) { - printf("fork error = %d\n", errno); - close(as); - exit(1); - } - if (pid > 0) { /* parent, go back to accept */ - close(as); - continue; - } - - - - /* child process to manage a connection */ - - close(s); /* close service socket */ - - /* get client request information */ - if ((nbytes = read(as, rbuf, 80)) <= 0) { - printf("socket read error = %d\n", errno); - close(as); - exit(1); - } - rbuf[nbytes] = '\0'; /* null terminate the info */ - lp = &rbuf[0]; - - /* start with file length, '=' will start the filename */ - flen = 0; - count = 0; - number = &nbuf[0]; - while (*lp != '=') { /* convert ascii to integer */ - nbuf[count] = *lp; - count++; - lp++; - } - nbuf[count] = '\0'; - flen = strtol(number, (char **)NULL, 10); - printf("flen is %d.\n",flen); - - /* the file name */ - lp++; - - printf("The file to send is %s\n", lp); - /* open requested file to send */ - if ((fd = open(lp, O_RDONLY)) < 0) { - printf("file open error = %d\n", errno); - close(as); - exit(1); - } - offset=NULL; - errno=0; - do { /* send file parts until EOF */ - if ((rc = sendfile(as, fd, offset, flen)) != flen) { - if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) { - printf("sendfile error = %d, rc = %d\n", errno, rc); - close(as); - close(fd); - exit(-1); - } - } - chunks++; - } while (rc != 0); - printf("File %s sent in %d parts\n", lp, chunks); - - - close(as); /* close connection */ - close(fd); /* close requested file */ - exit(0); - - } - - - close(s); /* close parent socket (never reached because of the while(1)) */ - - - - -} - diff --git a/testcases/network/ipv6/tcpdump6/Makefile b/testcases/network/ipv6/tcpdump6/Makefile deleted file mode 100644 index 409f5982..00000000 --- a/testcases/network/ipv6/tcpdump6/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: - -install: - ln -f tcpdump601 ../../../bin - -clean: - diff --git a/testcases/network/ipv6/tcpdump6/tcpdump601 b/testcases/network/ipv6/tcpdump6/tcpdump601 deleted file mode 100755 index 502f9735..00000000 --- a/testcases/network/ipv6/tcpdump6/tcpdump601 +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/sh -#****************************************************************************** -# Copyright (c) International Business Machines Corp., 2000 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this pronram; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# -# FILE : tcpdump -# -# PURPOSE: To test the basic functionality of `tcpdump`. -# -# SETUP: The "RHOST" setting should be exported to be the hostname of -# another machine on the same subnet. Otherwise, the hostname -# of the tested machine will be used. -# -# HISTORY: -# 04/17/01 Robbie Williamson (robbiew@us.ibm.com) -# -Written -# -#----------------------------------------------------------------------- -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -TC=tcpdump -TCtmp=${TCtmp:-/tmp/$TC$$} -RHOST=${RHOST:-`hostname`} -NUMLOOPS=${NUMLOOPS:-20} -OUTFILE=$TCtmp/tcpdump_out - -#****************************************************************************** -# -# FUNCTION: do_test -# PURPOSE: Invoke tcpdump -# INPUT: None -# -#****************************************************************************** - -do_test() -{ - $trace_logic - - mkdir -p $TCtmp - [ $? -eq 0 ] || end_testcase "mkdir -p $TCtmp failed" - ping6 -f $RHOST > /dev/null 2>&1 & - /usr/sbin/tcpdump -c $NUMLOOPS > $OUTFILE - [ $? -eq 0 ] || end_testcase "Problems trying to launch tcpdump" - grep "$RHOST\>" $OUTFILE - [ $? -eq 0 ] || end_testcase "$RHOST was not listed in network traffic" - PID=`ps -ef | grep "ping6 -f $RHOST" | grep -v grep | awk '{print $2}'` - kill -9 $PID - rm -rf $OUTFILE -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - echo "$this_file: doing $0." - rm -rf $TCtmp - [ $# -eq 0 ] && { echo "Test Successful"; exit 0; } - echo "Test Failed: $@" - exit 1 -} - -#----------------------------------------------------------------------- -# -# FUNCTION: MAIN -# PURPOSE: To invoke functions that perform the tasks as described in -# the design in the prolog above. -# INPUT: See SETUP in the prolog above. -# OUTPUT: Logged run results written to testcase run log -# -#----------------------------------------------------------------------- -do_test -end_testcase diff --git a/testcases/network/lib6/Makefile b/testcases/network/lib6/Makefile index 387e28c1..9436acaf 100644 --- a/testcases/network/lib6/Makefile +++ b/testcases/network/lib6/Makefile @@ -20,25 +20,19 @@ # name of file : Makefile # # description : make(1) description file for lib6 tests. # ########################################################################### -CFLAGS+= -I../../../include -g -D_GNU_SOURCE -LOADLIBES+= -L../../../lib runcc.a -lltp -lpthread -RANLIB ?= ranlib +top_srcdir ?= ../../.. -SRCS=$(wildcard *.c) -TARGETS= asapi_01 asapi_02 asapi_03 asapi_04 asapi_05 asapi_06 asapi_07 \ - getaddrinfo_01 in6_01 in6_02 +include $(top_srcdir)/include/mk/testcases.mk -all: $(TARGETS) +CPPFLAGS += -D_GNU_SOURCE -$(TARGETS): %: %.c runcc.a +LDLIBS += -lpthread -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../bin/$$i ; done +CLEAN_TARGETS += $(LIB) -clean: - rm -f $(TARGETS) *.a *.o +FILTER_OUT_MAKE_TARGETS := runcc -runcc.a: runcc.o - $(AR) cr $@ $^ - $(RANLIB) $@ +include $(top_srcdir)/include/mk/generic_leaf_target.mk + +$(MAKE_TARGETS): %: %.o runcc.o diff --git a/testcases/network/lib6/runcc.c b/testcases/network/lib6/runcc.c index 3cc71296..bf74bdc8 100644 --- a/testcases/network/lib6/runcc.c +++ b/testcases/network/lib6/runcc.c @@ -96,7 +96,7 @@ runcc(char *tname, char *filename0, char *program) cflags, filename0, filename); es = system(cmd); if (WEXITSTATUS(es) == 127) { - tst_resm(TBROK, "%s: can't run C compiler: \"%s\"", cmd); + tst_resm(TBROK, "can't run C compiler: \"%s\"", cmd); if (unlink(filename) < 0) tst_resm(TWARN, "%s; unlink \"%s\" failed: %s", tname, filename, strerror(errno)); diff --git a/testcases/network/multicast/Makefile b/testcases/network/multicast/Makefile dissimilarity index 98% index 29d44de3..ce28018f 100644 --- a/testcases/network/multicast/Makefile +++ b/testcases/network/multicast/Makefile @@ -1,11 +1,26 @@ -SUBDIRS = mc_cmds mc_commo mc_member mc_opts - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# network/multicast test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/multicast/mc_cmds/Makefile b/testcases/network/multicast/mc_cmds/Makefile dissimilarity index 94% index 8c9e51c2..6579ad16 100644 --- a/testcases/network/multicast/mc_cmds/Makefile +++ b/testcases/network/multicast/mc_cmds/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f mc_cmds ../../../bin - -clean: - +# +# network/multicast/mc_cmds 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := mc_cmds + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/multicast/mc_cmds/mc_cmds b/testcases/network/multicast/mc_cmds/mc_cmds index a4d48fc1..a31e393f 100755 --- a/testcases/network/multicast/mc_cmds/mc_cmds +++ b/testcases/network/multicast/mc_cmds/mc_cmds @@ -63,7 +63,7 @@ do_test() IFNAME=${IFNAME:-$(netstat -i -n | grep "^[b-z]\{2,4\}[0-9][^*]"|\ awk '{print $1}')} - INTERFACE=${INTERFACE:-$($LTPROOT/tools/gethost `hostname` | grep addresses: | awk '{print $2}')} + INTERFACE=${INTERFACE:-$("$LTPROOT/tools/gethost" `hostname` | grep addresses: | awk '{print $2}')} echo "Testing ifconfig and netstat" diff --git a/testcases/network/multicast/mc_commo/Makefile b/testcases/network/multicast/mc_commo/Makefile dissimilarity index 97% index 3abf439e..dac2fb86 100644 --- a/testcases/network/multicast/mc_commo/Makefile +++ b/testcases/network/multicast/mc_commo/Makefile @@ -1,17 +1,29 @@ -CFLAGS += -O -Wall -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f mc_commo ../../../bin - ln -f mc_recv ../../../bin - ln -f mc_send ../../../bin - -clean: - rm -f $(TARGETS) - - +# +# network/multicast/mc_commo 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := mc_commo + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/multicast/mc_commo/mc_commo b/testcases/network/multicast/mc_commo/mc_commo index e18a10e5..788f547d 100755 --- a/testcases/network/multicast/mc_commo/mc_commo +++ b/testcases/network/multicast/mc_commo/mc_commo @@ -39,7 +39,6 @@ $trace_logic TC=mc_commo -TCsrc=${TCsrc:-`pwd`} TCtmp=${TCtmp:-"/tmp/mc_commo.$$"} CLEANUP=${CLEANUP:-ON} EXECUTABLES="mc_recv" @@ -50,7 +49,7 @@ PORT=3333 RHOST=${RHOST:-`hostname`} OUTFILE=$TCtmp/mc_commo_out NUMLOOPS=${NUMLOOPS:-2} -INTERFACE=${INTERFACE:-$($LTPROOT/tools/gethost `hostname` | grep addresses: | awk '{print $2}')} +INTERFACE=${INTERFACE:-$("$LTPROOT/tools/gethost" `hostname` | grep addresses: | awk '{print $2}')} this_file=${0##*/} trap "interrupt_test" 2 @@ -86,7 +85,8 @@ do_test () # Start up the recv on local host echo "Starting mc_recv on $GROUP_ADDR $INTERFACE $PORT" - $TCsrc/$EXECUTABLES $GROUP_ADDR $INTERFACE $PORT >> $OUTFILE & + "$LTPROOT/testcases/bin/$EXECUTABLES" $GROUP_ADDR $INTERFACE $PORT \ + >> $OUTFILE & SERVER_PID=$! sleep 5 ps -ewf | grep mc_recv | grep -v grep @@ -128,7 +128,8 @@ do_test () do echo "Running on $HOST mc_send $GROUP_ADDR $HOST $PORT $TTL" - rsh -n -l root $HOST $TCsrc/$REMOTE_EXEC $GROUP_ADDR $HOST $PORT $TTL >/dev/null & + rsh -n -l root $HOST "$LTPROOT/testcases/bin$REMOTE_EXEC" $GROUP_ADDR \ + $HOST $PORT $TTL >/dev/null & sleep 10 rsh -n -l root $HOST "ps -ewf | grep mc_send | grep -v grep" [ $? = 0 ] || end_testcase "Could NOT start mc_send on $HOST" diff --git a/testcases/network/multicast/mc_member/Makefile b/testcases/network/multicast/mc_member/Makefile dissimilarity index 98% index 8b6b0939..afd1114a 100644 --- a/testcases/network/multicast/mc_member/Makefile +++ b/testcases/network/multicast/mc_member/Makefile @@ -1,18 +1,29 @@ -CFLAGS += -w -O -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f mc_member ../../../bin - ln -f member ../../../bin - ln -f ManyGroups ../../../bin - ln -f TooManyGroups ../../../bin - -clean: - rm -f $(TARGETS) - - +# +# network/multicast/mc_member 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := mc_member *ManyGroups + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/multicast/mc_member/mc_member b/testcases/network/multicast/mc_member/mc_member index 1c917bc6..116c65fa 100755 --- a/testcases/network/multicast/mc_member/mc_member +++ b/testcases/network/multicast/mc_member/mc_member @@ -45,7 +45,7 @@ CLEANUP=${CLEANUP:-ON} LTPROOT=${LTPROOT:-"../../../../"} EXECUTABLES=${EXECUTABLES:-"member"} NUMLOOPS=${NUMLOOPS:-2} -INTERFACE=${INTERFACE:-$($LTPROOT/tools/gethost `hostname`| grep address |awk '{ print $2 }')} +INTERFACE=${INTERFACE:-$("$LTPROOT/tools/gethost" `hostname`| grep address |awk '{ print $2 }')} GLIST=${GLIST:-$TCsrc/ManyGroups} TooManyGLIST=${TooManyGLIST:-$TCsrc/TooManyGroups} ERRFILE=${ERRFILE:-$TCtmp/errors} diff --git a/testcases/network/multicast/mc_opts/Makefile b/testcases/network/multicast/mc_opts/Makefile dissimilarity index 97% index 7623c224..e00dedd7 100644 --- a/testcases/network/multicast/mc_opts/Makefile +++ b/testcases/network/multicast/mc_opts/Makefile @@ -1,17 +1,29 @@ -CFLAGS += -Wall -g -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e;ln -f mc_opts ../../../bin - @set -e;ln -f opts ../../../bin - @set -e;ln -f opts_e ../../../bin - -clean: - rm -f $(TARGETS) - - +# +# network/multicast/mc_opts 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := mc_opts + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/multicast/mc_opts/mc_opts b/testcases/network/multicast/mc_opts/mc_opts index ffd25ea1..27f59344 100755 --- a/testcases/network/multicast/mc_opts/mc_opts +++ b/testcases/network/multicast/mc_opts/mc_opts @@ -43,12 +43,11 @@ if [ -z $LTPBIN ]; then PATH=../../../bin/:./:$PATH fi TC=mc_opts -TCsrc=${TCsrc:-`pwd`} -TCtmp=${TCtmp:-$TCsrc/$TC$$} +TCtmp=${TCtmp:-$LTPROOT/bin/$TC$$} CLEANUP=${CLEANUP:-ON} EXECUTABLES=${EXECUTABLES:-"opts opts_e"} NUMLOOPS=${NUMLOOPS:-10} -IPADDR=${IPADDR:-$(gethost `hostname`| grep address |awk '{ print $2 }')} +IPADDR=${IPADDR:-$("$LTPROOT/tools/gethost" `hostname`| grep address |awk '{ print $2 }')} this_file=${0##*/} trap "interrupt_test" 2 @@ -58,8 +57,7 @@ setup() mkdir -p $TCtmp for i in $EXECUTABLES do - cp $TCsrc/$i $TCtmp - chmod 755 $TCtmp/$i + install -m 0755 "$LTPROOT/$i" "$TCtmp/." done } @@ -117,7 +115,7 @@ do_cleanup() echo "$this_file: doing $0." cd / - if [ $TCtmp != $TCsrc ]; then + if [ "x$TCtmp" != "x$TCsrc" ]; then rm -rf $TCtmp fi } diff --git a/testcases/network/nfs/Makefile b/testcases/network/nfs/Makefile dissimilarity index 98% index 21a3571f..c9dd3bf2 100644 --- a/testcases/network/nfs/Makefile +++ b/testcases/network/nfs/Makefile @@ -1,10 +1,26 @@ -SUBDIRS = `ls */Makefile | sed "s/Makefile//g" ` -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# network/nfs test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/nfs/fsx-linux/Makefile b/testcases/network/nfs/fsx-linux/Makefile dissimilarity index 96% index 6bc2523c..eaf88a8c 100644 --- a/testcases/network/nfs/fsx-linux/Makefile +++ b/testcases/network/nfs/fsx-linux/Makefile @@ -1,15 +1,29 @@ -CFLAGS += -w -O -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f fsx.sh ../../../bin - -clean: - rm -f $(TARGETS) - - +# +# network/nfs/fsx-linux testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := fsx.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/nfs/nfs01/Makefile b/testcases/network/nfs/nfs01/Makefile dissimilarity index 97% index 44748b5e..64d9819c 100644 --- a/testcases/network/nfs/nfs01/Makefile +++ b/testcases/network/nfs/nfs01/Makefile @@ -1,15 +1,29 @@ -CFLAGS += -w -O -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f nfs01 ../../../bin; ln -f open_files ../../../bin - -clean: - rm -f $(TARGETS) - - +# +# network/nfs/nfs01 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := nfs01 + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/nfs/nfs02/Makefile b/testcases/network/nfs/nfs02/Makefile dissimilarity index 97% index c549b89b..226c4815 100644 --- a/testcases/network/nfs/nfs02/Makefile +++ b/testcases/network/nfs/nfs02/Makefile @@ -1,11 +1,31 @@ -all: - -install: generate - ln -f nfs02 ../../../bin - -generate: - ../../generate.sh - -clean: - rm -rf datafiles - rm -f ../../../bin/nfs02 +# +# network/nfs/nfs02 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := nfs02 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/nfs/nfs03/Makefile b/testcases/network/nfs/nfs03/Makefile dissimilarity index 97% index af9d241a..33464f53 100644 --- a/testcases/network/nfs/nfs03/Makefile +++ b/testcases/network/nfs/nfs03/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f nfs03 ../../../bin - -clean: - rm -f ../../../bin/nfs03 +# +# network/nfs/nfs03 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := nfs03 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/nfs/nfs04/Makefile b/testcases/network/nfs/nfs04/Makefile dissimilarity index 98% index cdd6e7fb..9676a57a 100644 --- a/testcases/network/nfs/nfs04/Makefile +++ b/testcases/network/nfs/nfs04/Makefile @@ -1,11 +1,31 @@ -CFLAGS+= -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) nfs04; do ln -f $$i ../../../bin/$$i ; done - -clean: - rm -f $(TARGETS) +# +# network/nfs/nfs04 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + +INSTALL_TARGETS := nfs04 + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/nfs/nfs_fsstress/Makefile b/testcases/network/nfs/nfs_fsstress/Makefile dissimilarity index 97% index d2c69031..78653464 100644 --- a/testcases/network/nfs/nfs_fsstress/Makefile +++ b/testcases/network/nfs/nfs_fsstress/Makefile @@ -1,16 +1,32 @@ -CFLAGS += -Wall -g -DNO_XFS -I. -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -LDFLAGS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f nfs_fsstress.sh ../../../bin - ln -f fsstress ../../../bin - -clean: - rm -f $(TARGETS) - - +# +# network/nfs/nfs_fsstress 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DNO_XFS \ + -I$(abs_srcdir) + +INSTALL_TARGETS := nfs_fsstress.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/nfs/nfslock01/Makefile b/testcases/network/nfs/nfslock01/Makefile dissimilarity index 98% index 8cc80ed8..fa7c97e1 100644 --- a/testcases/network/nfs/nfslock01/Makefile +++ b/testcases/network/nfs/nfslock01/Makefile @@ -1,22 +1,33 @@ -CFLAGS += -w -O -TESTS = nfs_flock nfs_flock_dgen nfs_flock_frk - -all: $(TESTS) - -install: - ln -f nfslock01 ../../../bin - ln -f $(TESTS) ../../../bin - -nfs_flock: - $(CC) $(CFLAGS) $(LDFLAGS) -o nfs_flock nfs_flock.c nfs_flock_func.c - -nfs_flock_frk: - $(CC) $(CFLAGS) $(LDFLAGS) -o nfs_flock_frk nfs_flock_frk.c - -nfs_flock_dgen: - $(CC) $(CFLAGS) $(LDFLAGS) -o nfs_flock_dgen nfs_flock_dgen.c - -clean: - rm -f $(TESTS) - - +# +# network/nfs/nfslock01 testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +FILTER_OUT_MAKE_TARGETS := nfs_flock_func + +INSTALL_TARGETS := nfslock01 + +include $(top_srcdir)/include/mk/generic_leaf_target.mk + +$(MAKE_TARGETS): %: %.o nfs_flock_func.o diff --git a/testcases/network/nfs/nfslock01/nfs_flock.c b/testcases/network/nfs/nfslock01/nfs_flock.c index 9c98679d..2e92c0ce 100644 --- a/testcases/network/nfs/nfslock01/nfs_flock.c +++ b/testcases/network/nfs/nfslock01/nfs_flock.c @@ -13,8 +13,6 @@ #define BYTES 64 #define LINES 16384 -int lock_reg(int, int, int, int, int, int); - int main(argc, argv) int argc; diff --git a/testcases/network/nfs/nfslock01/nfs_flock.h b/testcases/network/nfs/nfslock01/nfs_flock.h index 390f8f53..09e3845f 100644 --- a/testcases/network/nfs/nfslock01/nfs_flock.h +++ b/testcases/network/nfs/nfslock01/nfs_flock.h @@ -3,6 +3,9 @@ #include #include #include +#include + +int lock_reg(int, int, off_t, int, off_t, int); #define read_lock(fd, offset, whence, len) \ lock_reg(fd, F_RDLCK, offset, whence, len, F_SETLK) diff --git a/testcases/network/nfs/nfslock01/nfs_flock_dgen.c b/testcases/network/nfs/nfslock01/nfs_flock_dgen.c dissimilarity index 86% index d9e7143c..af346538 100644 --- a/testcases/network/nfs/nfslock01/nfs_flock_dgen.c +++ b/testcases/network/nfs/nfslock01/nfs_flock_dgen.c @@ -1,59 +1,57 @@ -/* - * This program generates data for testing file locking - */ - -#include -#include -#include - -int main(argc, argv) -int argc; -char **argv; -{ - int i, j, k, nlines, nchars, ctype; - char c, buf[BUFSIZ]; - FILE *fp; - - if (argc != 5) { - printf("Usage: \n"); - exit(2); - } - - fp = fopen(argv[1], "w"); - - nchars = atoi(argv[2]); - if (nchars > BUFSIZ) { - printf("Exceeded the maximum limit of the buffer (4096)\n"); - exit(3); - } - nlines = atoi(argv[3]); - ctype = atoi(argv[4]); - - k = 0; - for(i = 1; i <= nlines; i++) { - if (ctype) { - if ((i%2) == 0) - c = '0'; - else - c = '1'; - } - else - c = 'A' + k; - - for(j=0; j < nchars; j++) - buf[j] = c; - - fprintf(fp,"%s\n",buf); - - if (!ctype) { - if (i != 1 && i%26 == 0) { - k = 0; - } else - k++; - } - } - - fclose(fp); - return(0); -} - +/* + * This program generates data for testing file locking + */ + +#include +#include +#include + +int +main (int argc, char **argv) +{ + int i, j, k, nlines, nchars, ctype; + char c, buf[BUFSIZ]; + FILE *fp; + + if (argc != 5) { + printf("usage: \n"); + exit(2); + } + + fp = fopen(argv[1], "w"); + + nchars = atoi(argv[2]); + if (nchars > BUFSIZ) { + printf("Exceeded the maximum limit of the buffer (%d)\n", BUFSIZ); + exit(3); + } + nlines = atoi(argv[3]); + ctype = atoi(argv[4]); + + k = 0; + for (i = 1; i <= nlines; i++) { + + if (ctype) + c = ((i % 2) ? '1' : '0'); + else + c = 'A' + k; + + for (j = 0; j < nchars; j++) + + buf[j] = c; + + fprintf(fp, "%s\n", buf); + + if (!ctype) { + if (i != 1 && i % 26 == 0) + k = 0; + else + k++; + } + + } + + fclose(fp); + return(0); +} + diff --git a/testcases/network/nfs/nfslock01/nfs_flock_frk.c b/testcases/network/nfs/nfslock01/nfs_flock_frk.c index 7a0054cb..42de78bf 100644 --- a/testcases/network/nfs/nfslock01/nfs_flock_frk.c +++ b/testcases/network/nfs/nfslock01/nfs_flock_frk.c @@ -11,9 +11,7 @@ #include int -main(argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { pid_t pid; char *Prog; diff --git a/testcases/network/nfs/nfslock01/nfs_flock_func.c b/testcases/network/nfs/nfslock01/nfs_flock_func.c index f6d27d7d..5a99499f 100644 --- a/testcases/network/nfs/nfslock01/nfs_flock_func.c +++ b/testcases/network/nfs/nfslock01/nfs_flock_func.c @@ -4,9 +4,7 @@ #include "nfs_flock.h" int -lock_reg(fd, type, offset, whence, len, cmd) - int fd, type, offset; - int whence, len, cmd; +lock_reg(int fd, int type, off_t offset, int whence, off_t len, int cmd) { struct flock lock; @@ -19,9 +17,7 @@ lock_reg(fd, type, offset, whence, len, cmd) } int -lock_test(fd, type, offset, whence, len) - int fd, type, offset; - int whence, len; +lock_test(int fd, int type, off_t offset, int whence, int len) { struct flock lock; diff --git a/testcases/network/nfs/nfsstat01/Makefile b/testcases/network/nfs/nfsstat01/Makefile dissimilarity index 97% index 1ab947a8..8723dd75 100644 --- a/testcases/network/nfs/nfsstat01/Makefile +++ b/testcases/network/nfs/nfsstat01/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f nfsstat01 ../../../bin - -clean: - rm -f ../../bin/nfsstat01 +# +# network/nfs/nfsstat01 test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := nfsstat01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/nfs/nfsstress/Makefile b/testcases/network/nfs/nfsstress/Makefile dissimilarity index 98% index ff163912..f24bdb91 100644 --- a/testcases/network/nfs/nfsstress/Makefile +++ b/testcases/network/nfs/nfsstress/Makefile @@ -1,14 +1,31 @@ -CFLAGS += -O -w -g -LDLIBS := -lpthread - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f nfsstress ../../../bin - ln -f $(TARGETS) ../../../bin - -clean: - rm -f $(TARGETS) +# +# network/nfs/nfsstress test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := nfsstress + +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/nfsv4/Makefile b/testcases/network/nfsv4/Makefile dissimilarity index 99% index db546e3a..02a01d08 100644 --- a/testcases/network/nfsv4/Makefile +++ b/testcases/network/nfsv4/Makefile @@ -1,4 +1,26 @@ -SUBDIRS := $(patsubst %/Makefile,%,$(wildcard */Makefile)) - -all clean install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done +# +# network/nfsv4 test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile dissimilarity index 98% index 51e17e4d..e4826054 100644 --- a/testcases/network/nfsv4/acl/Makefile +++ b/testcases/network/nfsv4/acl/Makefile @@ -1,25 +1,29 @@ -# -# @(#)Makefile ACL Basic tests -# -# to make tests, use 'make' - -ifeq ($(shell echo | $(CC) $(CFLAGS) -E -include sys/acl.h - 1>/dev/null 2>/dev/null && echo yes),yes) -ACLTESTS := acl1 -else -ACLTESTS := -endif - -#include ../tests.init -LIBS := -lacl - -all: $(ACLTESTS) - @chmod a+x runtest - -acl1: acl1.c - $(CC) $(CFLAGS) $(LDFLAGS) -o acl1 acl1.c $(LIBS) - -install: $(ACLTESTS) - @set -e; for i in $(ACLTESTS); do ln -f $$i ../../../bin ; done - -clean: - rm -f $(ACLTESTS) +# +# network/nfsv4/acl 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_post.mk + +LDLIBS += -lacl + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/nfsv4/acl/random_gen.pyc b/testcases/network/nfsv4/acl/random_gen.pyc deleted file mode 100644 index 3c9b235a9a5bee872a4e87ab9e38e3fd894530cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 11694 zcwWs~S#KNH6+ScEG}LOzGA%o?i8Kq5LY193iQ@u|6-$ww$dscciqyI+#Tim#QzXS1 zR&*d0K~*%b1&S_@eQO_!KJ^Fmp^yD7MSnogGIusow6ZXXjTv3u{hssP@0@e*{P@4) z*`NRQ5BDnI{Y&6;7aymDFB9M?z^)`T*wr|p!>$e{{!Derej#;hkKY3a| zIO+N@LzdK*DHSELI z>6N4xb?g}US}!-u=D~{9@E4fE=Y1-^gl$~#79}gfCE)yV@;LKaiWXSIB3xsNR!YlE zb54eHGMqEQIR@t#oRg&`<4S3jyyV?6Fh@8s4yM702{5yqm;`f_6H{Q0apD4)OiY;#zU%;o8>5U1x%RZf)LQE^a=!x45~y zbhn~=nxW?&jedf!W7MPut`2sBwBshdoKx1+F%<+4ZLDBsuFK?@VK2q2sg{oISgN39DT;&AdZ>IAi##w5_sh<*7gfS1sFh z%jBWB7ssks9g;zfa@Fsn~9IS`OizdTo>sEbge;avjdCG!G82 znZp{XS#GoAwmPmuE9w+dk#QrP1buT=ztaLOhF{Jyt#-e8U@g?$)_k>7ug|}6Qg$q7p<%g4&GyrUM%7s;SL*Xr^2UO!s#LQYKWaT=e28qeaQti3Ic0(N zx^_jI(Z;n3Et#Z2(_nmjg0JoxZD3S9>UHVyBI%Z3!Wup$^{2p1ft@C_u#!>1$0>n< zU?~gsC}0-mXousl&5EZnioD<|YKN78Vyo=uSriKe(j?0V7g4h~v%znhHRHH#F0B?x zjstW+Becryen`T;{;R(J%dM8xFbk9nszjQq!KE92=pk$B1C-4x;A?6e(%O`ERWwD@ zqra@Fw}5#THxVj_cd0JBGuVv@-i-!m_#?CfMG>AA1;(l@;Sg=D~2WHi!ZjI7{SClqo#gm zLlJO5x<#JQ4Tu4DN~D|&OZhfQ`DR$kKj@_vou!)gq#lS=2Spx4rG?D%#i?kwsJNSD z6{W-&N~N1fL+*1ZG7NNDq^Xc}cxWZU3JtAxJqz#_3GijlST8-EBaEWx&^7ZIfMBV? zVHUP)Y~@QDgoGE}@U%kHs^{n1`4|b3SUb#c#rN=*m6XeAV*eS9>B-9jn1L#K1p?E2k z!c-bugIoplDv1zu&uY12Y_%?;)k0lOfIaE)g?9K7Kif3q6b&inEW^s7#VlBEWuaAe zoFlO=ZGPVoXVVui6UYVitBGy^SF5s8a6_7PyJ0!3LP;f6ifOl1w_P5MQkqsz3EtDK>W%*990c>9!xzx&#+~ojG^HQ z!A(1p*7G6teu>7=CbcmwgV>tXvRYQ3*2lHWVkl_x{#N}pggqP2qhSQmZe_!O!0YaS zixA3qrUHR>Iq+9KWF@H(F*Qf%N)k9dbX^Xk%d0{NdzT+EIW!-!;&n%S)T~4-Bs_9q z3sV3Cy(6j^@|F?a^TY!BRjv!bwdBbVPVK zgN~SpJWh(x5#y>bqq5GyN#d$}hs;D>H12SiBnPiAS8K{lgydbZ}1TtM37b`b1fLg%eU%l3fa&qN0$p_^L*f zm4w3?R9143vPfFJ$_g|!j(JSjsRYF_u0;ii;xm*it&?=~c?0bvjJTa=?*CnFMwoAwT6MMT~+ z>UJn9xacoPwuR#2zr{5%rd{a6YF_~RLLOW3aWeiq zWn!C?%c@9O$}dY2vqj1>eiZc2yB) z1Up-lSuZ)1J&;Pp4Ww~f%@+UdIPHFdx07S;^nO`swuOGGC$RgDo zcxK-cOjar4VWuE5Nc+@0DWpJCA<+2r{AUnbsX_M(LWn6*$urP=ug2tSJGv#sf(eXW zGzyR2!6p>R46K$qU$rz>J2Vhj_)t_X$dY)R))M*=!r!Qz@FAY3*DVQ8jh-e(q)CQ|+aBYS;f#FLavb`wg#uZm3hzq>j%RiLs0ByZ zQ2}s#gvsy-98)LMCbbQ67HDb&Se72KKCT&mVt<`H#u`&+MJSOzucgz7$I; zM6-|LSZ)z`uazr(NG|R!B=!aP`eUuM|IFXUra%<B1yqA=!(@KSvYikG?oBuRwq+K zXHR1~J)jvGBWK2t`*z_!K+)eb$Q@&qoszrRED;vEUH1LcLW zK5#ixg}Zc)i*mbF+Sq#ZXl;G7w79yuwp}7o&c=(DmWw-F(%Wcj>A~h1MXQVJ54nh@ z*W7zzRotkk3i&9(M~Wl{O=(~{K&Nae;!ub AZU6uP diff --git a/testcases/network/nfsv4/locks/Makefile b/testcases/network/nfsv4/locks/Makefile dissimilarity index 98% index 24adbe07..1cffdf22 100644 --- a/testcases/network/nfsv4/locks/Makefile +++ b/testcases/network/nfsv4/locks/Makefile @@ -1,12 +1,33 @@ -TARGETS := locktests - -all: $(TARGETS) - -locktests: locktests.c netsync.c - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lpthread - -install: $(TARGETS) - ln -f locktests ../../../bin/locktests - -clean: - $(RM) locktests +# +# network/nfsv4/locks 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +MAKE_TARGETS := locktests + +LDLIBS += -lpthread + +$(MAKE_TARGETS): $(patsubst $(abs_srcdir)/%.c,%.o,$(wildcard $(abs_srcdir)/*.c)) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/rpc/Makefile b/testcases/network/rpc/Makefile dissimilarity index 99% index 9f0b42c9..b7836546 100644 --- a/testcases/network/rpc/Makefile +++ b/testcases/network/rpc/Makefile @@ -1,17 +1,29 @@ -SUBDIRS = basic_tests - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - chmod +x rpc-tirpc-full-test-suite/run_tirpc_tests.sh - ln -f rpc-tirpc-full-test-suite/run_tirpc_tests.sh ../../bin - chmod +x rpc-tirpc-full-test-suite/run_rpc_tests.sh - ln -f rpc-tirpc-full-test-suite/run_rpc_tests.sh ../../bin - chmod +x rpc-tirpc-full-test-suite/rpc_ts_wizard.sh - ln -f rpc-tirpc-full-test-suite/rpc_ts_wizard.sh ../../bin - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - +# +# network/rpc test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := *.sh + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile dissimilarity index 98% index 48949707..31608130 100644 --- a/testcases/network/rpc/basic_tests/Makefile +++ b/testcases/network/rpc/basic_tests/Makefile @@ -1,10 +1,26 @@ -SUBDIRS = rpc01 rpcinfo rup rusers - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# network/rpc/basic_tests test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/rpc/basic_tests/rpc01/Makefile b/testcases/network/rpc/basic_tests/rpc01/Makefile dissimilarity index 97% index 3c3ad4d0..cae4c2e3 100644 --- a/testcases/network/rpc/basic_tests/rpc01/Makefile +++ b/testcases/network/rpc/basic_tests/rpc01/Makefile @@ -1,17 +1,29 @@ -CFLAGS += -w -O -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f rpc01 ../../../../bin - ln -f rpc1 ../../../../bin - ln -f rpc_server ../../../../bin - -clean: - rm -f $(TARGETS) - - +# +# network/rpc/basic_tests/rpc01 test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := rpc01 + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/rpc/basic_tests/rpc01/rpc01 b/testcases/network/rpc/basic_tests/rpc01/rpc01 index fd5a7d3d..be87e944 100755 --- a/testcases/network/rpc/basic_tests/rpc01/rpc01 +++ b/testcases/network/rpc/basic_tests/rpc01/rpc01 @@ -38,8 +38,7 @@ this_file=${0##*/} TC=${TC:=rpc01} TCbin=${TCbin:=`pwd`} TCdat=${TCdat:=$TCbin/datafiles} -TCsrc=${TCsrc:=$TCbin} -TCtmp=${TCtmp:=$TCsrc} +TCtmp=${TCtmp:=$LTPROOT/testcases/bin} NUMLOOPS=${NUMLOOPS:=3} RHOST=${RHOST:=`hostname`} CLEANUP=${CLEANUP:="ON"} diff --git a/testcases/network/rpc/basic_tests/rpc01/rpc1.c b/testcases/network/rpc/basic_tests/rpc01/rpc1.c index 9c00b159..0bd259bf 100644 --- a/testcases/network/rpc/basic_tests/rpc01/rpc1.c +++ b/testcases/network/rpc/basic_tests/rpc01/rpc1.c @@ -23,16 +23,13 @@ struct data { char *data; }; - int xdr_receive_data(XDR *, struct data **); int xdr_send_data(XDR *, struct data *); void do_compare(int, char *, struct data *, char *); +void usage_error(char *program_name); - - -main(argc, argv) -int argc; -char *argv[]; +int +main(int argc, char *argv[]) { struct hostent *hp; struct data buffer, *return_buffer; @@ -170,8 +167,6 @@ char *argv[]; exit(0); } - - void do_compare(int rpc_rc, char *msg, struct data *buffer, char *ret_data) { @@ -190,11 +185,8 @@ do_compare(int rpc_rc, char *msg, struct data *buffer, char *ret_data) } } - - -xdr_receive_data(xdrs, buffer) -XDR *xdrs; -struct data **buffer; +int +xdr_receive_data(XDR *xdrs, struct data **buffer) { struct data *bp; int i, rc; @@ -210,10 +202,8 @@ struct data **buffer; return(rc); } - -xdr_send_data(xdrs, buffer) -XDR *xdrs; -struct data *buffer; +int +xdr_send_data(XDR *xdrs, struct data *buffer) { int i, rc; char *p; @@ -226,12 +216,10 @@ struct data *buffer; return(rc); } - -usage_error(program_name) -char *program_name; +void +usage_error(char *program_name) { fprintf(stderr, "Usage: %s -s server -f file [-p program-number] [-v version]\n", program_name); exit(2); } - diff --git a/testcases/network/rpc/basic_tests/rpc01/rpc_server.c b/testcases/network/rpc/basic_tests/rpc01/rpc_server.c index 855db360..fb600a9b 100644 --- a/testcases/network/rpc/basic_tests/rpc01/rpc_server.c +++ b/testcases/network/rpc/basic_tests/rpc01/rpc_server.c @@ -1,10 +1,11 @@ +#include #include -#include #include #include #include -#include #include +#include +#include int debug = 0; int program = 2000333; @@ -19,16 +20,13 @@ struct data { char *data; }; +void breakpoint(void); +void service_request(struct svc_req *rqstp, SVCXPRT *transp); +int xdr_receive_data(XDR *xdrs, struct data **buffer); +int xdr_send_data(XDR *xdrs, struct data *buffer); - -void service_request(); -int xdr_receive_data(); -int xdr_send_data(); - - -main(argc, argv) -int argc; -char *argv[]; +int +main (int argc, char *argv[]) { SVCXPRT *transp; struct hostent *hp; @@ -98,16 +96,9 @@ char *argv[]; exit(1); } - - - void -service_request(rqstp, transp) -struct svc_req *rqstp; -SVCXPRT *transp; +service_request(struct svc_req *rqstp, SVCXPRT *transp) { - char *s; - int ret; struct data *buffer; switch (rqstp->rq_proc) { @@ -132,11 +123,8 @@ SVCXPRT *transp; } } - - -xdr_receive_data(xdrs, buffer) -XDR *xdrs; -struct data **buffer; +int +xdr_receive_data(XDR *xdrs, struct data **buffer) { struct data *bp; int i, rc; @@ -152,10 +140,8 @@ struct data **buffer; return(rc); } - -xdr_send_data(xdrs, buffer) -XDR *xdrs; -struct data *buffer; +int +xdr_send_data(XDR *xdrs, struct data *buffer) { int i, rc; char *p; @@ -168,12 +154,7 @@ struct data *buffer; return(rc); } - - - - - -breakpoint() +void breakpoint(void) { if (debug) printf("breakpoint\n"); diff --git a/testcases/network/rpc/basic_tests/rpcinfo/Makefile b/testcases/network/rpc/basic_tests/rpcinfo/Makefile dissimilarity index 94% index 8d75bf1f..5ef59513 100644 --- a/testcases/network/rpc/basic_tests/rpcinfo/Makefile +++ b/testcases/network/rpc/basic_tests/rpcinfo/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f rpcinfo01 ../../../../bin - -clean: - +# +# network/rpc/basic_tests/rpcinfo test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := rpcinfo01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01 b/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01 index fcfb5fe4..8cdf1102 100755 --- a/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01 +++ b/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01 @@ -94,8 +94,8 @@ else fi fi -ssh -n $RHOST "ps -ewf" | grep portmap | grep -v grep > /dev/null -[ $? -eq 0 ] || ssh -n $RHOST "ps -ewf" | grep rpcbind | grep -v grep > /dev/null +rsh -n $RHOST "ps -ewf" | grep portmap | grep -v grep > /dev/null +[ $? -eq 0 ] || rsh -n $RHOST "ps -ewf" | grep rpcbind | grep -v grep > /dev/null [ $? -eq 0 ] || end_testcase "The portmap or rpcbind daemon is NOT running on $RHOST" echo "Test rpcinfo with default options" diff --git a/testcases/network/rpc/basic_tests/rup/Makefile b/testcases/network/rpc/basic_tests/rup/Makefile dissimilarity index 94% index ef3f89f3..567c3d83 100644 --- a/testcases/network/rpc/basic_tests/rup/Makefile +++ b/testcases/network/rpc/basic_tests/rup/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f rup01 ../../../../bin - -clean: - +# +# network/rpc/basic_tests/rup test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := rup01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/rpc/basic_tests/rusers/Makefile b/testcases/network/rpc/basic_tests/rusers/Makefile dissimilarity index 94% index fef7e59e..6d7ea41c 100644 --- a/testcases/network/rpc/basic_tests/rusers/Makefile +++ b/testcases/network/rpc/basic_tests/rusers/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f rusers01 ../../../../bin - -clean: - +# +# network/rpc/basic_tests/rusers01 test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := rusers01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/sctp/Makefile b/testcases/network/sctp/Makefile dissimilarity index 98% index 0d4d115d..9d45ac17 100644 --- a/testcases/network/sctp/Makefile +++ b/testcases/network/sctp/Makefile @@ -1,11 +1,57 @@ -SUBDIRS = lib testlib func_tests - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - +# +# network/sctp test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +LIBSCTP := $(DESTDIR)/$(libdir)/libsctp.a +LIBSCTPUTIL := $(DESTDIR)/$(libdir)/libsctputil.a +LIBSCTPDIR := lib +LIBSCTPUTILDIR := testlib + +FILTER_OUT_DIRS := $(LIBSCTPDIR) $(LIBSCTPUTILDIR) + +$(LIBSCTPDIR) $(LIBSCTPUTILDIR): + mkdir -p "$@" + +lib-clean:: $(LIBSCTPDIR) $(LIBSCTPUTILDIR) + for i in $^; do \ + $(MAKE) -C "$$i" -f "$(abs_srcdir)/$$i/Makefile" clean; \ + done + + +$(LIBSCTP): $(LIBSCTPDIR) + set -e; for i in all install; do \ + $(MAKE) -C "$^" -f "$(abs_srcdir)/$^/Makefile" $$i; \ + done + +$(LIBSCTPUTIL): $(LIBSCTPUTILDIR) + set -e; for i in all install; do \ + $(MAKE) -C "$^" -f "$(abs_srcdir)/$^/Makefile" $$i; \ + done + +trunk-all: $(LIBSCTP) $(LIBSCTPUTIL) + +trunk-clean:: | lib-clean + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/sctp/func_tests/Makefile b/testcases/network/sctp/func_tests/Makefile dissimilarity index 72% index ff7dd7c4..b544a7b7 100644 --- a/testcases/network/sctp/func_tests/Makefile +++ b/testcases/network/sctp/func_tests/Makefile @@ -1,148 +1,73 @@ -# -# (C) Copyright IBM Corp. 2001, 2003 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -########################################################################### -# name of file : Makefile # -########################################################################### -INCLUDES += -I../../../../include -I../include -I../testlib -LIBS += -L../../../../lib -L../lib -L../testlib - -CFLAGS += -g $(INCLUDES) -DLTP -Wall - -LOADLIBES += $(LIBS) -lltp -lsctputil -lsctp -lpthread - -V6FLAGS = -DTEST_V6=1 $(CFLAGS) - -SRCS = $(wildcard *.c) - -V4_TARGETS = test_1_to_1_accept_close test_1_to_1_addrs test_1_to_1_connect \ - test_1_to_1_events test_1_to_1_initmsg_connect \ - test_1_to_1_nonblock test_1_to_1_recvfrom test_1_to_1_recvmsg \ - test_1_to_1_rtoinfo test_1_to_1_send test_1_to_1_sendmsg \ - test_1_to_1_sendto test_1_to_1_shutdown \ - test_1_to_1_socket_bind_listen test_1_to_1_sockopt \ - test_1_to_1_threads test_assoc_abort test_assoc_shutdown \ - test_autoclose test_basic test_connect test_fragments \ - test_getname test_inaddr_any test_peeloff test_recvmsg \ - test_sctp_sendrecvmsg test_sockopt test_tcp_style \ - test_timetolive test_1_to_1_connectx test_connectx - -V6_TARGETS = test_basic_v6 test_fragments_v6 test_getname_v6 \ - test_inaddr_any_v6 test_peeloff_v6 test_sctp_sendrecvmsg_v6 \ - test_sockopt_v6 test_tcp_style_v6 test_timetolive_v6 - -all: $(V4_TARGETS) $(V6_TARGETS) - -test_1_to_1_accept_close: test_1_to_1_accept_close.c -test_1_to_1_addrs: test_1_to_1_addrs.c -test_1_to_1_connect: test_1_to_1_connect.c -test_1_to_1_events: test_1_to_1_events.c -test_1_to_1_initmsg_connect: test_1_to_1_initmsg_connect.c -test_1_to_1_nonblock: test_1_to_1_nonblock.c -test_1_to_1_recvfrom: test_1_to_1_recvfrom.c -test_1_to_1_recvmsg: test_1_to_1_recvmsg.c -test_1_to_1_rtoinfo: test_1_to_1_rtoinfo.c -test_1_to_1_send: test_1_to_1_send.c -test_1_to_1_sendmsg: test_1_to_1_sendmsg.c -test_1_to_1_sendto: test_1_to_1_sendto.c -test_1_to_1_shutdown: test_1_to_1_shutdown.c -test_1_to_1_socket_bind_listen: test_1_to_1_socket_bind_listen.c -test_1_to_1_sockopt: test_1_to_1_sockopt.c -test_1_to_1_threads: test_1_to_1_threads.c -test_assoc_abort: test_assoc_abort.c -test_assoc_shutdown: test_assoc_shutdown.c -test_autoclose: test_autoclose.c -test_basic: test_basic.c -test_basic_v6: test_basic_v6.o -test_connect: test_connect.c -test_fragments: test_fragments.c -test_fragments_v6: test_fragments_v6.o -test_getname: test_getname.c -test_getname_v6: test_getname_v6.o -test_inaddr_any: test_inaddr_any.c -test_inaddr_any_v6: test_inaddr_any_v6.o -test_peeloff: test_peeloff.c -test_peeloff_v6: test_peeloff_v6.o -test_recvmsg: test_recvmsg.c -test_sctp_sendrecvmsg: test_sctp_sendrecvmsg.c -test_sctp_sendrecvmsg_v6: test_sctp_sendrecvmsg_v6.o -test_sockopt: test_sockopt.c -test_sockopt_v6: test_sockopt_v6.o -test_tcp_style: test_tcp_style.c -test_tcp_style_v6: test_tcp_style_v6.o -test_timetolive: test_timetolive.c -test_timetolive_v6: test_timetolive_v6.o -test_1_to_1_connectx: test_1_to_1_connectx.c -test_connectx: test_connectx.c - -test_basic_v6.o: test_basic.c - $(CC) -c $(V6FLAGS) -o $@ $^ -test_fragments_v6.o: test_fragments.c - $(CC) -c $(V6FLAGS) -o $@ $^ -test_getname_v6.o: test_getname.c - $(CC) -c $(V6FLAGS) -o $@ $^ -test_inaddr_any_v6.o: test_inaddr_any.c - $(CC) -c $(V6FLAGS) -o $@ $^ -test_peeloff_v6.o: test_peeloff.c - $(CC) -c $(V6FLAGS) -o $@ $^ -test_sctp_sendrecvmsg_v6.o: test_sctp_sendrecvmsg.c - $(CC) -c $(V6FLAGS) -o $@ $^ -test_sockopt_v6.o: test_sockopt.c - $(CC) -c $(V6FLAGS) -o $@ $^ -test_tcp_style_v6.o: test_tcp_style.c - $(CC) -c $(V6FLAGS) -o $@ $^ -test_timetolive_v6.o: test_timetolive.c - $(CC) -c $(V6FLAGS) -o $@ $^ - -v4test: ${V4_TARGETS} - @for a in $^; \ - do \ - echo "./$$a"; \ - if ./$$a; \ - then \ - echo "$$a passes"; \ - echo ""; \ - else \ - echo "$$a fails"; \ - exit 1; \ - fi; \ - done - -v6test: ${V6_TARGETS} - @for a in $^; \ - do \ - echo "./$$a"; \ - if ./$$a; \ - then \ - echo "$$a passes"; \ - echo ""; \ - else \ - echo "$$a fails"; \ - exit 1; \ - fi; \ - done - -install: - ln -f $(V4_TARGETS) ../../../bin - ln -f $(V6_TARGETS) ../../../bin - -clean: - rm -f $(V4_TARGETS) - rm -f $(V6_TARGETS) - rm -f ../../../bin/$(V6_TARGETS) - rm -f *.o +# +# (C) Copyright IBM Corp. 2001, 2003 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +########################################################################### +# name of file : Makefile # +########################################################################### + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -I$(abs_srcdir)/../include -I$(abs_srcdir)/../testlib -DLTP + +LDFLAGS += $(addprefix -L$(abs_builddir)/../,lib testlib) + +LDLIBS += -lsctputil -lsctp -lpthread + +V4_TARGETS := $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*.c)) + +V6_TARGETS := test_basic_v6 test_fragments_v6 test_getname_v6 \ + test_inaddr_any_v6 test_peeloff_v6 \ + test_sctp_sendrecvmsg_v6 test_sockopt_v6 \ + test_tcp_style_v6 test_timetolive_v6 + +$(V6_TARGETS): CPPFLAGS += -DTEST_V6=1 + +%_v6.o: %.c + $(COMPILE.c) $(OUTPUT_OPTION) $< + +MAKE_TARGETS := $(V4_TARGETS) $(V6_TARGETS) + +v4test: $(V4_TARGETS) + @for a in $^; \ + do \ + echo "./$$a"; \ + if ./$$a; then \ + echo "$$a - passed"; \ + echo ""; \ + else \ + echo "$$a - failed"; \ + exit 1; \ + fi; \ + done + +v6test: $(V6_TARGETS) + @for a in $^; \ + do \ + echo "./$$a"; \ + if ./$$a; then \ + echo "$$a - passed"; \ + echo ""; \ + else \ + echo "$$a - failed"; \ + exit 1; \ + fi; \ + done + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/sctp/lib/Makefile b/testcases/network/sctp/lib/Makefile dissimilarity index 98% index 0f767bc9..f0d0b6f6 100644 --- a/testcases/network/sctp/lib/Makefile +++ b/testcases/network/sctp/lib/Makefile @@ -1,42 +1,31 @@ -# -# (C) Copyright IBM Corp. 2003 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -######################################################################### -# name of file : Makefile # -# description : make(1) description file to build SCTP library # -# # -######################################################################### -INCLUDES+=-I../include - -CFLAGS += -g $(INCLUDES) -SRCS=addrs.c bindx.c opt_info.c peeloff.c recvmsg.c sendmsg.c connectx.c -OBJS=$(SRCS:.c=.o) -MAINS=libsctp.a - -all: libsctp.a - -libsctp.a: $(OBJS) - $(AR) -rc $@ $(OBJS) - -$(OBJS): $(SRCS) ../include/netinet/sctp.h - $(CC) -c $(SRCS) $(CFLAGS) - -install: - -clean: - /bin/rm -rf $(OBJS) libsctp.a +# +# testcases/network/sctp/lib 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -I$(abs_srcdir)/../include + +LIB := libsctp.a + +include $(top_srcdir)/include/mk/lib.mk diff --git a/testcases/network/sctp/testlib/Makefile b/testcases/network/sctp/testlib/Makefile dissimilarity index 98% index 2f00fa62..4994016b 100644 --- a/testcases/network/sctp/testlib/Makefile +++ b/testcases/network/sctp/testlib/Makefile @@ -1,44 +1,41 @@ -# -# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -######################################################################### -# name of file : Makefile # -# description : make(1) description file to build a library for the # -# common routines in the sctp tests. # -######################################################################### -INCLUDES+=-I../../../../include -I../include -I. -LIBS+=-L../../../../lib -L../lib - -CFLAGS += -g $(INCLUDES) -DLTP -D_USC_LIB_ -LOADLIBES += $(LIBS) -lltp -lsctp -SRCS=sctputil.c -OBJS=$(SRCS:.c=.o) -MAINS=libsctputil.a - -all: libsctputil.a - -libsctputil.a: $(OBJS) - $(AR) -rc $@ $(OBJS) - -$(OBJS): $(SRCS) ../include/netinet/sctp.h - $(CC) -c $(SRCS) $(CFLAGS) - -install: - -clean: - /bin/rm -rf $(OBJS) libsctputil.a +# +# testcases/network/sctp/testlib 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -DLTP -D_USC_LIB_ -I$(abs_srcdir)/../include + +LDLIBS += -lltp -lsctp + +LIB := libsctputil.a + +# +#DEPLIBDIR := ../lib + +include $(top_srcdir)/include/mk/lib.mk + +#$(MAKE_TARGETS): | libsctp.a + +#$()/libsctp.a: +# $(MAKE) -C $(builddir)/../lib all diff --git a/testcases/network/sctp/testlib/sctputil.c b/testcases/network/sctp/testlib/sctputil.c index e8cbdfd0..05c4d70b 100644 --- a/testcases/network/sctp/testlib/sctputil.c +++ b/testcases/network/sctp/testlib/sctputil.c @@ -50,8 +50,8 @@ #include #include #include -#include -#include +#include "netinet/sctp.h" +#include "sctputil.h" /* This function prints the cmsg data. */ void diff --git a/testcases/network/sockets/Makefile b/testcases/network/sockets/Makefile dissimilarity index 98% index 77a8b419..763d72e7 100644 --- a/testcases/network/sockets/Makefile +++ b/testcases/network/sockets/Makefile @@ -1,37 +1,31 @@ -# -# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -########################################################################### -# name of file : Makefile # -# description : make(2) erver & client for socket tests # -########################################################################### -CFLAGS+= -I../../../../include -Wall -g -LOADLIBES+= -lpthread - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS) ; do ln -f $$i ../../bin/$$i ; done ; - -clean: - rm -f $(TARGETS) - - +# +# network/sockets 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := ltpSockets.sh + +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/Makefile b/testcases/network/stress/Makefile dissimilarity index 98% index 70576a23..673392ef 100644 --- a/testcases/network/stress/Makefile +++ b/testcases/network/stress/Makefile @@ -1,10 +1,26 @@ -SUBDIRS = `ls */Makefile | sed "s/Makefile//g"` - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# network/stress test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/stress/broken_ip/Makefile b/testcases/network/stress/broken_ip/Makefile dissimilarity index 99% index f7e072c8..af5b54d6 100644 --- a/testcases/network/stress/broken_ip/Makefile +++ b/testcases/network/stress/broken_ip/Makefile @@ -1,14 +1,31 @@ -SCRIPTS = broken_ip4-version broken_ip4-ihl broken_ip4-totlen \ - broken_ip4-fragment broken_ip4-protcol \ - broken_ip4-checksum broken_ip4-dstaddr \ - broken_ip6-version broken_ip6-plen \ - broken_ip6-nexthdr broken_ip6-dstaddr - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../bin/$$i ; done +# +# network/stress/broken_ip test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := broken_ip* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/dns/Makefile b/testcases/network/stress/dns/Makefile dissimilarity index 98% index 459f411f..a627839a 100644 --- a/testcases/network/stress/dns/Makefile +++ b/testcases/network/stress/dns/Makefile @@ -1,11 +1,31 @@ -SCRIPTS = dns4-stress dns6-stress \ - dns-stress01-rmt dns-stress02-rmt - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../bin/$$i ; done +# +# network/stress/dns test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := dns-* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/ftp/Makefile b/testcases/network/stress/ftp/Makefile dissimilarity index 99% index fb9c2909..a1a5224c 100644 --- a/testcases/network/stress/ftp/Makefile +++ b/testcases/network/stress/ftp/Makefile @@ -1,13 +1,31 @@ -SCRIPTS = ftp4-download-stress ftp6-download-stress \ - ftp-download-stress01-rmt ftp-download-stress02-rmt \ - ftp4-upload-stress ftp6-upload-stress \ - ftp-upload-stress01-rmt ftp-upload-stress02-rmt - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../bin/$$i ; done +# +# network/stress/ftp test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := ftp-* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/http/Makefile b/testcases/network/stress/http/Makefile dissimilarity index 98% index 6c49c872..35d9e5f4 100644 --- a/testcases/network/stress/http/Makefile +++ b/testcases/network/stress/http/Makefile @@ -1,11 +1,31 @@ -SCRIPTS = http4-stress http6-stress \ - http-stress01-rmt http-stress02-rmt - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../bin/$$i ; done +# +# network/stress/http test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := http-* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/icmp/Makefile b/testcases/network/stress/icmp/Makefile dissimilarity index 98% index 70576a23..0dad1d13 100644 --- a/testcases/network/stress/icmp/Makefile +++ b/testcases/network/stress/icmp/Makefile @@ -1,10 +1,26 @@ -SUBDIRS = `ls */Makefile | sed "s/Makefile//g"` - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# network/stress/icmp test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/stress/icmp/multi-diffip/Makefile b/testcases/network/stress/icmp/multi-diffip/Makefile dissimilarity index 99% index 03031dc0..d114c452 100644 --- a/testcases/network/stress/icmp/multi-diffip/Makefile +++ b/testcases/network/stress/icmp/multi-diffip/Makefile @@ -1,17 +1,31 @@ -SCRIPTS = icmp4-multi-diffip01 \ - icmp4-multi-diffip02 icmp4-multi-diffip03 \ - icmp4-multi-diffip04 icmp4-multi-diffip05 \ - icmp4-multi-diffip06 icmp4-multi-diffip07 \ - icmp6-multi-diffip01 \ - icmp6-multi-diffip02 icmp6-multi-diffip03 \ - icmp6-multi-diffip04 icmp6-multi-diffip05 \ - icmp6-multi-diffip06 icmp6-multi-diffip07 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/icmp/multi-diffip testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := icmp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/icmp/multi-diffnic/Makefile b/testcases/network/stress/icmp/multi-diffnic/Makefile dissimilarity index 99% index 0ea07f58..4746e87f 100644 --- a/testcases/network/stress/icmp/multi-diffnic/Makefile +++ b/testcases/network/stress/icmp/multi-diffnic/Makefile @@ -1,17 +1,31 @@ -SCRIPTS = icmp4-multi-diffnic01 \ - icmp4-multi-diffnic02 icmp4-multi-diffnic03 \ - icmp4-multi-diffnic04 icmp4-multi-diffnic05 \ - icmp4-multi-diffnic06 icmp4-multi-diffnic07 \ - icmp6-multi-diffnic01 \ - icmp6-multi-diffnic02 icmp6-multi-diffnic03 \ - icmp6-multi-diffnic04 icmp6-multi-diffnic05 \ - icmp6-multi-diffnic06 icmp6-multi-diffnic07 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/icmp/multi-diffnic testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := icmp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/icmp/uni-basic/Makefile b/testcases/network/stress/icmp/uni-basic/Makefile dissimilarity index 99% index dcf1c663..d5d15eb3 100644 --- a/testcases/network/stress/icmp/uni-basic/Makefile +++ b/testcases/network/stress/icmp/uni-basic/Makefile @@ -1,17 +1,31 @@ -SCRIPTS = icmp4-uni-basic01 \ - icmp4-uni-basic02 icmp4-uni-basic03 \ - icmp4-uni-basic04 icmp4-uni-basic05 \ - icmp4-uni-basic06 icmp4-uni-basic07 \ - icmp6-uni-basic01 \ - icmp6-uni-basic02 icmp6-uni-basic03 \ - icmp6-uni-basic04 icmp6-uni-basic05 \ - icmp6-uni-basic06 icmp6-uni-basic07 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/icmp/uni-basic testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := icmp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/interface/Makefile b/testcases/network/stress/interface/Makefile dissimilarity index 99% index 702c1687..f4fda671 100644 --- a/testcases/network/stress/interface/Makefile +++ b/testcases/network/stress/interface/Makefile @@ -1,18 +1,31 @@ -SCRIPTS = if4-updown \ - if4-addr-change \ - if4-alias-adddel if4-alias-addlarge \ - if4-route-adddel if4-route-addlarge \ - if4-mtu-change \ - if6-updown \ - if6-addr-adddel if6-addr-addlarge \ - if6-route-adddel if6-route-addlarge \ - if6-mtu-change - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../bin/$$i ; done +# +# network/stress/interface test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := if* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/multicast/Makefile b/testcases/network/stress/multicast/Makefile dissimilarity index 98% index 70576a23..79286a85 100644 --- a/testcases/network/stress/multicast/Makefile +++ b/testcases/network/stress/multicast/Makefile @@ -1,10 +1,26 @@ -SUBDIRS = `ls */Makefile | sed "s/Makefile//g"` - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# network/stress/multicast test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/stress/multicast/grp-operation/Makefile b/testcases/network/stress/multicast/grp-operation/Makefile dissimilarity index 99% index 0ff7f05a..37d28f01 100644 --- a/testcases/network/stress/multicast/grp-operation/Makefile +++ b/testcases/network/stress/multicast/grp-operation/Makefile @@ -1,11 +1,31 @@ -SCRIPTS = mcast4-grpope01 mcast4-grpope02 mcast4-grpope03 mcast4-grpope04 \ - mcast6-grpope01 mcast6-grpope02 mcast6-grpope03 mcast6-grpope04 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/grp-operation 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. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := mcast* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/multicast/packet-flood/Makefile b/testcases/network/stress/multicast/packet-flood/Makefile dissimilarity index 98% index 15857176..53b53611 100644 --- a/testcases/network/stress/multicast/packet-flood/Makefile +++ b/testcases/network/stress/multicast/packet-flood/Makefile @@ -1,11 +1,31 @@ -SCRIPTS = mcast4-pktfld01 mcast4-pktfld02 \ - mcast6-pktfld01 mcast6-pktfld02 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/packet-flood 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. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := mcast* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/multicast/query-flood/Makefile b/testcases/network/stress/multicast/query-flood/Makefile dissimilarity index 99% index 68bfb0c5..e4999550 100644 --- a/testcases/network/stress/multicast/query-flood/Makefile +++ b/testcases/network/stress/multicast/query-flood/Makefile @@ -1,13 +1,31 @@ -SCRIPTS = mcast4-queryfld01 mcast4-queryfld02 mcast4-queryfld03 \ - mcast4-queryfld04 mcast4-queryfld05 mcast4-queryfld06 \ - mcast6-queryfld01 mcast6-queryfld02 mcast6-queryfld03 \ - mcast6-queryfld04 mcast6-queryfld05 mcast6-queryfld06 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/query-flood 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. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := mcast* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/ns-tools/Makefile b/testcases/network/stress/ns-tools/Makefile dissimilarity index 99% index ca5f1736..944a5db0 100644 --- a/testcases/network/stress/ns-tools/Makefile +++ b/testcases/network/stress/ns-tools/Makefile @@ -1,62 +1,38 @@ -SCRIPTS=check_envval \ - get_ifname initialize_if set_ipv4addr add_ipv6addr \ - check_icmpv4_connectivity check_icmpv6_connectivity \ - check_netem check_setkey \ - create_file \ - find_portbundle \ - bg_tcp_traffic \ - killall_icmp_traffic killall_tcp_traffic killall_udp_traffic \ - output_ipsec_conf \ - ns-echoclient - -BINS=ns-tcpserver ns-tcpclient ns-udpserver ns-udpclient \ - ns-icmpv4_sender ns-icmpv6_sender \ - ns-udpsender \ - ns-icmp_redirector \ - ns-mcast_receiver ns-igmp_querier \ - ns-mcast_join - -TARGETS=$(SCRIPTS) $(BINS) - -#CC=gcc -#CFLAGS=-g -Wall -#CFLAGS=-O2 -CFLAGS += -Wall - -all: scripts $(BINS) - -ns-tcpserver: ns-common.o ns-tcpserver.o -ns-tcpclient: ns-common.o ns-tcpclient.o -ns-udpserver: ns-common.o ns-udpserver.o -ns-udpclient: ns-common.o ns-udpclient.o -ns-icmpv4_sender: ns-common.o ns-icmpv4_sender.o -ns-icmpv6_sender: ns-common.o ns-icmpv6_sender.o -ns-udpsender: ns-common.o ns-udpsender.o -ns-icmp_redirector: ns-common.o ns-icmp_redirector.o -ns-mcast_receiver: ns-common.o ns-mcast_receiver.o -ns-igmp_querier: ns-common.o ns-igmp_querier.o -ns-mcast_join: ns-common.o ns-mcast_join.o - -ns-common.o: ns-traffic.h ns-common.c -ns-tcpserver.o: ns-traffic.h ns-tcpserver.c -ns-tcpclient.o: ns-traffic.h ns-tcpclient.c -ns-udpserver.o: ns-traffic.h ns-udpserver.c -ns-udpclient.o: ns-traffic.h ns-udpclient.c -ns-icmpv4_sender.o: ns-traffic.h ns-icmpv4_sender.c -ns-icmpv6_sender.o: ns-traffic.h ns-icmpv6_sender.c -ns-udpsender.o: ns-traffic.h ns-udpsender.c -ns-icmp_redirector.o: ns-traffic.h ns-icmp_redirector.c -ns-mcast_receiver.o: ns-traffic.h ns-mcast.h ns-mcast_receiver.c -ns-igmp_querier.o: ns-traffic.h ns-mcast.h ns-igmp_querier.c -ns-mcast_join.o: ns-traffic.h ns-mcast.h ns-mcast_join.c - -scripts: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done - -clean: - @set -e; for i in $(TARGETS); do rm -f ../../../bin/$$i ; done - rm -f $(BINS) *.o - @true +# +# network/stress/ns-tools test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := check_envval get_ifname initialize_if set_ipv4addr \ + add_ipv6addr check_icmpv4_connectivity \ + check_icmpv6_connectivity check_netem check_setkey \ + create_file find_portbundle bg_tcp_traffic \ + killall_icmp_traffic killall_tcp_traffic \ + killall_udp_traffic output_ipsec_conf ns-echoclient + +FILTER_OUT_MAKE_TARGETS := ns-common + +include $(top_srcdir)/include/mk/generic_leaf_target.mk + +$(MAKE_TARGETS): %: %.o ns-common.o diff --git a/testcases/network/stress/ns-tools/check_envval b/testcases/network/stress/ns-tools/check_envval index d8a7f4ea..16bcfe9b 100644 --- a/testcases/network/stress/ns-tools/check_envval +++ b/testcases/network/stress/ns-tools/check_envval @@ -42,6 +42,10 @@ #trace_logic=${trace_logic:-"set -x"} $trace_logic +. cmdlib.sh + +exists cut locale rsh + # Unset the locale cocerned variables for env in `locale | cut -f 1 -d '='` ; do unset $env @@ -49,24 +53,28 @@ done unset LANGUAGE # RHOST +RHOST=${RHOST:=127.0.0.1} if [ x${RHOST} = x ]; then tst_resm TBROK "Environment variable RHOST is not set." exit 1 fi # LHOST_HWADDRS +LHOST_HWADDRS=${LHOST_HWADDRS:=} if [ x"${LHOST_HWADDRS}" = x ]; then tst_resm TBROK "Environment variable LHOST_HWADDRS is not set." exit 1 fi # RHOST_HWADDRS +RHOST_HWADDRS=${RHOST_HWADDRS:=} if [ x"${RHOST_HWADDRS}" = x ]; then tst_resm TBROK "Environment variable RHOST_HWADDRS is not set." exit 1 fi # LTP_RSH +LTP_RSH=${LTP_RSH:=} if [ x"${LTP_RSH}" = x ]; then LTP_RSH="rsh -n" elif [ "$LTP_RSH" = "rsh" ]; then @@ -74,6 +82,7 @@ elif [ "$LTP_RSH" = "rsh" ]; then fi # TMPDIR +TMPDIR=${TMPDIR:=} if [ x"${TMPDIR}" = x ]; then TMPDIR=/tmp fi diff --git a/testcases/network/stress/route/Makefile b/testcases/network/stress/route/Makefile dissimilarity index 99% index 14017f3f..0632e8c1 100644 --- a/testcases/network/stress/route/Makefile +++ b/testcases/network/stress/route/Makefile @@ -1,13 +1,29 @@ -SCRIPTS = route4-change-dst route4-change-gw route4-change-if \ - route4-redirect route4-ifdown route4-rmmod \ - route6-change-dst route6-change-gw route6-change-if \ - route6-redirect route6-ifdown route6-rmmod - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../bin/$$i ; done +# +# network/stress/route test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := route* + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/ssh/Makefile b/testcases/network/stress/ssh/Makefile dissimilarity index 98% index 07f0b56b..05bc06fa 100644 --- a/testcases/network/stress/ssh/Makefile +++ b/testcases/network/stress/ssh/Makefile @@ -1,11 +1,29 @@ -SCRIPTS = ssh4-stress ssh6-stress \ - ssh-stress01-rmt ssh-stress02-rmt ssh-stress03-rmt - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../bin/$$i ; done +# +# testcases/network/stress/ssh 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. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := ssh* + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/Makefile b/testcases/network/stress/tcp/Makefile dissimilarity index 98% index 70576a23..1bd9dba5 100644 --- a/testcases/network/stress/tcp/Makefile +++ b/testcases/network/stress/tcp/Makefile @@ -1,10 +1,26 @@ -SUBDIRS = `ls */Makefile | sed "s/Makefile//g"` - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# testcases/network/stress/tcp 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. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/stress/tcp/multi-diffip/Makefile b/testcases/network/stress/tcp/multi-diffip/Makefile dissimilarity index 99% index 6ffff148..d94f9d38 100644 --- a/testcases/network/stress/tcp/multi-diffip/Makefile +++ b/testcases/network/stress/tcp/multi-diffip/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-multi-diffip01 \ - tcp4-multi-diffip02 tcp4-multi-diffip03 \ - tcp4-multi-diffip04 tcp4-multi-diffip05 \ - tcp4-multi-diffip06 tcp4-multi-diffip07 \ - tcp4-multi-diffip08 \ - tcp4-multi-diffip09 tcp4-multi-diffip10 \ - tcp4-multi-diffip11 tcp4-multi-diffip12 \ - tcp4-multi-diffip13 tcp4-multi-diffip14 \ - tcp6-multi-diffip01 \ - tcp6-multi-diffip02 tcp6-multi-diffip03 \ - tcp6-multi-diffip04 tcp6-multi-diffip05 \ - tcp6-multi-diffip06 tcp6-multi-diffip07 \ - tcp6-multi-diffip08 \ - tcp6-multi-diffip09 tcp6-multi-diffip10 \ - tcp6-multi-diffip11 tcp6-multi-diffip12 \ - tcp6-multi-diffip13 tcp6-multi-diffip14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/multi-diffip testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/multi-diffnic/Makefile b/testcases/network/stress/tcp/multi-diffnic/Makefile dissimilarity index 99% index 69cd7034..d25d20e8 100644 --- a/testcases/network/stress/tcp/multi-diffnic/Makefile +++ b/testcases/network/stress/tcp/multi-diffnic/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-multi-diffnic01 \ - tcp4-multi-diffnic02 tcp4-multi-diffnic03 \ - tcp4-multi-diffnic04 tcp4-multi-diffnic05 \ - tcp4-multi-diffnic06 tcp4-multi-diffnic07 \ - tcp4-multi-diffnic08 \ - tcp4-multi-diffnic09 tcp4-multi-diffnic10 \ - tcp4-multi-diffnic11 tcp4-multi-diffnic12 \ - tcp4-multi-diffnic13 tcp4-multi-diffnic14 \ - tcp6-multi-diffnic01 \ - tcp6-multi-diffnic02 tcp6-multi-diffnic03 \ - tcp6-multi-diffnic04 tcp6-multi-diffnic05 \ - tcp6-multi-diffnic06 tcp6-multi-diffnic07 \ - tcp6-multi-diffnic08 \ - tcp6-multi-diffnic09 tcp6-multi-diffnic10 \ - tcp6-multi-diffnic11 tcp6-multi-diffnic12 \ - tcp6-multi-diffnic13 tcp6-multi-diffnic14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/multi-diffnic testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/multi-diffport/Makefile b/testcases/network/stress/tcp/multi-diffport/Makefile dissimilarity index 99% index b3e90581..5e0bdf2c 100644 --- a/testcases/network/stress/tcp/multi-diffport/Makefile +++ b/testcases/network/stress/tcp/multi-diffport/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-multi-diffport01 \ - tcp4-multi-diffport02 tcp4-multi-diffport03 \ - tcp4-multi-diffport04 tcp4-multi-diffport05 \ - tcp4-multi-diffport06 tcp4-multi-diffport07 \ - tcp4-multi-diffport08 \ - tcp4-multi-diffport09 tcp4-multi-diffport10 \ - tcp4-multi-diffport11 tcp4-multi-diffport12 \ - tcp4-multi-diffport13 tcp4-multi-diffport14 \ - tcp6-multi-diffport01 \ - tcp6-multi-diffport02 tcp6-multi-diffport03 \ - tcp6-multi-diffport04 tcp6-multi-diffport05 \ - tcp6-multi-diffport06 tcp6-multi-diffport07 \ - tcp6-multi-diffport08 \ - tcp6-multi-diffport09 tcp6-multi-diffport10 \ - tcp6-multi-diffport11 tcp6-multi-diffport12 \ - tcp6-multi-diffport13 tcp6-multi-diffport14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/multi-diffport testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/multi-sameport/Makefile b/testcases/network/stress/tcp/multi-sameport/Makefile dissimilarity index 99% index 07774398..fb127b88 100644 --- a/testcases/network/stress/tcp/multi-sameport/Makefile +++ b/testcases/network/stress/tcp/multi-sameport/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-multi-sameport01 \ - tcp4-multi-sameport02 tcp4-multi-sameport03 \ - tcp4-multi-sameport04 tcp4-multi-sameport05 \ - tcp4-multi-sameport06 tcp4-multi-sameport07 \ - tcp4-multi-sameport08 \ - tcp4-multi-sameport09 tcp4-multi-sameport10 \ - tcp4-multi-sameport11 tcp4-multi-sameport12 \ - tcp4-multi-sameport13 tcp4-multi-sameport14 \ - tcp6-multi-sameport01 \ - tcp6-multi-sameport02 tcp6-multi-sameport03 \ - tcp6-multi-sameport04 tcp6-multi-sameport05 \ - tcp6-multi-sameport06 tcp6-multi-sameport07 \ - tcp6-multi-sameport08 \ - tcp6-multi-sameport09 tcp6-multi-sameport10 \ - tcp6-multi-sameport11 tcp6-multi-sameport12 \ - tcp6-multi-sameport13 tcp6-multi-sameport14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/multi-sameport testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/uni-basic/Makefile b/testcases/network/stress/tcp/uni-basic/Makefile dissimilarity index 99% index d831a4e2..09f1071a 100644 --- a/testcases/network/stress/tcp/uni-basic/Makefile +++ b/testcases/network/stress/tcp/uni-basic/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-uni-basic01 \ - tcp4-uni-basic02 tcp4-uni-basic03 \ - tcp4-uni-basic04 tcp4-uni-basic05 \ - tcp4-uni-basic06 tcp4-uni-basic07 \ - tcp4-uni-basic08 \ - tcp4-uni-basic09 tcp4-uni-basic10 \ - tcp4-uni-basic11 tcp4-uni-basic12 \ - tcp4-uni-basic13 tcp4-uni-basic14 \ - tcp6-uni-basic01 \ - tcp6-uni-basic02 tcp6-uni-basic03 \ - tcp6-uni-basic04 tcp6-uni-basic05 \ - tcp6-uni-basic06 tcp6-uni-basic07 \ - tcp6-uni-basic08 \ - tcp6-uni-basic09 tcp6-uni-basic10 \ - tcp6-uni-basic11 tcp6-uni-basic12 \ - tcp6-uni-basic13 tcp6-uni-basic14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/uni-basic testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/uni-dsackoff/Makefile b/testcases/network/stress/tcp/uni-dsackoff/Makefile dissimilarity index 99% index 84f4b84c..df31c1a2 100644 --- a/testcases/network/stress/tcp/uni-dsackoff/Makefile +++ b/testcases/network/stress/tcp/uni-dsackoff/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-uni-dsackoff01 \ - tcp4-uni-dsackoff02 tcp4-uni-dsackoff03 \ - tcp4-uni-dsackoff04 tcp4-uni-dsackoff05 \ - tcp4-uni-dsackoff06 tcp4-uni-dsackoff07 \ - tcp4-uni-dsackoff08 \ - tcp4-uni-dsackoff09 tcp4-uni-dsackoff10 \ - tcp4-uni-dsackoff11 tcp4-uni-dsackoff12 \ - tcp4-uni-dsackoff13 tcp4-uni-dsackoff14 \ - tcp6-uni-dsackoff01 \ - tcp6-uni-dsackoff02 tcp6-uni-dsackoff03 \ - tcp6-uni-dsackoff04 tcp6-uni-dsackoff05 \ - tcp6-uni-dsackoff06 tcp6-uni-dsackoff07 \ - tcp6-uni-dsackoff08 \ - tcp6-uni-dsackoff09 tcp6-uni-dsackoff10 \ - tcp6-uni-dsackoff11 tcp6-uni-dsackoff12 \ - tcp6-uni-dsackoff13 tcp6-uni-dsackoff14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/uni-dsackoff testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/uni-pktlossdup/Makefile b/testcases/network/stress/tcp/uni-pktlossdup/Makefile dissimilarity index 99% index 577a99fb..54cf4691 100644 --- a/testcases/network/stress/tcp/uni-pktlossdup/Makefile +++ b/testcases/network/stress/tcp/uni-pktlossdup/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-uni-pktlossdup01 \ - tcp4-uni-pktlossdup02 tcp4-uni-pktlossdup03 \ - tcp4-uni-pktlossdup04 tcp4-uni-pktlossdup05 \ - tcp4-uni-pktlossdup06 tcp4-uni-pktlossdup07 \ - tcp4-uni-pktlossdup08 \ - tcp4-uni-pktlossdup09 tcp4-uni-pktlossdup10 \ - tcp4-uni-pktlossdup11 tcp4-uni-pktlossdup12 \ - tcp4-uni-pktlossdup13 tcp4-uni-pktlossdup14 \ - tcp6-uni-pktlossdup01 \ - tcp6-uni-pktlossdup02 tcp6-uni-pktlossdup03 \ - tcp6-uni-pktlossdup04 tcp6-uni-pktlossdup05 \ - tcp6-uni-pktlossdup06 tcp6-uni-pktlossdup07 \ - tcp6-uni-pktlossdup08 \ - tcp6-uni-pktlossdup09 tcp6-uni-pktlossdup10 \ - tcp6-uni-pktlossdup11 tcp6-uni-pktlossdup12 \ - tcp6-uni-pktlossdup13 tcp6-uni-pktlossdup14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/uni-pktlossdup testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/uni-sackoff/Makefile b/testcases/network/stress/tcp/uni-sackoff/Makefile dissimilarity index 99% index 899b922f..890aa274 100644 --- a/testcases/network/stress/tcp/uni-sackoff/Makefile +++ b/testcases/network/stress/tcp/uni-sackoff/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-uni-sackoff01 \ - tcp4-uni-sackoff02 tcp4-uni-sackoff03 \ - tcp4-uni-sackoff04 tcp4-uni-sackoff05 \ - tcp4-uni-sackoff06 tcp4-uni-sackoff07 \ - tcp4-uni-sackoff08 \ - tcp4-uni-sackoff09 tcp4-uni-sackoff10 \ - tcp4-uni-sackoff11 tcp4-uni-sackoff12 \ - tcp4-uni-sackoff13 tcp4-uni-sackoff14 \ - tcp6-uni-sackoff01 \ - tcp6-uni-sackoff02 tcp6-uni-sackoff03 \ - tcp6-uni-sackoff04 tcp6-uni-sackoff05 \ - tcp6-uni-sackoff06 tcp6-uni-sackoff07 \ - tcp6-uni-sackoff08 \ - tcp6-uni-sackoff09 tcp6-uni-sackoff10 \ - tcp6-uni-sackoff11 tcp6-uni-sackoff12 \ - tcp6-uni-sackoff13 tcp6-uni-sackoff14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/uni-sackoff testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/uni-smallsend/Makefile b/testcases/network/stress/tcp/uni-smallsend/Makefile dissimilarity index 99% index d8cdbca8..27c8c2c6 100644 --- a/testcases/network/stress/tcp/uni-smallsend/Makefile +++ b/testcases/network/stress/tcp/uni-smallsend/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-uni-smallsend01 \ - tcp4-uni-smallsend02 tcp4-uni-smallsend03 \ - tcp4-uni-smallsend04 tcp4-uni-smallsend05 \ - tcp4-uni-smallsend06 tcp4-uni-smallsend07 \ - tcp4-uni-smallsend08 \ - tcp4-uni-smallsend09 tcp4-uni-smallsend10 \ - tcp4-uni-smallsend11 tcp4-uni-smallsend12 \ - tcp4-uni-smallsend13 tcp4-uni-smallsend14 \ - tcp6-uni-smallsend01 \ - tcp6-uni-smallsend02 tcp6-uni-smallsend03 \ - tcp6-uni-smallsend04 tcp6-uni-smallsend05 \ - tcp6-uni-smallsend06 tcp6-uni-smallsend07 \ - tcp6-uni-smallsend08 \ - tcp6-uni-smallsend09 tcp6-uni-smallsend10 \ - tcp6-uni-smallsend11 tcp6-uni-smallsend12 \ - tcp6-uni-smallsend13 tcp6-uni-smallsend14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/uni-smallsend testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/uni-tso/Makefile b/testcases/network/stress/tcp/uni-tso/Makefile dissimilarity index 99% index 06078c4d..64e98598 100644 --- a/testcases/network/stress/tcp/uni-tso/Makefile +++ b/testcases/network/stress/tcp/uni-tso/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-uni-tso01 \ - tcp4-uni-tso02 tcp4-uni-tso03 \ - tcp4-uni-tso04 tcp4-uni-tso05 \ - tcp4-uni-tso06 tcp4-uni-tso07 \ - tcp4-uni-tso08 \ - tcp4-uni-tso09 tcp4-uni-tso10 \ - tcp4-uni-tso11 tcp4-uni-tso12 \ - tcp4-uni-tso13 tcp4-uni-tso14 \ - tcp6-uni-tso01 \ - tcp6-uni-tso02 tcp6-uni-tso03 \ - tcp6-uni-tso04 tcp6-uni-tso05 \ - tcp6-uni-tso06 tcp6-uni-tso07 \ - tcp6-uni-tso08 \ - tcp6-uni-tso09 tcp6-uni-tso10 \ - tcp6-uni-tso11 tcp6-uni-tso12 \ - tcp6-uni-tso13 tcp6-uni-tso14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/uni-tso testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/tcp/uni-winscale/Makefile b/testcases/network/stress/tcp/uni-winscale/Makefile dissimilarity index 99% index e91c3d7c..bf051cf9 100644 --- a/testcases/network/stress/tcp/uni-winscale/Makefile +++ b/testcases/network/stress/tcp/uni-winscale/Makefile @@ -1,25 +1,31 @@ -SCRIPTS = tcp4-uni-winscale01 \ - tcp4-uni-winscale02 tcp4-uni-winscale03 \ - tcp4-uni-winscale04 tcp4-uni-winscale05 \ - tcp4-uni-winscale06 tcp4-uni-winscale07 \ - tcp4-uni-winscale08 \ - tcp4-uni-winscale09 tcp4-uni-winscale10 \ - tcp4-uni-winscale11 tcp4-uni-winscale12 \ - tcp4-uni-winscale13 tcp4-uni-winscale14 \ - tcp6-uni-winscale01 \ - tcp6-uni-winscale02 tcp6-uni-winscale03 \ - tcp6-uni-winscale04 tcp6-uni-winscale05 \ - tcp6-uni-winscale06 tcp6-uni-winscale07 \ - tcp6-uni-winscale08 \ - tcp6-uni-winscale09 tcp6-uni-winscale10 \ - tcp6-uni-winscale11 tcp6-uni-winscale12 \ - tcp6-uni-winscale13 tcp6-uni-winscale14 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/tcp/uni-winscale testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/udp/Makefile b/testcases/network/stress/udp/Makefile dissimilarity index 98% index 70576a23..31e1f7d6 100644 --- a/testcases/network/stress/udp/Makefile +++ b/testcases/network/stress/udp/Makefile @@ -1,10 +1,26 @@ -SUBDIRS = `ls */Makefile | sed "s/Makefile//g"` - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# testcases/network/stress/udp 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. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/stress/udp/multi-diffip/Makefile b/testcases/network/stress/udp/multi-diffip/Makefile dissimilarity index 99% index 046c8b13..a0f21482 100644 --- a/testcases/network/stress/udp/multi-diffip/Makefile +++ b/testcases/network/stress/udp/multi-diffip/Makefile @@ -1,17 +1,31 @@ -SCRIPTS = udp4-multi-diffip01 \ - udp4-multi-diffip02 udp4-multi-diffip03 \ - udp4-multi-diffip04 udp4-multi-diffip05 \ - udp4-multi-diffip06 udp4-multi-diffip07 \ - udp6-multi-diffip01 \ - udp6-multi-diffip02 udp6-multi-diffip03 \ - udp6-multi-diffip04 udp6-multi-diffip05 \ - udp6-multi-diffip06 udp6-multi-diffip07 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/udp/multi-diffip testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := udp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/udp/multi-diffnic/Makefile b/testcases/network/stress/udp/multi-diffnic/Makefile dissimilarity index 99% index 7587bb5b..607ec12e 100644 --- a/testcases/network/stress/udp/multi-diffnic/Makefile +++ b/testcases/network/stress/udp/multi-diffnic/Makefile @@ -1,17 +1,31 @@ -SCRIPTS = udp4-multi-diffnic01 \ - udp4-multi-diffnic02 udp4-multi-diffnic03 \ - udp4-multi-diffnic04 udp4-multi-diffnic05 \ - udp4-multi-diffnic06 udp4-multi-diffnic07 \ - udp6-multi-diffnic01 \ - udp6-multi-diffnic02 udp6-multi-diffnic03 \ - udp6-multi-diffnic04 udp6-multi-diffnic05 \ - udp6-multi-diffnic06 udp6-multi-diffnic07 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/udp/multi-diffnic testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := udp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/udp/multi-diffport/Makefile b/testcases/network/stress/udp/multi-diffport/Makefile dissimilarity index 99% index 91fc77a5..a76c3221 100644 --- a/testcases/network/stress/udp/multi-diffport/Makefile +++ b/testcases/network/stress/udp/multi-diffport/Makefile @@ -1,17 +1,31 @@ -SCRIPTS = udp4-multi-diffport01 \ - udp4-multi-diffport02 udp4-multi-diffport03 \ - udp4-multi-diffport04 udp4-multi-diffport05 \ - udp4-multi-diffport06 udp4-multi-diffport07 \ - udp6-multi-diffport01 \ - udp6-multi-diffport02 udp6-multi-diffport03 \ - udp6-multi-diffport04 udp6-multi-diffport05 \ - udp6-multi-diffport06 udp6-multi-diffport07 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/udp/multi-diffport testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := udp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/stress/udp/uni-basic/Makefile b/testcases/network/stress/udp/uni-basic/Makefile dissimilarity index 99% index f4cb0c8a..bfd3d193 100644 --- a/testcases/network/stress/udp/uni-basic/Makefile +++ b/testcases/network/stress/udp/uni-basic/Makefile @@ -1,17 +1,31 @@ -SCRIPTS = udp4-uni-basic01 \ - udp4-uni-basic02 udp4-uni-basic03 \ - udp4-uni-basic04 udp4-uni-basic05 \ - udp4-uni-basic06 udp4-uni-basic07 \ - udp6-uni-basic01 \ - udp6-uni-basic02 udp6-uni-basic03 \ - udp6-uni-basic04 udp6-uni-basic05 \ - udp6-uni-basic06 udp6-uni-basic07 - -all: - @chmod +x $(SCRIPTS) - -install: - @set -e; for i in $(SCRIPTS); do ln -f $$i ../../../../bin ; done - -clean: - @set -e; for i in $(SCRIPTS); do rm -f ../../../../bin/$$i ; done +# +# network/stress/udp/uni-basic testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, October 2009 +# + +top_srcdir ?= ../../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := udp* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/Makefile b/testcases/network/tcp_cmds/Makefile dissimilarity index 98% index 3feb71f1..f2bac244 100644 --- a/testcases/network/tcp_cmds/Makefile +++ b/testcases/network/tcp_cmds/Makefile @@ -1,12 +1,32 @@ -SUBDIRS = `ls */Makefile | sed "s/Makefile//g"` - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - - +# +# network/tcp_cmds test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +trunk-all: | ../datafiles/bin.sm + +../datafiles/bin.sm: + $(MAKE) -C .. -f "$(abs_srcdir)/../Makefile" generate + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/network/tcp_cmds/Makefile.inc b/testcases/network/tcp_cmds/Makefile.inc new file mode 100644 index 00000000..427b41e1 --- /dev/null +++ b/testcases/network/tcp_cmds/Makefile.inc @@ -0,0 +1,30 @@ +# +# network/tcp_cmds datafiles dependent include 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. +# +# Garrett Cooper, September 2009 +# + +all: | ../../datafiles/bin.sm + +../../datafiles/bin.sm: + $(MAKE) -C ../.. -f "$(abs_srcdir)/../../Makefile" generate + +.PHONY: generate + +# vim: syntax=make diff --git a/testcases/network/tcp_cmds/arp/Makefile b/testcases/network/tcp_cmds/arp/Makefile dissimilarity index 94% index 390e4ef5..bfaba19f 100644 --- a/testcases/network/tcp_cmds/arp/Makefile +++ b/testcases/network/tcp_cmds/arp/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f arp01 ../../../bin - -clean: - +# +# network/tcp_cmds/arp 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := arp01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/arp/arp01 b/testcases/network/tcp_cmds/arp/arp01 index 8939b205..11edc269 100755 --- a/testcases/network/tcp_cmds/arp/arp01 +++ b/testcases/network/tcp_cmds/arp/arp01 @@ -34,32 +34,6 @@ # -Ported # #----------------------------------------------------------------------- -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -RHOST=${RHOST:-`hostname`} -SLEEPTIME=${SLEEPTIME:-1} -NUMLOOPS=${NUMLOOPS:-20} - -#----------------------------------------------------------------------- -# -# FUNCTION: exists -# -#----------------------------------------------------------------------- - -exists() -{ - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done -} #----------------------------------------------------------------------- # @@ -69,15 +43,19 @@ exists() do_setup() { - $trace_logic - export TCID="arp01" - export TST_TOTAL=1 - export TST_COUNT=1 - exists "arp tr awk ping sleep" + NUMLOOPS=${NUMLOOPS:-20} + TST_TOTAL=$(( $NUMLOOPS * 2 )) + + tst_setup + exists arp grep hostname ping sleep whoami + + RHOST=${RHOST:-$(hostname)} + SLEEPTIME=${SLEEPTIME:-1} + LUSER=$(whoami) + + [ "$LUSER" = "root" ] || end_testcase "Must be root to run this test!" - LUSER=`id | tr -s '()' ' ' | awk '{print $2}'` - [ "$LUSER" = "root" ] || end_testcase "Must be root to run this test!" } #----------------------------------------------------------------------- @@ -88,52 +66,34 @@ do_setup() do_test() { - $trace_logic - - COUNT=1 - while [ $COUNT -le $NUMLOOPS ] - do - arp -a 2>&1 1>/dev/null - [ $? -eq 0 ] || end_testcase "arp -a failed" - COUNT=`expr $COUNT + 1` - done - - sleep $SLEEPTIME - - # PURPOSE: stress the automatic creation of arp entries by pinging a host - # and deleting the arp entry again. - - COUNT=1 - while [ $COUNT -le $NUMLOOPS ] - do - ping -c1 $RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "ping $RHOST failed" - arp -a | grep "$RHOST\>" 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "arp -a failed" - arp -d $RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "arp -d $RHOST failed" - COUNT=`expr $COUNT + 1` - sleep $SLEEPTIME - done -} + while [ $TST_COUNT -le $NUMLOOPS ]; do + arp -a 2>&1 1>/dev/null || end_testcase "arp -a failed" + incr_tst_count + done -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= + sleep $SLEEPTIME -end_testcase() -{ - $trace_logic + # PURPOSE: stress the automatic creation of arp entries by pinging a host + # and deleting the arp entry again. + + while [ $TST_COUNT -le $TST_TOTAL ]; do + + ping -c1 $RHOST 2>&1 1>/dev/null || end_testcase "ping $RHOST failed" + + if ! arp -a | grep "$RHOST\>" 2>&1 1>/dev/null; then + end_testcase "arp -a failed" + fi + + if ! arp -d $RHOST 2>&1 1>/dev/null; then + end_testcase "arp -d $RHOST failed" + fi + + incr_tst_count + + sleep $SLEEPTIME + + done - [ $# = 0 ] && { echo "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 } #----------------------------------------------------------------------- @@ -143,6 +103,10 @@ end_testcase() # INPUT: None. # OUTPUT: None. #----------------------------------------------------------------------- + +. net_cmdlib.sh + +read_opts $* do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/echo/Makefile b/testcases/network/tcp_cmds/echo/Makefile dissimilarity index 96% index 169f714c..15fb84e0 100644 --- a/testcases/network/tcp_cmds/echo/Makefile +++ b/testcases/network/tcp_cmds/echo/Makefile @@ -1,15 +1,38 @@ -CFLAGS += -w -O -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f echo01 ../../../bin - -clean: - rm -f $(TARGETS) - - +# +# network/tcp_cmds/echo 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -DDEBUG -I$(abs_srcdir)/../include + +INSTALL_TARGETS := echo01 + +MAKE_TARGETS := echoes echoes6 + +%6: CPPFLAGS += -DINET6 + +%6.o: %.c + $(COMPILE.c) $(OUTPUT_OPTION) $< + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/echo/createfile.c b/testcases/network/tcp_cmds/echo/createfile.c index d3e26a57..35e89e8c 100644 --- a/testcases/network/tcp_cmds/echo/createfile.c +++ b/testcases/network/tcp_cmds/echo/createfile.c @@ -7,35 +7,46 @@ @! # the file size matches the file size required @! # SPEC. EXEC. REQS: This program is used by ctatcdt3.c and ctatcet3.c */ + #include #include +#include +#include #include #include -int main (int argc,char *argv[]) + +int +main (int argc, char *argv[]) { -int fd; -int fsize; -int count=0; -int n,remain; -static char buf[BUFSIZ]; - for ( fsize=0;fsize= BUFSIZ) { - count=fsize/BUFSIZ; - remain=fsize%BUFSIZ; - } - else remain=fsize; - while (count-- !=0) - if((n=write(fd,buf,BUFSIZ)) != BUFSIZ) + count = fsize / BUFSIZ; + remain = fsize % BUFSIZ; + } else + remain = fsize; + while (count-- !=0) { + if((n = write(fd, buf, BUFSIZ)) != BUFSIZ) perror("createfile"); - if ((n=write(fd,buf,remain)) != remain) + } + if ((n = write(fd, buf, remain)) != remain) perror("createfile"); close(fd); + return 0; + } diff --git a/testcases/network/tcp_cmds/echo/echo01 b/testcases/network/tcp_cmds/echo/echo01 index 5d0a2501..eb798ae1 100755 --- a/testcases/network/tcp_cmds/echo/echo01 +++ b/testcases/network/tcp_cmds/echo/echo01 @@ -32,118 +32,84 @@ unset LIBPATH # # #*********************************************************************** -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -TC=sine -RHOST=${RHOST:-`hostname`} -TCbin=${TCbin:-`pwd`} -TCsrc=${TCsrc:-$TCbin} -TCtmp=${TCtmp:-$TCsrc/echo$$} -CLEANUP=${CLEANUP:-ON} -CREATFILE=createfile -ECHOES=echoes - -EXECUTABLES=${EXECUTABLES:-"$CREATFILE $ECHOES"} -ECHOFILE=${ECHOFILE:-echofile} -ECHOSIZE=${ECHOSIZE:-8192} -NUMLOOPS=${NUMLOOPS:-2} -NUMPROCESSES=${NUMPROCESSES:-10} #----------------------------------------------------------------------- # -# FUNCTION: do_test -# PURPOSE: Loop until interrupted creating the echo file and then -# echoing it to RHOST. -# INPUT: None. -# OUTPUT: Informational messages are logged into the run log. +# FUNCTION: do_setup # #----------------------------------------------------------------------- -do_test() +do_setup() { - $trace_logic - mkdir $TCtmp - echo "Creating echo file $ECHOFILE" - $TCbin/$CREATFILE $ECHOSIZE $TCtmp/$ECHOFILE - [ $? = 0 ] || end_testcase "$ECHOFILE not created" - - echo "Compute the checksum of this file" - csum1=`sum $TCtmp/$ECHOFILE |awk '{print $1}'` - [ $csum1 ] || end_testcase "initial checksum computation failed" - - COUNT=1 - while [ $COUNT -le $NUMLOOPS ] - do - $TCbin/$ECHOES $RHOST $TCtmp/$ECHOFILE $NUMPROCESSES - [ $? = 0 ] || end_testcase "Error in $ECHOES test in loop $COUNT" - - NUM=0 - while [ $NUM -lt $NUMPROCESSES ] - do - csum2=`sum $TCtmp/$ECHOFILE\$NUM |awk '{print $1}'` - [ "$csum1" -eq "$csum2" ] || end_testcase "Checksums differ in loop $COUNT" - NUM=`expr $NUM + 1` - done - - echo "Successful execution for loop $COUNT" - COUNT=`expr $COUNT + 1` - if [ $COUNT -le $NUMLOOPS ]; then - echo "Sleeping 60 seconds to avoid hitting max. connections setting for service" - sleep 60 - fi - done + + NUMLOOPS=${NUMLOOPS:-2} + TST_TOTAL=$NUMLOOPS + + export TST_COUNT TST_TOTAL + + exists hostname sum + tst_setup + + TC=sine + RHOST=${RHOST:-`hostname`} + TCtmp=${TCtmp:-$LTPROOT/testcases/bin/echo$$} + CLEANUP=${CLEANUP:-ON} + CREATEFILE=createfile + ECHOES=echoes${EXEC_SUFFIX} + + ECHOFILE=${ECHOFILE:-echofile${EXEC_SUFFIX}} + ECHOSIZE=${ECHOSIZE:-8192} + NUMPROCESSES=${NUMPROCESSES:-10} + } #----------------------------------------------------------------------- # -# FUNCTION: do_cleanup -# PURPOSE: Called when the testcase is interrupted by the user -# or by interrupt_testcase() when time limit expired -# INPUT: None. -# OUTPUT: None. +# FUNCTION: do_test +# PURPOSE: Loop until interrupted creating the echo file and then +# echoing it to RHOST. +# INPUT: None. +# OUTPUT: Informational messages are logged into the run log. # #----------------------------------------------------------------------- -do_cleanup() +do_test() { - $trace_logic - - cd / - if [ $TCtmp = $TCsrc ]; then - rm -f $TCtmp/echofile* - else - rm -rf $TCtmp - fi -} + mkdir $TCtmp + echo "Creating echo file $ECHOFILE" + if ! "$LTPROOT/testcases/bin/$CREATEFILE" $ECHOSIZE "$TCtmp/$ECHOFILE"; then + end_testcase "$ECHOFILE not created" + fi + + echo "Compute the checksum of this file" + csum1=$(sum $TCtmp/$ECHOFILE | awk '{print $1}') + [ $csum1 ] || end_testcase "initial checksum computation failed" + + while [ $TST_COUNT -le $NUMLOOPS ]; do -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - - # Call other cleanup functions - [ $CLEANUP = "ON" ] && do_cleanup - - [ $# -eq 0 ] && { echo "Test Successful"; exit 0; } - echo "Test Failed: $@" - echo"" - echo "***NOTE***" - echo "Make sure the streamed echo is uncommented in inetd.conf" - echo "on the server. Also try increasing max connections from" - echo "default of 40, i.e. nowait.400" - exit 1 -} + if ! $ECHOES $RHOST "$TCtmp/$ECHOFILE" $NUMPROCESSES; then + end_testcase "Error in $ECHOES test in loop $TST_COUNT" + fi + + NUM=0 + while [ $NUM -lt $NUMPROCESSES ] + do + csum2=$(sum "$TCtmp/${ECHOFILE}${NUM}" | awk '{print $1}') + if [ "$csum1" = "$csum2" ]; then + end_testcase "Checksums differ in loop $TST_COUNT" + fi + NUM=$(( $NUM + 1 )) + done + + tst_resm TINFO "Execution $TST_COUNT passed." + + incr_tst_count + if [ $TST_COUNT -le $NUMLOOPS ]; then + tst_resm TINFO "Sleeping 60 seconds to avoid hitting max. connections setting for service" + sleep 60 + fi + done +} #----------------------------------------------------------------------- # @@ -154,5 +120,10 @@ end_testcase() # OUTPUT: Logged run results written to testcase run log # #----------------------------------------------------------------------- + +. net_cmdlib.sh + +read_opts $* +do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/echo/echoes.c b/testcases/network/tcp_cmds/echo/echoes.c dissimilarity index 75% index b9dd244a..2563e068 100644 --- a/testcases/network/tcp_cmds/echo/echoes.c +++ b/testcases/network/tcp_cmds/echo/echoes.c @@ -1,321 +1,404 @@ -/* -@! # TEST TYPE(S): Concurrency, Load stress -@! # TESTCASE DESCRIPTION: -@! # Purpose: to send packets from the file to echo protocol on remote -@! # machine and read the echoing packets back and compare them -@! # Design: Connect to echo protocol on the remote machine -@! # read from the file and send the file to remote machine -@! # read the echoing packets and store them in a file -@! # repeat until file exhausted. -@! # compare result -@! # -@! # SPEC. EXEC. REQS: May require multiple of this test to run -@! # to target machines from multiple machine in order -@! # to create stress condition -@! # echoes -*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TRUE 1 -#define FALSE 0 - -void echofile (struct servent *, struct hostent *, char *, char *); -void getfilename(char *, char*, int); -int checkfile(char *, char *); -void itoa(int, char []); -void reverse(char []); -void cleanup(int); - - -int main (int argc,char *argv[],char *env[]) -{ - - int i,j,k,wait_stat,pid,finish; - struct servent *sp; - struct hostent *hp; - struct { - char resultfile[35]; - int pid; - int status; - }echo_struc[200]; - - hp = gethostbyname(argv[1]); - if ((sp=getservbyname("echo","tcp"))==NULL) { - printf("ERROR service is not available\n"); - perror("echo"); - exit(1); - } - i=atoi(argv[3]); - j=0; - while ( i-- > 0 ) { - echo_struc[j].status=0; - switch (pid=fork()) { - case 0: - getfilename(argv[2],echo_struc[j].resultfile,j); - echofile(sp,hp,echo_struc[j].resultfile,argv[2]); - break; - case -1: - printf("ERROR when forking a new process\n"); - perror("echo"); - exit(1); - break; - default: - echo_struc[j].pid=pid; - echo_struc[j].status=1; - j++; - break; - } - } - finish=atoi(argv[3]); - i=finish; - while (finish != 0) { - if ((pid=wait(&wait_stat)) == -1) { - printf("ERROR in wait process\n"); - perror("echo"); - exit(1); - } - if (wait_stat==0) - for (j=0;js_port; - memcpy(&hostaddr,hp->h_addr_list[0],sizeof(struct in_addr)); - memset((char *)&sa,0x00,sizeof (sa)); - sa.sin_port=port; - sa.sin_family=AF_INET; - sa.sin_addr=hostaddr; - -#ifdef DEBUG - printf("sizeof (hostaddr)=%d\n",sizeof (hostaddr)); - printf("port=%d hostaddr=%x", ntohs(port), hostaddr); - printf("Connect .......\n"); -#endif - if (connect(s,(struct sockaddr *) &sa,sizeof(sa))==-1) { - printf ("ERROR occured during connect socket operation(%d)\n",pid); - perror("echo:connect"); - cleanup(s); - exit(1); - } -#ifdef DEBUG - addrlen=sizeof(address); - printf("addrlen=%d\n",addrlen); - printf("hp->h_length=%d\n",hp->h_length); - printf("hp->h_addrtype=%d\n",hp->h_addrtype); - printf("hp->h_addr=%d\n",inet_ntoa(hp->h_addr)); - if (getsockname(s,&address,&addrlen) == -1 ) { - printf ("ERROR occured during getsockname(%d)\n",pid); - perror("echo"); - cleanup(s); - exit(1); - } - portnum=ntohs(address.sin_port); - printf ("local port is: %d\n",portnum); - if (getpeername(s,&address,&addrlen) == -1) { - printf ("ERROR occured during getpeername(%d)\n",pid); - perror("echo"); - cleanup(s); - exit(1); - } - portnum=ntohs(address.sin_port); - /* printf ("remote address is: %d\n",portnum); -*/ -#endif - if ((fdr=open(orgfile,O_RDONLY)) < 0 ) { - printf("ERROR when opening the input file(%d)\n",pid); - perror("echo:orginal file"); - cleanup(s); - exit(1); - } - if ((fdw=creat(resultfile,0644)) < 0 ) { - printf("ERROR when opening the temporary temp file(%d)\n",pid); - perror("echo:resultfile"); - cleanup(s); - exit(1); - } - finish=FALSE; - count=0; - while (!finish) { - if ((nwrite=read(fdr,wr_buffer,BUFSIZ))==-1) { - printf("ERROR when reading input file(%d)\n",pid); - perror("echo:orginal file"); - cleanup(s); - exit(1); - } - if (nwrite==0) - finish=TRUE; - else { - count++; - if((n=write(s,wr_buffer,nwrite))!=nwrite) { - printf("ERROR during write to socket(%d)\n",pid); - perror("echo:socket write"); - cleanup(s); - exit(1); - } -#ifdef DEBUG -/* - printf("Writing .......%d\n",count); -*/ -#endif - while (nwrite!=0) { - if((nread=read(s,rd_buffer,BUFSIZ))==-1) { - printf("read size:%d\n",n); - printf("ERROR during read from socket(%d)\n",pid); - perror("echo:socket read"); - cleanup(s); - exit(1); - } -#ifdef DEBUG -/* - printf("Reading ....... %d\n",count); -*/ -#endif - if((n=write(fdw,rd_buffer,nread))!=nread) { - printf("read size:%d\n",n); - printf("ERROR during write to result file(%d)\n",pid); - perror("echo:result file"); - cleanup(s); - exit(1); - } - nwrite-=nread; - } - - }/* end of else */ - } /* end of while */ - if ((n=close(s)) == -1) { - printf("ERROR in closing socket(%d)\n",pid); - perror("echo"); - exit(1); - } - if ((n=close(fdr)) == -1) { - printf("ERROR in closing input file(%d)\n",pid); - perror("echo"); - exit(1); - } - if ((n=close(fdw) ) == -1) { - printf("ERROR in closing temp file(%d)\n",pid); - perror("echo"); - exit(1); - } - if (checkfile(orgfile,resultfile)) { - printf("ERROR input file and output file are not equal(%d)\n",pid); - exit(1); - } - printf("Finish ....%d\n",pid); - exit(0); -} - -void getfilename(char *strptr, char* filename, int j) -{ - int i; - char s[10],*sptr=&s[0]; - - strcpy(filename,strptr); - itoa(j,s); - strcat(filename,s); -} - -int checkfile(char *file1, char *file2) -{ - int n; - struct stat buffer,*bufptr=&buffer; - stat(file1,bufptr); - n=bufptr->st_size; -#ifdef DEBUG - /* printf("%s size= %d \n",file1,n); -*/ -#endif - stat(file2,bufptr); -#ifdef DEBUG - /* printf("%s size= %d \n",file2,bufptr->st_size); -*/ -#endif - if(n != buffer.st_size) - return(TRUE); - else return(FALSE); -} - -void itoa(int n, char s[]) -{ - int i, sign; - - if ((sign = n) < 0) - n = -n; - i = 0; - do { - s[i++] = n % 10 + '0'; - } while ((n /= 10) > 0); - if (sign < 0) - s[i++] = '-'; - s[i] = '\0'; - reverse(s); -} - -void reverse(char s[]) -{ - int c, i, j; - - for (i=0, j=strlen(s)-1; i < j; i++, j--) { - c = s[i]; - s[i] = s[j]; - s[j] = c; - } -} - -void cleanup(int s) -{ - close(s); -} +/* +@! # TEST TYPE(S): Concurrency, Load stress +@! # TESTCASE DESCRIPTION: +@! # Purpose: to send packets from the file to echo protocol on remote +@! # machine and read the echoing packets back and compare them +@! # Design: Connect to echo protocol on the remote machine +@! # read from the file and send the file to remote machine +@! # read the echoing packets and store them in a file +@! # repeat until file exhausted. +@! # compare result +@! # +@! # SPEC. EXEC. REQS: May require multiple of this test to run +@! # to target machines from multiple machine in order +@! # to create stress condition +@! # echoes +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "test.h" +#include "netdefs.h" + +#if INET6 +char *TCID = "echoes6"; +#else +char *TCID = "echoes"; +#endif + +int TST_TOTAL = 1; + +void echofile (struct servent *, struct addrinfo *, char *, char *); +int checkfile(char *, char *); +void cleanup(int); + + +int +main (int argc, char *argv[], char *env[]) +{ + + unsigned int finish, i, j, k; + int gai, wait_stat; + pid_t pid; + struct addrinfo hints, *hp; + struct servent *sp; + struct { + char resultfile[FILENAME_MAX+1]; + pid_t pid; + } echo_struc[200]; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PFI; + hints.ai_socktype = SOCK_STREAM; + + if (argc != 4) { + tst_resm(TBROK, "usage: remote-addr file num-procs"); + tst_exit(); + } + + if ((sp = getservbyname("echo", "tcp")) == NULL) { + tst_resm(TBROK, "echo service not found (check " + "/etc/services?)"); + tst_exit(); + } + + if ((gai = getaddrinfo(argv[1], NULL, &hints, &hp)) != 0) { + tst_resm(TBROK, "Unknown subject address %s: %s\n", + argv[1], gai_strerror(gai)); + tst_exit(); + } + if (!hp || !hp->ai_addr || hp->ai_addr->sa_family != AFI) { + tst_resm(TBROK, "getaddrinfo failed"); + tst_exit(); + } + i = (unsigned int) strtol(argv[3], (char**) NULL, 10); + j = 0; + while (i-- > 0) { + switch (pid = fork()) { + case 0: + snprintf(echo_struc[j].resultfile, + FILENAME_MAX, "%s%u", argv[2], j); + echofile(sp, hp, echo_struc[j].resultfile, argv[2]); + break; + case -1: + tst_resm(TFAIL, "Failed to fork a new process: %s", + strerror(errno)); + tst_exit(); + break; + default: + echo_struc[j].pid = pid; + j++; + break; + } + } + finish = (unsigned int) strtol(argv[3], (char**) NULL, 10); + i = finish; + /* Consume all operating threads until we're done... */ + while (finish != 0) { + + if ((pid = wait(&wait_stat)) == -1) { + tst_resm(TFAIL, "ERROR in wait process"); + tst_exit(); + } + if (wait_stat == 0) { + for (j = 0; j < i; j++) { + if (echo_struc[j].pid == pid) { + finish--; + j = i; + } + } + } else { + + tst_resm(TFAIL, "wait(2) status was non-zero"); + + if (WIFEXITED(wait_stat)) { + tst_resm(TINFO, "exit status: %d", + WEXITSTATUS(wait_stat)); + } else if (WIFSIGNALED(wait_stat)) { + tst_resm(TINFO, "signaled: %d", + WTERMSIG(wait_stat)); + } + + for (k = 0; k < i; k++) { + if (kill(echo_struc[k].pid, 0) == 0) { + kill(echo_struc[k].pid, 9); + } + } + + tst_exit(); + + } + + } + + return 0; +} + +void +echofile (struct servent *sp, struct addrinfo *ai, char *resultfile, + char *srcfile) +{ + int n; + int port; + char wr_buffer[BUFSIZ]; + char rd_buffer[BUFSIZ]; + sai_t sa; +#ifdef DEBUG + sa_t address; + socklen_t addrlen; +#endif + int s; + int finish; + int fdw, fdr; + int nread, nwrite; + int count; + pid_t pid; + +#ifdef DEBUG + printf("Creating socket .....\n"); +#endif + + pid = getpid(); + if ((s = socket(AFI, SOCK_STREAM, 0)) < 0 ) { + tst_resm(TBROK, "Failed to create listener socket (pid=%d)", + pid); + perror("echo:socket"); + cleanup(s); + tst_exit(); + } + port = sp->s_port; + + /* + * TODO: Old code did something of the form: + * + * struct hostent *hp; + * + * hp = gethostbyname(argv[1]); + * + * ... + * + * struct in_addr hostaddr; + * + * memcpy(&hostaddr,hp->h_addr_list[0],sizeof(struct in_addr)); + * + * This is all fine and dandy, but gethostbyname has been deprecated + * for some time, and doesn't work too well with IPV6 (from what I've + * read), so I have to push it over to getaddrinfo. getaddrinfo isn't + * a 1:1 mapping though, so I have to do some work to shoehorn the old + * code to fit the new code. + * + * Some notes (from a test app)... + * + * (gdb) set args 127.0.0.1 + * (gdb) list + * 33 for (int i = 1; i < argc; i++) { + * 34 + * 35 gai = getaddrinfo(argv[i], NULL, &hints, &ai); + * 36 hp = gethostbyname(argv[i]); + * 37 + * 38 if (gai != 0) { + * 39 printf("Error: %s\n", gai_strerror(gai)); + * 40 error = 2; + * 41 } else { + * 42 printf("Host IP: 0x%x\n", ai->ai_addr); + * (gdb) p *hp + * $16 = {h_name = 0x1a60198 "127.0.0.1", h_aliases = 0x1a60190, h_addrtype = 2, + * h_length = 4, h_addr_list = 0x1a60180} + * (gdb) p *hp->h_addr_list + * $14 = 0x1a60170 "\177" + * (gdb) p *ai + * $15 = {ai_flags = 0, ai_family = 2, ai_socktype = 1, ai_protocol = 6, + * ai_addrlen = 16, ai_addr = 0x1a600b0, ai_canonname = 0x0, + * ai_next = 0x1a600d0} + * + * If one continues down this path, SIGPIPE will get tossed at the first + * write(2), as opposed to Connection refused (the old code). So I'm not + * passing in the correct info to connect(2). + * + * That and using -DDEBUG with the getpeername(3) call below always fails + * (that alone should be a sufficient to note that my sockaddr* data is + * skewed). + * + * For now let's just mark it broken. + * + */ + //tst_resm(TBROK, "FIX ME GARRETT!"); + //tst_exit(); + + memset((char*) &sa, 0, sizeof(sa)); + memcpy(&sa, ai->ai_addr, ai->ai_addrlen); + +#if INET6 + sa.sin6_port = port; +#else + sa.sin_port = port; +#endif + + if (connect(s, (sa_t*) &sa, sizeof(sa)) == -1) { + tst_resm(TBROK, "Failed to create connector socket (pid=%d)", + pid); + perror("echo:connect"); + cleanup(s); + tst_exit(); + } + +#ifdef DEBUG + /* printf("addrlen=%d\n", addrlen); */ + /* printf("ai->ai_addr=%s\n", inet_ntoa(ai->ai_addr)); */ + if (getsockname(s, &address, &addrlen) == -1) { + tst_resm (TBROK, "getsockname call failed (pid=%d): %s", + pid, strerror(errno)); + perror("echo"); + cleanup(s); + tst_exit(); + } + + printf ("local port is: %d\n", port); + + if (getpeername(s, &address, &addrlen) == -1) { + tst_resm (TBROK, "getpeername call failed (pid=%d): %s", + pid, strerror(errno)); + cleanup(s); + tst_exit(); + } + + tst_resm (TINFO, "The remote port is: %d\n", port); +#endif + if ((fdr = open(srcfile, O_RDONLY)) < 0) { + tst_resm(TBROK, "Failed to open input file (pid=%d)", pid); + perror("echo:orginal file"); + cleanup(s); + tst_exit(); + } + + if ((fdw = creat(resultfile, 0644)) < 0) { + tst_resm(TBROK, "Failed to create a temporary file (pid=%d)", + pid); + perror("echo:resultfile"); + cleanup(s); + tst_exit(); + } +#if DEBUG + tst_resm (TINFO, "creat(resultfile,...) done."); +#endif + finish = FALSE; + count = 0; + while (finish == FALSE) { + + if ((nwrite = read(fdr, wr_buffer, BUFSIZ)) == -1) { + tst_resm(TFAIL, "Failed to read from file (pid=%d)", + pid); + cleanup(s); + perror("read srcfile"); + } +#if DEBUG + tst_resm (TINFO, "Read %d bytes from file", nwrite); +#endif + if (nwrite == 0) + finish = TRUE; + else { + count++; + if((n = write(s, wr_buffer, nwrite)) != nwrite) { + tst_resm(TFAIL, "Failed to write to socket " + "(pid=%d)", pid); + cleanup(s); + perror("write"); + } +#ifdef DEBUG + tst_resm(TINFO, "Writing %d bytes to remote socket", + count); +#endif + while (nwrite != 0) { + + nread = read(s, rd_buffer, BUFSIZ); + if (nread == -1) { + printf("read size: %d\n", n); + tst_resm(TFAIL, "Failed to read from " + "socket [2nd time] " + "(pid=%d)", pid); + cleanup(s); + perror("socket read"); + } +#ifdef DEBUG + printf("Reading ....... %d\n",count); +#endif + n = write(fdw, rd_buffer, nread); + if (n != nread) { + tst_resm(TFAIL, "ERROR during write to " + "result file (pid=%d); " + "read amount: %d", + pid, n); + cleanup(s); + perror("write resultfile"); + } + + nwrite -= nread; + + } + + }/* end of else */ + + } /* end of while */ + + if ((n = close(s)) == -1) { + tst_resm(TBROK, "Failed to cleanly close socket (pid=%d)", + pid); + perror("close"); + tst_exit(); + } + if ((n = close(fdr)) == -1) { + tst_resm(TBROK, "Failed to cleanly close input file (pid=%d)", + pid); + perror("close srcfile"); + tst_exit(); + } + if ((n = close(fdw) ) == -1) { + tst_resm(TBROK, "Failed to cleanly close temp file (pid=%d)", + pid); + perror("close"); + tst_exit(); + } + if (checkfile(srcfile, resultfile) != TRUE) { + tst_resm(TFAIL, "Input file and output file are not equal " + "(pid=%d)", pid); + tst_exit(); + } + tst_resm(TINFO, "Finish .... (pid=%d)", pid); + exit(0); +} + +int +checkfile(char *file1, char *file2) +{ + off_t n; + struct stat buffer; + stat(file1, &buffer); + n = buffer.st_size; +#ifdef DEBUG + printf("%s size=%lu\n", file1, n); +#endif + stat(file2, &buffer); +#ifdef DEBUG + printf("%s size=%lu\n", file2, buffer.st_size); +#endif + if (n != buffer.st_size) + return FALSE; + else + return TRUE; +} + +void +cleanup(int s) +{ + close(s); +} diff --git a/testcases/network/tcp_cmds/finger/Makefile b/testcases/network/tcp_cmds/finger/Makefile dissimilarity index 94% index d4a07ace..025dfb66 100644 --- a/testcases/network/tcp_cmds/finger/Makefile +++ b/testcases/network/tcp_cmds/finger/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f finger01 ../../../bin - -clean: - +# +# network/tcp_cmds/finger 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := finger01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/finger/finger01 b/testcases/network/tcp_cmds/finger/finger01 dissimilarity index 64% index d90bca2d..2a61d407 100755 --- a/testcases/network/tcp_cmds/finger/finger01 +++ b/testcases/network/tcp_cmds/finger/finger01 @@ -1,268 +1,202 @@ -#!/bin/sh -# -# Copyright (c) International Business Machines Corp., 2000 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this pronram; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# -# FILE : finger -# -# PURPOSE: To test the basic functionality of the `finger` command. -# -# SETUP: The home directory of root on the machine exported as "RHOST" -# MUST have a ".rhosts" file with the hostname of the machine -# where the test is executed. Also, both machines MUST have -# the fingerd daemon active (see inetd or xinetd config file). -# -# HISTORY: -# 06/06/03 Manoj Iyer - manjo@mail.utexas.edu -# - Ported tests to use test macro -# 03/01 Robbie Williamson (robbiew@us.ibm.com) -# -Ported -# -#----------------------------------------------------------------------- -# Uncomment line below for debugging information -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -RUSER=root -RHOST=${RHOST:-`hostname`} -LHOST=`hostname` -SLEEPTIME=${SLEEPTIME:-1} -LUSER=`id | tr -s '()' ' ' | awk '{print $2}'` - -this_file=${0##*/} - -#----------------------------------------------------------------------- -# -# FUNCTION: exists -# -#----------------------------------------------------------------------- - -exists() -{ - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done -} - - -#----------------------------------------------------------------------- -# -# FUNCTION: do_setup -# -#----------------------------------------------------------------------- - -do_setup () -{ - $trace_logic - - # Start fingerd locally and remotely. - - export TCID="finger01" - export TST_TOTAL=3 - export TST_COUNT=1 - - exists "finger netstat awk rsh" - - [ "$LUSER" = "root" ] || end_testcase "MUST BE root to run the test!" - - FINGER=`netstat -a | grep "*:finger" |awk '{print $6}'` - if [ "$FINGER" != "LISTEN" ]; then - end_testcase "Please start fingerd locally." - fi - - FINGER=`rsh -n $RHOST netstat -a |grep "*:finger"|awk '{print $6}'` - if [ "$FINGER" != "LISTEN" ]; then - end_testcase "Please start fingerd on remote host." - fi -} - -#----------------------------------------------------------------------- -# FUNCTION: do_test1 -# PURPOSE: Run finger with no flags -# INPUT: None. -# OUTPUT: Error messages are logged for all discrepancies found. -#----------------------------------------------------------------------- - -do_test1() -{ - $trace_logic - TCID="finger01" - TST_COUNT=1 - tst_resm TINFO "finger: do_test1 started" - - finger @$LHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger @$LHOST" - finger @$RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger @$RHOST" - - # Testing finger command with user argument - - finger $LUSER 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger $LUSER" - finger $LUSER@$LHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger $LUSER@$LHOST" - finger $RUSER@$RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger @$RUSER" -} - -#----------------------------------------------------------------------- -# FUNCTION: do_test2 -# PURPOSE: To run the "finger User@host" commands and verify that the -# "finger" command is functioning properly. -# INPUT: None. -# OUTPUT: Error messages are logged for all discrepancies found. -#----------------------------------------------------------------------- - -do_test2() -{ - $trace_logic - - TCID="finger02" - TST_COUNT=2 - tst_resm TINFO "do_test2 $TC finger -bad flag" - BADUSER="uuuu" - BADHOST="xxxx" - - tst_resm TINFO "finger -badflag default " - finger -x 2>&1 1>/dev/null - [ $? = 0 ] && end_testcase "finger -x should fail" - - tst_resm TINFO "finger -bad user " - finger $BADUSER 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger $BADUSER " - finger @$BADHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger @$BADHOST" - finger $BADUSER@$BADHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger $BADUSER@$BADHOST" -} - -#----------------------------------------------------------------------- -# FUNCTION: do_test3 -# PURPOSE: To run the "finger -flag User@Host" commands and verify that the -# "finger" command is functioning properly. -# INPUT: None. -# OUTPUT: Error messages are logged for all discrepancies found. -#----------------------------------------------------------------------- - -do_test3() -{ - $trace_logic - - TCID="finger03" - TST_COUNT=3 - tst_resm TINFO "do_test3 $TC finger -f flag" - - tst_resm TINFO "finger -l : gives a long listing" - finger -l 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -l" - finger -l $LUSER 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -l $LUSER " - finger -l @$LHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -l @$LHOST" - finger -l $LUSER@$LHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -l $LUSER@$LHOST" - finger -l @$RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -l @$RHOST" - finger -l $RUSER@$RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -l $RUSER@$RHOST" - - tst_resm TINFO "finger -m : assures that user is a user ID discretionary" - finger -m 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -m" - finger -m $LUSER 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -m $LUSER " - finger -m @$LHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -m @$LHOST" - finger -m $LUSER@$LHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -m $LUSER@$LHOST" - finger -m @$RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -m @$RHOST" - finger -m $RUSER@$RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -m $RUSER@$RHOST" - - tst_resm TINFO "finger -p:suppresses printing of .plan files on long and brief long formats" - finger -p 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -p" - finger -p $LUSER 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -p $LUSER " - finger -p @$LHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -p @$LHOST" - finger -p $LUSER@$LHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -p $LUSER@$LHOST" - finger -p @$RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -p @$RHOST" - finger -p $RUSER@$RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -p $RUSER@$RHOST" - - tst_resm TINFO "finger -s : gives a short format list" - finger -s 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -s" - finger -s $LUSER 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -s $LUSER " - finger -s @$LHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -s @$LHOST" - finger -s $LUSER@$LHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -s $LUSER@$LHOST" - finger -s @$RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -s @$RHOST" - finger -s $RUSER@$RHOST 2>&1 1>/dev/null - [ $? = 0 ] || end_testcase "finger -s $RUSER@$RHOST" - -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - tst_resm TINFO "$this_file: doing $0." - - [ $# = 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "test failed: $@" - exit 1 -} - -#----------------------------------------------------------------------- -# FUNCTION: MAIN -# PURPOSE: To invoke the functions to perform the tasks outlined in the -# prologue. -# INPUT: None. -# OUTPUT: None. -#----------------------------------------------------------------------- -do_setup -do_test1 -sleep $SLEEPTIME -do_test2 -sleep $SLEEPTIME -do_test3 -sleep $SLEEPTIME -end_testcase +#!/bin/sh +# +# Copyright (c) International Business Machines Corp., 2000 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this pronram; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# +# FILE : finger +# +# PURPOSE: To test the basic functionality of the `finger` command. +# +# SETUP: The home directory of root on the machine exported as "RHOST" +# MUST have a ".rhosts" file with the hostname of the machine +# where the test is executed. Also, both machines MUST have +# the fingerd daemon active (see inetd or xinetd config file). +# +# HISTORY: +# 06/06/03 Manoj Iyer - manjo@mail.utexas.edu +# - Ported tests to use test macro +# 03/01 Robbie Williamson (robbiew@us.ibm.com) +# -Ported +# +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# +# FUNCTION: do_setup +# +#----------------------------------------------------------------------- + +do_setup() +{ + + # Start fingerd locally and remotely. + export TST_TOTAL=3 + + tst_setup + + exists awk finger hostname netstat rsh whoami + + LHOST=$(hostname) + LUSER=$(whoami) + RUSER=root + RHOST=${RHOST:-$(hostname)} + SLEEPTIME=${SLEEPTIME:-1} + + exists awk finger netstat rsh whoami + + [ "$LUSER" = "root" ] || end_testcase "MUST BE root to run the test!" + + FINGER=$(netstat -a | grep "*:finger" |awk '{print $6}') + if [ "$FINGER" != "LISTEN" ]; then + end_testcase "Please start fingerd locally." + fi + + FINGER=$(rsh -n $RHOST netstat -a |grep "*:finger"|awk '{print $6}') + if [ "$FINGER" != "LISTEN" ]; then + end_testcase "Please start fingerd on remote host." + fi +} + +#----------------------------------------------------------------------- +# FUNCTION: do_test1 +# PURPOSE: Run finger with no flags +# INPUT: None. +# OUTPUT: Error messages are logged for all discrepancies found. +#----------------------------------------------------------------------- + +do_test1() +{ + tst_resm TINFO "finger: do_test1 started" + + finger @$LHOST 2>&1 1>/dev/null + [ $? = 0 ] || end_testcase "finger @$LHOST" + finger @$RHOST 2>&1 1>/dev/null + [ $? = 0 ] || end_testcase "finger @$RHOST" + + # Testing finger command with user argument + + finger $LUSER 2>&1 1>/dev/null || end_testcase "finger $LUSER" + if ! finger $LUSER@$LHOST 2>&1 1>/dev/null; then + end_testcase "finger $LUSER@$LHOST" + fi + finger $RUSER@$RHOST 2>&1 1>/dev/null || end_testcase "finger @$RUSER" +} + +#----------------------------------------------------------------------- +# FUNCTION: do_test2 +# PURPOSE: To run the "finger User@host" commands and verify that the +# "finger" command is functioning properly. +# INPUT: None. +# OUTPUT: Error messages are logged for all discrepancies found. +#----------------------------------------------------------------------- + +do_test2() +{ + tst_resm TINFO "finger: do_test2 (-bad flag) started" + BADUSER="uuuu" + BADHOST="xxxx" + + tst_resm TINFO "finger -badflag default " + finger -x 2>&1 1>/dev/null && end_testcase "finger -x should fail" + + tst_resm TINFO "finger -bad user " + finger $BADUSER 2>&1 1>/dev/null || end_testcase "finger $BADUSER" + finger @$BADHOST 2>&1 1>/dev/null || end_testcase "finger @$BADHOST" + if ! finger $BADUSER@$BADHOST 2>&1 1>/dev/null; then + end_testcase "finger $BADUSER@$BADHOST" + fi +} + +#----------------------------------------------------------------------- +# FUNCTION: do_test3 +# PURPOSE: To run the "finger -flag User@Host" commands and verify that the +# "finger" command is functioning properly. +# INPUT: None. +# OUTPUT: Error messages are logged for all discrepancies found. +#----------------------------------------------------------------------- + +do_test3() +{ + tst_resm TINFO "finger: do_test3 (-f flag) started" + + tst_resm TINFO "finger -l : gives a long listing" + finger -l 2>&1 1>/dev/null || end_testcase "finger -l" + finger -l $LUSER 2>&1 1>/dev/null || end_testcase "finger -l $LUSER" + finger -l @$LHOST 2>&1 1>/dev/null || end_testcase "finger -l @$LHOST" + if ! finger -l $LUSER@$LHOST 2>&1 1>/dev/null; then + end_testcase "finger -l $LUSER@$LHOST" + fi + finger -l @$RHOST 2>&1 1>/dev/null || end_testcase "finger -l @$RHOST" + if ! finger -l $RUSER@$RHOST 2>&1 1>/dev/null; then + end_testcase "finger -l $RUSER@$RHOST" + fi + + tst_resm TINFO "finger -m : assures that user is a user ID discretionary" + finger -m 2>&1 1>/dev/null || end_testcase "finger -m" + finger -m $LUSER 2>&1 1>/dev/null || end_testcase "finger -m $LUSER" + finger -m @$LHOST 2>&1 1>/dev/null || end_testcase "finger -m @$LHOST" + if ! finger -m $LUSER@$LHOST 2>&1 1>/dev/null; then + end_testcase "finger -m $LUSER@$LHOST" + fi + finger -m @$RHOST 2>&1 1>/dev/null || end_testcase "finger -m @$RHOST" + if ! finger -m $RUSER@$RHOST 2>&1 1>/dev/null; then + end_testcase "finger -m $RUSER@$RHOST" + fi + + tst_resm TINFO "finger -p : suppresses printing of .plan files on long and brief long formats" + finger -p 2>&1 1>/dev/null || end_testcase "finger -p" + finger -p $LUSER 2>&1 1>/dev/null || end_testcase "finger -p $LUSER" + finger -p @$LHOST 2>&1 1>/dev/null || end_testcase "finger -p @$LHOST" + if ! finger -p $LUSER@$LHOST 2>&1 1>/dev/null; then + end_testcase "finger -p $LUSER@$LHOST" + fi + finger -p @$RHOST 2>&1 1>/dev/null || end_testcase "finger -p @$RHOST" + if ! finger -p $RUSER@$RHOST 2>&1 1>/dev/null; then + end_testcase "finger -p $RUSER@$RHOST" + fi + + tst_resm TINFO "finger -s : gives a short format list" + finger -s 2>&1 1>/dev/null || end_testcase "finger -s" + finger -s $LUSER 2>&1 1>/dev/null || end_testcase "finger -s $LUSER " + finger -s @$LHOST 2>&1 1>/dev/null || end_testcase "finger -s @$LHOST" + if ! finger -s $LUSER@$LHOST 2>&1 1>/dev/null; then + end_testcase "finger -s $LUSER@$LHOST" + fi + finger -s @$RHOST 2>&1 1>/dev/null || end_testcase "finger -s @$RHOST" + if ! finger -s $RUSER@$RHOST 2>&1 1>/dev/null; then + end_testcase "finger -s $RUSER@$RHOST" + fi + +} + +#----------------------------------------------------------------------- +# FUNCTION: MAIN +# PURPOSE: To invoke the functions to perform the tasks outlined in the +# prologue. +# INPUT: None. +# OUTPUT: None. +#----------------------------------------------------------------------- +. net_cmdlib.sh + +read_opts $* +do_setup +for TST_COUNT in 1 2 3; do + eval "do_test$TST_COUNT" + sleep $SLEEPTIME +done +end_testcase diff --git a/testcases/network/tcp_cmds/ftp/Makefile b/testcases/network/tcp_cmds/ftp/Makefile dissimilarity index 99% index d191c003..5b856184 100644 --- a/testcases/network/tcp_cmds/ftp/Makefile +++ b/testcases/network/tcp_cmds/ftp/Makefile @@ -1,17 +1,30 @@ -generate: - ../../generate.sh - -all: generate - -install: - ln -f ftp01 ../../../bin - ln -f ftp02 ../../../bin - ln -f ftp02_s1 ../../../bin - ln -f ftp03 ../../../bin - ln -f ftp04 ../../../bin - ln -f ftp05 ../../../bin - ln -f ftp_set_passwd ../../../bin - ln -f ftp_setup_vsftp_conf ../../../bin - -clean: - rm -rf datafiles +# +# network/tcp_cmds/ftp 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +INSTALL_TARGETS := ftp* + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/ftp/ftp01 b/testcases/network/tcp_cmds/ftp/ftp01 index 290e5752..5f32ecba 100755 --- a/testcases/network/tcp_cmds/ftp/ftp01 +++ b/testcases/network/tcp_cmds/ftp/ftp01 @@ -39,41 +39,6 @@ #----------------------------------------------------------------------- # #---------------------------------------------------------------------- -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -RHOST=${RHOST:-`hostname`} -RUSER=${RUSER:-root} -PASSWD=${PASSWD:-.pasroot} - -TC=ftp -TCbin=${TCbin:-`pwd`} -TCtmp=${TCtmp:-$TCbin/$TC$$} -TCdat=${TCdat:-$TCbin/datafiles} -SLEEPTIME=${SLEEPTIME:-0} -ASCII_FILES=${ASCII_FILES:-"ascii.sm ascii.med ascii.lg ascii.jmb"} -BIN_FILES=${BIN_FILES:-"bin.sm bin.med bin.lg bin.jmb"} - - -#----------------------------------------------------------------------- -# -# FUNCTION: exists -# -#----------------------------------------------------------------------- - -exists() -{ - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done -} #----------------------------------------------------------------------- # @@ -83,19 +48,28 @@ exists() do_setup() { - $trace_logic - export TCID=ftp - export TST_TOTAL=1 - export TST_COUNT=1 + TC=ftp + TCtmp=${TCtmp:-$LTPROOT/$TC${EXEC_SUFFIX}$$} + TCdat=${TCdat:-$LTPROOT/datafiles} + SLEEPTIME=${SLEEPTIME:-0} + ASCII_FILES=${ASCII_FILES:-"ascii.sm ascii.med ascii.lg ascii.jmb"} + BIN_FILES=${BIN_FILES:-"bin.sm bin.med bin.lg bin.jmb"} + + RHOST=${RHOST:-`hostname`} + RUSER=${RUSER:-root} + PASSWD=${PASSWD:-.pasroot} + + tst_setup + + exists awk ftp rsh - exists "rsh ftp awk" - mkdir -p $TCtmp - cd $TCtmp + cd "$TCtmp" + + rsh -n -l root $RHOST mkdir -p "$TCtmp" + rsh -n -l root $RHOST chown -R ${RUSER} "$TCtmp" + [ $? = 0 ] || end_testcase "Check .rhosts file on remote machine." - rsh -n -l root $RHOST mkdir -p $TCtmp - rsh -n -l root $RHOST chown -R ${RUSER} $TCtmp - [ $? = 0 ] || echo "Check .rhosts file on remote machine." } #----------------------------------------------------------------------- @@ -106,55 +80,53 @@ do_setup() do_test() { - $trace_logic - - for i in binary ascii - do - if [ $i = "binary" ]; then - FILES=$BIN_FILES - fi - if [ $i = "ascii" ]; then - FILES=$ASCII_FILES - fi - for j in $FILES - do - for a in get put - do - if [ $a = "get" ]; then - { - echo user $RUSER $PASSWD - echo lcd $TCtmp - echo $i - echo cd $TCdat - echo $a $j - echo quit - } | ftp -nv $RHOST - SUM1=`ls -l $TCtmp/$j | awk '{print $5}'` - SUM2=`ls -l $TCdat/$j | awk '{print $5}'` - rm -f $TCtmp/$j - else - { - echo user $RUSER $PASSWD - echo lcd $TCdat - echo $i - echo cd $TCtmp - echo $a $j - echo quit - } | ftp -nv $RHOST - SUM1=`rsh -n -l root $RHOST sum $TCtmp/$j | awk '{print $1}'` - SUM2=`sum $TCdat/$j | awk '{print $1}'` - rsh -n -l root $RHOST rm -f $TCtmp/$j - fi + + for i in binary ascii; do + + if [ $i = "binary" ]; then + FILES=$BIN_FILES + fi + if [ $i = "ascii" ]; then + FILES=$ASCII_FILES + fi + for j in $FILES; do + + for a in get put; do + if [ $a = "get" ]; then + { + echo user $RUSER $PASSWD + echo lcd $TCtmp + echo $i + echo cd $TCdat + echo $a $j + echo quit + } | ftp -nv $RHOST + SUM1=`ls -l $TCtmp/$j | awk '{print $5}'` + SUM2=`ls -l $TCdat/$j | awk '{print $5}'` + rm -f $TCtmp/$j + else + { + echo user $RUSER $PASSWD + echo lcd $TCdat + echo $i + echo cd $TCtmp + echo $a $j + echo quit + } | ftp -nv $RHOST + SUM1=`rsh -n -l root $RHOST sum $TCtmp/$j | awk '{print $1}'` + SUM2=`sum $TCdat/$j | awk '{print $1}'` + rsh -n -l root $RHOST rm -f $TCtmp/$j + fi - if [ $SUM1 = $SUM2 ]; then - tst_resm TINFO "Test Successful doing ftp $a $j $i" - else - end_testcase "Test Fail: Wrong sum while performing ftp $a $j $i" - fi - sleep $SLEEPTIME - done - done - done + if [ $SUM1 = $SUM2 ]; then + tst_resm TINFO "Test Successful doing ftp $a $j $i" + else + end_testcase "Test Fail: Wrong sum while performing ftp $a $j $i" + fi + sleep $SLEEPTIME + done + done + done } @@ -166,32 +138,8 @@ do_test() do_cleanup() { - $trace_logic - - rm -rf $TCtmp - - rsh -n -l root $RHOST rmdir $TCtmp -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - do_cleanup - echo "$this_file: doing $0." - - [ $# = 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 + rsh -n -l root $RHOST rmdir "$TCtmp" + tst_cleanup } #---------------------------------------------------------------------- @@ -202,6 +150,9 @@ end_testcase() # OUTPUT: A testcase run log with the results of the execution of this # test. #---------------------------------------------------------------------- +. net_cmdlib.sh + +read_opts $* do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/ftp/ftp02 b/testcases/network/tcp_cmds/ftp/ftp02 index 6b4a2ca4..8a9002e6 100755 --- a/testcases/network/tcp_cmds/ftp/ftp02 +++ b/testcases/network/tcp_cmds/ftp/ftp02 @@ -29,38 +29,45 @@ # This version is intended for EAL certification, it will need modification # to conform with LTP standards in the offical LTP tree. -export RHOST="localhost" -export TEST_USER="ftpuser2" -export TEST_USER_PASSWD="eal" -export TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA" -export TEST_USER_HOMEDIR="/home/$TEST_USER" - #----------------------------------------------------------------------- # FUNCTION: do_setup #----------------------------------------------------------------------- -do_setup(){ - #erase user if he may exist , so we can have a clean env - rm -rf /home/$TEST_USER - userdel $TEST_USER - sleep 1 +do_setup() +{ + + export RHOST="localhost" + export TEST_USER="ftpuser2" + export TEST_USER_PASSWD="eal" + export TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA" + export TEST_USER_HOMEDIR="/home/$TEST_USER" + + # erase user if he may exist, so we can have a clean env + TCtmp="/home/$TEST_USER" + + tst_setup + + exists expect ftp ftp02_s1 useradd userdel + + userdel $TEST_USER + sleep 1 + + if ! useradd -m -p $TEST_USER_ENCRYPTED_PASSWD $TEST_USER; then + end_testcase "Could not add test user $TEST_USER to system $RHOST." + fi + + trap do_cleanup EXIT - useradd -m -p $TEST_USER_ENCRYPTED_PASSWD $TEST_USER - if [ $? != 0 ] - then { - echo "Could not add test user $TEST_USER to system $RHOST." - exit 1 - } - fi } #----------------------------------------------------------------------- # FUNCTION: do_cleanup #----------------------------------------------------------------------- -do_cleanup(){ - rm -rf /home/$TEST_USER - userdel $TEST_USER +do_cleanup() +{ + userdel $TEST_USER + tst_cleanup } #----------------------------------------------------------------------- @@ -71,9 +78,9 @@ do_cleanup(){ # Cleanup Test User from system # Exit with exit code of script called upon #----------------------------------------------------------------------- -do_setup -ftp02_s1 -EXIT_CODE=$? -do_cleanup -exit $EXIT_CODE +. net_cmdlib.sh +read_opts $* +do_setup +ftp02_s1 || end_testcase "Testcase failed." +end_testcase diff --git a/testcases/network/tcp_cmds/ftp/ftp02_s1 b/testcases/network/tcp_cmds/ftp/ftp02_s1 index 26efcb13..c49a561f 100755 --- a/testcases/network/tcp_cmds/ftp/ftp02_s1 +++ b/testcases/network/tcp_cmds/ftp/ftp02_s1 @@ -47,8 +47,8 @@ spawn ftp $RHOST sleep 1 # Check if connection succeeded. expect { - "Name" {} - timeout {send_user "\nConnection failed\n Test FAILED \n";exit 1} + "Name" {} + timeout {send_user "\nConnection failed; test FAILED\n";exit 1} } send "$RUSER\r" @@ -58,15 +58,14 @@ send "$PASSWD\r" sleep 1 expect { - # 530 - Login failed - "530" {send_user "Ftp invalid password, login test PASSED\n"} - # 230 - Login successful - "230" {send_user "Ftp invalid password, login test FAILED \n";exit 1} + # 530 - Login failed + "530" {send_user "Login failed as expected; test PASSED\n"} + # 230 - Login successful + "230" {send_user "Login succeeded unexpectedly; test FAILED\n"; exit 1} } expect "ftp>" send "exit\r" - send_user "\nTest Successful\n\n" exit 0 diff --git a/testcases/network/tcp_cmds/ftp/ftp03 b/testcases/network/tcp_cmds/ftp/ftp03 index 45ee0928..24e30e9f 100755 --- a/testcases/network/tcp_cmds/ftp/ftp03 +++ b/testcases/network/tcp_cmds/ftp/ftp03 @@ -31,69 +31,66 @@ # This version is intended for EAL certification, it will need modification # to conform with LTP standards in the offical LTP tree. -RHOST="localhost" -TEST_USER="ftpuser1" -TEST_USER_PASSWD="eal" -TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA" -TEST_USER_HOMEDIR="/home/$TEST_USER" -tvar=${MACHTYPE%-*} -tvar=${tvar#*-} - -if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] -then -ls /etc/vsftpd/vsftpd.conf - if [ $? != 0 ] - then { - echo "vsftpd.conf not found. Possible cause: does not exist on WS." - echo "Test ftp03 FAIL." - EXIT_CODE=1 - exit 1 - } - fi -LOCAL_ENABLE=`cat /etc/vsftpd/vsftpd.conf | grep "^local_enable=" | awk -F= '{print $2}'` -else -LOCAL_ENABLE=`cat /etc/vsftpd.conf | grep "^local_enable=" | awk -F= '{print $2}'` -fi -if [ "$LOCAL_ENABLE" != "YES" ]; then - LOCAL_ENABLE="NO" -fi - -EXIT_CODE=0 - #----------------------------------------------------------------------- # FUNCTION: do_setup #----------------------------------------------------------------------- -do_setup(){ - - #erase user if he may exist , so we can have a clean env - rm -rf /home/$TEST_USER - userdel $TEST_USER - sleep 1 - - useradd -m -p $TEST_USER_ENCRYPTED_PASSWD $TEST_USER - if [ $? != 0 ] - then { - echo "Could not add test user $TEST_USER on system $RHOST." - exit 1 - } - fi - - #create users home diretory (SLES 8 does not do this, even when specified in adduser) - USER_UID=`id -u $TEST_USER` - USER_GID=`id -g $TEST_USER` - mkdir $TEST_USER_HOMEDIR - chown -R $USER_UID.$USER_GID $TEST_USER_HOMEDIR +do_setup() +{ + RHOST="localhost" + TCtmp=/home/$TEST_USER + TEST_USER="ftpuser1" + TEST_USER_PASSWD="eal" + TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA" + TEST_USER_HOMEDIR="/home/$TEST_USER" + VSFTP_CONF= + + tst_setup + + exists ftp useradd userdel vftpd + + for vsftp_conf in /etc/vsftpd /etc; do + + if [ -r "$vsftp_confdir/vsftp.conf" ]; then + VSFTP_CONF="$vsftp_confdir/vsftp.conf" + break + fi + + done + if [ ! -r "$VSFTP_CONF" ] ; then + end_testcase "vsftpd.conf not found." + fi + LOCAL_ENABLE=$(awk -F= '/^local_enable=/ {print $2}' "$VSFTP_CONF") + + [ "$LOCAL_ENABLE" != "YES" ] && LOCAL_ENABLE="NO" + + userdel $TEST_USER + sleep 1 + + if ! useradd -m -p $TEST_USER_ENCRYPTED_PASSWD $TEST_USER; then + end_testcase "Could not add test user $TEST_USER on system $RHOST." + fi + + trap do_cleanup QUIT + + # create users home diretory (SLES 8 does not do this, even when specified + # in adduser) + USER_UID=$(id -u $TEST_USER) + USER_GID=$(id -g $TEST_USER) + mkdir -p "$TEST_USER_HOMEDIR" + chown -R $USER_UID:$USER_GID $TEST_USER_HOMEDIR + } #----------------------------------------------------------------------- # FUNCTION: do_cleanup #----------------------------------------------------------------------- -do_cleanup(){ - rm -rf /home/$TEST_USER - userdel $TEST_USER +do_cleanup() +{ + userdel $TEST_USER + tst_cleanup } #----------------------------------------------------------------------- @@ -105,51 +102,48 @@ do_cleanup(){ #----------------------------------------------------------------------- do_test(){ - echo "TEST: Ftp into a remote host as a local user (other than root), LOCAL_ENABLE=$LOCAL_ENABLE" + tst_resm TINFO "TEST: Ftp into a remote host as a local user (other than root), LOCAL_ENABLE=$LOCAL_ENABLE" -if [ "$LOCAL_ENABLE" = "YES" ]; then { + if [ "$LOCAL_ENABLE" = "YES" ]; then expect -c " - spawn ftp $RHOST - sleep 1 - expect -re \": \" - send \"$TEST_USER\r\" - expect -re \"Password:\" - send \"$TEST_USER_PASSWD\r\" - expect { - # 530 - Login failed - \"530\" {send_user \"==> TEST \#$TEST : FAIL (ftp rejected login attempt)\n\";exit 1} - # 230 - Login successful - \"230\" {send_user \"==> TEST \#$TEST : PASS (ftp allowed login attempt)\n\";exit 0} - } - expect \"ftp> \" - send \"quit\r\" + spawn ftp $RHOST + sleep 1 + expect -re \": \" + send \"$TEST_USER\r\" + expect -re \"Password:\" + send \"$TEST_USER_PASSWD\r\" + expect { + # 530 - Login failed + \"530\" {send_user \"==> TEST \#$TEST : FAIL (ftp rejected login attempt)\n\";exit 1} + # 230 - Login successful + \"230\" {send_user \"==> TEST \#$TEST : PASS (ftp allowed login attempt)\n\";exit 0} + } + expect \"ftp> \" + send \"quit\r\" " -} else { + else expect -c " - spawn ftp $RHOST - sleep 1 - expect -re \": \" - send \"$TEST_USER\r\" - expect -re \"Password:\" - send \"$TEST_USER_PASSWD\r\" - expect { - # 230 - Login successful - \"230\" {send_user \"==> TEST \#$TEST : FAIL (ftp allowed login attempt)\n\";exit 1} - # 500 - Login failed - \"500\" {send_user \"==> TEST \#$TEST : PASS (ftp rejected login attempt)\n\";exit 0} - # 530 - Login failed - \"530\" {send_user \"==> TEST \#$TEST : PASS (ftp rejected login attempt)\n\";exit 0} - } - expect \"ftp> \" - send \"quit\r\" + spawn ftp $RHOST + sleep 1 + expect -re \": \" + send \"$TEST_USER\r\" + expect -re \"Password:\" + send \"$TEST_USER_PASSWD\r\" + expect { + # 230 - Login successful + \"230\" {send_user \"==> TEST \#$TEST : FAIL (ftp allowed login attempt)\n\";exit 1} + # 500 - Login failed + \"500\" {send_user \"==> TEST \#$TEST : PASS (ftp rejected login attempt)\n\";exit 0} + # 530 - Login failed + \"530\" {send_user \"==> TEST \#$TEST : PASS (ftp rejected login attempt)\n\";exit 0} + } + expect \"ftp> \" + send \"quit\r\" " -} fi - + fi - if [ $? != 0 ] - then { - EXIT_CODE=1 - } + if [ $? != 0 ]; then + end_testcase "Testcase failed" fi } @@ -158,7 +152,9 @@ if [ "$LOCAL_ENABLE" = "YES" ]; then { # PURPOSE: To invoke the functions to perform the tasks described in # the prologue. #---------------------------------------------------------------------- +. net_cmdlib.sh + +read_opts $* do_setup do_test -do_cleanup -exit $EXIT_CODE +end_testcase diff --git a/testcases/network/tcp_cmds/ftp/ftp04 b/testcases/network/tcp_cmds/ftp/ftp04 index 910e087b..405fba44 100755 --- a/testcases/network/tcp_cmds/ftp/ftp04 +++ b/testcases/network/tcp_cmds/ftp/ftp04 @@ -28,97 +28,77 @@ # 03/04/03 Jerone Young (jeroney@us.ibm.com) # 09/21/05 Kris Wilson (krisw@us.ibm.com) Check if vsftpd is on system. +#----------------------------------------------------------------------- +# FUNCTION: do_setup +#----------------------------------------------------------------------- + +do_setup() +{ -RHOST=localhost -TEST_USER=root - -if [ $PASSWD ] -then - TEST_USER_PASSWORD=$PASSWD -else - echo "YOU MUST EXPORT PASSWD VARIABLE" - exit 1 -fi + tvar=${MACHTYPE%-*} + tvar=${tvar#*-} + RHOST=localhost + TEST_USER=root -EXIT_CODE=0 + tst_setup -#----------------------------------------------------------------------- -# FUNCTION: verify_user_is_in_ftpusers_db -#----------------------------------------------------------------------- - -verify_user_is_in_ftpusers_db(){ + if [ -n "$PASSWD" ]; then + TEST_USER_PASSWORD=$PASSWD + else + end_testcase "You must set your password via the PASSWD variable." + exit 1 + fi -tvar=${MACHTYPE%-*} -tvar=${tvar#*-} + exists awk expect ftp vsftpd - if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] - then - # Check if vsftpd is on system. - which vsftpd - if [ $? != 0 ] - then { - echo "vsftpd not found. Possible cause: does not exist on WS." - echo "Test ftp04 FAIL." - EXIT_CODE=1 - exit 1 - } - fi + if [ $tvar = "redhat" -o $tvar = "redhat-linux" ]; then echo "Verifying test user $TEST_USER is in /etc/vsftpd.ftpusers database..." - FTPUSERS=`grep $TEST_USER /etc/vsftpd.ftpusers` - else + FTPUSERS=$(awk "/$TEST_USER/" /etc/vsftpd.ftpusers) + else echo "Verifying test user $TEST_USER is in /etc/ftpusers database..." - FTPUSERS=`grep $TEST_USER /etc/ftpusers` - fi - if [ "x$FTPUSERS" = "x" ] - then { - echo "Test user $TEST_USER not found in /etc/ftpusers unable to run TEST, exiting 0 ..." - exit 0 - } - fi - + FTPUSERS=$(awk "/$TEST_USER/" /etc/ftpusers) + fi + if [ -z "$FTPUSERS" ] ; then + end_testcase "Test user $TEST_USER not found in /etc/ftpusers unable to run TEST, exiting 0 ..." + fi + } #----------------------------------------------------------------------- # FUNCTION: do_test #----------------------------------------------------------------------- -do_test() { - - echo "TEST: Ftp should reject $TEST_USER from loging in successfully" - expect -c " - spawn ftp $RHOST - sleep 1 - expect -re \": \" - send \"$TEST_USER\r\" - expect -re \"Password:\" - send \"$TEST_USER_PASSWD\r\" - expect { - # 230 - Login successful - \"230\" {send_user \"==> TEST \#$TEST : FAIL (ftp allowed login attempt)\n\";exit 1} - # 530 - Login failed - \"530\" {send_user \"==> TEST \#$TEST : PASS (ftp rejected login attempt)\n\";exit 0} - } - expect \"ftp> \" - send \"quit\r\" - " - - if [ $? != 0 ] - then { - EXIT_CODE=1 +do_test() +{ + + tst_resm TINFO "Ftp should reject $TEST_USER from loging in successfully" + expect -c " + spawn ftp $RHOST + sleep 1 + expect -re \": \" + send \"$TEST_USER\r\" + expect -re \"Password:\" + send \"$TEST_USER_PASSWD\r\" + expect { + # 230 - Login successful + \"230\" {send_user \"==> TEST \#$TEST : FAIL (ftp allowed login attempt)\n\";exit 1} + # 530 - Login failed + \"530\" {send_user \"==> TEST \#$TEST : PASS (ftp rejected login attempt)\n\";exit 0} } - fi + expect \"ftp> \" + send \"quit\r\" + " + + [ $? -eq 0 ] || end_testcase "Testcase failed." } #---------------------------------------------------------------------- # FUNCTION: MAIN #---------------------------------------------------------------------- -verify_user_is_in_ftpusers_db -do_test -exit $EXIT_CODE - - - - - +. net_cmdlib.sh +read_opts $* +do_setup +do_test +end_testcase diff --git a/testcases/network/tcp_cmds/ftp/ftp05 b/testcases/network/tcp_cmds/ftp/ftp05 index f372bb36..ed133c00 100755 --- a/testcases/network/tcp_cmds/ftp/ftp05 +++ b/testcases/network/tcp_cmds/ftp/ftp05 @@ -31,90 +31,85 @@ # This version is intended for EAL certification, it will need modification # to conform with LTP standards in the offical LTP tree. -RHOST="localhost" -TEST_USER="anonymous" -TEST_USER_PASSWD="noone@nowhere.com" +do_setup() +{ + RHOST="localhost" + TEST_USER="anonymous" + TEST_USER_PASSWD="noone@nowhere.com" + VSFTP_CONF= -tvar=${MACHTYPE%-*} -tvar=${tvar#*-} + tst_setup -if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] -then + exists expect ftp vsftpd - # Check if vsftpd is on system. - which vsftpd - if [ $? != 0 ] - then { - echo "vsftpd not found. Possible cause: does not exist on WS." - echo "Test ftp05 FAIL." - EXIT_CODE=1 - exit 1 - } - fi + for vsftp_conf in /etc/vsftpd /etc; do -ANONYMOUS_ENABLE=`cat /etc/vsftpd/vsftpd.conf | grep "^anonymous_enable=" | awk -F= '{print $2}'` -else -ANONYMOUS_ENABLE=`cat /etc/vsftpd.conf | grep "^anonymous_enable=" | awk -F= '{print $2}'` -fi -if [ "$ANONYMOUS_ENABLE" != "NO" ]; then - ANONYMOUS_ENABLE="YES" -fi + if [ -r "$vsftp_confdir/vsftp.conf" ]; then + VSFTP_CONF="$vsftp_confdir/vsftp.conf" + break + fi -EXIT_CODE=0 + done + if [ ! -r "$VSFTP_CONF" ] ; then + end_testcase "vsftpd.conf not found." + fi + ANONYMOUS_ENABLE=$(awk -F= '/^anonymous_enable=/ {print $2}' "$VSFTP_CONF") + if [ "$ANONYMOUS_ENABLE" != "NO" ]; then + ANONYMOUS_ENABLE="YES" + fi +} #----------------------------------------------------------------------- -# FUNCTION: do_test +# FUNCTION : do_test # -# DESCRIPTION: The anonymous user will ftp in and create a directory in his home directory on the remote host. +# DESCRIPTION: The anonymous user will ftp in and create a directory in his/her +# home directory on the remote host. #----------------------------------------------------------------------- -do_test(){ - echo "TEST: Ftp into a remote host as anonymous user, ANONYMOUS_ENABLE=$ANONYMOUS_ENABLE" +do_test() +{ + tst_resm TINFO "Ftp into a remote host as anonymous user; ANONYMOUS_ENABLE=$ANONYMOUS_ENABLE" -if [ "$ANONYMOUS_ENABLE" = "YES" ]; then { - expect -c " - spawn ftp $RHOST - sleep 1 - expect -re \": \" - send \"$TEST_USER\r\" - expect -re \"Password:\" - send \"$TEST_USER_PASSWD\r\" - expect { - # 530 - Login failed - \"530\" {send_user \"==> TEST \#$TEST : FAIL (ftp rejected login attempt)\n\";exit 1} - # 230 - Login successful - \"230\" {send_user \"==> TEST \#$TEST : PASS (ftp allowed login attempt)\n\";exit 0} - } - expect \"ftp> \" - send \"quit\r\" + if [ "$ANONYMOUS_ENABLE" = "YES" ]; then + expect -c " + spawn ftp $RHOST + sleep 1 + expect -re \": \" + send \"$TEST_USER\r\" + expect -re \"Password:\" + send \"$TEST_USER_PASSWD\r\" + expect { + # 530 - Login failed + \"530\" {send_user \"==> TEST \#$TEST : FAIL (ftp rejected login attempt)\n\";exit 1} + # 230 - Login successful + \"230\" {send_user \"==> TEST \#$TEST : PASS (ftp allowed login attempt)\n\";exit 0} + } + expect \"ftp> \" + send \"quit\r\" " -} else { + else expect -c " - spawn ftp $RHOST - sleep 1 - expect -re \": \" - send \"$TEST_USER\r\" - expect -re \"Password:\" - send \"$TEST_USER_PASSWD\r\" - expect { - # 230 - Login successful - \"230\" {send_user \"==> TEST \#$TEST : FAIL (ftp allowed login attempt)\n\";exit 1} - # 500 - Login failed - \"500\" {send_user \"==> TEST \#$TEST : PASS (ftp rejected login attempt)\n\";exit 0} - # 530 - Login failed - \"530\" {send_user \"==> TEST \#$TEST : PASS (ftp rejected login attempt)\n\";exit 0} - } - expect \"ftp> \" - send \"quit\r\" + spawn ftp $RHOST + sleep 1 + expect -re \": \" + send \"$TEST_USER\r\" + expect -re \"Password:\" + send \"$TEST_USER_PASSWD\r\" + expect { + # 230 - Login successful + \"230\" {send_user \"==> TEST \#$TEST : FAIL (ftp allowed login attempt)\n\";exit 1} + # 500 - Login failed + \"500\" {send_user \"==> TEST \#$TEST : PASS (ftp rejected login attempt)\n\";exit 0} + # 530 - Login failed + \"530\" {send_user \"==> TEST \#$TEST : PASS (ftp rejected login attempt)\n\";exit 0} + } + expect \"ftp> \" + send \"quit\r\" " -} fi + fi + [ $? -eq 0 ] || end_testcase "Testcase failed." - if [ $? != 0 ] - then { - EXIT_CODE=1 - } - fi } #---------------------------------------------------------------------- @@ -122,5 +117,9 @@ if [ "$ANONYMOUS_ENABLE" = "YES" ]; then { # PURPOSE: To invoke the functions to perform the tasks described in # the prologue. #---------------------------------------------------------------------- +. net_cmdlib.sh + +read_opts $* +do_setup do_test -exit $EXIT_CODE +end_testcase diff --git a/testcases/network/tcp_cmds/ftp/ftp_set_passwd b/testcases/network/tcp_cmds/ftp/ftp_set_passwd index af56b3a2..8e94033b 100755 --- a/testcases/network/tcp_cmds/ftp/ftp_set_passwd +++ b/testcases/network/tcp_cmds/ftp/ftp_set_passwd @@ -8,7 +8,7 @@ # if { [llength $argv] < 2} { - exit 1 + exit 1 } set USER [lindex $argv 0] diff --git a/testcases/network/tcp_cmds/host/Makefile b/testcases/network/tcp_cmds/host/Makefile dissimilarity index 94% index b7341c9a..333047d2 100644 --- a/testcases/network/tcp_cmds/host/Makefile +++ b/testcases/network/tcp_cmds/host/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f host01 ../../../bin - -clean: - +# +# network/tcp_cmds/host 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := host01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/host/host01 b/testcases/network/tcp_cmds/host/host01 index d6b7cae9..78bcbb65 100755 --- a/testcases/network/tcp_cmds/host/host01 +++ b/testcases/network/tcp_cmds/host/host01 @@ -32,32 +32,18 @@ # # #----------------------------------------------------------------------- -# Uncomment line below for debug output -#trace_logic=${trace_logic:-"set -x"} -$trace_logic -RHOST=${RHOST:-`hostname`} -NUMLOOPS=${NUMLOOPS:-20} -SLEEPTIME=${SLEEPTIME:-0} +do_setup() +{ + NUMLOOPS=${NUMLOOPS:-1} + SLEEPTIME=${SLEEPTIME:-0} -this_file=${0##*/} -#----------------------------------------------------------------------- -# -# FUNCTION: exists -# -#----------------------------------------------------------------------- + tst_setup + + exists awk host hostname + + RHOST=${RHOST:-`hostname`} -exists() -{ - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done } #----------------------------------------------------------------------- @@ -68,52 +54,34 @@ exists() do_test() { - $trace_logic - tst_resm TINFO "$this_file: test the basic functionality of the `host` command." - - count=0 - while [ $count -lt $NUMLOOPS ] - do - host $RHOST - if [ $? -eq 0 ]; then - rhost_addr=`host $RHOST | tr -s ',' ' ' | awk '{print $NF}'` 2>&1 \ - >/dev/null - host $rhost_addr 2>&1 >/dev/null - [ $? -eq 0 ] || end_testcase "host can not do a reverse lookup" - else - end_testcase "host $RHOST on local machine failed" - fi - count=$(( $count + 1 )) - sleep $SLEEPTIME - done -} -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= + tst_resm TINFO "test basic functionality of the \`$TC' command." -end_testcase() -{ - $trace_logic - tst_resm TINFO "$this_file: doing $0." + while [ $TST_COUNT -lt $NUMLOOPS ]; do + + if rhost_addr=$(host $RHOST); then + rhost_addr=$(echo "$rhost_addr" | awk -F, '{print $NF}') 2>&1 >/dev/null + if ! host $rhost_addr 2>&1 >/dev/null; then + end_testcase "reverse lookup with host failed" + fi + + else + end_testcase "host $RHOST on local machine failed" + fi + + incr_tst_count + sleep $SLEEPTIME + + done - [ $# -eq 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 } #----------------------------------------------------------------------- # FUNCTION: MAIN #----------------------------------------------------------------------- -export TCID="host01" -export TST_TOTAL=1 -export TST_COUNT=1 -exists "host awk" +. net_cmdlib.sh + +read_opts $* +do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/include/netdefs.h b/testcases/network/tcp_cmds/include/netdefs.h new file mode 100644 index 00000000..067f20ae --- /dev/null +++ b/testcases/network/tcp_cmds/include/netdefs.h @@ -0,0 +1,73 @@ +/* + * tcpcmds common definitions header (designed for to maximize modularity + * between IPv4 and IPv6 test code). + * + * 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. + * + */ + +#ifndef __NETDEFS_H +#define __NETDEFS_H + +#include + +#if INET6 + +#include +#include + +typedef struct icmp6_hdr icmp_t; +typedef struct sockaddr sa_t; +typedef struct sockaddr_in6 sai_t; + +#define AFI AF_INET6 +#define IERP ICMP6_ECHO_REPLY +#define IERQ ICMP6_ECHO_REQUEST +#define ICMP_PROTO "ipv6-imcp" +#define PFI PF_INET6 + +#else + +#include +#include + +typedef struct icmp icmp_t; +typedef struct sockaddr sa_t; +typedef struct sockaddr_in sai_t; + +#define AFI AF_INET +#define IERP ICMP_ECHOREPLY +#define IERQ ICMP_ECHO +#define ICMP_PROTO "imcp" +#define PFI PF_INET + +#endif + +#define LISTEN_BACKLOG 10 + +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + +#endif diff --git a/testcases/network/tcp_cmds/netstat/Makefile b/testcases/network/tcp_cmds/netstat/Makefile dissimilarity index 94% index b61180fc..87b6964a 100644 --- a/testcases/network/tcp_cmds/netstat/Makefile +++ b/testcases/network/tcp_cmds/netstat/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f netstat01 ../../../bin - -clean: - +# +# network/tcp_cmds/netstat 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := netstat01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/netstat/netstat01 b/testcases/network/tcp_cmds/netstat/netstat01 index 1cf0d9dd..365c1422 100755 --- a/testcases/network/tcp_cmds/netstat/netstat01 +++ b/testcases/network/tcp_cmds/netstat/netstat01 @@ -31,33 +31,17 @@ # # #----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic -NUMLOOPS=${NUMLOOPS:-5} -SLEEPTIME=${SLEEPTIME:-0} +do_setup() +{ + NUMLOOPS=${NUMLOOPS:-1} + SLEEPTIME=${SLEEPTIME:-0} -#----------------------------------------------------------------------- -# -# FUNCTION: exists -# -#----------------------------------------------------------------------- + tst_setup -exists() -{ - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done + exists netstat } - #------------------------------------------------------------------------- # FUNCTION: do_test # PURPOSE: @@ -70,39 +54,21 @@ exists() #----------------------------------------------------------------------- do_test() { - $trace_logic - COUNT=1 - while [ $COUNT -le $NUMLOOPS ] - do - for COMMAND in "netstat -s" "netstat -rn" "netstat -i" "netstat -gn" "netstat -apn" - do - $COMMAND 2>&1 1>/dev/null - [ $? -eq 0 ] || end_testcase "$COMMAND failed" - done + while [ $TST_COUNT -le $NUMLOOPS ]; do - COUNT=$(( $COUNT + 1 )) - sleep $SLEEPTIME - done -} + for flag in "-s" "-rn" "-i" "-gn" "-apn"; do + if ! netstat $flag 1>/dev/null 2>&1; then + end_testcase "$COMMAND failed" + fi + done -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= + incr_tst_count -end_testcase() -{ - $trace_logic + sleep $SLEEPTIME + + done - [ $# -eq 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 } #----------------------------------------------------------------------- @@ -114,9 +80,9 @@ end_testcase() # OUTPUT: Logged run results written to testcase run log # #----------------------------------------------------------------------- -export TCID="netstat01" -export TST_TOTAL=1 -export TST_COUNT=1 -exists "netstat" +. net_cmdlib.sh + +read_opts $* +do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/perf_lan/Makefile b/testcases/network/tcp_cmds/perf_lan/Makefile dissimilarity index 97% index 58537b6b..c8e8a15c 100644 --- a/testcases/network/tcp_cmds/perf_lan/Makefile +++ b/testcases/network/tcp_cmds/perf_lan/Makefile @@ -1,17 +1,42 @@ -CFLAGS+= -I../../../../include -Wall -w -O -LOADLIBES+= -L../../../../lib -lltp -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - ln -f perf_lan ../../../bin - ln -f pingpong ../../../bin - -clean: - rm -f $(TARGETS) - - +# +# network/tcp_cmds/perf_lan 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -D_GNU_SOURCE -I$(abs_srcdir)/../include + +INSTALL_TARGETS := perf_lan + +# NOTE (garrcoop): Once everything compiles with the same sources using +# pingpong.c, then the following commented code should be uncommented and +# pingpong6.c should be nuked. Unfortunately that isn't quite yet... +# +#MAKE_TARGETS := pingpong pingpong6 +# +#%6: CPPFLAGS += -DINET6 +# +#%6.o: %.c +# $(COMPILE.c) $(OUTPUT_OPTION) $< + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/perf_lan/perf_lan b/testcases/network/tcp_cmds/perf_lan/perf_lan index 4125fde7..d09310ef 100755 --- a/testcases/network/tcp_cmds/perf_lan/perf_lan +++ b/testcases/network/tcp_cmds/perf_lan/perf_lan @@ -21,7 +21,7 @@ unset LIBPATH # # FILE : perf_lan # -# PURPOSE: Generates LAN traffic using ICMP tst_resm TINFO packets. +# PURPOSE: Generates LAN traffic using ICMP echo packets. # # # SETUP: The home directory of root on the machine exported as "RHOST" @@ -36,30 +36,20 @@ unset LIBPATH # # #*********************************************************************** -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic -TC=slan -RHOST=${RHOST:-`hostname`} -TCbin=${TCbin:-`pwd`} -TCsrc=${TCsrc:-$TCbin} -TCtmp=${TCtmp:-$TCsrc/perf_lan$$} -CLEANUP=${CLEANUP:-ON} +do_setup() +{ + RHOST=${RHOST:-`hostname`} + TCtmp=${TCtmp:-$LTPROOT/testcases/bin/${TC}$$} -PACKETSIZE=${PACKETSIZE:-512} -NUMPACKETS=${NUMPACKETS:-1} -NUMLOOPS=${NUMLOOPS:-10} -EXECUTABLES="pingpong" + PACKETSIZE=${PACKETSIZE:-512} + NUMPACKETS=${NUMPACKETS:-1} + NUMLOOPS=${NUMLOOPS:-10} + PINGPONG="pingpong${EXEC_SUFFIX}" -trap "interrupt_testcase" 2 15 16 30 + tst_setup -do_setup() -{ - export TCID="perf_lan" - export TST_TOTAL=1 - export TST_COUNT=1 - mkdir -p $TCtmp + trap interrupt_testcase INT TERM URG USR1 } #----------------------------------------------------------------------- @@ -72,75 +62,29 @@ do_setup() do_test() { - $trace_logic - tst_resm TINFO "$this_file: doing $0." - - TLOOP=1 - COUNT=1 - [ $NUMLOOPS -gt 0 ] || TLOOP=$NUMLOOPS - while [ $TLOOP -le $NUMLOOPS ] - do - $TCbin/$EXECUTABLES $RHOST $PACKETSIZE $NUMPACKETS - RETVALUE=$? - - case "$RETVALUE" in - 0) tst_resm TINFO "Successful execution for loop $COUNT" ;; - 1) end_testcase "Error trying to send to host" ;; - 2) end_testcase "Error - Data length is too long";; - 3) end_testcase "Usage error ";; - 5) end_testcase "Error - Socket setting" ;; - 6) end_testcase "Error - Pipe broken";; - 7) end_testcase "Error - Fork fail";; - 10)end_testcase "Error - wrong Protocol" ;; - *) end_testcase "Return code from $EXECUTABLES is $RETVALUE" ;; - esac - if [ $NUMLOOPS -gt 0 ] ; then TLOOP=$(( $TLOOP + 1 )); fi - COUNT=$(( $COUNT + 1 )) - done -} + tst_resm TINFO "Executing $0" -#----------------------------------------------------------------------- -# -# FUNCTION: do_cleanup -# PURPOSE: Called when the testcase is interrupted by the user -# or by interrupt_testcase() when time limit expired -# INPUT: None. -# OUTPUT: None. -# -#----------------------------------------------------------------------- + while [ $TST_COUNT -le $NUMLOOPS ]; do -do_cleanup() -{ - $trace_logic - tst_resm TINFO "$this_file: doing $0." + $PINGPONG $RHOST $PACKETSIZE $NUMPACKETS - cd / - if [ $TCtmp != $TCsrc ]; then - rm -rf $TCtmp - fi -} + RETVALUE=$? + + case "$RETVALUE" in + 0) tst_resm TINFO "Successful execution for loop $TST_COUNT";; + 1) end_testcase "Error trying to send to host";; + 2) end_testcase "Error - Data length is too long";; + 3) end_testcase "Usage error ";; + 5) end_testcase "Error - Socket setting";; + 6) end_testcase "Error - Pipe broken";; + 7) end_testcase "Error - Fork fail";; + 10) end_testcase "Error - wrong Protocol";; + *) end_testcase "Unexpected exit code from $PINGPONG: $RETVALUE";; + esac + incr_tst_count + + done -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - tst_resm TINFO "$this_file: doing $0." - - # Call other cleanup functions - [ $CLEANUP = "ON" ] && do_cleanup - - [ $# -eq 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 } #----------------------------------------------------------------------- @@ -154,13 +98,10 @@ end_testcase() interrupt_testcase() { - $trace_logic - tst_resm TINFO "$this_file: doing $0." - - tst_resm TINFO "Testcase interrupted - cleaning up" - tst_resm TINFO "Killing background process if it is still running" - kill -9 $CHILDPID - end_testcase + tst_resm TINFO "Testcase interrupted - cleaning up" + tst_resm TINFO "Killing background process if it is still running" + kill -9 $CHILDPID + end_testcase } #----------------------------------------------------------------------- @@ -172,6 +113,10 @@ interrupt_testcase() # OUTPUT: Logged run results written to testcase run log # #----------------------------------------------------------------------- +. net_cmdlib.sh + +read_args $* + do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong.c b/testcases/network/tcp_cmds/perf_lan/pingpong.c dissimilarity index 71% index 0de6956a..5e73ebf4 100644 --- a/testcases/network/tcp_cmds/perf_lan/pingpong.c +++ b/testcases/network/tcp_cmds/perf_lan/pingpong.c @@ -1,388 +1,407 @@ -/* -# -# -# Task Subprogram -# -# SUBPROGRAM NAME: PINGPONG.C -# -# REQUIRED PARAMETERS: -# Calling Procedure: pingpong HOST SIZE PACKETS -# HOST - Current host -# SIZE - Size of each packet -# PACKETS - the number of packets across the network -# -# SETUP REQUIRED: -# o This task must be run as root. -# o TCP/IP must be configured before executing this task. -# -# DESCRIPTION: -# Purpose:To generate lan traffic with ICMP echo packet -# Command: None -# Subcommand:None -# Design: -# Create raw socket -# spawn child process to send echo ICMP packet -# the child process build echo packet and send to network -# repeat n times -# the parent goes on to receive the reply -# when finish print # of packets sent & # pf packets received -# -# -#=========================================================================== -*/ - -#define PS2 -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include "test.h" -#include "usctest.h" - - -#define MAXPACKET 4096 /* max packet size */ -#ifndef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 64 -#endif - -int pfd[2]; -int fdstr[10]; -int verbose; -int count; -u_char packet[MAXPACKET]; -int options; -int s; /* Socket file descriptor */ -struct hostent *hp; /* Pointer to host info */ -struct timezone tz; /* leftover */ - -struct sockaddr whereto;/* Who to pingpong */ -int datalen; /* How much data */ - - -char *hostname; -char hnamebuf[MAXHOSTNAMELEN]; - -int npackets=1; -int ntransmitted = 0; /* sequence # for outbound packets = #sent */ -int ident; - -int nreceived = 0; /* # of packets we got back */ -int timing = 0; -void finish(int); -int nwrite; -char *TCID = "perf_lan"; -int TST_TOTAL = 1; -extern int Tst_count; - -u_short in_cksum(u_short *, int); -int ck_packet(char *, int, struct sockaddr_in *); -int echopkt(int, int); - - -/* - * M A I N - */ -int main(argc, argv) -char *argv[]; -{ - struct sockaddr_in from; - char **av = argv; - struct sockaddr_in *to = (struct sockaddr_in *) &whereto; - int rc = 0; - struct protoent *proto; - - tst_resm (TINFO, "Starting pingpong - to send / receive packets from host \n"); - - /* Get Host net address */ - tst_resm (TINFO, "Get host net address for sending packets \n"); - memset( (char *)&whereto, 0x00, sizeof(struct sockaddr) ); - to->sin_family = AF_INET; - to->sin_addr.s_addr = inet_addr(av[1]); - if (to->sin_addr.s_addr != -1) { - strcpy(hnamebuf, av[1]); - hostname = hnamebuf; - } else { - hp = gethostbyname(av[1]); - if (hp) { - to->sin_family = hp->h_addrtype; - memcpy((caddr_t)&to->sin_addr, hp->h_addr, hp->h_length); - hostname = hp->h_name; - } else { - tst_resm (TINFO, "%s: unknown host, couldn't get address\n",argv[0]); - exit(1); - } - } - - - - /* Determine Packet Size - either use what was passed in or default */ - tst_resm (TINFO, "Determine packet size \n"); - if( argc >= 3 ) - datalen = atoi( av[2] ); - else - datalen = 64-8; - if (datalen > MAXPACKET) { - tst_resm (TINFO, "Pingpong: packet size too large\n"); - exit(1); - } - if (datalen >= sizeof(struct timeval)) - timing = 1; - - - /* Set number of packets to be sent */ - tst_resm (TINFO, "Determine number of packets to send \n"); - if (argc >= 4) - npackets = atoi(av[3]); - - - /* Get PID of current process */ - ident = getpid() & 0xFFFF; - - - /* Get network protocol to use (check /etc/protocol) */ - if ((proto = getprotobyname("icmp")) == NULL) { - tst_resm (TINFO, "ICMP: unknown protocol\n"); - exit(10); - } - - - /* Create a socket endpoint for communications - returns a descriptor */ - if ((s = socket(AF_INET, SOCK_RAW, proto->p_proto)) < 0) { - tst_resm (TINFO, "Pingpong: socket - could not create link \n"); - exit(5); - } - - tst_resm (TINFO, "echoing %s: %d data bytes\n", hostname, datalen ); - - setlinebuf( stdout ); - - /* Setup traps */ - signal( SIGINT, finish ); - signal( SIGCLD, finish ); - - - /* Fork a child process to continue sending packets */ - tst_resm (TINFO, "Create a child process to continue to send packets \n"); - switch (fork()) { - case -1: - tst_resm (TINFO, "ERROR when forking a new process\n"); - exit(1); - case 0: - /* Child's work */ - ntransmitted=echopkt(datalen,npackets); - tst_resm (TINFO, "%d packets transmitted, ",ntransmitted); - sleep(10); - break; - default: - tst_resm (TINFO, "Parent started - to receive packets \n"); - /* Parent's work - receive packets back from child */ - for (;;) { - int len = sizeof (packet); - unsigned int fromlen = sizeof (from); -#ifdef __64BIT__ - long cc; -#else - int cc; -#endif - - /* Receive packet from socket */ - tst_resm (TINFO, "Receiving packet \n"); - fromlen = sizeof (from); - if ( (cc=recvfrom(s, packet, len, 0, (struct sockaddr *)&from, &fromlen)) < 0) { - tst_resm (TINFO, "ERROR in recvfrom\n"); - } - /* Verify contents of packet */ - if ((rc = ck_packet (packet, cc, &from)) != 0) { - tst_resm (TINFO, "ERROR - network garbled packet\n"); - } - else { - nreceived++; - } - } - } - return 0; -} - -int echopkt(datalen,npackets) -int datalen; -int npackets; -{ - int count=0; - static u_char outpack[MAXPACKET]; - register struct icmp *icp = (struct icmp *) outpack; - int i; -#ifdef __64BIT__ - long cc; -#else - int cc; -#endif - - register struct timeval *tp = (struct timeval *) &outpack[8]; - register u_char *datap = &outpack[8+sizeof(struct timeval)]; - - - /* Setup the packet structure */ - tst_resm (TINFO, "Setup ICMP packet structure to send to host \n"); - icp->icmp_type = ICMP_ECHO; - icp->icmp_code = 0; - icp->icmp_cksum = 0; - icp->icmp_id = ident; /* ID */ - - cc = datalen+8; /* skips ICMP portion */ - - - /* Add time stamp and user data */ - tst_resm (TINFO, "Add time stamp, user data, and check sum to packet. \n"); - if (timing) - gettimeofday( tp, &tz ); - - for( i=8; iicmp_cksum = in_cksum( (ushort *)icp, cc ); - - /* cc = sendto(s, msg, len, flags, to, tolen) */ - ntransmitted=0; - while (count < npackets) { - count++; - /* Send packet through socket created */ - tst_resm (TINFO, "Sending packet through created socket \n"); - i = sendto( s, outpack, cc, 0, &whereto, sizeof(struct sockaddr) ); - - if( i < 0 || i != cc ) { - if( i<0 ) perror("sendto"); - tst_resm (TINFO, "pingpong: wrote %s %d chars, ret=%d\n",hostname,cc,i); - fflush(stdout); - } - } - /* sleep(30); */ - return(count); -} - - - -/* - * I N _ C K S U M - * - * Checksum routine for Internet Protocol family headers (C Version) - * - */ -u_short in_cksum(u_short *addr, int len) -{ - register int nleft = len; - register u_short *w = addr, tmp; - register int sum = 0; - register u_short answer = 0; - - /* - * Our algorithm is simple, using a 32 bit accumulator (sum), we add - * sequential 16 bit words to it, and at the end, fold back all the - * carry bits from the top 16 bits into the lower 16 bits. - */ - while (nleft > 1) { - sum += *w++; - nleft -= 2; - } - - /* mop up an odd byte, if necessary */ - if (nleft == 1) { - tmp = *(u_char *)w; - sum += (tmp << 8); - } - /* add back carry outs from top 16 bits to low 16 bits */ - sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ - sum += (sum >> 16); /* add carry */ - answer = ~sum; /* truncate to 16 bits */ - return(answer); -} - - -/* - * T V S U B - * - * Subtract 2 timeval structs: out = out - in. - * - * Out is assumed to be >= in. - *tvsub( out, in ) - *register struct timeval *out, *in; - *{ - * if( (out->tv_usec -= in->tv_usec) < 0 ) { - * out->tv_sec--; - * out->tv_usec += 1000000; - * } - * out->tv_sec -= in->tv_sec; - *} - */ - -/* - * F I N I S H - * - * Outputs packet information to confirm transmission and reception. - */ -void finish(int n) -{ - tst_resm (TINFO, "%d packets received, \n", nreceived ); - exit(0); -} - - -/* - * C K _ P A C K E T - * - * Checks contents of packet to verify information did not get destroyed - */ - -int ck_packet (buf, cc, from) -char *buf; /* pointer to start of IP header */ -int cc; /* total size of received packet */ -struct sockaddr_in *from; /* address of sender */ -{ - u_char i; - int iphdrlen; - struct ip *ip = (struct ip *) buf; /* pointer to IP header */ - register struct icmp *icp; /* ptr to ICMP */ - u_char *datap ; - - from->sin_addr.s_addr = ntohl(from->sin_addr.s_addr); - - iphdrlen = ip->ip_hl << 2; /* Convert # 16-bit words to #bytes */ - cc -= iphdrlen; - icp = (struct icmp *) (buf + iphdrlen); - datap = (u_char *)icp + sizeof(struct timeval) + 8; - if (icp->icmp_type != ICMP_ECHOREPLY) { - return(0); /* Not your packet 'cause not an echo */ - } - if (icp->icmp_id != ident) { - return(0); /* Sent to us by someone else */ - } - - /* Verify data in packet */ - tst_resm (TINFO, "Verify data in packet after returned from sender \n"); - if ( datalen > 118 ) { - datalen=118; - } - tst_resm (TINFO, "Checking Data.\n"); - for( i=8; i +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "test.h" +#include "usctest.h" +#include "netdefs.h" + +#define MAXPACKET 4096 /* max packet size */ +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 64 +#endif + +#if INET6 +char *TCID = "perf_lan6"; +#else +char *TCID = "perf_lan"; +#endif + +int TST_TOTAL = 1; + +int pfd[2]; +int fdstr[10]; +int verbose; +int count; +uint8_t packet[MAXPACKET]; +int options; +int s; /* Socket file descriptor */ +struct hostent *hp; /* Pointer to host info */ +struct timezone tz; /* leftover */ + +sai_t whereto; /* Who to pingpong */ +int datalen; /* How much data */ + +char *hostname; +char hnamebuf[MAXHOSTNAMELEN]; + +int npackets = 1; +int ntransmitted = 0; /* sequence number for outbound + * packets => amount sent */ +int ident; +int nwrite; + +int nreceived = 0; /* # of packets we got back */ +int timing = 0; + +void finish(int); +uint16_t in_cksum(uint16_t*, int); +int ck_packet(uint8_t*, size_t, sai_t*); +int echopkt(int, int); + +/* + * M A I N + */ +int +main (int argc, char *argv[]) +{ + sai_t from; + int rc = 0; + struct protoent *proto; + + tst_resm (TINFO, "Starting pingpong - to send / receive packets from " + "host"); + + /* Get Host net address */ + tst_resm (TINFO, "Get host net address for sending packets"); + memset( (char *)&whereto, 0, sizeof(sa_t) ); +#if INET6 + whereto.sin6_family = AFI; + whereto.sin6_addr.s6_addr = inet_addr(argv[1]); + if (whereto.sin6_addr.s6_addr != -1) { +#else + whereto.sin_family = AFI; + whereto.sin_addr.s_addr = inet_addr(argv[1]); + if (whereto.sin_addr.s_addr != -1) { +#endif + strcpy(hnamebuf, argv[1]); + hostname = hnamebuf; + } else { + + if ((hp = gethostbyname(argv[1])) != NULL) { +#if INET6 + whereto.sin6_family = hp->h_addrtype; + memcpy((caddr_t) &whereto.sin6_addr, hp->h_addr, hp->h_length); +#else + whereto.sin_family = hp->h_addrtype; + memcpy((caddr_t) &whereto.sin_addr, hp->h_addr, hp->h_length); +#endif + hostname = hp->h_name; + } else { + tst_resm (TBROK, "%s: unknown host, couldn't get " + "address", argv[0]); + tst_exit(); + } + + } + + + + /* Determine Packet Size - either use what was passed in or the default */ + tst_resm (TINFO, "Determining packet size"); + + if (argc >= 3) + datalen = atoi(argv[2]); + if (datalen < 0) { + tst_resm (TBROK, "datalen must be an integer."); + tst_exit(); + } + else + datalen = 64; + + datalen -= 8; + + if (datalen > MAXPACKET) { + tst_resm (TBROK, "packet size too large"); + tst_exit(); + } + if (datalen >= sizeof(struct timeval)) + timing = 1; + + /* Set number of packets to be sent */ + tst_resm (TINFO, "Determining number of packets to send"); + if (argc >= 4) + npackets = atoi(argv[3]); + + + /* Get PID of current process */ + ident = getpid() & 0xFFFF; + + + /* Get network protocol to use (check /etc/protocol) */ + if ((proto = getprotobyname(ICMP_PROTO)) == NULL) { + tst_resm (TINFO, "unknown protocol: %s", ICMP_PROTO); + tst_exit(); + } + + + /* Create a socket endpoint for communications - returns a descriptor */ + if ((s = socket(AFI, SOCK_RAW, proto->p_proto)) < 0) { + tst_resm (TINFO, "socket - could not create link"); + tst_exit(); + } + + tst_resm (TINFO, "echoing %s: %d data bytes", hostname, datalen); + + setlinebuf(stdout); + + /* Setup traps */ + signal(SIGINT, finish); + signal(SIGCLD, finish); + + + /* Fork a child process to continue sending packets */ + tst_resm (TINFO, "Create a child process to continue to send packets"); + switch (fork()) { + case -1: + tst_resm (TINFO, "ERROR when forking a new process"); + tst_exit(); + case 0: + /* Child's work */ + ntransmitted = echopkt(datalen, npackets); + tst_resm (TINFO, "%d packets transmitted", ntransmitted); + sleep(10); + break; + default: + + tst_resm (TINFO, "Parent started - to receive packets"); + /* Parent's work - receive packets back from child */ + + size_t len; + + while (1) { + + len = sizeof (packet); + size_t cc; + socklen_t fromlen; + + /* Receive packet from socket */ + tst_resm (TINFO, "Receiving packet"); + if ( (cc = recvfrom(s, packet, len, 0, (sa_t*) &from, &fromlen)) < 0) { + tst_resm (TINFO, "ERROR - recvfrom"); + } + /* Verify contents of packet */ + if ((rc = ck_packet (packet, cc, &from)) != 0) { + tst_resm (TINFO, "ERROR - network garbled packet"); + } else { + nreceived++; + } + + } + + } + + return 0; + +} + +int +echopkt (int datalen, int npackets) +{ + int count = 0; + static uint8_t outpack[MAXPACKET]; + register icmp_t *icp = (icmp_t *) outpack; + int i; + size_t cc; + + register u_char *datap = &outpack[8]; + + /* Setup the packet structure */ + tst_resm (TINFO, "Setting up ICMP packet structure to send to host"); + +#if INET6 + icp->icmp6_type = IERQ; + icp->icmp6_code = 0; + icp->icmp6_id = ident; /* ID */ +#else + icp->icmp_type = IERQ; + icp->icmp_code = 0; + icp->icmp_id = ident; /* ID */ +#endif + + cc = datalen + 8; /* skips ICMP portion */ + + for (i = 8; i < datalen; i++) { /* skip 8 for time */ + *datap++ = i; + } + + /* Compute ICMP checksum here */ +#if INET6 + icp->icmp6_cksum = in_cksum((uint16_t*) icp, cc); +#else + icp->icmp_cksum = in_cksum((uint16_t*) icp, cc); +#endif + + /* cc = sendto(s, msg, len, flags, to, tolen) */ + ntransmitted = 0; + + while (count < npackets) { + count++; + /* Send packet through socket created */ + tst_resm (TINFO, "Sending packet through created socket"); + i = sendto( s, outpack, cc, 0, (const sa_t*) &whereto, sizeof(whereto) ); + + if (i < 0 || i != cc) { + if (i < 0) + perror("sendto"); + tst_resm(TINFO, "wrote %s %d chars, ret=%d", + hostname, cc, i); + fflush(stdout); + } + } + /* sleep(30); */ + return(count); + +} + +/* + * I N _ C K S U M + * + * Checksum routine for Internet Protocol family headers (C Version) + * + */ +uint16_t +in_cksum (uint16_t *addr, int len) +{ + register int nleft = len; + register uint16_t *w = addr, tmp; + register int sum = 0; + register uint16_t answer = 0; + + /* + * Our algorithm is simple, using a 32 bit accumulator (sum), we add + * sequential 16 bit words to it, and at the end, fold back all the + * carry bits from the top 16 bits into the lower 16 bits. + */ + while (nleft > 1) { + sum += *w++; + nleft -= 2; + } + + /* mop up an odd byte, if necessary */ + if (nleft == 1) { + tmp = *(u_char *)w; + sum += (tmp << 8); + } + /* add back carry outs from top 16 bits to low 16 bits */ + sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ + sum += (sum >> 16); /* add carry */ + answer = ~sum; /* truncate to 16 bits */ + + return answer; + +} + +/* + * F I N I S H + * + * Outputs packet information to confirm transmission and reception. + */ +void +finish (int n) +{ + tst_resm (TINFO, "%d packets received", nreceived); + exit(0); +} + + +/* + * C K _ P A C K E T + * + * Checks contents of packet to verify information did not get destroyed + */ + +/* + * buf - pointer to start of IP header + * cc - total size of received packet + * from - address of sender + */ +int +ck_packet (uint8_t *buf, size_t cc, sai_t *from) +{ + u_char i; + int iphdrlen; + struct ip *ip = (struct ip *) buf; /* pointer to IP header */ + register icmp_t *icp; /* ptr to ICMP */ + u_char *datap ; + +#if INET6 + from->sin6_addr.s6_addr = ntohl(from->sin6_addr.s6_addr); +#else + from->sin_addr.s_addr = ntohl(from->sin_addr.s_addr); +#endif + + iphdrlen = ip->ip_hl << 2; /* Convert # 16-bit words to + * number of bytes */ + cc -= iphdrlen; + icp = (icmp_t*) (buf + iphdrlen); + datap = (u_char *)icp + sizeof(struct timeval) + 8; + if (icp->icmp_type != IERP) { + return 0; /* Not your packet because it's + * not an echo */ + } + if (icp->icmp_id != ident) { + return 0; /* Sent to us by someone + * else */ + } + + /* Verify data in packet */ + tst_resm (TINFO, "Verify data in packet after returned from sender"); + if (datalen > 118) { + datalen = 118; + } + tst_resm (TINFO, "Checking Data."); + for(i = 8; i < datalen; i++) { /* skip 8 for time */ + if (i != (*datap)) { + tst_resm (TINFO, "Data cannot be validated."); + } + datap++; + } + + return 0; + +} diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong6.c b/testcases/network/tcp_cmds/perf_lan/pingpong6.c new file mode 100644 index 00000000..b775c087 --- /dev/null +++ b/testcases/network/tcp_cmds/perf_lan/pingpong6.c @@ -0,0 +1,298 @@ +/* +# +# +# Task Subprogram +# +# SUBPROGRAM NAME: PINGPONG6.C +# +# REQUIRED PARAMETERS: +# Calling Procedure: pingpong6 HOST SIZE PACKETS +# HOST - Current host +# SIZE - Size of each packet +# PACKETS - the number of packets across the network +# +# SETUP REQUIRED: +# o This task must be run as root. +# o TCP/IP must be configured before executing this task. +# +# DESCRIPTION: +# Purpose:To generate lan traffic with ICMP6 echo packet +# Command: None +# Subcommand:None +# Design: +# Create raw socket +# spawn child process to send echo ICMP6 packet +# the child process build echo packet and send to network +# repeat n times +# the parent goes on to receive the reply +# when finish print # of packets sent & # pf packets received +# +# +#=========================================================================== +*/ + +#define PS2 +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define MAXPACKET 4096 /* max packet size */ +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 64 +#endif + +int pfd[2]; +int fdstr[10]; +int verbose; +int count; +u_char packet[MAXPACKET]; +int options; +int s; /* Socket file descriptor */ +struct addrinfo *hp; /* Pointer to host info */ +struct addrinfo hints; + +struct sockaddr_in6 whereto;/* Who to pingpong */ +int datalen; /* How much data */ + + +char *hostname; +char hnamebuf[MAXHOSTNAMELEN]; + +int npackets=1; +int ntransmitted = 0; /* sequence # for outbound packets = #sent */ +int ident; + +int nreceived = 0; /* # of packets we got back */ +int timing = 0; +void finish(int); +int nwrite; +/* + * M A I N + */ +int +main(argc, argv) +char *argv[]; +{ + struct sockaddr_in6 from; + char **av = argv; + int nrcv; + int on = 1; + int rc = 0; + struct protoent *proto; + int gai; + + printf ("Starting pingpong - to send / receive packets from host \n"); + + /* Get Host net address */ + printf ("Get host net address for sending packets \n"); + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_INET6; + + if ((gai=getaddrinfo(av[1], NULL, &hints, &hp))!=0) { + fprintf(stderr, "Unknown subject address %s: %s\n",av[1], gai_strerror(gai)); + exit(1); + } + if (!hp->ai_addr || hp->ai_addr->sa_family != AF_INET6) { + fprintf(stderr, "getaddrinfo failed"); + exit(1); + } + strcpy(hnamebuf, av[1]); + hostname = hnamebuf; + memset( (char *)&whereto, 0x00, sizeof(struct sockaddr) ); + memcpy(&whereto, hp->ai_addr, hp->ai_addrlen); + + /* Determine Packet Size - either use what was passed in or default */ + printf ("Determine packet size \n"); + if( argc >= 3 ) + datalen = atoi( av[2] ) - 8; + else + datalen = 64-8; + if (datalen > MAXPACKET) { + printf("Pingpong: packet size too large\n"); + exit(1); + } + + + /* Set number of packets to be sent */ + printf ("Determine number of packets to send \n"); + if (argc >= 4) + npackets = atoi(av[3]); + + + /* Get PID of current process */ + ident = getpid() & 0xFFFF; + + + /* Get network protocol to use (check /etc/protocol) */ + if ((proto = getprotobyname("ipv6-icmp")) == NULL) { + printf("ICMP6: unknown protocol\n"); + exit(1); + } + + + /* Create a socket endpoint for communications - returns a descriptor */ + if ((s = socket(AF_INET6, SOCK_RAW, proto->p_proto)) < 0) { + printf("Pingpong: socket - could not create link \n"); + exit(1); + } + + printf("echoing %s: %d data bytes\n", hostname, datalen ); + printf("Total packet size is %d bytes\n",datalen+8); + + setlinebuf( stdout ); + + /* Setup traps */ + signal( SIGINT, finish ); + signal( SIGCLD, finish ); + + + /* Fork a child process to continue sending packets */ + printf ("Create a child process to continue to send packets \n"); + switch (fork()) { + case -1: + printf("ERROR when forking a new process\n"); + exit(1); + case 0: + /* Child's work */ + ntransmitted=echopkt(datalen,npackets); + printf("%d packets transmitted, ",ntransmitted); + sleep(10); + break; + default: + printf ("Parent started - to receive packets \n"); + /* Parent's work - receive packets back from child */ + for (;;) { + int len = sizeof (packet); + unsigned int fromlen = sizeof (from); +#ifdef __64BIT__ + long cc; +#else + int cc; +#endif + + /* Receive packet from socket */ + fromlen = sizeof (from); + if ( (cc=recvfrom(s, packet, len, 0, (struct sockaddr *)&from, &fromlen)) < 0) { + printf("ERROR in recvfrom\n"); + } + /* Verify contents of packet */ + if ((rc = ck_packet (packet, cc, &from)) == 0) + nreceived++; + } + } + return 0; +} + +echopkt(datalen,npackets) +int datalen; +int npackets; +{ + int count=0; + static u_char outpack[MAXPACKET]; + register struct icmp6_hdr *icp = (struct icmp6_hdr *) outpack; + int i; +#ifdef __64BIT__ + long cc; +#else + int cc; +#endif + + register u_char *datap = &outpack[8]; + + + /* Setup the packet structure */ + printf ("Setup ICMP packet structure to send to host \n"); + icp->icmp6_type = ICMP6_ECHO_REQUEST; + icp->icmp6_code = 0; + icp->icmp6_cksum = 0; + icp->icmp6_id = ident; /* ID */ + + cc = datalen+8; /* skips ICMP portion */ + + for( i=0; iicmp6_type != ICMP6_ECHO_REPLY) { + return(1); /* Not your packet 'cause not an echo */ + } + if (icp->icmp6_id != ident) { + return(1); /* Sent to us by someone else */ + } + printf("Receiving packet \n"); + /* Verify data in packet */ + + printf ("Checking Data.\n"); + for( i=0; i&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done + COUNT=${COUNT:-5} + SLEEPTIME=${SLEEPTIME:-1} + PACKETSIZES=${PACKETSIZES:-"8 16 32 64 128 256 512 1024 2048 4064"} + + tst_setup + + exists ping + + RHOST=${RHOST:-127.0.0.1} } @@ -74,34 +63,14 @@ exists() do_test() { - $trace_logic - tst_resm TINFO "ping with 8 16 32 64 128 256 512 1024 2048 4064 ICMP packets" - for packetsize in $PACKETSIZES - do - tst_resm TINFO "calling ping with packet size = $packetsize" - ping -R -c $COUNT -s $packetsize $RHOST 2>&1 1>/dev/null - [ $? -eq 0 ] || end_testcase "failed: ping -c $COUNT -s $packetsize $RHOST" - sleep $SLEEPTIME - done -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - - [ $# -eq 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 + tst_resm TINFO "ping with $PACKETSIZES ICMP packets" + for packetsize in $PACKETSIZES; do + tst_resm TINFO "calling ping with packet size = $packetsize" + if ! ping -R -c $COUNT -s $packetsize $RHOST 2>&1 1>/dev/null; then + end_testcase "failed: ping -c $COUNT -s $packetsize $RHOST" + fi + sleep $SLEEPTIME + done } #******************************************************************************* @@ -109,9 +78,9 @@ end_testcase() # FUNCTION: MAIN # #******************************************************************************* -export TCID="ping01" -export TST_TOTAL=1 -export TST_COUNT=1 -exists "ping" +. net_cmdlib.sh + +read_opts $* +do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/rcp/Makefile b/testcases/network/tcp_cmds/rcp/Makefile dissimilarity index 97% index 6da286bb..1da03b66 100644 --- a/testcases/network/tcp_cmds/rcp/Makefile +++ b/testcases/network/tcp_cmds/rcp/Makefile @@ -1,10 +1,30 @@ -all: - -generate: - ../../generate.sh - -install: generate - ln -f rcp01 ../../../bin - -clean: - rm -rf datafiles +# +# network/tcp_cmds/rcp 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +INSTALL_TARGETS := rcp01 + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/rcp/rcp01 b/testcases/network/tcp_cmds/rcp/rcp01 index 8f2931c5..943bf1b9 100755 --- a/testcases/network/tcp_cmds/rcp/rcp01 +++ b/testcases/network/tcp_cmds/rcp/rcp01 @@ -34,38 +34,6 @@ # # #----------------------------------------------------------------------- -# Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -TC=rcp -TCbin=${TCbin:-`pwd`} -TCtmp=${TCtmp:-$TCbin/$TC$$} -TCdat=${TCdat:-$TCbin/datafiles} -LHOST=`hostname` -RHOST=${RHOST:-$LHOST} -SLEEPTIME=${SLEEPTIME:-0} -FILES=${FILES:-"bin.sm bin.med bin.lg bin.jmb"} - - -#----------------------------------------------------------------------- -# -# FUNCTION: exists -# -#----------------------------------------------------------------------- - -exists() -{ - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done -} #----------------------------------------------------------------------- # @@ -75,11 +43,24 @@ exists() do_setup() { - $trace_logic - exists "rcp rsh awk" - rsh -n -l root $RHOST mkdir -p $TCtmp 2>&1 1>/dev/null - mkdir -p $TCtmp + TCtmp=${TCtmp:-$LTPROOT/testcases/bin/$TC${EXEC_SUFFIX}$$} + TCdat=${TCdat:-$LTPROOT/testcases/bin/datafiles} + LHOST=`hostname` + RHOST=${RHOST:-$LHOST} + SLEEPTIME=${SLEEPTIME:-0} + FILES=${FILES:-"bin.sm bin.med bin.lg bin.jmb"} + + tst_setup + + exists awk rcp rsh sum + + if ! rsh -n -l root $RHOST mkdir -p $TCtmp 2>&1 1>/dev/null; then + end_testcase "Remote mkdir failed" + fi + + trap do_cleanup EXIT + } #----------------------------------------------------------------------- @@ -90,44 +71,49 @@ do_setup() do_test() { - $trace_logic - - for j in $FILES - do - rcp $TCdat/$j $RHOST:$TCtmp/$j - - SUM1=`sum $TCdat/$j | awk '{print $1}'` - SUM2=`rsh -n -l root $RHOST sum $TCtmp/$j | awk '{print $1}'` - rsh -n -l root $RHOST "rm -f $TCtmp/$j" - sleep $SLEEPTIME - - if [ $SUM1 = $SUM2 ] - then - tst_resm TINFO "rcp $TCdat/$j $RHOST:$TCtmp/$j successful" - else - end_testcase "FAILED: wrong sum in transfer to $RHOST" - fi - sleep $SLEEPTIME - done - - for j in $FILES - do - tst_resm TINFO "remote coping $RHOST:$TCdat/$j $TCtmp/$j " - rcp $RHOST:$TCdat/$j $TCtmp/$j 2>&1 1>/dev/null - - SUM1=`sum $TCtmp/$j | awk '{print $1}'` - SUM2=`rsh -n -l root $RHOST sum $TCdat/$j | awk '{print $1}'` - rm -f $TCtmp/$j - sleep $SLEEPTIME - - if [ $SUM1 = $SUM2 ] - then - tst_resm TINFO "rcp $RHOST:$TCdat/$j $TCtmp/$j successful" - else - end_testcase "FAILED: wrong sum in transfer to $LHOST from $RHOST" - fi - sleep $SLEEPTIME - done + + for j in $FILES; do + + if ! rcp $TCdat/$j $RHOST:$TCtmp/$j; then + end_testcase "Failed to rcp file." + fi + + SUM1=`sum $TCdat/$j | awk '{print $1}'` + SUM2=`rsh -n -l root $RHOST sum $TCtmp/$j | awk '{print $1}'` + rsh -n -l root $RHOST "rm -f $TCtmp/$j" + sleep $SLEEPTIME + + if [ "$SUM1 = $SUM2" ]; then + tst_resm TINFO "rcp $TCdat/$j $RHOST:$TCtmp/$j successful" + else + end_testcase "FAILED: wrong sum in transfer to $RHOST" + fi + + sleep $SLEEPTIME + + done + + for j in $FILES; do + + tst_resm TINFO "remote copying $RHOST:$TCdat/$j to $TCtmp/$j" + if ! rcp $RHOST:$TCdat/$j $TCtmp/$j 2>&1 1>/dev/null; then + tst_resm TFAIL "Failed to rcp file."; continue + fi + + SUM1=`sum $TCtmp/$j | awk '{print $1}'` + SUM2=`rsh -n -l root $RHOST sum $TCdat/$j | awk '{print $1}'` + rm -f $TCtmp/$j + sleep $SLEEPTIME + + if [ "$SUM1" = "$SUM2" ]; then + tst_resm TINFO "rcp $RHOST:$TCdat/$j $TCtmp/$j successful" + else + end_testcase "FAILED: wrong sum in transfer to $LHOST from $RHOST" + fi + sleep $SLEEPTIME + + done + } #----------------------------------------------------------------------- @@ -138,30 +124,8 @@ do_test() do_cleanup() { - $trace_logic - - rsh -n -l root $RHOST rmdir $TCtmp - rmdir $TCtmp -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - do_cleanup - - [ $# -eq 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 + rsh -n -l root $RHOST rmdir $TCtmp + tst_cleanup } #---------------------------------------------------------------------- @@ -172,9 +136,9 @@ end_testcase() # OUTPUT: A testcase run log with the results of the execution of this # test. #---------------------------------------------------------------------- -export TCID=rcp01 -export TST_TOTAL=1 -export TST_COUNT=1 +. net_cmdlib.sh + +read_opts $* do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/rdist/Makefile b/testcases/network/tcp_cmds/rdist/Makefile dissimilarity index 97% index 5fda3b22..de954891 100644 --- a/testcases/network/tcp_cmds/rdist/Makefile +++ b/testcases/network/tcp_cmds/rdist/Makefile @@ -1,10 +1,30 @@ -all: - -generate: - ../../generate.sh - -install: generate - ln -f rdist01 ../../../bin - -clean: - rm -rf datafiles +# +# network/tcp_cmds/rdist 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +INSTALL_TARGETS := rdist01 + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/rdist/rdist01 b/testcases/network/tcp_cmds/rdist/rdist01 index 624fd121..33e8703c 100755 --- a/testcases/network/tcp_cmds/rdist/rdist01 +++ b/testcases/network/tcp_cmds/rdist/rdist01 @@ -35,39 +35,6 @@ # # #*********************************************************************** -# Uncomment line below for debug output. -# trace_logic=${trace_logic:-"set -x"} -$trace_logic - -RHOST=${RHOST:-`hostname`} -USER_LIST=${USER_LIST:-'root'} -TCbin=${TCbin:-`pwd`} -TCdat=${TCdat:-$TCbin} -TCtmp=${TCtmp:-$TCbin/rdist$$} -FILES=${FILES:-'bin.sm bin.med bin.lg bin.jmb file.dir/bin.sm file.dir/bin.med file.dir/bin.jmb'} -SLEEPTIME=${SLEEPTIME:-10} -CLEANUP=${CLEANUP:-ON} - - -#----------------------------------------------------------------------- -# -# FUNCTION: exists -# -#----------------------------------------------------------------------- - -exists() -{ - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done -} - #----------------------------------------------------------------------- # @@ -77,41 +44,43 @@ exists() do_setup() { - $trace_logic - export TCID=rdist01 - export TST_TOTAL=1 - export TST_COUNT=1 - - - exists "dirname basename rdist" - - mkdir -p $TCtmp - cd $TCtmp - - # start with a clean LHOST - for i in $FILES - do - rm -rf $i - done - - for i in $FILES - do - BASE=`basename $i` - DIR=`dirname $i` - mkdir -p $DIR - cp $TCdat/datafiles/$BASE $DIR - [ $? -eq 0 ] || end_testcase "failed to cp $TCdat/datafiles/$BASE to $DIR" - chmod 764 $i - done - - # get the sum of all the files to rdist on the local machine - LSUM=0 - SUM=`sum -s $FILES|awk '{ print $1 }'` - for i in $SUM - do - LSUM=$(( $LSUM + $i )) - done + USER_LIST=${USER_LIST:-'root'} + TCdat=${TCdat:-$LTPROOT/testcases/bin/datafiles} + TCtmp=${TCtmp:-$LTPROOT/testcases/bin/$TC${EXEC_SUFFIX}$$} + FILES=${FILES:-'bin.sm bin.med bin.lg bin.jmb file.dir/bin.sm file.dir/bin.med file.dir/bin.jmb'} + SLEEPTIME=${SLEEPTIME:-10} + + tst_setup + + exists awk hostname rdist + + RHOST=${RHOST:-`hostname`} + + # start with a clean LHOST + for i in $FILES; do + rm -rf $i + done + + for i in $FILES; do + BASE=${i##*/} + DIR=${%%/*} + test -d "$DIR" || mkdir -p "$DIR" + if [ $? -ne 0 ] ; then + end_testcase "failed to create $DIR" + fi + if ! cp $TCdat/$BASE $DIR; then + end_testcase "failed to copy $TCdat/$BASE to $DIR" + fi + chmod 764 $i + done + + # get the sum of all the files to rdist on the local machine + LSUM=0 + SUM=`sum -s $FILES | awk '{ print $1 }'` + for i in $SUM; do + LSUM=$(( $LSUM + $i )) + done } #----------------------------------------------------------------------- @@ -123,33 +92,29 @@ do_setup() create_distfile() { - $trace_logic - - T_FILES="FILES = ( " - for i in $FILES - do - DIR=`dirname $i` - if [ $DIR = "." ]; then - T_FILES="$T_FILES $i" - else - T_FILES="$T_FILES $DIR" - fi - done - T_FILES="$T_FILES )" - - T_HOST="HOSTS = (" - for c_ruser in $RUSERS - do - for c_rhost in $HOSTS - do + T_FILES="FILES = ( " + for i in $FILES; do + if [ "${i%%*/}" = "." ]; then + T_FILES="$T_FILES $i" + else + T_FILES="$T_FILES $DIR" + fi + done + T_FILES="$T_FILES )" + + T_HOST="HOSTS = (" + for c_ruser in $RUSERS; do + for c_rhost in $HOSTS; do T_HOST=$T_HOST"$c_ruser@$c_rhost " - done - done - - T_HOST=$T_HOST")" - echo "$T_HOST" > $TCtmp/distfile - echo "$T_FILES" >> $TCtmp/distfile - echo '${FILES} -> ${HOSTS}' >> $TCtmp/distfile + done + done + + T_HOST="$T_HOST)" + cat < "$TCtmp/distfile" +$T_HOST +$T_FILES +${FILES} -> ${HOSTS} +EOF } #----------------------------------------------------------------------- @@ -162,26 +127,22 @@ create_distfile() check_result() { - $trace_logic - cd $TCtmp - for c_rhost in $HOSTS - do - for c_ruser in $RUSERS - do - TOTAL_SUM=`rsh -n -l $c_ruser $c_rhost \ - x=0;SUM=\$(sum -s $FILES|awk '{ print \$1 }') - for i in \$SUM - do - x=\$(( \$x + \$i )) + cd $TCtmp + for c_rhost in $HOSTS; do + for c_ruser in $RUSERS; do + TOTAL_SUM=`rsh -n -l $c_ruser $c_rhost \ + x=0; SUM=\$(sum -s $FILES|awk '{ print \$1 }') + for i in \$SUM; do + x=\$(( \$x + \$i )) done echo \$x` - if [ $TOTAL_SUM = $LSUM ]; then - tst_resm TINFO "Success rdist in $c_ruser@$c_rhost " - rsh -n -l $c_ruser $c_rhost "rm -rf $FILES $DIRECTORIES" - else - end_testcase "Wrong sum doing rdist in $curr_ruser@$curr_rhost" - fi - done + if [ $TOTAL_SUM = $LSUM ]; then + tst_resm TINFO "Success rdist in $c_ruser@$c_rhost " + rsh -n -l $c_ruser $c_rhost "rm -rf $FILES $DIRECTORIES" + else + end_testcase "Wrong sum doing rdist in $curr_ruser@$curr_rhost" + fi + done done } @@ -195,63 +156,21 @@ check_result() do_test() { - $trace_logic - - HOSTS="" - RUSERS="" - - for cur_host in $RHOST - do - HOSTS=$HOSTS" $cur_host" - for cur_user in $USER_LIST - do - RUSERS=$RUSERS" $cur_user" - create_distfile - rdist -f $TCtmp/distfile - [ $? -eq 0 ] || end_testcase "error doing rdist -f $TCtmp/distfile" - check_result - sleep $SLEEPTIME - done - done -} - -#----------------------------------------------------------------------- -# -# FUNCTION: do_cleanup -# PURPOSE: Called when the testcase is interrupted by the user -# or by interrupt_testcase() when time limit expired -# INPUT: None. -# OUTPUT: None. -# -#----------------------------------------------------------------------- - -do_cleanup() -{ - $trace_logic - - rm -rf $TCtmp -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - - # Call other cleanup functions - [ $CLEANUP = "ON" ] && do_cleanup - - [ $# -eq 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 + HOSTS="" + RUSERS="" + + for cur_host in $RHOST; do + HOSTS=$HOSTS" $cur_host" + for cur_user in $USER_LIST; do + RUSERS=$RUSERS" $cur_user" + create_distfile + if ! rdist -f $TCtmp/distfile; then + end_testcase "error doing rdist -f $TCtmp/distfile" + fi + check_result + sleep $SLEEPTIME + done + done } #---------------------------------------------------------------------- @@ -262,6 +181,9 @@ end_testcase() # OUTPUT: A testcase run log with the results of the execution of this # test. #---------------------------------------------------------------------- +. net_cmdlib.sh + +read_opts $* do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/rlogin/Makefile b/testcases/network/tcp_cmds/rlogin/Makefile dissimilarity index 94% index 6f43237a..ccc2884a 100644 --- a/testcases/network/tcp_cmds/rlogin/Makefile +++ b/testcases/network/tcp_cmds/rlogin/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f rlogin01 ../../../bin - -clean: - +# +# network/tcp_cmds/rlogin 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := rlogin01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/rsh/Makefile b/testcases/network/tcp_cmds/rsh/Makefile dissimilarity index 94% index 821318b2..b408556c 100644 --- a/testcases/network/tcp_cmds/rsh/Makefile +++ b/testcases/network/tcp_cmds/rsh/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f rsh01 ../../../bin - -clean: - +# +# network/tcp_cmds/rsh 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := rsh01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/rsh/rsh01 b/testcases/network/tcp_cmds/rsh/rsh01 index 30563ceb..e87a6a0d 100755 --- a/testcases/network/tcp_cmds/rsh/rsh01 +++ b/testcases/network/tcp_cmds/rsh/rsh01 @@ -33,32 +33,22 @@ # # #---------------------------------------------------------------------- -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic -RHOST=${RHOST:-`hostname`} -SLEEPTIME=${SLEEPTIME:-0} -NUMLOOPS=${NUMLOOPS:-25} +do_setup() +{ + FAIL_IMMEDIATELY=${FAIL_IMMEDIATELY:-1} + SLEEPTIME=${SLEEPTIME:-0} + NUMLOOPS=${NUMLOOPS:-1} -#----------------------------------------------------------------------- -# -# FUNCTION: exists -# -#----------------------------------------------------------------------- + export TST_TOTAL=$NUMLOOPS + + tst_setup + + exists awk hostname rsh + + RHOST=${RHOST:-`hostname`} -exists() -{ - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done } #----------------------------------------------------------------------- @@ -69,40 +59,44 @@ exists() do_test() { - $trace_logic - - COUNT=1 - while [ $COUNT -le $NUMLOOPS ] - do - CHECK=$(rsh -n -l root $RHOST "ls -l /etc/hosts | wc -w") - - if [ "$CHECK" -eq 9 ]; then - tst_resm TINFO "rsh Test successful in loop $COUNT" - else - tst_resm TBROK "FAILED: rsh failed" - fi - sleep $SLEEPTIME - COUNT=$(( $COUNT + 1 )) - done -} -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPADDRTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= + while [ $TST_COUNT -le $NUMLOOPS ]; do -end_testcase() -{ - $trace_logic + PASSED=0 + + if OUT=$(rsh -n -l root $RHOST 'ls -l /etc/hosts'); then + + # + # Successful output would be something of the form: + # + # gcooper@orangebox ~ $ ls -l /etc/hosts + # -rw-r--r-- 1 root root 463 Jul 5 09:26 /etc/hosts + # + echo "$OUT" | \ + awk 'NF == 9 && $NF == "/etc/hosts" { exit 0 } END { exit 1 }' \ + >& /dev/null + + if [ $? -eq 0 ] ; then + tst_resm TPASS "rsh to $RHOST test succeeded" + PASSED=1 + fi + + fi + + if [ $PASSED -ne 1 ] ; then + tst_resm TFAIL "rsh to $RHOST failed" + # If the first rsh failed, the likelihood that the rest will + # succeed is low. + if [ "$FAIL_IMMEDIATELY" = "1" ] && [ $COUNT -eq 1 ]; then + exit 2 + fi + fi + + sleep $SLEEPTIME + incr_tst_count + + done - [ $# -eq 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 } #---------------------------------------------------------------------- @@ -113,9 +107,9 @@ end_testcase() # OUTPUT: A testcase run log with the results of the execution of this # test. #---------------------------------------------------------------------- -export TCID=rsh01 -export TST_TOTAL=1 -export TST_COUNT=1 -exists "rsh wc" +. net_cmdlib.sh + +read_opts $* +do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/rwho/Makefile b/testcases/network/tcp_cmds/rwho/Makefile dissimilarity index 94% index 06819d9d..385bce25 100644 --- a/testcases/network/tcp_cmds/rwho/Makefile +++ b/testcases/network/tcp_cmds/rwho/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f rwho01 ../../../bin - -clean: - +# +# network/tcp_cmds/rwho 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := rwho01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/rwho/rwho01 b/testcases/network/tcp_cmds/rwho/rwho01 index 7d6a482c..9967967f 100755 --- a/testcases/network/tcp_cmds/rwho/rwho01 +++ b/testcases/network/tcp_cmds/rwho/rwho01 @@ -38,91 +38,61 @@ # #============================================================================== # error codes: 0 rwho/ruptime successful -# 1 rwho failed no local and remote host in file -# 2 ruptime failed no local and remote host in file +# 1 rwho failed no local and remote host in file +# 2 ruptime failed no local and remote host in file #============================================================================== -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -LHOST=`hostname | cut -f1 -d.` -RHOST=${RHOST:-$LHOST} -TC=rwho -TCtmp=${TCtmp:-/tmp/$TC} -CLEANUP=${CLEANUP:-ON} - -PID=0 -RHOST_PID=0 -SLEEPTIME=${SLEEPTIME:-20} -NUMLOOPS=${NUMLOOPS:-25} -OUTFILE=${OUTFILE:-$TCtmp/rwho.out} #----------------------------------------------------------------------- # -# FUNCTION: exists +# FUNCTION: do_setup # #----------------------------------------------------------------------- -exists() +do_setup() { - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done -} + TCtmp=${TCtmp:-$LTPROOT/testcases/bin/$TC${EXEC_SUFFIX}$$} -#----------------------------------------------------------------------- -# -# FUNCTION: do_setup -# -#----------------------------------------------------------------------- + PID=0 + RHOST_PID=0 + SLEEPTIME=${SLEEPTIME:-20} + NUMLOOPS=${NUMLOOPS:-25} + OUTFILE=${OUTFILE:-$TCtmp/${TC}.out} + + tst_setup + + exists awk cut hostname killall ps rsh rwho + + LHOST=`hostname | cut -f1 -d.` + RHOST=${RHOST:-$LHOST} + + trap do_cleanup EXIT + + if ! ps -ef | awk '/rwhod/ && $0 !~ /awk/'; then + tst_resm TINFO "Starting rwhod on $LHOST" + rwhod || end_testcase "Unable to start rwhod on $LHOST" + PID=1 + sleep $SLEEPTIME + fi + + if ! rsh -n -l root $RHOST ps -ef | awk '/rwhod/ && $0 !~ /awk/'; then + tst_resm TINFO "Starting rwhod on $RHOST" + if ! rsh -n -l root $RHOST /usr/sbin/rwhod; then + end_testcase "Unable to start rwhod on $RHOST" + fi + RHOST_PID=$(rsh -n -l root $RHOST ps -ef | awk '/rwhod/ && $0 !~ /awk/ {print $2 ; exit}') + if [ -z "$RHOST_PID" ]; then + RHOST_PID=0 + end_testcase "Unable to start rwhod on $RHOST" + fi + sleep $SLEEPTIME + fi + + RHOSTNAME=`rsh -n -l root $RHOST hostname | cut -f1 -d.` + if [ -z "$RHOSTNAME" ]; then + end_testcase "Unable to determine RHOSTNAME" + fi -do_setup() -{ - $trace_logic - - export TCID=rwho01 - export TST_TOTAL=1 - export TST_COUNT=1 - - exists "rwho rsh killall grep awk cut" - - ps -ef | grep rwhod | grep -v grep - if [ $? -ne 0 ]; then - tst_resm TINFO "Starting rwhod on $LHOST" - /usr/sbin/rwhod - [ $? -eq 0 ] || end_testcase "Unable to start rwhod on $LHOST" - PID=1 - sleep $SLEEPTIME - fi - - rsh -n -l root $RHOST ps -ef | grep rwhod - if [ $? -ne 0 ]; then - tst_resm TINFO "Starting rwhod on $RHOST" - rsh -n -l root $RHOST /usr/sbin/rwhod - if [ $? -ne 0 ]; then - end_testcase "Unable to start rwhod on $RHOST" - fi - RHOST_PID=$(rsh -n -l root $RHOST ps -ef | grep rwhod | grep -v grep | awk '{print $2 ; exit}') - if [ -z "$RHOST_PID" ]; then - RHOST_PID=0 - end_testcase "Unable to start rwhod on $RHOST" - fi - sleep $SLEEPTIME - fi - - RHOSTNAME=`rsh -n -l root $RHOST hostname | cut -f1 -d.` - if [ -z "$RHOSTNAME" ]; then - end_testcase "Unable to determine RHOSTNAME" - fi - - mkdir -p $TCtmp } #----------------------------------------------------------------------- @@ -133,26 +103,23 @@ do_setup() do_test() { - $trace_logic - - COUNT=1 - while [ $COUNT -le $NUMLOOPS ] - do - rwho -a > $OUTFILE - HOST=`awk '{print $2}' $OUTFILE|grep "$LHOST\>"|cut -f1 -d:|sort -u` - [ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in rwho outfile" - HOST=`awk '{print $2}' $OUTFILE|grep "$RHOSTNAME\>"|cut -f1 -d:|sort -u` - [ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in rwho outfile" - - ruptime -a > $OUTFILE - HOST=`awk '{print $1}' $OUTFILE|grep "$LHOST\>"|sort -u` - [ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in ruptime outfile" - HOST=`awk '{print $1}' $OUTFILE|grep "$RHOSTNAME\>"|sort -u` - [ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in ruptime outfile" - - tst_resm TINFO "Test $COUNT of $NUMLOOPS complete" - COUNT=$(( $COUNT + 1 )) - done + + while [ $TST_COUNT -le $NUMLOOPS ]; do + rwho -a > $OUTFILE + HOST=`awk "\$2 ~ /$LHOST>/" $OUTFILE | cut -f1 -d: | sort -u` + [ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in rwho outfile" + HOST=`awk "\$2 ~ /$RHOSTNAME>/" $OUTFILE | cut -f1 -d: | sort -u` + [ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in rwho outfile" + + ruptime -a > $OUTFILE + HOST=`awk "\$1 ~ /$LHOST>/" $OUTFILE | sort -u` + [ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in ruptime outfile" + HOST=`awk "\$1 ~ /$RHOSTNAME>/" $OUTFILE | sort -u` + [ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in ruptime outfile" + + tst_resm TINFO "Test $COUNT of $NUMLOOPS complete" + incr_tst_count + done } #----------------------------------------------------------------------- @@ -163,38 +130,18 @@ do_test() do_cleanup() { - rm -fr $TCtmp - if [ $PID -ne 0 ]; then - tst_resm TINFO "Stopping rwhod on $LHOST" - killall rwhod - fi - - if [ $RHOST_PID -ne 0 ]; then - tst_resm TINFO "Stopping rwhod on $RHOST" - rsh -n -l root $RHOST "killall rwhod" - fi -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= + if [ $PID -ne 0 ]; then + tst_resm TINFO "Stopping rwhod on $LHOST" + killall rwhod + fi + + if [ $RHOST_PID -ne 0 ]; then + tst_resm TINFO "Stopping rwhod on $RHOST" + rsh -n -l root $RHOST "killall rwhod" + fi + + tst_cleanup -end_testcase() -{ - $trace_logic - - if [ $CLEANUP = "ON" ]; then - do_cleanup - fi - [ $# -eq 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 } #----------------------------------------------------------------------- @@ -202,6 +149,9 @@ end_testcase() # FUNCTION: MAIN # #----------------------------------------------------------------------- +. net_cmdlib.sh + +read_opts $* do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/sendfile/Makefile b/testcases/network/tcp_cmds/sendfile/Makefile dissimilarity index 98% index 52b35cd5..124ce5d9 100644 --- a/testcases/network/tcp_cmds/sendfile/Makefile +++ b/testcases/network/tcp_cmds/sendfile/Makefile @@ -1,18 +1,39 @@ -CFLAGS+= -I../../../../include -Wall -w -O -LOADLIBES+= -L../../../../lib -lltp -LDLIBS += - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -generate: - ../../generate.sh - -install: generate - ln -f sendfile01 ../../../bin - -clean: - rm -f $(TARGETS) - rm -rf datafiles +# +# network/tcp_cmds/sendfile 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(abs_srcdir)/../Makefile.inc + +CPPFLAGS += -I$(abs_srcdir)/../include + +INSTALL_TARGETS := sendfile01 + +MAKE_TARGETS += testsf_c testsf_s testsf_c6 testsf_s6 + +testsf_c6.o testsf_s6.o: CPPFLAGS += -DINET6 + +testsf_c6.o testsf_s6.o: %6.o: %.c + $(COMPILE.c) $(OUTPUT_OPTION) $< + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/sendfile/sendfile01 b/testcases/network/tcp_cmds/sendfile/sendfile01 index 6d08d565..4e93447a 100755 --- a/testcases/network/tcp_cmds/sendfile/sendfile01 +++ b/testcases/network/tcp_cmds/sendfile/sendfile01 @@ -37,26 +37,6 @@ # # #*********************************************************************** -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -this_file=${0##*/} - -TC=sendfile01 -RHOST=${RHOST:-`hostname`} -TCbin=${TCbin:-`pwd`} -TCsrc=${TCsrc:-$TCbin} -TCdat=${TCdat:-$TCsrc/datafiles} -TCtmp=${TCtmp:-$TCsrc/$TC$$} -CLEANUP=${CLEANUP:-ON} -EXECUTABLES="testsf_c" -REMOTE_EXEC="testsf_s" -LTPROOT=${LTPROOT:-../../../..} -FILES=${FILES:-"ascii.sm ascii.med ascii.lg ascii.jmb"} - -IPADDR=$($LTPROOT/tools/gethost $RHOST | grep addresses: | awk '{print $2}') - #----------------------------------------------------------------------- # @@ -66,17 +46,23 @@ IPADDR=$($LTPROOT/tools/gethost $RHOST | grep addresses: | awk '{print $2}') # #----------------------------------------------------------------------- -exists() +do_setup() { - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done + TC=sendfile01 + RHOST=${RHOST:-`hostname`} + TCdat=${TCdat:-$LTPROOT/testcases/bin/datafiles} + TCtmp=${TCtmp:-$LTPROOT/testcases/bin/$TC${EXEC_SUFFIX}$$} + CLIENT="testsf_c${EXEC_SUFFIX}" + SERVER="testsf_s${EXEC_SUFFIX}" + LTPROOT=${LTPROOT:-../../../..} + FILES=${FILES:-"ascii.sm ascii.med ascii.lg ascii.jmb"} + + tst_setup + + exists awk diff gethost grep rsh stat + + IPADDR=$(gethost $RHOST | awk '/addresses:/ {print $2}') + } @@ -85,38 +71,39 @@ exists() # # FUNCTION DESCRIPTION: Perform the test # -# PARAMETERS: None. +# PARAMETERS: None. # -# RETURNS: None. +# RETURNS: None. #============================================================================= do_test() { - $trace_logic - tst_resm TINFO "$this_file: doing $0." + tst_resm TINFO "Doing $0." - mkdir -p $TCtmp - PORT=$$ - rsh -n -l root $IPADDR "$TCsrc/SF_Server $IPADDR $PORT $TCsrc" - sleep 10 - PID=$(rsh -n -l root $IPADDR "ps -ef "|grep $REMOTE_EXEC | grep $PORT | grep -v grep|awk '{print $2}') - [ "$PID" ] || end_testcase "Could not start server" - - for clnt_fname in $FILES - do - serv_fname=$TCdat/$clnt_fname - SIZE=`ls -l $serv_fname|awk '{print $5}'` - tst_resm TINFO "Starting $EXECUTABLES $IPADDR Client_filename Server_filename Size " + mkdir -p $TCtmp + PORT=$$ + if ! rsh -l root $IPADDR "$LTPROOT/testcases/bin/SF_Server $IPADDR $PORT $LTPROOT/testcases/bin"; then + end_testcase "rsh failed to $IPADDR as root failed" + fi + sleep 10 + PID=$(rsh -l root $IPADDR "ps -ef" | awk "\$0 !~ /awk/ && /$SERVER/ && /$PORT/ {print \$1}") + [ -n "$PID" ] || end_testcase "Could not start server" + + for clnt_fname in $FILES; do + serv_fname=$TCdat/$clnt_fname + SIZE=`stat -c '%s' $serv_fname` + tst_resm TINFO "Starting $SERVER $IPADDR Client_filename Server_filename Size " - $TCsrc/$EXECUTABLES $IPADDR $PORT $TCtmp/$clnt_fname $serv_fname $SIZE - RetVal=$? + $CLIENT $IPADDR $PORT "$TCtmp/$clnt_fname" $serv_fname $SIZE + RetVal=$? - [ $RetVal -eq 0 ] || end_testcase "$EXECUTABLES returned error $RetVal" + [ $RetVal -eq 0 ] || end_testcase "$CLIENT returned error $RetVal" + + diff $serv_fname $TCtmp/$clnt_fname + DiffVal=$? + [ $DiffVal -gt 1 ] && end_testcase "ERROR: Cannot compare files" + [ $DiffVal -eq 1 ] && end_testcase "The file copied differs from the original" + done - diff $serv_fname $TCtmp/$clnt_fname - DiffVal=$? - [ $DiffVal -gt 1 ] && end_testcase "ERROR: Cannot compare files" - [ $DiffVal -eq 1 ] && end_testcase "The file copied differs from the original" - done } #============================================================================= @@ -124,51 +111,24 @@ do_test() # # FUNCTION DESCRIPTION: Clean up # -# PARAMETERS: None. +# PARAMETERS: None. # -# RETURNS: None. +# RETURNS: None. #============================================================================= do_cleanup() { - $trace_logic - PID=$(rsh -n -l root $RHOST "ps -ef|grep \"$REMOTE_EXEC $IPADDR\""| grep $PORT| - grep -v grep|grep -v vi|awk '{print $2}') - [ "$PID" ] && rsh -n -l root $RHOST kill -9 $PID - - rm -rf $TCtmp -} - -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= - -end_testcase() -{ - $trace_logic - tst_resm TINFO "$this_file: doing $0." - - - # Call other cleanup functions - [ $CLEANUP = "ON" ] && do_cleanup - - [ $# -eq 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 + PID=$(rsh -n -l root $RHOST "ps -ef" | awk "\$0 !~ /awk/ && /$SERVER/ && /$PORT/ {print \$1}") + [ -n "$PID" ] && rsh -n -l root $RHOST kill -9 $PID + tst_cleanup } #============================================================================= # MAIN PROCEDURE #============================================================================= -export TCID="sendfile01" -export TST_TOTAL=1 -export TST_COUNT=1 -exists "rsh diff awk grep" +. net_cmdlib.sh + +read_opts $* +do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/sendfile/testsf_c.c b/testcases/network/tcp_cmds/sendfile/testsf_c.c dissimilarity index 87% index fe1be1a9..52b9ecf8 100644 --- a/testcases/network/tcp_cmds/sendfile/testsf_c.c +++ b/testcases/network/tcp_cmds/sendfile/testsf_c.c @@ -1,111 +1,132 @@ - -/* - * Client for the send_file test program - * Syntax: testsf_c - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "test.h" -#include "usctest.h" - - -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - -char *TCID="sendfile"; -int TST_TOTAL=1; -extern int Tst_count; - -int main(argc, argv) -int argc; -char *argv[]; - -{ - struct sockaddr_in sa; - int s, fd; - char *lp, *sp; - int nbyte; - char *clnt_fname; - char rbuf[PATH_MAX]; - int flen, nlen; - int port; - - /* open socket to server */ - if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - tst_resm(TBROK, "socket error = %d\n", errno); - exit(1); - } - - clnt_fname = argv[3]; /* filename to create */ - - /* prepare to copy file from server to local machine */ - if ((fd = open(clnt_fname, O_CREAT | O_TRUNC | O_WRONLY, 0777)) < 0) { - tst_resm(TBROK, "file open error = %d\n", errno); - close(s); - exit(1); - } - - lp = argv[5]; /* get file size */ - flen = strtol(lp,(char **)NULL,10); - - - /* initialize request info: */ - rbuf[0] = '\0'; - sp = &rbuf[0]; - sp = strcat(sp, argv[5]); /* file size */ - sp = strcat(sp, "="); - sp = strcat(sp, argv[4]); /* requested file */ - - tst_resm(TINFO, "sp=%s\n",sp); - /* initialize server info to make the connection */ - sa.sin_family = AF_INET; - sa.sin_addr.s_addr = inet_addr(argv[1]); - port=atoi(argv[2]); - sa.sin_port = htons(port); - - if ( connect(s, (struct sockaddr*) &sa, sizeof(sa) ) < 0 ) { - tst_resm(TBROK, "connect error = %d\n", errno); - close(s); - exit(1); - } - - /* send request info to server */ - if ((nbyte = write(s, rbuf, strlen(rbuf))) <= 0) { - tst_resm(TBROK, "socket write error = %d\n", errno); - close(s); - exit(1); - } - - tst_resm(TINFO, "client write %d bytes to server with contents %s\n", - nbyte, rbuf); - - nlen = 0; /* init size of info received */ - rbuf[0] = '\0'; - while ((nbyte = read(s, rbuf, PATH_MAX)) >0) { /* receive info until EOF */ - nlen += nbyte; - if (write(fd, rbuf, nbyte) != nbyte) { - tst_resm(TBROK, "Error writing to file %s on client\n",clnt_fname); - exit(1); - } - } - - - if (nlen != flen) { /* compare expected size with current size */ - tst_resm(TBROK, "WRONG!!! nlen = %d, should be %d\n", nlen, flen); - exit (1); - } - else - tst_resm(TINFO, "File %s received\n", argv[4]); - - close(s); - close(fd); - exit(0); -} + +/* + * Client for the send_file test program + * Syntax: testsf_c + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "test.h" +#include "usctest.h" +#include "netdefs.h" + +int TST_TOTAL = 1; +extern int Tst_count; + +#if INET6 +char *TCID = "sendfile6_client"; +#else +char *TCID = "sendfile_client"; +#endif + +int +main (int argc, char *argv[]) +{ + sai_t sai; + int s, fd; + int nbyte; + char *serv_fname, *clnt_fname; + char rbuf[PATH_MAX]; + int nlen, gai; + struct addrinfo *hp; + struct addrinfo hints; + int port; + + if (argc != 6) { + tst_resm(TBROK, "usage: server-ip port client-file server-file file-len"); + tst_exit(); + } + + int i; + for (i = 0; i < argc; i++) + printf("i=%d: %s\n", i, *(argv+i)); + + /* open socket to server */ + if ((s = socket(AFI, SOCK_STREAM, 0)) < 0) { + tst_resm(TBROK, "socket error = %d\n", errno); + tst_exit(); + } + + clnt_fname = argv[3]; /* filename to create */ + serv_fname = argv[4]; /* filename to request */ + + /* prepare to copy file from server to local machine */ + if ((fd = open(clnt_fname, O_CREAT | O_TRUNC | O_WRONLY, 0777)) < 0) { + tst_resm(TBROK, "file open error = %d\n", errno); + close(s); + tst_exit(); + } + + /* initialize request info: */ + rbuf[0] = '\0'; + /* The request will be done in the form: `file-size=requested-file'. */ + snprintf(rbuf, PATH_MAX, "%s=%s", argv[5], serv_fname); + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PFI; + if ((gai = getaddrinfo(argv[1], NULL, &hints, &hp)) != 0) { + tst_resm(TBROK, "Unknown subject address %s: %s\n", + argv[1], gai_strerror(gai)); + } + if (!hp || !hp->ai_addr || hp->ai_addr->sa_family != AFI) { + tst_resm(TBROK, "getaddrinfo failed"); + tst_exit(); + } + + tst_resm(TINFO, "rbuf => %s\n", rbuf); + /* initialize server info to make the connection */ + memcpy(&sai, hp->ai_addr, hp->ai_addrlen); + port = atoi(argv[2]); + +#if INET6 + sai.sin6_port = htons(port); +#else + sai.sin_port = htons(port); +#endif + + if (connect(s, (sa_t*) &sai, sizeof(sai) ) < 0) { + tst_resm(TBROK, "connect error = %d\n", errno); + close(s); + exit(1); + } + + /* send request info to server */ + if ((nbyte = write(s, rbuf, strlen(rbuf))) <= 0) { + tst_resm(TBROK, "socket write error = %d\n", errno); + close(s); + exit(1); + } + + tst_resm(TINFO, "client write %d bytes to server with contents %s\n", + nbyte, rbuf); + + nlen = 0; /* init size of info received */ + rbuf[0] = '\0'; + /* read until an EOF is encountered. */ + while ((nbyte = read(s, rbuf, PATH_MAX)) > 0) { + nlen += nbyte; + if (write(fd, rbuf, nbyte) != nbyte) { + tst_resm(TBROK, "Error writing to file %s on client\n", + clnt_fname); + tst_exit(); + } + } + + tst_res(TINFO, "Asking for remote file: %s", serv_fname); + + tst_resm(TINFO, "File %s received\n", argv[4]); + + close(s); + close(fd); + + return 0; + +} diff --git a/testcases/network/tcp_cmds/sendfile/testsf_s.c b/testcases/network/tcp_cmds/sendfile/testsf_s.c dissimilarity index 87% index c07d5b86..bc777125 100644 --- a/testcases/network/tcp_cmds/sendfile/testsf_s.c +++ b/testcases/network/tcp_cmds/sendfile/testsf_s.c @@ -1,176 +1,183 @@ -/* - * Server for the sendfile test program - * Syntax: testsf_s - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "test.h" -#include "usctest.h" - - -#define LISTEN_BACKLOG 10 - -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - -char *TCID="sendfile"; -int TST_TOTAL=1; -extern int Tst_count; - - -void -test_sig(sig) -int sig; -{ - - int status; - - wait(&status); - - -} - - -int main(argc, argv) -int argc; -char *argv[]; - -{ - struct sockaddr_in sa, *ap; - struct sockaddr from; - int s, fd, as, rc; - char *lp; - char *number; - int clen, pid; - int nbytes, flen,count; - char rbuf[PATH_MAX]; - int chunks=0; - off_t *offset; - char nbuf[PATH_MAX]; - int port; - - /* open socket */ - if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - tst_resm(TBROK, "socket error = %d\n", errno); - exit(-1); - } - - signal(SIGCHLD, SIG_IGN); /* ignore signals from children */ - - /* server IP and port */ - sa.sin_family = AF_INET; - sa.sin_addr.s_addr = inet_addr(argv[1]); - port=atoi(argv[2]); - sa.sin_port = htons(port); - - /* bind IP and port to socket */ - if ( bind(s, (struct sockaddr*) &sa, sizeof(sa) ) < 0 ) { - tst_resm(TBROK, "bind error = %d\n", errno); - close(s); - exit(-1); - } - - /* start to listen socket */ - if ( listen(s, LISTEN_BACKLOG ) < 0 ) { - tst_resm(TBROK, "listen error = %d\n", errno); - close(s); - exit(-1); - } - - /* process connections */ - while(1) { - /* accept a connection from a client */ - clen = sizeof(from); - if ((as = accept(s, &from, &clen )) < 0 ) { - tst_resm(TBROK, "accept error = %d\n", errno); - if (errno == EINTR) - continue; - close(s); - exit(-1); - } - - ap = (struct sockaddr_in *)&from; - - /* create a process to manage the connection */ - if ((pid = fork()) < 0) { - tst_resm(TBROK, "fork error = %d\n", errno); - close(as); - exit(-1); - } - if (pid > 0) { /* parent, go back to accept */ - close(as); - continue; - } - - - - /* child process to manage a connection */ - - close(s); /* close service socket */ - - /* get client request information */ - if ((nbytes = read(as, rbuf, PATH_MAX)) <= 0) { - tst_resm(TBROK, "socket read error = %d\n", errno); - close(as); - exit(-1); - } - rbuf[nbytes] = '\0'; /* null terminate the info */ - lp = &rbuf[0]; - - /* start with file length, '=' will start the filename */ - flen = 0; - count = 0; - number = &nbuf[0]; - while (*lp != '=') { /* convert ascii to integer */ - nbuf[count] = *lp; - count++; - lp++; - } - nbuf[count] = '\0'; - flen = strtol(number, (char **)NULL, 10); - - /* the file name */ - lp++; - - tst_resm(TINFO, "The file to send is %s\n", lp); - /* open requested file to send */ - if ((fd = open(lp, O_RDONLY)) < 0) { - tst_resm(TBROK, "file open error = %d\n", errno); - close(as); - exit(-1); - } - offset=NULL; - errno=0; - do { /* send file parts until EOF */ - if ((rc = sendfile(as, fd, offset, flen)) != flen) { - if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) { - tst_resm(TBROK, "sendfile error = %d, rc = %d\n", errno, rc); - close(as); - close(fd); - exit(-1); - } - } - chunks++; - } while (rc != 0); - tst_resm(TINFO, "File %s sent in %d parts\n", lp, chunks); - - - close(as); /* close connection */ - close(fd); /* close requested file */ - return(0); - - } - close(s); /* close parent socket (never reached because of the while(1)) */ -} +/* + * Server for the sendfile test program + * Syntax: testsf_s + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "test.h" +#include "usctest.h" +#include "netdefs.h" + +int TST_TOTAL = 1; +extern int Tst_count; + +#if INET6 +char *TCID = "sendfile6_server"; +#else +char *TCID = "sendfile_server"; +#endif + +int +main(int argc, char *argv[]) +{ + sai_t sa, *ap; + sa_t from; + struct addrinfo *hp; + struct addrinfo hints; + int as, fd, gai, rc, s; + char *lp; + char *number; + int pid, nbytes, flen,count; + char rbuf[PATH_MAX]; + int chunks=0; + off_t *offset; + char nbuf[PATH_MAX]; + int port; + + if (argc != 3) { + tst_resm(TBROK, "usage: listen-address listen-port"); + tst_exit(); + } + + /* open socket */ + if ((s = socket(AFI, SOCK_STREAM, 0)) < 0) { + tst_resm(TBROK, "socket error = %d\n", errno); + tst_exit(); + } + + signal(SIGCHLD, SIG_IGN); /* ignore signals from children */ + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PFI; + if ((gai = getaddrinfo(argv[1], NULL, &hints, &hp)) != 0) { + tst_resm(TBROK, "getaddrinfo failed"); + tst_exit(); + } + if (!hp || !hp->ai_addr || hp->ai_addr->sa_family != AFI) { + tst_resm(TBROK, "getaddrinfo failed"); + tst_exit(); + } + + /* server IP and port */ + memcpy(&sa, hp->ai_addr, hp->ai_addrlen); + port = atoi(argv[2]); +#if INET6 + sa.sin6_port = htons(port); +#else + sa.sin_port = htons(port); +#endif + + /* bind IP and port to socket */ + if (bind(s, (sa_t*) &sa, sizeof(sa) ) < 0) { + tst_resm(TBROK, "bind error = %d\n", errno); + close(s); + tst_exit(); + } + + /* start to listen socket */ + if (listen(s, LISTEN_BACKLOG) < 0) { + tst_resm(TBROK, "listen error = %d\n", errno); + close(s); + tst_exit(); + } + + socklen_t fromlen; + + /* process connections */ + while (1) { + + /* accept a connection from a client */ + if ((as = accept(s, &from, &fromlen)) < 0 ) { + tst_resm(TBROK, "accept error = %d\n", errno); + if (errno == EINTR) + continue; + close(s); + tst_exit(); + } + + ap = (sai_t*) &from; + + /* create a process to manage the connection */ + if ((pid = fork()) < 0) { + tst_resm(TBROK, "fork error = %d\n", errno); + close(as); + tst_exit(); + } + if (pid > 0) { /* parent, go back to accept */ + close(as); + continue; + } + + /* child process to manage a connection */ + + close(s); /* close service socket */ + + /* get client request information */ + if ((nbytes = read(as, rbuf, PATH_MAX)) <= 0) { + tst_resm(TBROK, "socket read error = %d\n", errno); + close(as); + tst_exit(); + } + rbuf[nbytes] = '\0'; /* null terminate the info */ + lp = &rbuf[0]; + + /* start with file length, '=' will start the filename */ + count = flen = 0; + number = &nbuf[0]; + while (*lp != '=') { /* convert ascii to integer */ + nbuf[count] = *lp; + count++; + lp++; + } + nbuf[count] = '\0'; + flen = strtol(number, (char **)NULL, 10); + + /* the file name */ + lp++; + + tst_resm(TINFO, "The file to send is %s\n", lp); + /* open requested file to send */ + if ((fd = open(lp, O_RDONLY)) < 0) { + tst_resm(TBROK, "file open error = %d\n", errno); + close(as); + tst_exit(); + } + offset = NULL; + errno = 0; + do { /* send file parts until EOF */ + if ((rc = sendfile(as, fd, offset, flen)) != flen) { + if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) { + tst_resm(TBROK, "sendfile error = %d, rc = %d\n", errno, rc); + close(as); + close(fd); + tst_exit(); + } + } + chunks++; + } while (rc != 0); + tst_resm(TINFO, "File %s sent in %d parts\n", lp, chunks); + + + close(as); /* close connection */ + close(fd); /* close requested file */ + + exit(0); + + } + + close(s); /* close parent socket (never reached because of the while(1)) */ + + return 0; + +} diff --git a/testcases/network/tcp_cmds/ssh/Makefile b/testcases/network/tcp_cmds/ssh/Makefile dissimilarity index 99% index 731c9e2f..9202eba7 100644 --- a/testcases/network/tcp_cmds/ssh/Makefile +++ b/testcases/network/tcp_cmds/ssh/Makefile @@ -1,13 +1,31 @@ -all: - -install: - ln -f ssh01 ../../../bin - ln -f ssh01_s1 ../../../bin - ln -f ssh02 ../../../bin - ln -f ssh02_s1 ../../../bin - ln -f ssh03 ../../../bin - ln -f ssh03_s1 ../../../bin - ln -f ssh_set_passwd ../../../bin - - -clean: +# +# network/tcp_cmds/ssh testcases Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := ssh* + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/ssh/ssh01 b/testcases/network/tcp_cmds/ssh/ssh01 index 288abf92..657449af 100755 --- a/testcases/network/tcp_cmds/ssh/ssh01 +++ b/testcases/network/tcp_cmds/ssh/ssh01 @@ -26,36 +26,43 @@ # 03/03 Jerone Young (jeroney@us.ibm.com) # -export RHOST="localhost" -export TEST_USER="ssh_usr1" -export TEST_USER_PASSWD="eal" -export TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA" -export TEST_USER_HOMEDIR="/home/$TEST_USER" - #----------------------------------------------------------------------- # FUNCTION: do_setup #----------------------------------------------------------------------- -do_setup(){ - - #erase user if he may exist , so we can have a clean env - rm -rf /home/$TEST_USER - userdel $TEST_USER - sleep 1 +do_setup() +{ + + export RHOST="localhost" + export TEST_USER="ssh_usr1" + export TEST_USER_PASSWD="eal" + export TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA" + export TEST_USER_HOMEDIR="/home/$TEST_USER" + + #erase user if he may exist , so we can have a clean env + TCtmp=/home/$TEST_USER + + tst_setup - useradd -m -p $TEST_USER_ENCRYPTED_PASSWD $TEST_USER - if [ $? != 0 ] - then { - echo "Could not add test user $TEST_USER to system $RHOST." - exit 1 - } - fi + exists expect ssh ssh01_s1 useradd userdel - #create users home diretory (SLES 8 does not do this, even when specified in adduser) - USER_UID=`id -u $TEST_USER` - USER_GID=`id -g $TEST_USER` - mkdir $TEST_USER_HOMEDIR - chown -R $USER_UID.$USER_GID $TEST_USER_HOMEDIR + userdel $TEST_USER + sleep 1 + + if ! useradd -m -p $TEST_USER_ENCRYPTED_PASSWD $TEST_USER; then + end_testcase "Could not add test user $TEST_USER to system $RHOST." + fi + + # create users home diretory (SLES 8 does not do this, even when specified + # in adduser) + USER_UID=$(id -u $TEST_USER) + USER_GID=$(id -g $TEST_USER) + if ! mkdir "$TEST_USER_HOMEDIR"; then + end_testcase "Failed to create $TEST_USER_HOMEDIR" + fi + chown -Rf $USER_UID.$USER_GID "$TEST_USER_HOMEDIR" + + trap do_cleanup EXIT } @@ -64,20 +71,21 @@ do_setup(){ #----------------------------------------------------------------------- do_cleanup(){ - rm -rf /home/$TEST_USER - userdel $TEST_USER + userdel $TEST_USER + tst_cleanup } #----------------------------------------------------------------------- # FUNCTION: MAIN # # DESCRIPTION: Create Test User -# Call upon script to make sure test user cannont log in with invalid password -# Cleanup Test User from system -# Exit with exit code of script called upon +# Call upon script to make sure test user cannont log in with invalid password +# Cleanup Test User from system +# Exit with exit code of script called upon #----------------------------------------------------------------------- +. net_cmdlib.sh + +read_opts $* do_setup -ssh01_s1 -EXIT_CODE=$? +ssh01_s1 || end_testcase "Testcase failed" do_cleanup -exit $EXIT_CODE diff --git a/testcases/network/tcp_cmds/ssh/ssh02 b/testcases/network/tcp_cmds/ssh/ssh02 index 4109aad8..84c36374 100755 --- a/testcases/network/tcp_cmds/ssh/ssh02 +++ b/testcases/network/tcp_cmds/ssh/ssh02 @@ -26,57 +26,69 @@ # 03/03 Jerone Young (jeroney@us.ibm.com) # -export RHOST="localhost" -export TEST_USER="ssh_usr2" -export TEST_USER_PASSWD="now_this_is_a_good_ltp_test_password" -export TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA" -export TEST_USER_HOMEDIR="/home/$TEST_USER" - #----------------------------------------------------------------------- # FUNCTION: do_setup #----------------------------------------------------------------------- -do_setup(){ - #erase user if he may exist , so we can have a clean env - rm -rf /home/$TEST_USER - userdel $TEST_USER - sleep 1 - - useradd -m -p $TEST_USER_ENCRYPTED_PASSWD $TEST_USER - if [ $? != 0 ] - then { - echo "Could not add test user $TEST_USER to system $RHOST." - exit 1 - } - fi - - #create users home diretory (SLES 8 does not do this, even when specified in adduser) - USER_UID=`id -u $TEST_USER` - USER_GID=`id -g $TEST_USER` - mkdir $TEST_USER_HOMEDIR - chown -R $USER_UID.$USER_GID $TEST_USER_HOMEDIR - +do_setup() +{ + + export RHOST="localhost" + export TEST_USER="ssh_usr2" + export TEST_USER_PASSWD="now_this_is_a_good_ltp_test_password" + export TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA" + export TEST_USER_HOMEDIR="/home/$TEST_USER" + + # erase user if he/she already exists, so we can have a clean env + TCtmp=/home/$TEST_USER + + rm -Rf $TCtmp + + tst_setup + + exists expect ssh ssh02_s1 useradd userdel + + userdel $TEST_USER + sleep 1 + + if ! useradd -m -p $TEST_USER_ENCRYPTED_PASSWD $TEST_USER; then + end_testcase "Could not add test user $TEST_USER to system $RHOST." + fi + + # create users home diretory (SLES 8 does not do this, even when specified + # in adduser) + USER_UID=$(id -u $TEST_USER) + USER_GID=$(id -g $TEST_USER) + if ! mkdir "$TEST_USER_HOMEDIR"; then + end_testcase "Failed to create $TEST_USER_HOMEDIR" + fi + chown -R $USER_UID.$USER_GID "$TEST_USER_HOMEDIR" + + trap do_cleanup EXIT + } #----------------------------------------------------------------------- # FUNCTION: do_cleanup #----------------------------------------------------------------------- -do_cleanup(){ - rm -rf /home/$TEST_USER - userdel $TEST_USER +do_cleanup() +{ + userdel $TEST_USER + tst_cleanup } #----------------------------------------------------------------------- # FUNCTION: MAIN # # DESCRIPTION: Create Test User -# Call upon script to make sure an invalid user can not have access -# Cleanup Test User from system -# Exit with exit code of script called upon +# Call upon script to make sure an invalid user can not have access +# Cleanup Test User from system +# Exit with exit code of script called upon #----------------------------------------------------------------------- +. net_cmdlib.sh + +read_opts $* do_setup -ssh02_s1 -EXIT_CODE=$? +ssh02_s1 || end_testcase "Testcase failed" do_cleanup -exit $EXIT_CODE diff --git a/testcases/network/tcp_cmds/ssh/ssh03 b/testcases/network/tcp_cmds/ssh/ssh03 index 7e5c3aeb..5c7305e2 100755 --- a/testcases/network/tcp_cmds/ssh/ssh03 +++ b/testcases/network/tcp_cmds/ssh/ssh03 @@ -26,35 +26,44 @@ # 03/03 Jerone Young (jeroney@us.ibm.com) # -export RHOST="localhost" -export TEST_USER="ssh_usr3" -export TEST_USER_PASSWD="eal" -export TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA" -export TEST_USER_HOMEDIR="/home/$TEST_USER" - #----------------------------------------------------------------------- # FUNCTION: do_setup #----------------------------------------------------------------------- -do_setup(){ - #erase user if he may exist , so we can have a clean env - rm -rf /home/$TEST_USER - userdel $TEST_USER - sleep 1 - - useradd -m -p $TEST_USER_ENCRYPTED_PASSWD $TEST_USER - if [ $? != 0 ] - then { - echo "Could not add test user $TEST_USER to system $RHOST." - exit 1 - } - fi +do_setup() +{ + export RHOST="localhost" + export TEST_USER="ssh_usr3" + export TEST_USER_PASSWD="eal" + export TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA" + export TEST_USER_HOMEDIR="/home/$TEST_USER" + + # erase user if he/she already exists, so we can have a clean env + TCtmp=/home/$TEST_USER + + rm -Rf $TCtmp + + tst_setup + + exists expect ssh ssh03_s1 useradd userdel - #create users home diretory (SLES 8 does not do this, even when specified in adduser) - USER_UID=`id -u $TEST_USER` - USER_GID=`id -g $TEST_USER` - mkdir $TEST_USER_HOMEDIR - chown -R $USER_UID.$USER_GID $TEST_USER_HOMEDIR + userdel $TEST_USER + sleep 1 + + if ! useradd -m -p $TEST_USER_ENCRYPTED_PASSWD $TEST_USER; then + end_testcase "Could not add test user $TEST_USER to system $RHOST." + fi + + # create users home diretory (SLES 8 does not do this, even when specified + # in adduser) + USER_UID=$(id -u $TEST_USER) + USER_GID=$(id -g $TEST_USER) + if ! mkdir "$TEST_USER_HOMEDIR"; then + end_testcase "Failed to create $TEST_USER_HOMEDIR" + fi + chown -R $USER_UID.$USER_GID "$TEST_USER_HOMEDIR" + + trap do_cleanup EXIT } @@ -62,9 +71,10 @@ do_setup(){ # FUNCTION: do_cleanup #----------------------------------------------------------------------- -do_cleanup(){ - rm -rf /home/$TEST_USER - userdel $TEST_USER +do_cleanup() +{ + userdel $TEST_USER + tst_cleanup } #----------------------------------------------------------------------- @@ -75,8 +85,9 @@ do_cleanup(){ # Cleanup Test User from system # Exit with exit code of script called upon #----------------------------------------------------------------------- +. net_cmdlib.sh + +read_opts $* do_setup -ssh03_s1 -EXIT_CODE=$? +ssh03_s1 || end_testcase "Testcase failed" do_cleanup -exit $EXIT_CODE diff --git a/testcases/network/tcp_cmds/ssh/ssh03_s1 b/testcases/network/tcp_cmds/ssh/ssh03_s1 index d9cc5cb5..2cb9c0ed 100755 --- a/testcases/network/tcp_cmds/ssh/ssh03_s1 +++ b/testcases/network/tcp_cmds/ssh/ssh03_s1 @@ -59,5 +59,4 @@ while 1 { sleep 1 } - exit 0 diff --git a/testcases/network/tcp_cmds/tcpdump/Makefile b/testcases/network/tcp_cmds/tcpdump/Makefile dissimilarity index 94% index b52b4760..43213b2c 100644 --- a/testcases/network/tcp_cmds/tcpdump/Makefile +++ b/testcases/network/tcp_cmds/tcpdump/Makefile @@ -1,7 +1,31 @@ -all: - -install: - ln -f tcpdump01 ../../../bin - -clean: - +# +# network/tcp_cmds/tcpdump 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := tcpdump01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cmds/tcpdump/tcpdump01 b/testcases/network/tcp_cmds/tcpdump/tcpdump01 index 30d79a2c..650e97e9 100755 --- a/testcases/network/tcp_cmds/tcpdump/tcpdump01 +++ b/testcases/network/tcp_cmds/tcpdump/tcpdump01 @@ -32,49 +32,6 @@ # -Written # #----------------------------------------------------------------------- -#Uncomment line below for debug output. -#trace_logic=${trace_logic:-"set -x"} -$trace_logic - -TC=tcpdump -TCtmp=${TCtmp:-/tmp/$TC$$} -RHOST=${RHOST:-`hostname`} -IP=`host ${RHOST}|awk '{print $4}'` -IFNUMS=`netstat -i|wc -l` -IFNUMS=$(( $IFNUMS - 2 )) -IFNAME=${IFNAME:-$(netstat -i|awk '{print $1}'|tail -n${IFNUMS})} -for i in ${IFNAME} -do - ifconfig ${i}|grep $IP - [ $? = 0 ] && IF=$i && break -done -[ -z "${IF}" ] && echo "Test broke: Could not identify interface" && exit 1 -IFNAME=${IF} -NUMLOOPS=${NUMLOOPS:-20} -OUTFILE=$TCtmp/tcpdump_out -LTPROOT=${LTPROOT:-"../../../../"} - - -#----------------------------------------------------------------------- -# -# FUNCTION: exists -# PURPOSE: Check if commands used by this testcase exists. -# -#----------------------------------------------------------------------- - -exists() -{ - for cmd in $1 - do - which $cmd 2>&1 1>/dev/null - if [ $? -ne 0 ] - then - tst_resm TBROK "Test broke: command $cmd not found" - exit 1 - fi - done -} - #****************************************************************************** # @@ -84,40 +41,45 @@ exists() # #****************************************************************************** -do_test() +do_setup() { - $trace_logic - mkdir -p $TCtmp - [ $? -eq 0 ] || end_testcase "mkdir -p $TCtmp failed" - ping -f $RHOST > /dev/null 2>&1 & - /usr/sbin/tcpdump -i $IFNAME -c $NUMLOOPS > $OUTFILE - [ $? -eq 0 ] || end_testcase "Problems trying to launch tcpdump" - grep "$RHOST\>" $OUTFILE - [ $? -eq 0 ] || end_testcase "$RHOST was not listed in network traffic" - PID=`ps -ef | grep "ping -f $RHOST" | grep -v grep | awk '{print $2}'` - kill -9 $PID - rm -rf $OUTFILE -} + tst_setup -#============================================================================= -# FUNCTION NAME: end_testcase -# -# FUNCTION DESCRIPTION: Clean up -# -# PARAMETERS: string, IF AND ONLY IF the testcase fails -# -# RETURNS: None. -#============================================================================= + exists awk grep host hostname ifconfig netstat ping tail tcpdump + RHOST=${RHOST:-`hostname`} + IP=`host ${RHOST} 2>/dev/null | awk '{print $4}'` + IFNUMS=`netstat -i|wc -l` + IFNUMS=$(( $IFNUMS - 2 )) + IFNAME=${IFNAME:-$(netstat -i | awk '{print $1}' | tail -n ${IFNUMS})} + + for i in ${IFNAME}; do + if ifconfig ${i} | grep $IP; then + IF=$i + break + fi + done + if [ -z "${IF}" ]; then + end_testcase "Could not identify interface" + exit 1 + fi + IFNAME=${IF} + NUMLOOPS=${NUMLOOPS:-20} + OUTFILE=$TCtmp/tcpdump_out -end_testcase() +} + +do_test() { - $trace_logic - tst_resm TINFO "$this_file: doing $0." - rm -rf $TCtmp - [ $# -eq 0 ] && { tst_resm TPASS "Test Successful"; exit 0; } - tst_resm TFAIL "Test Failed: $@" - exit 1 + ping -f $RHOST > /dev/null 2>&1 & + if ! tcpdump -i $IFNAME -c $NUMLOOPS > $OUTFILE; then + end_testcase "Problems trying to launch tcpdump" + fi + if ! grep "$RHOST\>" $OUTFILE; then + end_testcase "$RHOST was not listed in network traffic" + fi + kill -15 %1 + rm -rf $OUTFILE } #----------------------------------------------------------------------- @@ -129,10 +91,9 @@ end_testcase() # OUTPUT: Logged run results written to testcase run log # #----------------------------------------------------------------------- -export TCID="tcpdump01" -export TST_TOTAL=1 -export TST_COUNT=1 +. net_cmdlib.sh -exists "ping awk tcpdump" +read_opts $* +do_setup do_test end_testcase diff --git a/testcases/network/tcp_cmds/telnet/Makefile b/testcases/network/tcp_cmds/telnet/Makefile dissimilarity index 96% index 9636a6e9..7d5f7c82 100644 --- a/testcases/network/tcp_cmds/telnet/Makefile +++ b/testcases/network/tcp_cmds/telnet/Makefile @@ -1,6 +1,31 @@ -all: - -install: - ln -f telnet01 ../../../bin - -clean: +# +# network/tcp_cmds/telnet 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := telnet01 + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/traceroute/Makefile b/testcases/network/traceroute/Makefile dissimilarity index 97% index e572922d..eb5aefb2 100644 --- a/testcases/network/traceroute/Makefile +++ b/testcases/network/traceroute/Makefile @@ -1,6 +1,29 @@ -all: - -install: - @ln -f traceroute_tests.sh ../../bin/traceroute_tests.sh - -clean: +# +# network/traceroute 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := traceroute_tests.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/xinetd/Makefile b/testcases/network/xinetd/Makefile dissimilarity index 97% index 3da56543..c3a80734 100644 --- a/testcases/network/xinetd/Makefile +++ b/testcases/network/xinetd/Makefile @@ -1,6 +1,31 @@ -all: - -install: - @ln -f xinetd_tests.sh ../../bin/xinetd_tests.sh - -clean: +# +# network/xinetd 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := xinetd_tests.sh + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/Makefile b/testcases/realtime/Makefile dissimilarity index 98% index 60ea13cf..9527b556 100644 --- a/testcases/realtime/Makefile +++ b/testcases/realtime/Makefile @@ -1,15 +1,105 @@ - -srcdir := . -include $(srcdir)/config.mk - -SUBDIRS = lib func perf stress - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done - @rm .config +# +# realtime test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../.. + +# Override these variables to use non-system available tools. +ACLOCAL ?= aclocal +AUTOCONF ?= autoconf +AUTOHEADER ?= autoheader +AUTOMAKE ?= automake + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/config.mk + +LIBDIR := lib +FILTER_OUT_DIRS := $(LIBDIR) +LIB := $(LIBDIR)/librealtime.a + +# START autotools junk +AUTOGENERATED_FILES = \ + m4/Makefile + +AUTOMAKE_FILES := config.guess config.sub install-sh missing stamp-h1 + +.PHONY: autotools aclocal autoconf autoheader automake +autotools: aclocal autoconf autoheader automake + +.PHONY: ac-clean ac-distclean ac-maintainer-clean +ac-clean:: + $(RM) -rf autom4te.cache + $(RM) -f aclocal.m4 config.log config.status + $(RM) -f include/realtime_config.h include/realtime_config.h.in include/stamp-h1 + +ac-distclean:: ac-clean +ac-maintainer-clean:: ac-distclean + $(RM) -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in + +aclocal: + $(ACLOCAL) -I $(abs_srcdir)/m4 + +autoconf: + $(AUTOCONF) + +autoheader: + $(AUTOHEADER) + +autoconf: configure + +include/realtime_config.h.in: configure.in $(wildcard m4/*.m4) + $(AUTOHEADER) + touch $@ + +configure: configure.in aclocal.m4 + $(AUTOCONF) +automake: aclocal $(AUTOMAKE_FILES) +$(AUTOMAKE_FILES): m4/Makefile.in +m4/Makefile.in: m4/Makefile.am + $(AUTOMAKE) -c -a + +.PHONY: autoheader +autoheader: include/realtime_config.h.in + +distclean:: %: clean ac-distclean + $(RM) -f $(AUTOGENERATED_FILES) + +maintainer-clean:: distclean ac-maintainer-clean + +$(AUTOGENERATED_FILES): $(top_builddir)/config.status + $(SHELL) $^ + +# END autotools junk + +$(LIBDIR): + mkdir -p "$@" + +$(LIB): $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$(LIBDIR)/Makefile" all + +trunk-all: $(LIB) + +trunk-clean:: | lib-clean + +lib-clean:: $(LIBDIR) + $(MAKE) -C $^ -f "$(abs_srcdir)/$(LIBDIR)/Makefile" clean + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/realtime/configure b/testcases/realtime/configure new file mode 100755 index 00000000..0357da3c --- /dev/null +++ b/testcases/realtime/configure @@ -0,0 +1,6887 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.63 for realtime realtime-20090930. +# +# Report bugs to . +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME='realtime' +PACKAGE_TARNAME='realtime' +PACKAGE_VERSION='realtime-20090930' +PACKAGE_STRING='realtime realtime-20090930' +PACKAGE_BUGREPORT='ltp-results@lists.sourceforge.net' + +ac_header_list= +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +LIBOBJS +RANLIB +AR +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +CROSS_COMPILATION_FALSE +CROSS_COMPILATION_TRUE +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures realtime realtime-20090930 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/realtime] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of realtime realtime-20090930:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +realtime configure realtime-20090930 +generated by GNU Autoconf 2.63 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by realtime $as_me realtime-20090930, which was +generated by GNU Autoconf 2.63. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +ac_header_list="$ac_header_list pthread.h" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in . "$srcdir"/.; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in . \"$srcdir\"/." >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in . \"$srcdir\"/." >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +am__api_version='1.10' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + +done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +$as_echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='realtime' + VERSION='realtime-20090930' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +ac_config_headers="$ac_config_headers include/realtime_config.h" + +ac_config_files="$ac_config_files m4/Makefile" + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } + +# Provide some information about the compiler. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } + fi + fi +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } +fi + +rm -f conftest$ac_cv_exeext +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + +for ac_header in $ac_header_list +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------------------ ## +## Report this to ltp-results@lists.sourceforge.net ## +## ------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + if test x$cross_compiling = xyes; then + CROSS_COMPILATION_TRUE= + CROSS_COMPILATION_FALSE='#' +else + CROSS_COMPILATION_TRUE='#' + CROSS_COMPILATION_FALSE= +fi + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } + +# Provide some information about the compiler. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# <= autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it. Not sure about +# 2.62. + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + +{ $as_echo "$as_me:$LINENO: checking Checking for PTHREAD_PRIO_INHERIT" >&5 +$as_echo_n "checking Checking for PTHREAD_PRIO_INHERIT... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include +int +main () +{ +int main(void) { + pthread_mutexattr_t attr; + return pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT); +} + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + has_priority_inherit="yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test "x$has_priority_inherit" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAS_PRIORITY_INHERIT 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +{ $as_echo "$as_me:$LINENO: checking Checking for pthread_mutexattr_*robust* APIs" >&5 +$as_echo_n "checking Checking for pthread_mutexattr_*robust* APIs... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include +int +main () +{ +int main(void) { + pthread_mutexattr_t attr; + return pthread_mutexattr_setrobust_np(&attr, 0); +} + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + has_robust="yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test "x$has_robust" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${CROSS_COMPILATION_TRUE}" && test -z "${CROSS_COMPILATION_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"CROSS_COMPILATION\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"CROSS_COMPILATION\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by realtime $as_me realtime-20090930, which was +generated by GNU Autoconf 2.63. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTION]... [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_version="\\ +realtime config.status realtime-20090930 +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { $as_echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { $as_echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "include/realtime_config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/realtime_config.h" ;; + "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files +# are listed without --file. Let's play safe and only enable the eval +# if we detect the quoting. +case $CONFIG_FILES in +*\'*) eval set x "$CONFIG_FILES" ;; +*) set x $CONFIG_FILES ;; +esac +shift +for mf +do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/testcases/realtime/configure.in b/testcases/realtime/configure.in new file mode 100644 index 00000000..256a4929 --- /dev/null +++ b/testcases/realtime/configure.in @@ -0,0 +1,26 @@ +AC_PREREQ(2.61) +AC_INIT([realtime],[realtime-20090930],[ltp-results@lists.sourceforge.net]) +AC_CONFIG_AUX_DIR([.]) +AM_INIT_AUTOMAKE +AC_CONFIG_HEADERS([include/realtime_config.h]) +AC_CONFIG_FILES([ \ + m4/Makefile \ +]) +AC_CHECK_HEADERS_ONCE([ \ + pthread.h \ +]) +AM_CONDITIONAL(CROSS_COMPILATION, test x$cross_compiling = xyes) + +AC_CANONICAL_HOST + +AC_PROG_CC +# <= autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it. Not sure about +# 2.62. +AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)]) +AC_PROG_AR +AC_PROG_RANLIB + +REALTIME_CHECK_PRIO_INHERIT +REALTIME_CHECK_ROBUST_APIS + +AC_OUTPUT diff --git a/testcases/realtime/func/Makefile b/testcases/realtime/func/Makefile dissimilarity index 99% index e30233c6..794bc9c3 100644 --- a/testcases/realtime/func/Makefile +++ b/testcases/realtime/func/Makefile @@ -1,30 +1,27 @@ - -srcdir := .. -include $(srcdir)/config.mk - -SUBDIRS = \ - async_handler \ - gtod_latency \ - hrtimer-prio \ - matrix_mult \ - measurement \ - periodic_cpu_load \ - pi-tests \ - pi_perf \ - prio-preempt \ - prio-wake \ - pthread_kill_latency \ - sched_football \ - sched_jitter \ - sched_latency \ - thread_clock \ - rt-migrate - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# realtime/func test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../config.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/realtime/func/async_handler/Makefile b/testcases/realtime/func/async_handler/Makefile dissimilarity index 98% index 0a813acd..faf4fa95 100644 --- a/testcases/realtime/func/async_handler/Makefile +++ b/testcases/realtime/func/async_handler/Makefile @@ -1,21 +1,27 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) - -ifeq ($(HAVE_PI_MUTEX), yes) -TARGETS = $(SRCS:%.c=%) -else -TARGETS = -endif - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/func/async_handler test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/func/gtod_latency/Makefile b/testcases/realtime/func/gtod_latency/Makefile dissimilarity index 98% index 4039a6ff..bd67ed6b 100644 --- a/testcases/realtime/func/gtod_latency/Makefile +++ b/testcases/realtime/func/gtod_latency/Makefile @@ -1,17 +1,27 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) - -TARGETS = $(SRCS:%.c=%) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/func/gtod_latency test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/func/hrtimer-prio/Makefile b/testcases/realtime/func/hrtimer-prio/Makefile dissimilarity index 98% index 4a583f84..0a1872c8 100644 --- a/testcases/realtime/func/hrtimer-prio/Makefile +++ b/testcases/realtime/func/hrtimer-prio/Makefile @@ -1,20 +1,27 @@ -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) - -ifeq ($(HAVE_PI_MUTEX), yes) -TARGETS = $(SRCS:%.c=%) -else -TARGETS = -endif - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/func/hrtimer-prio test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/func/matrix_mult/Makefile b/testcases/realtime/func/matrix_mult/Makefile dissimilarity index 98% index 4a583f84..c19cad10 100644 --- a/testcases/realtime/func/matrix_mult/Makefile +++ b/testcases/realtime/func/matrix_mult/Makefile @@ -1,20 +1,27 @@ -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) - -ifeq ($(HAVE_PI_MUTEX), yes) -TARGETS = $(SRCS:%.c=%) -else -TARGETS = -endif - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/func/matrix_mult test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/func/measurement/Makefile b/testcases/realtime/func/measurement/Makefile dissimilarity index 98% index 67aa51eb..fdad2c5f 100644 --- a/testcases/realtime/func/measurement/Makefile +++ b/testcases/realtime/func/measurement/Makefile @@ -1,16 +1,27 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(SRCS:%.c=%) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/func/measurement test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/func/periodic_cpu_load/Makefile b/testcases/realtime/func/periodic_cpu_load/Makefile dissimilarity index 98% index 4039a6ff..275eb06a 100644 --- a/testcases/realtime/func/periodic_cpu_load/Makefile +++ b/testcases/realtime/func/periodic_cpu_load/Makefile @@ -1,17 +1,27 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) - -TARGETS = $(SRCS:%.c=%) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/func/periodic_cpu_load test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile dissimilarity index 98% index 1e1de910..eb9cca3f 100644 --- a/testcases/realtime/func/pi-tests/Makefile +++ b/testcases/realtime/func/pi-tests/Makefile @@ -1,25 +1,30 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - -ALL_TARGETS = testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 \ - sbrk_mutex - -TARGETS = testpi-0 - -ifeq ($(HAVE_PI_MUTEX), yes) -TARGETS += testpi-1 testpi-2 testpi-4 testpi-5 testpi-7 -endif - -ifeq ($(HAVE_ROBUST_MUTEX), yes) -TARGETS += testpi-6 sbrk_mutex -endif - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(ALL_TARGETS) *~ - +# +# realtime/func/pi-tests test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk + +MAKE_TARGETS := testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 sbrk_mutex + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/func/pi-tests/sbrk_mutex.c b/testcases/realtime/func/pi-tests/sbrk_mutex.c index e198ca41..40c38056 100644 --- a/testcases/realtime/func/pi-tests/sbrk_mutex.c +++ b/testcases/realtime/func/pi-tests/sbrk_mutex.c @@ -43,7 +43,9 @@ #include #include #include -#include +#include "librttest.h" + +#if defined(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS) #define NUM_MUTEXES 5000 #define NUM_THREADS 50 @@ -147,3 +149,10 @@ int main(int argc, char* argv[]) } return 0; } + +#else +int main(void) { + printf("Your system doesn't support the pthread robust mutexattr API's\n"); + return 1; +} +#endif diff --git a/testcases/realtime/func/pi-tests/testpi-1.c b/testcases/realtime/func/pi-tests/testpi-1.c index 9899e70a..dc6081bf 100644 --- a/testcases/realtime/func/pi-tests/testpi-1.c +++ b/testcases/realtime/func/pi-tests/testpi-1.c @@ -91,9 +91,8 @@ void* func_nonrt(void* arg) printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); exit(-1); } - rc = sched_getaffinity(0, sizeof(mask), &mask); - printf("Thread %d started running with priority %d on CPU %ld\n", tid, pthr->priority, (long)mask.__bits); + printf("Thread %d started running with priority %d\n", tid, pthr->priority); pthread_mutex_lock(&glob_mutex); printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", tid, pthr->policy, pthr->priority); /* Wait for other RT threads to start up */ @@ -127,9 +126,8 @@ void* func_rt(void* arg) printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); exit(-1); } - rc = sched_getaffinity(0, sizeof(mask), &mask); - printf("Thread %d started running with prio %d on CPU %ld\n", tid, pthr->priority, (long)mask.__bits); + printf("Thread %d started running with prio %d\n", tid, pthr->priority); pthread_barrier_wait(&barrier); pthread_mutex_lock(&glob_mutex); printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", tid, pthr->policy, pthr->priority); @@ -167,9 +165,8 @@ void* func_noise(void* arg) printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); exit(-1); } - rc = sched_getaffinity(0, sizeof(mask), &mask); - printf("Noise Thread %d started running with prio %d on CPU %ld\n", tid, pthr->priority, (long)mask.__bits); + printf("Noise Thread %d started running with prio %d\n", tid, pthr->priority); pthread_barrier_wait(&barrier); for (i=0;i<10000;i++) { @@ -209,7 +206,6 @@ int main(int argc, char* argv[]) { printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); exit(-1); } - retc = sched_getaffinity(0, sizeof(mask), &mask); for (i=0;ipriority, (long)mask.__bits); + printf("Thread %d started running with priority %d\n", tid, pthr->priority); pthread_mutex_lock(&glob_mutex); printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", tid, pthr->policy, pthr->priority); /* Wait for other RT threads to start up */ @@ -127,9 +126,8 @@ void* func_rt(void* arg) printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); exit(-1); } - rc = sched_getaffinity(0, sizeof(mask), &mask); - printf("Thread %d started running with prio %d on CPU %ld\n", tid, pthr->priority, (long)mask.__bits); + printf("Thread %d started running with prio %d\n", tid, pthr->priority); pthread_barrier_wait(&barrier); pthread_mutex_lock(&glob_mutex); printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", tid, pthr->policy, pthr->priority); @@ -167,9 +165,8 @@ void* func_noise(void* arg) printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); exit(-1); } - rc = sched_getaffinity(0, sizeof(mask), &mask); - printf("Noise Thread %d started running with prio %d on CPU %ld\n", tid, pthr->priority, (long)mask.__bits); + printf("Noise Thread %d started running with prio %d\n", tid, pthr->priority); pthread_barrier_wait(&barrier); for (i=0;i<10000;i++) { @@ -208,7 +205,6 @@ int main(int argc, char* argv[]) { printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); exit(-1); } - retc = sched_getaffinity(0, sizeof(mask), &mask); for (i=0;ipriority, (long)mask.__bits); + printf("Thread %d started running with priority %d\n", tid, pthr->priority); pthread_mutex_lock(glob_mutex); printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", tid, pthr->policy, pthr->priority); pthread_barrier_wait(&barrier); @@ -127,9 +126,8 @@ void* func_rt(void* arg) printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); exit(-1); } - rc = sched_getaffinity(0, sizeof(mask), &mask); - printf("Thread %d started running with prio %d on CPU %ld\n", tid, pthr->priority, (long)mask.__bits); + printf("Thread %d started running with prio %d\n", tid, pthr->priority); pthread_barrier_wait(&barrier); pthread_mutex_lock(glob_mutex); printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", tid, pthr->policy, pthr->priority); @@ -167,9 +165,8 @@ void* func_noise(void* arg) printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); exit(-1); } - rc = sched_getaffinity(0, sizeof(mask), &mask); - printf("Noise Thread started running with prio %d on CPU %ld\n", pthr->priority, (long)mask.__bits); + printf("Noise Thread started running with prio %d\n", pthr->priority); pthread_barrier_wait(&barrier); for (i=0;i<10000;i++) { @@ -209,7 +206,6 @@ int main(int argc, char* argv[]) { printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); exit(-1); } - retc = sched_getaffinity(0, sizeof(mask), &mask); for (i=0;i -#ifndef __USE_XOPEN2K -# define __USE_XOPEN2K #endif +#include #include #include #include @@ -116,7 +115,13 @@ static void ftrace_write(const char *fmt, ...) n = vsnprintf(buff, BUFSIZ, fmt, ap); va_end(ap); - write(mark_fd, buff, n); + /* + * This doesn't return any valid vs invalid exit codes, so printing out + * a perror to warn the end-user of an issue is sufficient. + */ + if (write(mark_fd, buff, n) < 0) { + perror("write"); + } } #define INTERVAL 100ULL * NS_PER_MS @@ -185,21 +190,35 @@ static void usage() ); } -static void parse_args(int c, char *v) +/* +int rt_init(const char *options, int (*parse_arg)(int option, char *value), + int argc, char *argv[]); + */ +static int parse_args(int c, char *v) { - switch (c) { - case 'a': prio_start = atoi(v); break; - case 'r': - run_interval = atoi(v); - break; - case 't': interval = atoi(v); break; - case 'l': nr_runs = atoi(v); break; - case 'e': max_err = atoi(v) * NS_PER_US; break; - case '?': - case 'h': - usage(); - exit(0); - } + int handled = 1; + switch (c) { + case 'a': + prio_start = atoi(v); + break; + case 'r': + run_interval = atoi(v); + break; + case 't': + interval = atoi(v); + break; + case 'l': + nr_runs = atoi(v); + break; + case 'e': + max_err = atoi(v) * NS_PER_US; + break; + case '?': + case 'h': + usage(); + handled = 0; + } + return handled; } static void record_time(int id, unsigned long long time, unsigned long l) @@ -247,12 +266,12 @@ static void print_results(void) for (i = 0; i < nr_runs; i++) { printf("%4d: ", i); for (t = 0; t < nr_tasks; t++) - printf("%6lld ", intervals[t].records[i].y); + printf("%6ld ", intervals[t].records[i].y); printf("\n"); printf(" len: "); for (t = 0; t < nr_tasks; t++) - printf("%6lld ", intervals_length[t].records[i].y); + printf("%6ld ", intervals_length[t].records[i].y); printf("\n"); printf(" loops: "); diff --git a/testcases/realtime/func/sched_football/Makefile b/testcases/realtime/func/sched_football/Makefile dissimilarity index 98% index 67aa51eb..1b2a480b 100644 --- a/testcases/realtime/func/sched_football/Makefile +++ b/testcases/realtime/func/sched_football/Makefile @@ -1,16 +1,27 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(SRCS:%.c=%) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/func/sched_football test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/func/sched_jitter/Makefile b/testcases/realtime/func/sched_jitter/Makefile dissimilarity index 98% index 67aa51eb..95bc9a95 100644 --- a/testcases/realtime/func/sched_jitter/Makefile +++ b/testcases/realtime/func/sched_jitter/Makefile @@ -1,16 +1,27 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(SRCS:%.c=%) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/func/sched_jitter test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/func/sched_latency/Makefile b/testcases/realtime/func/sched_latency/Makefile dissimilarity index 98% index 0a813acd..564d42f9 100644 --- a/testcases/realtime/func/sched_latency/Makefile +++ b/testcases/realtime/func/sched_latency/Makefile @@ -1,21 +1,27 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) - -ifeq ($(HAVE_PI_MUTEX), yes) -TARGETS = $(SRCS:%.c=%) -else -TARGETS = -endif - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/func/sched_latency test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/func/thread_clock/Makefile b/testcases/realtime/func/thread_clock/Makefile dissimilarity index 98% index 67aa51eb..b94b897c 100644 --- a/testcases/realtime/func/thread_clock/Makefile +++ b/testcases/realtime/func/thread_clock/Makefile @@ -1,16 +1,27 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(SRCS:%.c=%) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/func/thread_clock test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/include/librttest.h b/testcases/realtime/include/librttest.h index 11df4995..74e760ce 100644 --- a/testcases/realtime/include/librttest.h +++ b/testcases/realtime/include/librttest.h @@ -55,6 +55,7 @@ #include #include #include "list.h" +#include "realtime_config.h" extern void setup(); extern void cleanup(); diff --git a/testcases/realtime/include/realtime_config.h.in b/testcases/realtime/include/realtime_config.h.in new file mode 100644 index 00000000..25043ab3 --- /dev/null +++ b/testcases/realtime/include/realtime_config.h.in @@ -0,0 +1,61 @@ +/* include/realtime_config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have PTHREAD_PRIO_INHERIT */ +#undef HAS_PRIORITY_INHERIT + +/* Define to 1 if you have pthread_mutexattr_*robust* APIs */ +#undef HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION diff --git a/testcases/realtime/lib/Makefile b/testcases/realtime/lib/Makefile dissimilarity index 95% index 667b419c..f6b9ad43 100644 --- a/testcases/realtime/lib/Makefile +++ b/testcases/realtime/lib/Makefile @@ -1,14 +1,35 @@ - -srcdir := .. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(SRCS:%.c=%.o) - -all: $(TARGETS) - -install: - -clean: - rm -f $(TARGETS) *~ +# +# realtime/lib 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CPPFLAGS += -I$(abs_srcdir)/../include + +CFLAGS += -D_GNU_SOURCE + +LDLIBS += -lpthread -lrt -lm + +LIB := librealtime.a + +include $(top_srcdir)/include/mk/lib.mk diff --git a/testcases/realtime/lib/librttest.c b/testcases/realtime/lib/librttest.c index 026bc3a6..e092f35a 100644 --- a/testcases/realtime/lib/librttest.c +++ b/testcases/realtime/lib/librttest.c @@ -141,7 +141,7 @@ int rt_init_long(const char *options, const struct option *longopts, exit(1); } if (!strchr(all_options, cur_opt->val)) { - fprintf(stderr, "Progreammer error -- argument --%s " + fprintf(stderr, "Programmer error -- argument --%s " "shortopt -%c wasn't listed in options (%s)\n", cur_opt->name, cur_opt->val, all_options); exit(1); @@ -152,7 +152,10 @@ int rt_init_long(const char *options, const struct option *longopts, cur_opt->name, cur_opt->val); exit(1); } - asprintf(&longopt_vals, "%s%c", longopt_vals, cur_opt->val); + if (asprintf(&longopt_vals, "%s%c", longopt_vals, cur_opt->val) < 0) { + perror("asprintf"); + exit(2); + } cur_opt++; } diff --git a/testcases/realtime/lib/libstats.c b/testcases/realtime/lib/libstats.c index e0c55adf..3144643b 100644 --- a/testcases/realtime/lib/libstats.c +++ b/testcases/realtime/lib/libstats.c @@ -75,7 +75,7 @@ int stats_container_append(stats_container_t *data, stats_record_t rec) { int myindex = ++data->index; if (myindex >= data->size) { - debug(DBG_ERR, "Number of elements cannot be more than %d\n", + debug(DBG_ERR, "Number of elements cannot be more than %ld\n", data->size); data->index--; return -1; diff --git a/testcases/realtime/m4/GNUmakefile b/testcases/realtime/m4/GNUmakefile new file mode 100644 index 00000000..24123e6a --- /dev/null +++ b/testcases/realtime/m4/GNUmakefile @@ -0,0 +1,37 @@ +# +# m4 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +M4MACROS := $(notdir $(wildcard *.m4)) + +INSTALL_DIR := $(datarootdir)/aclocal + +INSTALL_MODE := 00644 + +INSTALL_TARGETS := $(M4_MACROS) + +MAKE_TARGETS := + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/m4/Makefile.am b/testcases/realtime/m4/Makefile.am new file mode 100644 index 00000000..87c304b4 --- /dev/null +++ b/testcases/realtime/m4/Makefile.am @@ -0,0 +1 @@ +# bogus makefile to appease automake diff --git a/testcases/realtime/m4/check.m4 b/testcases/realtime/m4/check.m4 new file mode 100644 index 00000000..e54431ff --- /dev/null +++ b/testcases/realtime/m4/check.m4 @@ -0,0 +1,35 @@ +AC_DEFUN([REALTIME_CHECK_PRIO_INHERIT],[ +AC_MSG_CHECKING([Checking for PTHREAD_PRIO_INHERIT]) +AC_TRY_COMPILE([ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include ],[int main(void) { + pthread_mutexattr_t attr; + return pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT); +}],[has_priority_inherit="yes"],[]) +if test "x$has_priority_inherit" = "xyes" ; then + AC_DEFINE(HAS_PRIORITY_INHERIT,1,[Define to 1 if you have PTHREAD_PRIO_INHERIT]) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi +]) + +AC_DEFUN([REALTIME_CHECK_ROBUST_APIS],[ +AC_MSG_CHECKING([Checking for pthread_mutexattr_*robust* APIs]) +AC_TRY_COMPILE([ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include ],[int main(void) { + pthread_mutexattr_t attr; + return pthread_mutexattr_setrobust_np(&attr, 0); +}],[has_robust="yes"]) +if test "x$has_robust" = "xyes" ; then + AC_DEFINE(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS,1,[Define to 1 if you have pthread_mutexattr_*robust* APIs]) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi +]) diff --git a/testcases/realtime/perf/Makefile b/testcases/realtime/perf/Makefile dissimilarity index 98% index 3418d47f..bf0368d3 100644 --- a/testcases/realtime/perf/Makefile +++ b/testcases/realtime/perf/Makefile @@ -1,14 +1,27 @@ - -srcdir := .. -include $(srcdir)/config.mk - -SUBDIRS = latency - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# realtime/perf 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../config.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/realtime/perf/latency/Makefile b/testcases/realtime/perf/latency/Makefile dissimilarity index 98% index 67aa51eb..6b1ad583 100644 --- a/testcases/realtime/perf/latency/Makefile +++ b/testcases/realtime/perf/latency/Makefile @@ -1,16 +1,27 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(SRCS:%.c=%) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/latency test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/realtime/scripts/check_pi.sh b/testcases/realtime/scripts/check_pi.sh deleted file mode 100755 index 8e3a105c..00000000 --- a/testcases/realtime/scripts/check_pi.sh +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/sh - -cat > check_pi.c < - -int main () -{ - pthread_mutexattr_t attr; - return pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT); -} -EOF - -gcc -o check_pi check_pi.c -lpthread 2> check_pi.err -status=$? - -if [ $status -eq 0 ] && [ ! -s check_pi.err ] && [ -x check_pi ]; then - echo yes -else - echo no -fi - -rm -f check_pi.c check_pi check_pi.err diff --git a/testcases/realtime/scripts/check_robust.sh b/testcases/realtime/scripts/check_robust.sh deleted file mode 100755 index 2a808d1a..00000000 --- a/testcases/realtime/scripts/check_robust.sh +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/sh - -cat > check_robust.c < - -int main () -{ - pthread_mutexattr_t attr; - return pthread_mutexattr_setrobust_np(&attr, 0); -} -EOF - -gcc -o check_robust check_robust.c -lpthread 2> check_robust.err -status=$? - -if [ $status -eq 0 ] && [ ! -s check_robust.err ] && [ -x check_robust ]; then - echo yes -else - echo no -fi - -rm -f check_robust.c check_robust check_robust.err diff --git a/testcases/realtime/stress/Makefile b/testcases/realtime/stress/Makefile dissimilarity index 98% index e03391fd..ad10e695 100644 --- a/testcases/realtime/stress/Makefile +++ b/testcases/realtime/stress/Makefile @@ -1,14 +1,27 @@ - -srcdir := .. -include $(srcdir)/config.mk - -SUBDIRS = pi-tests - -all: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# realtime/stress 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. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../config.mk +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile dissimilarity index 98% index 67aa51eb..5edc3b4e 100644 --- a/testcases/realtime/stress/pi-tests/Makefile +++ b/testcases/realtime/stress/pi-tests/Makefile @@ -1,16 +1,27 @@ - -srcdir := ../.. -include $(srcdir)/config.mk - - -SRCS = $(wildcard *.c) -TARGETS = $(SRCS:%.c=%) - -all: $(TARGETS) - -install: - @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i; done - -clean: - rm -f $(TARGETS) *~ - +# +# realtime/stress/pi-tests test suite Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, September 2009 +# + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/env_pre.mk +include $(abs_srcdir)/../../config.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testscripts/default_runtest_set.awk b/testscripts/default_runtest_set.awk new file mode 100755 index 00000000..38ea9129 --- /dev/null +++ b/testscripts/default_runtest_set.awk @@ -0,0 +1,44 @@ +#!/usr/bin/awk -f +# +# Script for determining default runtest set from runltp / runltplite.sh. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# +# Invoke this awk script like: +# +# $0 /path/to/ltp/runltp +# +# e.g. +# +# $0 /opt/ltp/runltp +# +# NOTE: $0 corresponds to the script name. +# + +BEGIN { RS="\n"; FS=" "; } +# We only care about lines with \/runtest\/ strings in them -- skip the rest. +/\/runtest\// { + split ($0,strs," ") + for (str in strs) { + if ($str ~ /\${LTPROOT}\/runtest\/([^[:space:]]+)/) { + sub (/\${LTPROOT}\/runtest\//, "", $str) + print $str + } + } +} diff --git a/testscripts/ltp-missing-install-files.py b/testscripts/ltp-missing-install-files.py new file mode 100755 index 00000000..612ae5d7 --- /dev/null +++ b/testscripts/ltp-missing-install-files.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python +# +# Script for determining items missing from LTP install based on the output +# log provided by runltp[lite.sh]. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# +# Please invoke this script with --help to determine usage. +# + +from optparse import OptionParser +import os, re, sys + +parser = OptionParser(usage='usage: %prog [options] logfile ...') + +parser.add_option('-v', '--verbose', action='store_true', default=False, + dest='verbose', help=('print out successful results as ' + 'well as failures')) + +opts, logfiles = parser.parse_args() + +if not len(logfiles): + parser.print_help() + +for logfile in logfiles: + if not os.access(logfile, os.R_OK): + sys.exit("%s not readable" % logfile) + +todo_res = [ + re.compile("""initiation_status="pan\(\d+\): execvp of '(?P.+)' \(tag (?P\w+)\) failed.+errno:2\s+No such file or directory"""), + re.compile("(?P\S+): line \d+: (?P\S+): No such file or directory"), + re.compile("(?P\S+): (?P\s+): No such file or directory"), + re.compile("""tag=(?P\w+) [\w=]+ +cmdline=.+ +contacts=.+ +analysis=.+ +<<>> +(\S+): (?P\w+): command not found +<<>> +initiation_status=.+ +.+termination_id=127.+""") +] + +for logfile in logfiles: + fd = open(logfile) + + # Case 1: + + # initiation_status="pan(9908): execvp of 'fs_perms_simpletest.sh' (tag fs_perms) failed. errno:2 No such file or directory" + + # Case 2: + + # /scratch/ltp-install4/testcases/bin/test_controllers.sh: line 109: /scratch/ltp-install4/testcases/bin/run_cpuset_test.sh: No such file or directory + + # Case 3: + + # gcc: /scratch/ltp-install4/testcases/bin/nmfile2.c: No such file or directory + + # Case 4: + + # <<>> + # tag=iogen01 stime=1248638309 + # cmdline="export LTPROOT; rwtest -N iogen01 -i 120s -s read,write -Da -Dv -n 2 500b:doio.f1.$$ 1000b:doio.f2.$$" + # contacts="" + # analysis=exit + # <<>> + # sh: rwtest: command not found + # <<>> + # initiation_status="ok" + # duration=0 termination_type=exited termination_id=127 corefile=no + + missing_ents = [] + + try: + + lines = fd.readlines() + + for line in lines: + + for todo_re in todo_res[:-1]: + + m = todo_re.match(line) + if m: + missing_ent = " ".join([m.group(1), m.group('app')]) + if missing_ent not in missing_ents: + missing_ents.append(missing_ent) + break + + for m in todo_res[2].finditer("".join(lines)): + missing_ent = " ".join([m.group('tag'), m.group('app')]) + if missing_ent not in missing_ents: + missing_ents.append(missing_ent) + + finally: + fd.close() + + if len(missing_ents): + print "\n".join(["%s: %s" % (os.path.basename(logfile), i) for i in ["Tag | App"] + missing_ents]) + elif opts.verbose: + print "%s: CONGRATULATIONS -- no missing files found!" % os.path.basename(logfile) diff --git a/tools/Makefile b/tools/Makefile dissimilarity index 98% index 3f7d53be..b481cc93 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,18 +1,35 @@ -SUBDIRS = apicmds genload netpipe-2.4 netpipe-2.4-ipv6 #top-LTP - -CFLAGS+= -Wall -I../include -LOADLIBES+= -L../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done - -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done - @set -e; ln -f gethost ../testcases/bin - -clean: - rm -f $(TARGETS) - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done +# +# tools 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= .. + +include $(top_srcdir)/include/mk/testcases.mk + +# top-LTP is really broken, apparently, and netpipe needs some fixing and +# reorganization.. +FILTER_OUT_DIRS := netpipe% top-LTP + +INSTALL_TARGETS := *.pl *.sh + +INSTALL_DIR := tools + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/tools/apicmds/Makefile b/tools/apicmds/Makefile dissimilarity index 99% index 5d9c4779..9596efa6 100644 --- a/tools/apicmds/Makefile +++ b/tools/apicmds/Makefile @@ -1,22 +1,34 @@ -CFLAGS+= -D_GNU_SOURCE -I../../include -LOADLIBES+= -L../../lib -lltp - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) -CMDLIST=tst_brk tst_brkm tst_res tst_resm tst_exit tst_flush tst_brkloop tst_brkloopm tst_kvercmp - -all: $(TARGETS) - -install: - @ln -f $(TARGETS) ../../testcases/bin/tst_brk - @ln -f $(TARGETS) ../../testcases/bin/tst_brkm - @ln -f $(TARGETS) ../../testcases/bin/tst_res - @ln -f $(TARGETS) ../../testcases/bin/tst_resm - @ln -f $(TARGETS) ../../testcases/bin/tst_exit - @ln -f $(TARGETS) ../../testcases/bin/tst_flush - @ln -f $(TARGETS) ../../testcases/bin/tst_brkloop - @ln -f $(TARGETS) ../../testcases/bin/tst_brkloopm - @ln -f $(TARGETS) ../../testcases/bin/tst_kvercmp - -clean: - rm -f $(TARGETS) +# +# Makefile for all tst_* API commands. +# +# 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. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -D_GNU_SOURCE + +MAKE_TARGETS := $(addprefix tst_,brkloop brkloopm brk brkm exit flush kvercmp res resm) + +include $(top_srcdir)/include/mk/generic_leaf_target.mk + +$(MAKE_TARGETS): %: ltpapicmd.o + $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION) diff --git a/tools/genhtml.pl b/tools/genhtml.pl index df390d56..3dcc77f5 100644 --- a/tools/genhtml.pl +++ b/tools/genhtml.pl @@ -179,31 +179,31 @@ foreach my $file (@ARGV) { } if ( $flag2 == 1 ) { $row_line = $row_line . "$line \n"; - if ($line =~ /\ FAIL\ / ) { + if ($line =~ /\ TFAIL\ / ) { $detected_fail = 1; if ( $failed_test_counter_flag == 0 ) { $failed_test_counter++; $failed_test_counter_flag=1; } - } elsif ($line =~ /\ BROK\ / ) { + } elsif ($line =~ /\ TBROK\ / ) { $detected_brok = 1; if ( $brok_test_counter_flag == 0 ) { $brok_test_counter++; $brok_test_counter_flag=1; } - } elsif ($line =~ /\ WARN\ / ) { + } elsif ($line =~ /\ TWARN\ / ) { $detected_warn = 1; if ( $warn_test_counter_flag == 0 ) { $warn_test_counter++; $warn_test_counter_flag=1; } - } elsif ($line =~ /\ RETR\ / ) { + } elsif ($line =~ /\ TRETR\ / ) { $detected_retr = 1; if ( $retr_test_counter_flag == 0 ) { $retr_test_counter++; $retr_test_counter_flag=1; } - } elsif ($line =~ /\ CONF\ / ) { + } elsif ($line =~ /\ TCONF\ / ) { $detected_conf = 1; if ( $conf_test_counter_flag == 0 ) { $conf_test_counter++; diff --git a/tools/genload/Makefile b/tools/genload/Makefile dissimilarity index 97% index 9b06756b..c00e64b4 100644 --- a/tools/genload/Makefile +++ b/tools/genload/Makefile @@ -1,14 +1,31 @@ -CFLAGS+= -DPACKAGE=\"stress\" -DVERSION=\"0.17pre11\" - -LDLIBS+= -lm - -SRCS=$(wildcard *.c) -TARGETS=$(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - @ln -f $(TARGETS) ../../testcases/bin/genload - -clean: - rm -fr $(TARGETS) +# +# tools/genload Makefile. +# +# Copyright (C) 2009, Cisco Systems Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Garrett Cooper, July 2009 +# + +top_srcdir ?= ../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +CFLAGS += -DPACKAGE=\"stress\" -DVERSION=\"0.17pre11\" + +LDLIBS += -lm + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/tools/genload/genload.c b/tools/genload/genload.c new file mode 100644 index 00000000..0b867601 --- /dev/null +++ b/tools/genload/genload.c @@ -0,0 +1,983 @@ +/* A program to put stress on a POSIX system (stress). + * + * Copyright (C) 2001, 2002 Amos Waterland + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., 59 + * Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* By default, print all messages of severity info and above. */ +static int global_debug = 2; + +/* By default, just print warning for non-critical errors. */ +static int global_ignore = 1; + +/* By default, retry on non-critical errors every 50ms. */ +static int global_retry = 50000; + +/* By default, use this as backoff coefficient for good fork throughput. */ +static int global_backoff = 3000; + +/* By default, do not timeout. */ +static int global_timeout = 0; + +/* Name of this program */ +static char *global_progname = PACKAGE; + +/* By default, do not hang after allocating memory. */ +static int global_vmhang = 0; + +/* Implemention of runtime-selectable severity message printing. */ +#define dbg if (global_debug >= 3) \ + fprintf (stdout, "%s: debug: (%d) ", global_progname, __LINE__), \ + fprintf +#define out if (global_debug >= 2) \ + fprintf (stdout, "%s: info: ", global_progname), \ + fprintf +#define wrn if (global_debug >= 1) \ + fprintf (stderr, "%s: warn: (%d) ", global_progname, __LINE__), \ + fprintf +#define err if (global_debug >= 0) \ + fprintf (stderr, "%s: error: (%d) ", global_progname, __LINE__), \ + fprintf + +/* Implementation of check for option argument correctness. */ +#define assert_arg(A) \ + if (++i == argc || ((arg = argv[i])[0] == '-' && \ + !isdigit ((int)arg[1]) )) \ + { \ + err (stderr, "missing argument to option '%s'\n", A); \ + exit (1); \ + } + +/* Prototypes for utility functions. */ +int usage (int status); +int version (int status); +long long atoll_s (const char *nptr); +long long atoll_b (const char *nptr); + +/* Prototypes for the worker functions. */ +int hogcpu (long long forks); +int hogio (long long forks); +int hogvm (long long forks, long long chunks, long long bytes); +int hoghdd (long long forks, int clean, long long files, long long bytes); + +int +main (int argc, char **argv) +{ + int i, pid, children = 0, retval = 0; + long starttime, stoptime, runtime; + + /* Variables that indicate which options have been selected. */ + int do_dryrun = 0; + int do_timeout = 0; + int do_cpu = 0; /* Default to 1 fork. */ + long long do_cpu_forks = 1; + int do_io = 0; /* Default to 1 fork. */ + long long do_io_forks = 1; + int do_vm = 0; /* Default to 1 fork, 1 chunk of 256MB. */ + long long do_vm_forks = 1; + long long do_vm_chunks = 1; + long long do_vm_bytes = 256 * 1024 * 1024; + int do_hdd = 0; /* Default to 1 fork, clean, 1 file of 1GB. */ + long long do_hdd_forks = 1; + int do_hdd_clean = 0; + long long do_hdd_files = 1; + long long do_hdd_bytes = 1024 * 1024 * 1024; + + /* Record our start time. */ + if ((starttime = time (NULL)) == -1) + { + err (stderr, "failed to acquire current time\n"); + exit (1); + } + + /* SuSv3 does not define any error conditions for this function. */ + global_progname = basename (argv[0]); + + /* For portability, parse command line options without getopt_long. */ + for (i = 1; i < argc; i++) + { + char *arg = argv[i]; + + if (strcmp (arg, "--help") == 0 || strcmp (arg, "-?") == 0) + { + usage (0); + } + else if (strcmp (arg, "--version") == 0) + { + version (0); + } + else if (strcmp (arg, "--verbose") == 0 || strcmp (arg, "-v") == 0) + { + global_debug = 3; + } + else if (strcmp (arg, "--quiet") == 0 || strcmp (arg, "-q") == 0) + { + global_debug = 0; + } + else if (strcmp (arg, "--dry-run") == 0 || strcmp (arg, "-n") == 0) + { + do_dryrun = 1; + } + else if (strcmp (arg, "--no-retry") == 0) + { + global_ignore = 0; + dbg (stdout, "turning off ignore of non-critical errors"); + } + else if (strcmp (arg, "--retry-delay") == 0) + { + assert_arg ("--retry-delay"); + global_retry = atoll (arg); + dbg (stdout, "setting retry delay to %dus\n", global_retry); + } + else if (strcmp (arg, "--backoff") == 0) + { + assert_arg ("--backoff"); + global_backoff = atoll (arg); + if (global_backoff < 0) + { + err (stderr, "invalid backoff factor: %i\n", global_backoff); + exit (1); + } + dbg (stdout, "setting backoff coeffient to %dus\n", global_backoff); + } + else if (strcmp (arg, "--timeout") == 0 || strcmp (arg, "-t") == 0) + { + do_timeout = 1; + assert_arg ("--timeout"); + global_timeout = atoll_s (arg); + dbg (stdout, "setting timeout to %ds\n", global_timeout); + } + else if (strcmp (arg, "--cpu") == 0 || strcmp (arg, "-c") == 0) + { + do_cpu = 1; + assert_arg ("--cpu"); + do_cpu_forks = atoll_b (arg); + } + else if (strcmp (arg, "--io") == 0 || strcmp (arg, "-i") == 0) + { + do_io = 1; + assert_arg ("--io"); + do_io_forks = atoll_b (arg); + } + else if (strcmp (arg, "--vm") == 0 || strcmp (arg, "-m") == 0) + { + do_vm = 1; + assert_arg ("--vm"); + do_vm_forks = atoll_b (arg); + } + else if (strcmp (arg, "--vm-chunks") == 0) + { + assert_arg ("--vm-chunks"); + do_vm_chunks = atoll_b (arg); + } + else if (strcmp (arg, "--vm-bytes") == 0) + { + assert_arg ("--vm-bytes"); + do_vm_bytes = atoll_b (arg); + } + else if (strcmp (arg, "--vm-hang") == 0) + { + global_vmhang = 1; + } + else if (strcmp (arg, "--hdd") == 0 || strcmp (arg, "-d") == 0) + { + do_hdd = 1; + assert_arg ("--hdd"); + do_hdd_forks = atoll_b (arg); + } + else if (strcmp (arg, "--hdd-noclean") == 0) + { + do_hdd_clean = 2; + } + else if (strcmp (arg, "--hdd-files") == 0) + { + assert_arg ("--hdd-files"); + do_hdd_files = atoll_b (arg); + } + else if (strcmp (arg, "--hdd-bytes") == 0) + { + assert_arg ("--hdd-bytes"); + do_hdd_bytes = atoll_b (arg); + } + else + { + err (stderr, "unrecognized option: %s\n", arg); + exit (1); + } + } + + /* Hog CPU option. */ + if (do_cpu) + { + out (stdout, "dispatching %lli hogcpu forks\n", do_cpu_forks); + + switch (pid = fork ()) + { + case 0: /* child */ + if (do_dryrun) + exit (0); + exit (hogcpu (do_cpu_forks)); + case -1: /* error */ + err (stderr, "hogcpu dispatcher fork failed\n"); + exit (1); + default: /* parent */ + children++; + dbg (stdout, "--> hogcpu dispatcher forked (%i)\n", pid); + } + } + + /* Hog I/O option. */ + if (do_io) + { + out (stdout, "dispatching %lli hogio forks\n", do_io_forks); + + switch (pid = fork ()) + { + case 0: /* child */ + if (do_dryrun) + exit (0); + exit (hogio (do_io_forks)); + case -1: /* error */ + err (stderr, "hogio dispatcher fork failed\n"); + exit (1); + default: /* parent */ + children++; + dbg (stdout, "--> hogio dispatcher forked (%i)\n", pid); + } + } + + /* Hog VM option. */ + if (do_vm) + { + out (stdout, + "dispatching %lli hogvm forks, each %lli chunks of %lli bytes\n", + do_vm_forks, do_vm_chunks, do_vm_bytes); + + switch (pid = fork ()) + { + case 0: /* child */ + if (do_dryrun) + exit (0); + exit (hogvm (do_vm_forks, do_vm_chunks, do_vm_bytes)); + case -1: /* error */ + err (stderr, "hogvm dispatcher fork failed\n"); + exit (1); + default: /* parent */ + children++; + dbg (stdout, "--> hogvm dispatcher forked (%i)\n", pid); + } + } + + /* Hog HDD option. */ + if (do_hdd) + { + out (stdout, "dispatching %lli hoghdd forks, each %lli files of " + "%lli bytes\n", do_hdd_forks, do_hdd_files, do_hdd_bytes); + + switch (pid = fork ()) + { + case 0: /* child */ + if (do_dryrun) + exit (0); + exit (hoghdd + (do_hdd_forks, do_hdd_clean, do_hdd_files, do_hdd_bytes)); + case -1: /* error */ + err (stderr, "hoghdd dispatcher fork failed\n"); + exit (1); + default: /* parent */ + children++; + dbg (stdout, "--> hoghdd dispatcher forked (%i)\n", pid); + } + } + + /* We have no work to do, so bail out. */ + if (children == 0) + usage (0); + + /* Wait for our children to exit. */ + while (children) + { + int status, ret; + + if ((pid = wait (&status)) > 0) + { + if ((WIFEXITED (status)) != 0) + { + if ((ret = WEXITSTATUS (status)) != 0) + { + err (stderr, "dispatcher %i returned error %i\n", pid, ret); + retval += ret; + } + else + { + dbg (stdout, "<-- dispatcher return (%i)\n", pid); + } + } + else + { + err (stderr, "dispatcher did not exit normally\n"); + ++retval; + } + + --children; + } + else + { + dbg (stdout, "wait() returned error: %s\n", strerror (errno)); + err (stderr, "detected missing dispatcher children\n"); + ++retval; + break; + } + } + + /* Record our stop time. */ + if ((stoptime = time (NULL)) == -1) + { + err (stderr, "failed to acquire current time\n"); + exit (1); + } + + /* Calculate our runtime. */ + runtime = stoptime - starttime; + + /* Print final status message. */ + if (retval) + { + err (stderr, "failed run completed in %lis\n", runtime); + } + else + { + out (stdout, "successful run completed in %lis\n", runtime); + } + + exit (retval); +} + +int +usage (int status) +{ + char *mesg = + "`%s' imposes certain types of compute stress on your system\n\n" + "Usage: %s [OPTION [ARG]] ...\n\n" + " -?, --help show this help statement\n" + " --version show version statement\n" + " -v, --verbose be verbose\n" + " -q, --quiet be quiet\n" + " -n, --dry-run show what would have been done\n" + " --no-retry exit rather than retry non-critical errors\n" + " --retry-delay n wait n us before continuing past error\n" + " -t, --timeout n timeout after n seconds\n" + " --backoff n wait for factor of n us before starting work\n" + " -c, --cpu n spawn n procs spinning on sqrt()\n" + " -i, --io n spawn n procs spinning on sync()\n" + " -m, --vm n spawn n procs spinning on malloc()\n" + " --vm-chunks c malloc c chunks (default is 1)\n" + " --vm-bytes b malloc chunks of b bytes (default is 256MB)\n" + " --vm-hang hang in a sleep loop after memory allocated\n" + " -d, --hdd n spawn n procs spinning on write()\n" + " --hdd-noclean do not unlink file to which random data written\n" + " --hdd-files f write to f files (default is 1)\n" + " --hdd-bytes b write b bytes (default is 1GB)\n\n" + "Infinity is denoted with 0. For -m, -d: n=0 means infinite redo,\n" + "n<0 means redo abs(n) times. Valid suffixes are m,h,d,y for time;\n" + "k,m,g for size.\n\n"; + + fprintf (stdout, mesg, global_progname, global_progname); + + if (status <= 0) + exit (-1 * status); + + return 0; +} + +int +version (int status) +{ + char *mesg = "%s %s\n"; + + fprintf (stdout, mesg, global_progname, VERSION); + + if (status <= 0) + exit (-1 * status); + + return 0; +} + +/* Convert a string representation of a number with an optional size suffix + * to a long long. + */ +long long +atoll_b (const char *nptr) +{ + int pos; + char suffix; + long long factor = 1; + + if ((pos = strlen (nptr) - 1) < 0) + { + err (stderr, "invalid string\n"); + exit (1); + } + + switch (suffix = nptr[pos]) + { + case 'k': + case 'K': + factor = 1024; + break; + case 'm': + case 'M': + factor = 1024 * 1024; + break; + case 'g': + case 'G': + factor = 1024 * 1024 * 1024; + break; + default: + if (suffix < '0' || suffix > '9') + { + err (stderr, "unrecognized suffix: %c\n", suffix); + exit (1); + } + } + + factor = atoll (nptr) * factor; + + return factor; +} + +/* Convert a string representation of a number with an optional time suffix + * to a long long. + */ +long long +atoll_s (const char *nptr) +{ + int pos; + char suffix; + long long factor = 1; + + if ((pos = strlen (nptr) - 1) < 0) + { + err (stderr, "invalid string\n"); + exit (1); + } + + switch (suffix = nptr[pos]) + { + case 's': + case 'S': + factor = 1; + break; + case 'm': + case 'M': + factor = 60; + break; + case 'h': + case 'H': + factor = 60 * 60; + break; + case 'd': + case 'D': + factor = 60 * 60 * 24; + break; + case 'y': + case 'Y': + factor = 60 * 60 * 24 * 360; + break; + default: + if (suffix < '0' || suffix > '9') + { + err (stderr, "unrecognized suffix: %c\n", suffix); + exit (1); + } + } + + factor = atoll (nptr) * factor; + + return factor; +} + +int +hogcpu (long long forks) +{ + long long i; + double d; + int pid, retval = 0; + + /* Make local copies of global variables. */ + int ignore = global_ignore; + int retry = global_retry; + int timeout = global_timeout; + long backoff = global_backoff * forks; + + dbg (stdout, "using backoff sleep of %lius for hogcpu\n", backoff); + + for (i = 0; forks == 0 || i < forks; i++) + { + switch (pid = fork ()) + { + case 0: /* child */ + alarm (timeout); + + /* Use a backoff sleep to ensure we get good fork throughput. */ + usleep (backoff); + + while (1) + d = sqrt (rand ()); + + /* This case never falls through; alarm signal can cause exit. */ + case -1: /* error */ + if (ignore) + { + ++retval; + wrn (stderr, "hogcpu worker fork failed, continuing\n"); + usleep (retry); + continue; + } + + err (stderr, "hogcpu worker fork failed\n"); + return 1; + default: /* parent */ + dbg (stdout, "--> hogcpu worker forked (%i)\n", pid); + } + } + + /* Wait for our children to exit. */ + while (i) + { + int status, ret; + + if ((pid = wait (&status)) > 0) + { + if ((WIFEXITED (status)) != 0) + { + if ((ret = WEXITSTATUS (status)) != 0) + { + err (stderr, "hogcpu worker %i exited %i\n", pid, ret); + retval += ret; + } + else + { + dbg (stdout, "<-- hogcpu worker exited (%i)\n", pid); + } + } + else + { + dbg (stdout, "<-- hogcpu worker signalled (%i)\n", pid); + } + + --i; + } + else + { + dbg (stdout, "wait() returned error: %s\n", strerror (errno)); + err (stderr, "detected missing hogcpu worker children\n"); + ++retval; + break; + } + } + + return retval; +} + +int +hogio (long long forks) +{ + long long i; + int pid, retval = 0; + + /* Make local copies of global variables. */ + int ignore = global_ignore; + int retry = global_retry; + int timeout = global_timeout; + long backoff = global_backoff * forks; + + dbg (stdout, "using backoff sleep of %lius for hogio\n", backoff); + + for (i = 0; forks == 0 || i < forks; i++) + { + switch (pid = fork ()) + { + case 0: /* child */ + alarm (timeout); + + /* Use a backoff sleep to ensure we get good fork throughput. */ + usleep (backoff); + + while (1) + sync (); + + /* This case never falls through; alarm signal can cause exit. */ + case -1: /* error */ + if (ignore) + { + ++retval; + wrn (stderr, "hogio worker fork failed, continuing\n"); + usleep (retry); + continue; + } + + err (stderr, "hogio worker fork failed\n"); + return 1; + default: /* parent */ + dbg (stdout, "--> hogio worker forked (%i)\n", pid); + } + } + + /* Wait for our children to exit. */ + while (i) + { + int status, ret; + + if ((pid = wait (&status)) > 0) + { + if ((WIFEXITED (status)) != 0) + { + if ((ret = WEXITSTATUS (status)) != 0) + { + err (stderr, "hogio worker %i exited %i\n", pid, ret); + retval += ret; + } + else + { + dbg (stdout, "<-- hogio worker exited (%i)\n", pid); + } + } + else + { + dbg (stdout, "<-- hogio worker signalled (%i)\n", pid); + } + + --i; + } + else + { + dbg (stdout, "wait() returned error: %s\n", strerror (errno)); + err (stderr, "detected missing hogio worker children\n"); + ++retval; + break; + } + } + + return retval; +} + +int +hogvm (long long forks, long long chunks, long long bytes) +{ + long long i, j, k; + int pid, retval = 0; + char **ptr; + + /* Make local copies of global variables. */ + int ignore = global_ignore; + int retry = global_retry; + int timeout = global_timeout; + long backoff = global_backoff * forks; + + dbg (stdout, "using backoff sleep of %lius for hogvm\n", backoff); + + if (bytes == 0) + { + /* 512MB is guess at the largest value can than be malloced at once. */ + bytes = 512 * 1024 * 1024; + } + + for (i = 0; forks == 0 || i < forks; i++) + { + switch (pid = fork ()) + { + case 0: /* child */ + alarm (timeout); + + /* Use a backoff sleep to ensure we get good fork throughput. */ + usleep (backoff); + + while (1) + { + ptr = (char **) malloc ( chunks * 2); + for (j = 0; chunks == 0 || j < chunks; j++) + { + if ((ptr[j] = (char *) malloc (bytes * sizeof (char)))) + { + for (k = 0; k < bytes; k++) + ptr[j][k] = 'Z'; /* Ensure that COW happens. */ + dbg (stdout, "hogvm worker malloced %lli bytes\n", k); + } + else if (ignore) + { + ++retval; + wrn (stderr, "hogvm malloc failed, continuing\n"); + usleep (retry); + continue; + } + else + { + ++retval; + err (stderr, "hogvm malloc failed\n"); + break; + } + } + if (global_vmhang && retval == 0) + { + dbg (stdout, "sleeping forever with allocated memory\n"); + while (1) + sleep (1024); + } + if (retval == 0) + { + dbg (stdout, + "hogvm worker freeing memory and starting over\n"); + for (j = 0; chunks == 0 || j < chunks; j++) { + free (ptr[j]); + } + free(ptr); + continue; + } + + exit (retval); + } + + /* This case never falls through; alarm signal can cause exit. */ + case -1: /* error */ + if (ignore) + { + ++retval; + wrn (stderr, "hogvm worker fork failed, continuing\n"); + usleep (retry); + continue; + } + + err (stderr, "hogvm worker fork failed\n"); + return 1; + default: /* parent */ + dbg (stdout, "--> hogvm worker forked (%i)\n", pid); + } + } + + /* Wait for our children to exit. */ + while (i) + { + int status, ret; + + if ((pid = wait (&status)) > 0) + { + if ((WIFEXITED (status)) != 0) + { + if ((ret = WEXITSTATUS (status)) != 0) + { + err (stderr, "hogvm worker %i exited %i\n", pid, ret); + retval += ret; + } + else + { + dbg (stdout, "<-- hogvm worker exited (%i)\n", pid); + } + } + else + { + dbg (stdout, "<-- hogvm worker signalled (%i)\n", pid); + } + + --i; + } + else + { + dbg (stdout, "wait() returned error: %s\n", strerror (errno)); + err (stderr, "detected missing hogvm worker children\n"); + ++retval; + break; + } + } + + return retval; +} + +int +hoghdd (long long forks, int clean, long long files, long long bytes) +{ + long long i, j; + int fd, pid, retval = 0; + int chunk = (1024 * 1024) - 1; /* Minimize slow writing. */ + char buff[chunk]; + + /* Make local copies of global variables. */ + int ignore = global_ignore; + int retry = global_retry; + int timeout = global_timeout; + long backoff = global_backoff * forks; + + /* Initialize buffer with some random ASCII data. */ + dbg (stdout, "seeding buffer with random data\n"); + for (i = 0; i < chunk - 1; i++) + { + j = rand (); + j = (j < 0) ? -j : j; + j %= 95; + j += 32; + buff[i] = j; + } + buff[i] = '\n'; + + dbg (stdout, "using backoff sleep of %lius for hoghdd\n", backoff); + + for (i = 0; forks == 0 || i < forks; i++) + { + switch (pid = fork ()) + { + case 0: /* child */ + alarm (timeout); + + /* Use a backoff sleep to ensure we get good fork throughput. */ + usleep (backoff); + + while (1) + { + for (i = 0; i < files; i++) + { + char name[] = "./stress.XXXXXX"; + + if ((fd = mkstemp (name)) < 0) + { + perror ("mkstemp"); + err (stderr, "mkstemp failed\n"); + exit (1); + } + + if (clean == 0) + { + dbg (stdout, "unlinking %s\n", name); + if (unlink (name)) + { + err (stderr, "unlink failed\n"); + exit (1); + } + } + + dbg (stdout, "fast writing to %s\n", name); + for (j = 0; bytes == 0 || j + chunk < bytes; j += chunk) + { + if (write (fd, buff, chunk) != chunk) + { + err (stderr, "write failed\n"); + exit (1); + } + } + + dbg (stdout, "slow writing to %s\n", name); + for (; bytes == 0 || j < bytes - 1; j++) + { + if (write (fd, "Z", 1) != 1) + { + err (stderr, "write failed\n"); + exit (1); + } + } + if (write (fd, "\n", 1) != 1) + { + err (stderr, "write failed\n"); + exit (1); + } + ++j; + + dbg (stdout, "closing %s after writing %lli bytes\n", name, + j); + close (fd); + + if (clean == 1) + { + if (unlink (name)) + { + err (stderr, "unlink failed\n"); + exit (1); + } + } + } + if (retval == 0) + { + dbg (stdout, "hoghdd worker starting over\n"); + continue; + } + + exit (retval); + } + + /* This case never falls through; alarm signal can cause exit. */ + case -1: /* error */ + if (ignore) + { + ++retval; + wrn (stderr, "hoghdd worker fork failed, continuing\n"); + usleep (retry); + continue; + } + + err (stderr, "hoghdd worker fork failed\n"); + return 1; + default: /* parent */ + dbg (stdout, "--> hoghdd worker forked (%i)\n", pid); + } + } + + /* Wait for our children to exit. */ + while (i) + { + int status, ret; + + if ((pid = wait (&status)) > 0) + { + if ((WIFEXITED (status)) != 0) + { + if ((ret = WEXITSTATUS (status)) != 0) + { + err (stderr, "hoghdd worker %i exited %i\n", pid, ret); + retval += ret; + } + else + { + dbg (stdout, "<-- hoghdd worker exited (%i)\n", pid); + } + } + else + { + dbg (stdout, "<-- hoghdd worker signalled (%i)\n", pid); + } + + --i; + } + else + { + dbg (stdout, "wait() returned error: %s\n", strerror (errno)); + err (stderr, "detected missing hoghdd worker children\n"); + ++retval; + break; + } + } + + return retval; +} diff --git a/tools/make-file.sh b/tools/make-file.sh index 1fa5dd98..1f1f9d0e 100755 --- a/tools/make-file.sh +++ b/tools/make-file.sh @@ -29,17 +29,15 @@ file=$1 size=$2 if [ -z "$1" ] || [ -z "$2" ] ; then - echo "Usage: make-file.sh " + echo "usage: ${0##*/} " exit 1 fi -if [ -e $file ] ; then - exit 0 -fi +[ -e "$file" ] && exit 0 -if ! perl -e "print 'A' x $size" > $file 2> /dev/null ; then - if ! awk 'BEGIN { cnt='$size'; while (cnt--) printf "A" }' > $file 2> /dev/null ; then - ( while ((size--)) ; do echo -n A ; done ) > $file +if ! perl -e "print 'A' x $size" > "$file" 2> /dev/null ; then + if ! awk 'BEGIN { cnt='$size'; while (cnt--) printf "A" }' > "$file" 2> /dev/null ; then + ( while ((size--)) ; do echo -n A ; done ) > "$file" fi fi diff --git a/utils/Makefile b/utils/Makefile index 89d0c93c..0898bb06 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -18,15 +18,10 @@ #### ################################################################################ -SUBDIRS := benchmark +top_srcdir ?= .. -configure: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done; +include $(top_srcdir)/include/mk/env_pre.mk -all: configure - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done; +RECURSIVE_TARGETS := all configure install -install: - -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done; +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/utils/benchmark/Makefile b/utils/benchmark/Makefile index 74b253ad..dd388f60 100644 --- a/utils/benchmark/Makefile +++ b/utils/benchmark/Makefile @@ -18,15 +18,13 @@ #### ################################################################################ -SUBDIRS := ebizzy-0.3 kernbench-0.42 +top_srcdir ?= ../.. -configure: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done; +include $(top_srcdir)/include/mk/env_pre.mk -all: configure - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done; +# XXX (garrcoop): kernbench needs fixing for out-of-build-tree support. +FILTER_OUT_DIRS := $(if $(OUT_OF_BUILD_TREE),kernbench%) -install: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done; -clean: - @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done; +RECURSIVE_TARGETS := all configure install + +include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/utils/benchmark/ebizzy-0.3/Makefile b/utils/benchmark/ebizzy-0.3/Makefile dissimilarity index 99% index b78542f2..7485f7df 100644 --- a/utils/benchmark/ebizzy-0.3/Makefile +++ b/utils/benchmark/ebizzy-0.3/Makefile @@ -1,10 +1,34 @@ -all: ebizzy - -configure: - ./configure -ebizzy: configure - gcc -Wall -Wshadow -lpthread -o ebizzy ebizzy.c -install: - -clean: - rm -f ebizzy *~ +# +# utils/benchmarks/ebizzy 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. +# +# Garrett Cooper, July 2009 +# + +# IMPORT NOTE: Be careful when upgrading this component as running the +# `configure' bourne shell script will overwrite this file! + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +WCPPFLAGS += -Wshadow + +LDLIBS += -lpthread + +include $(top_srcdir)/include/mk/generic_leaf_target.mk -- 2.11.4.GIT